proteus 1.9.0
C/C++/Fortran libraries
Loading...
Searching...
No Matches
equivalent_polynomials.cpp
Go to the documentation of this file.
1/* Generated by Cython 3.3.0 */
2
3/* BEGIN: Cython Metadata
4{
5 "distutils": {
6 "depends": [
7 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/arrayobject.h",
8 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/arrayscalars.h",
9 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ndarrayobject.h",
10 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ndarraytypes.h",
11 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ufuncobject.h",
12 "proteus/equivalent_polynomials.h",
13 "proteus/equivalent_polynomials.pxd",
14 "proteus/equivalent_polynomials_coefficients.h",
15 "proteus/equivalent_polynomials_coefficients_quad.h",
16 "proteus/equivalent_polynomials_utils.h"
17 ],
18 "include_dirs": [
19 "proteus",
20 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include"
21 ],
22 "language": "c++",
23 "name": "equivalent_polynomials",
24 "sources": [
25 "proteus/equivalent_polynomials.pyx"
26 ]
27 },
28 "module_name": "equivalent_polynomials"
29}
30END: Cython Metadata */
31
32#ifndef PY_SSIZE_T_CLEAN
33#define PY_SSIZE_T_CLEAN
34#endif /* PY_SSIZE_T_CLEAN */
35/* InitLimitedAPI */
36#if defined(Py_LIMITED_API)
37 #if !defined(CYTHON_LIMITED_API)
38 #define CYTHON_LIMITED_API 1
39 #endif
40#elif defined(CYTHON_LIMITED_API)
41 #ifdef _MSC_VER
42 #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.")
43 #else
44 #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.
45 #endif
46#endif
47
48#include "Python.h"
49#ifndef Py_PYTHON_H
50 #error Python headers needed to compile C extensions, please install development version of Python.
51#elif PY_VERSION_HEX < 0x03090000
52 #error Cython requires Python 3.9+.
53#elif defined(Py_LIMITED_API) && (Py_LIMITED_API & 0xFFFF0000) > (PY_VERSION_HEX & 0xFFFF0000)
54 #error 'Py_LIMITED_API' can only select past Python X.Y versions, not future ones.
55#else
56#define __PYX_ABI_VERSION "3_3_0"
57#define CYTHON_HEX_VERSION 0x030300F0
58#define CYTHON_FUTURE_DIVISION 1
59/* CModulePreamble */
60#include <stddef.h>
61#ifndef offsetof
62 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
63#endif
64#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
65 #ifndef __stdcall
66 #define __stdcall
67 #endif
68 #ifndef __cdecl
69 #define __cdecl
70 #endif
71 #ifndef __fastcall
72 #define __fastcall
73 #endif
74#endif
75#ifdef __has_builtin
76 #define __Pyx_has_cbuiltin(name) __has_builtin(name)
77#else
78 #define __Pyx_has_cbuiltin(name) (0)
79#endif
80#ifndef DL_IMPORT
81 #define DL_IMPORT(t) t
82#endif
83#ifndef DL_EXPORT
84 #define DL_EXPORT(t) t
85#endif
86#define __PYX_COMMA ,
87#ifndef PY_LONG_LONG
88 #define PY_LONG_LONG LONG_LONG
89#endif
90#ifndef Py_HUGE_VAL
91 #define Py_HUGE_VAL HUGE_VAL
92#endif
93#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
94#if defined(CYTHON_LIMITED_API)
95 #ifdef Py_LIMITED_API
96 #undef __PYX_LIMITED_VERSION_HEX
97 #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
98 #if Py_LIMITED_API < 0x03090000
99 #error "Cython 3.3 requires the Python Limited API version to be 3.9 or greater."
100 #endif
101 #endif
102 #if defined(GRAALVM_PYTHON) || defined(PYPY_VERSION)
103 #ifdef _MSC_VER
104 #pragma message ("Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
105 code for PyPy and GraalPy and is unlikely to work.")
106 #else
107 #warning "Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
108 code for PyPy and GraalPy and is unlikely to work."
109 #endif
110 #endif
111 #define CYTHON_COMPILING_IN_PYPY 0
112 #define CYTHON_COMPILING_IN_CPYTHON 0
113 #define CYTHON_COMPILING_IN_LIMITED_API 1
114 #define CYTHON_COMPILING_IN_GRAAL 0
115 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
116 #undef CYTHON_USE_TYPE_SLOTS
117 #define CYTHON_USE_TYPE_SLOTS 0
118 #undef CYTHON_USE_TYPE_SPECS
119 #define CYTHON_USE_TYPE_SPECS 1
120 #undef CYTHON_USE_PYTYPE_LOOKUP
121 #define CYTHON_USE_PYTYPE_LOOKUP 0
122 #undef CYTHON_USE_PYLIST_INTERNALS
123 #define CYTHON_USE_PYLIST_INTERNALS 0
124 #undef CYTHON_USE_UNICODE_INTERNALS
125 #define CYTHON_USE_UNICODE_INTERNALS 0
126 #ifndef CYTHON_USE_UNICODE_WRITER
127 #define CYTHON_USE_UNICODE_WRITER 0
128 #endif
129 #undef CYTHON_USE_PYLONG_INTERNALS
130 #define CYTHON_USE_PYLONG_INTERNALS 0
131 #ifndef CYTHON_AVOID_BORROWED_REFS
132 #define CYTHON_AVOID_BORROWED_REFS 0
133 #endif
134 #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
135 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
136 #endif
137 #undef CYTHON_ASSUME_SAFE_MACROS
138 #define CYTHON_ASSUME_SAFE_MACROS 0
139 #undef CYTHON_ASSUME_SAFE_SIZE
140 #define CYTHON_ASSUME_SAFE_SIZE 0
141 #undef CYTHON_UNPACK_METHODS
142 #define CYTHON_UNPACK_METHODS 0
143 #undef CYTHON_FAST_THREAD_STATE
144 #define CYTHON_FAST_THREAD_STATE 0
145 #undef CYTHON_FAST_GIL
146 #define CYTHON_FAST_GIL 0
147 #undef CYTHON_VECTORCALL
148 #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
149 #ifndef CYTHON_VECTORCALL_TPNEW
150 #define CYTHON_VECTORCALL_TPNEW (CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
151 #endif
152 #ifndef CYTHON_PEP487_INIT_SUBCLASS
153 #define CYTHON_PEP487_INIT_SUBCLASS 1
154 #endif
155 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
156 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
157 #endif
158 #ifndef CYTHON_USE_MODULE_STATE
159 #define CYTHON_USE_MODULE_STATE 0
160 #endif
161 #undef CYTHON_USE_SYS_MONITORING
162 #define CYTHON_USE_SYS_MONITORING 0
163 #ifndef CYTHON_USE_TP_FINALIZE
164 #define CYTHON_USE_TP_FINALIZE (__PYX_LIMITED_VERSION_HEX >= 0x030F0000 && PY_VERSION_HEX > 0x030F00A8)
165 #endif
166 #ifndef CYTHON_USE_AM_SEND
167 #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
168 #endif
169 #undef CYTHON_USE_DICT_VERSIONS
170 #define CYTHON_USE_DICT_VERSIONS 0
171 #undef CYTHON_USE_EXC_INFO_STACK
172 #define CYTHON_USE_EXC_INFO_STACK 0
173 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
174 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
175 #endif
176 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
177 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
178 #endif
179 #ifndef CYTHON_USE_FREELISTS
180 #define CYTHON_USE_FREELISTS 1
181 #endif
182 #undef CYTHON_IMMORTAL_CONSTANTS
183 #define CYTHON_IMMORTAL_CONSTANTS 0
184 #if __PYX_LIMITED_VERSION_HEX < 0x030E0000
185 #undef CYTHON_OPAQUE_OBJECTS
186 #define CYTHON_OPAQUE_OBJECTS 0
187 #elif !defined(CYTHON_OPAQUE_OBJECTS)
188 #define CYTHON_OPAQUE_OBJECTS (__PYX_LIMITED_VERSION_HEX >= 0x030F0000)
189 #endif
190#elif defined(GRAALVM_PYTHON)
191 /* For very preliminary testing purposes. Most variables are set the same as PyPy.
192 The existence of this section does not imply that anything works or is even tested */
193 #define CYTHON_COMPILING_IN_PYPY 0
194 #define CYTHON_COMPILING_IN_CPYTHON 0
195 #define CYTHON_COMPILING_IN_LIMITED_API 0
196 #define CYTHON_COMPILING_IN_GRAAL 1
197 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
198 #ifndef CYTHON_USE_TYPE_SLOTS
199 #define CYTHON_USE_TYPE_SLOTS 0
200 #endif
201 #undef CYTHON_USE_TYPE_SPECS
202 #define CYTHON_USE_TYPE_SPECS 0
203 #undef CYTHON_USE_PYTYPE_LOOKUP
204 #define CYTHON_USE_PYTYPE_LOOKUP 0
205 #undef CYTHON_USE_PYLIST_INTERNALS
206 #define CYTHON_USE_PYLIST_INTERNALS 0
207 #undef CYTHON_USE_UNICODE_INTERNALS
208 #define CYTHON_USE_UNICODE_INTERNALS 0
209 #undef CYTHON_USE_UNICODE_WRITER
210 #define CYTHON_USE_UNICODE_WRITER 0
211 #undef CYTHON_USE_PYLONG_INTERNALS
212 #define CYTHON_USE_PYLONG_INTERNALS 0
213 #undef CYTHON_AVOID_BORROWED_REFS
214 #define CYTHON_AVOID_BORROWED_REFS 1
215 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
216 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
217 #undef CYTHON_ASSUME_SAFE_MACROS
218 #define CYTHON_ASSUME_SAFE_MACROS 0
219 #undef CYTHON_ASSUME_SAFE_SIZE
220 #define CYTHON_ASSUME_SAFE_SIZE 0
221 #undef CYTHON_UNPACK_METHODS
222 #define CYTHON_UNPACK_METHODS 0
223 #undef CYTHON_FAST_THREAD_STATE
224 #define CYTHON_FAST_THREAD_STATE 0
225 #undef CYTHON_FAST_GIL
226 #define CYTHON_FAST_GIL 0
227 #ifndef CYTHON_VECTORCALL
228 #define CYTHON_VECTORCALL 1
229 #endif
230 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
231 #undef CYTHON_VECTORCALL_TPNEW
232 #define CYTHON_VECTORCALL_TPNEW 0
233 #elif !defined(CYTHON_VECTORCALL_TPNEW)
234 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
235 #endif
236 #ifndef CYTHON_PEP487_INIT_SUBCLASS
237 #define CYTHON_PEP487_INIT_SUBCLASS 1
238 #endif
239 #undef CYTHON_PEP489_MULTI_PHASE_INIT
240 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
241 #undef CYTHON_USE_MODULE_STATE
242 #define CYTHON_USE_MODULE_STATE 0
243 #undef CYTHON_USE_SYS_MONITORING
244 #define CYTHON_USE_SYS_MONITORING 0
245 #undef CYTHON_USE_TP_FINALIZE
246 #define CYTHON_USE_TP_FINALIZE 0
247 #undef CYTHON_USE_AM_SEND
248 #define CYTHON_USE_AM_SEND 0
249 #undef CYTHON_USE_DICT_VERSIONS
250 #define CYTHON_USE_DICT_VERSIONS 0
251 #undef CYTHON_USE_EXC_INFO_STACK
252 #define CYTHON_USE_EXC_INFO_STACK 1
253 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
254 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
255 #endif
256 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
257 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
258 #endif
259 #undef CYTHON_USE_FREELISTS
260 #define CYTHON_USE_FREELISTS 0
261 #undef CYTHON_IMMORTAL_CONSTANTS
262 #define CYTHON_IMMORTAL_CONSTANTS 0
263 #undef CYTHON_OPAQUE_OBJECTS
264 #define CYTHON_OPAQUE_OBJECTS 0
265#elif defined(PYPY_VERSION)
266 #define CYTHON_COMPILING_IN_PYPY 1
267 #define CYTHON_COMPILING_IN_CPYTHON 0
268 #define CYTHON_COMPILING_IN_LIMITED_API 0
269 #define CYTHON_COMPILING_IN_GRAAL 0
270 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
271 #undef CYTHON_USE_TYPE_SLOTS
272 #define CYTHON_USE_TYPE_SLOTS 1
273 #ifndef CYTHON_USE_TYPE_SPECS
274 #define CYTHON_USE_TYPE_SPECS 0
275 #endif
276 #undef CYTHON_USE_PYTYPE_LOOKUP
277 #define CYTHON_USE_PYTYPE_LOOKUP 0
278 #undef CYTHON_USE_PYLIST_INTERNALS
279 #define CYTHON_USE_PYLIST_INTERNALS 0
280 #undef CYTHON_USE_UNICODE_INTERNALS
281 #define CYTHON_USE_UNICODE_INTERNALS 0
282 #undef CYTHON_USE_UNICODE_WRITER
283 #define CYTHON_USE_UNICODE_WRITER 0
284 #undef CYTHON_USE_PYLONG_INTERNALS
285 #define CYTHON_USE_PYLONG_INTERNALS 0
286 #undef CYTHON_AVOID_BORROWED_REFS
287 #define CYTHON_AVOID_BORROWED_REFS 1
288 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
289 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
290 #undef CYTHON_ASSUME_SAFE_MACROS
291 #define CYTHON_ASSUME_SAFE_MACROS 0
292 #ifndef CYTHON_ASSUME_SAFE_SIZE
293 #define CYTHON_ASSUME_SAFE_SIZE 1
294 #endif
295 #undef CYTHON_UNPACK_METHODS
296 #define CYTHON_UNPACK_METHODS 0
297 #undef CYTHON_FAST_THREAD_STATE
298 #define CYTHON_FAST_THREAD_STATE 0
299 #undef CYTHON_FAST_GIL
300 #define CYTHON_FAST_GIL 0
301 #ifndef CYTHON_VECTORCALL
302 #define CYTHON_VECTORCALL 1
303 #endif
304 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
305 #undef CYTHON_VECTORCALL_TPNEW
306 #define CYTHON_VECTORCALL_TPNEW 0
307 #elif !defined(CYTHON_VECTORCALL_TPNEW)
308 #define CYTHON_VECTORCALL_TPNEW (PYPY_VERSION_NUM >= 0x07030800 && CYTHON_VECTORCALL)
309 #endif
310 #ifndef CYTHON_PEP487_INIT_SUBCLASS
311 #define CYTHON_PEP487_INIT_SUBCLASS 1
312 #endif
313 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
314 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
315 #endif
316 #undef CYTHON_USE_MODULE_STATE
317 #define CYTHON_USE_MODULE_STATE 0
318 #undef CYTHON_USE_SYS_MONITORING
319 #define CYTHON_USE_SYS_MONITORING 0
320 #ifndef CYTHON_USE_TP_FINALIZE
321 #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
322 #endif
323 #undef CYTHON_USE_AM_SEND
324 #define CYTHON_USE_AM_SEND 0
325 #undef CYTHON_USE_DICT_VERSIONS
326 #define CYTHON_USE_DICT_VERSIONS 0
327 #undef CYTHON_USE_EXC_INFO_STACK
328 #define CYTHON_USE_EXC_INFO_STACK 0
329 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
330 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
331 #endif
332 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
333 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
334 #endif
335 #undef CYTHON_USE_FREELISTS
336 #define CYTHON_USE_FREELISTS 0
337 #undef CYTHON_IMMORTAL_CONSTANTS
338 #define CYTHON_IMMORTAL_CONSTANTS 0
339 #undef CYTHON_OPAQUE_OBJECTS
340 #define CYTHON_OPAQUE_OBJECTS 0
341#else
342 #define CYTHON_COMPILING_IN_PYPY 0
343 #define CYTHON_COMPILING_IN_CPYTHON 1
344 #define CYTHON_COMPILING_IN_LIMITED_API 0
345 #define CYTHON_COMPILING_IN_GRAAL 0
346 #ifdef Py_GIL_DISABLED
347 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
348 #else
349 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
350 #endif
351 #if PY_VERSION_HEX < 0x030A0000
352 #undef CYTHON_USE_TYPE_SLOTS
353 #define CYTHON_USE_TYPE_SLOTS 1
354 #elif !defined(CYTHON_USE_TYPE_SLOTS)
355 #define CYTHON_USE_TYPE_SLOTS 1
356 #endif
357 #ifndef CYTHON_USE_TYPE_SPECS
358 #define CYTHON_USE_TYPE_SPECS 0
359 #endif
360 #ifndef CYTHON_USE_PYTYPE_LOOKUP
361 #define CYTHON_USE_PYTYPE_LOOKUP 1
362 #endif
363 #ifndef CYTHON_USE_PYLONG_INTERNALS
364 #define CYTHON_USE_PYLONG_INTERNALS 1
365 #endif
366 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
367 #undef CYTHON_USE_PYLIST_INTERNALS
368 #define CYTHON_USE_PYLIST_INTERNALS 0
369 #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
370 #define CYTHON_USE_PYLIST_INTERNALS 1
371 #endif
372 #ifndef CYTHON_USE_UNICODE_INTERNALS
373 #define CYTHON_USE_UNICODE_INTERNALS 1
374 #endif
375 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
376 #undef CYTHON_USE_UNICODE_WRITER
377 #define CYTHON_USE_UNICODE_WRITER 0
378 #elif !defined(CYTHON_USE_UNICODE_WRITER)
379 #define CYTHON_USE_UNICODE_WRITER 1
380 #endif
381 #ifndef CYTHON_AVOID_BORROWED_REFS
382 #define CYTHON_AVOID_BORROWED_REFS 0
383 #endif
384 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
385 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
386 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
387 #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
388 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
389 #endif
390 #ifndef CYTHON_ASSUME_SAFE_MACROS
391 #define CYTHON_ASSUME_SAFE_MACROS 1
392 #endif
393 #ifndef CYTHON_ASSUME_SAFE_SIZE
394 #define CYTHON_ASSUME_SAFE_SIZE 1
395 #endif
396 #ifndef CYTHON_UNPACK_METHODS
397 #define CYTHON_UNPACK_METHODS 1
398 #endif
399 #ifndef CYTHON_FAST_THREAD_STATE
400 #define CYTHON_FAST_THREAD_STATE 1
401 #endif
402 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
403 #undef CYTHON_FAST_GIL
404 #define CYTHON_FAST_GIL 0
405 #elif !defined(CYTHON_FAST_GIL)
406 #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
407 #endif
408 #ifndef CYTHON_VECTORCALL
409 #define CYTHON_VECTORCALL 1
410 #endif
411 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
412 #undef CYTHON_VECTORCALL_TPNEW
413 #define CYTHON_VECTORCALL_TPNEW 0
414 #elif !defined(CYTHON_VECTORCALL_TPNEW)
415 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
416 #endif
417 #ifndef CYTHON_PEP487_INIT_SUBCLASS
418 #define CYTHON_PEP487_INIT_SUBCLASS 1
419 #endif
420 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
421 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
422 #endif
423 #ifndef CYTHON_USE_MODULE_STATE
424 #define CYTHON_USE_MODULE_STATE 0
425 #endif
426 #ifndef CYTHON_USE_SYS_MONITORING
427 #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
428 #endif
429 #ifndef CYTHON_USE_TP_FINALIZE
430 #define CYTHON_USE_TP_FINALIZE 1
431 #endif
432 #ifndef CYTHON_USE_AM_SEND
433 #define CYTHON_USE_AM_SEND 1
434 #endif
435 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
436 #undef CYTHON_USE_DICT_VERSIONS
437 #define CYTHON_USE_DICT_VERSIONS 0
438 #elif !defined(CYTHON_USE_DICT_VERSIONS)
439 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
440 #endif
441 #ifndef CYTHON_USE_EXC_INFO_STACK
442 #define CYTHON_USE_EXC_INFO_STACK 1
443 #endif
444 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
445 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
446 #endif
447 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
448 #define CYTHON_USE_OWN_PREP_RERAISE_STAR (PY_VERSION_HEX < 0x030C00B2)
449 #endif
450 #ifndef CYTHON_USE_FREELISTS
451 #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
452 #endif
453 #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
454 #undef CYTHON_IMMORTAL_CONSTANTS
455 #define CYTHON_IMMORTAL_CONSTANTS 0 // definitely won't work
456 #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
457 #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
458 #endif
459 #ifndef CYTHON_OPAQUE_OBJECTS
460 #define CYTHON_OPAQUE_OBJECTS 0
461 #endif
462#endif
463#if CYTHON_USE_PYLONG_INTERNALS
464 #undef SHIFT
465 #undef BASE
466 #undef MASK
467 #ifdef SIZEOF_VOID_P
468 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
469 #endif
470#endif
471#ifndef __has_attribute
472 #define __has_attribute(x) 0
473#endif
474#ifndef __has_cpp_attribute
475 #define __has_cpp_attribute(x) 0
476#endif
477#ifndef CYTHON_RESTRICT
478 #if defined(__GNUC__)
479 #define CYTHON_RESTRICT __restrict__
480 #elif defined(_MSC_VER) && _MSC_VER >= 1400
481 #define CYTHON_RESTRICT __restrict
482 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
483 #define CYTHON_RESTRICT restrict
484 #else
485 #define CYTHON_RESTRICT
486 #endif
487#endif
488#ifndef CYTHON_UNUSED
489 #if defined(__cplusplus)
490 /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
491 * but leads to warnings with -pedantic, since it is a C++17 feature */
492 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
493 #if __has_cpp_attribute(maybe_unused)
494 #define CYTHON_UNUSED [[maybe_unused]]
495 #endif
496 #endif
497 #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
498 #define CYTHON_UNUSED [[maybe_unused]]
499 #endif
500#endif
501#ifndef CYTHON_UNUSED
502# if defined(__GNUC__)
503# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
504# define CYTHON_UNUSED __attribute__ ((__unused__))
505# else
506# define CYTHON_UNUSED
507# endif
508# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
509# define CYTHON_UNUSED __attribute__ ((__unused__))
510# else
511# define CYTHON_UNUSED
512# endif
513#endif
514#ifndef CYTHON_UNUSED_VAR
515# if defined(__cplusplus)
516 template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
517# else
518# define CYTHON_UNUSED_VAR(x) (void)(x)
519# endif
520#endif
521#ifndef CYTHON_MAYBE_UNUSED_VAR
522 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
523#endif
524#ifndef CYTHON_NCP_UNUSED
525# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
526# define CYTHON_NCP_UNUSED
527# else
528# define CYTHON_NCP_UNUSED CYTHON_UNUSED
529# endif
530#endif
531#ifndef CYTHON_USE_CPP_STD_MOVE
532 #if defined(__cplusplus) && (\
533 __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
534 #define CYTHON_USE_CPP_STD_MOVE 1
535 #else
536 #define CYTHON_USE_CPP_STD_MOVE 0
537 #endif
538#endif
539#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
540#include <stdint.h>
541typedef uintptr_t __pyx_uintptr_t;
542#ifndef CYTHON_FALLTHROUGH
543 #if defined(__cplusplus)
544 /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
545 * but leads to warnings with -pedantic, since it is a C++17 feature */
546 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
547 #if __has_cpp_attribute(fallthrough)
548 #define CYTHON_FALLTHROUGH [[fallthrough]]
549 #endif
550 #endif
551 #ifndef CYTHON_FALLTHROUGH
552 #if __has_cpp_attribute(clang::fallthrough)
553 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
554 #elif __has_cpp_attribute(gnu::fallthrough)
555 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
556 #endif
557 #endif
558 #endif
559 #ifndef CYTHON_FALLTHROUGH
560 #if __has_attribute(fallthrough)
561 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
562 #else
563 #define CYTHON_FALLTHROUGH
564 #endif
565 #endif
566 #if defined(__clang__) && defined(__apple_build_version__)
567 #if __apple_build_version__ < 7000000
568 #undef CYTHON_FALLTHROUGH
569 #define CYTHON_FALLTHROUGH
570 #endif
571 #endif
572#endif
573#ifdef Py_UNREACHABLE
574 #define __Pyx_UNREACHABLE() Py_UNREACHABLE()
575#elif __Pyx_has_cbuiltin(__builtin_unreachable)
576 #define __Pyx_UNREACHABLE() __builtin_unreachable()
577#elif defined(__clang__) || defined(__INTEL_COMPILER) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)))
578 #define __Pyx_UNREACHABLE() __builtin_unreachable()
579#elif defined(_MSC_VER)
580 #define __Pyx_UNREACHABLE() __assume(0)
581#else
582 #define __Pyx_UNREACHABLE() Py_FatalError("Unreachable C code path reached")
583#endif
584#ifndef Py_UNREACHABLE
585 #define Py_UNREACHABLE() __Pyx_UNREACHABLE()
586#endif
587#ifdef __cplusplus
588 template <typename T>
589 struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
590 #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
591#else
592 #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
593#endif
594#if CYTHON_COMPILING_IN_PYPY == 1
595 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000)
596#else
597 #define __PYX_NEED_TP_PRINT_SLOT 0
598#endif
599#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
600#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
601#define __Pyx_PyErr_FetchException(petype, peval, petb) PyErr_Fetch(petype, peval, petb)
602#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_Restore(etype, eval, etb)
603#else
604#define __Pyx_PyErr_FetchException(petype, peval, petb) *(petype)=NULL; *(peval)=PyErr_GetRaisedException(); *(petb)=NULL
605#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_SetRaisedException(eval)
606#endif
607
608/* CppInitCode */
609#ifndef __cplusplus
610 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
611#endif
612#ifndef CYTHON_INLINE
613 #if defined(__clang__)
614 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
615 #else
616 #define CYTHON_INLINE inline
617 #endif
618#endif
619template<typename T>
620void __Pyx_call_destructor(T& x) {
621 x.~T();
622}
623template<typename T>
624class __Pyx_FakeReference {
625 public:
626 __Pyx_FakeReference() : ptr(NULL) { }
627 __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
628 T *operator->() { return ptr; }
629 T *operator&() { return ptr; }
630 operator T&() { return *ptr; }
631 template<typename U> bool operator ==(const U& other) const { return *ptr == other; }
632 template<typename U> bool operator !=(const U& other) const { return *ptr != other; }
633 template<typename U> bool operator==(const __Pyx_FakeReference<U>& other) const { return *ptr == *other.ptr; }
634 template<typename U> bool operator!=(const __Pyx_FakeReference<U>& other) const { return *ptr != *other.ptr; }
635 private:
636 T *ptr;
637};
638
639/* PythonCompatibility */
640#define __PYX_BUILD_PY_SSIZE_T "n"
641#define CYTHON_FORMAT_SSIZE_T "z"
642#define __Pyx_BUILTIN_MODULE_NAME "builtins"
643#define __Pyx_DefaultClassType PyType_Type
644#if CYTHON_COMPILING_IN_LIMITED_API
645 #ifndef CO_OPTIMIZED
646 static int CO_OPTIMIZED;
647 #endif
648 #ifndef CO_NEWLOCALS
649 static int CO_NEWLOCALS;
650 #endif
651 #ifndef CO_VARARGS
652 static int CO_VARARGS;
653 #endif
654 #ifndef CO_VARKEYWORDS
655 static int CO_VARKEYWORDS;
656 #endif
657 #ifndef CO_ASYNC_GENERATOR
658 static int CO_ASYNC_GENERATOR;
659 #endif
660 #ifndef CO_GENERATOR
661 static int CO_GENERATOR;
662 #endif
663 #ifndef CO_COROUTINE
664 static int CO_COROUTINE;
665 #endif
666#else
667 #ifndef CO_COROUTINE
668 #define CO_COROUTINE 0x80
669 #endif
670 #ifndef CO_ASYNC_GENERATOR
671 #define CO_ASYNC_GENERATOR 0x200
672 #endif
673#endif
674static int __Pyx_init_co_variables(void);
675#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
676 #define __Pyx_Py_Is(x, y) Py_Is(x, y)
677#else
678 #define __Pyx_Py_Is(x, y) ((x) == (y))
679#endif
680#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
681 #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
682#else
683 #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
684#endif
685#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
686 #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
687#else
688 #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
689#endif
690#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
691 #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
692#else
693 #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
694#endif
695#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
696#if CYTHON_COMPILING_IN_PYPY
697 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
698#else
699 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
700#endif
701#if CYTHON_COMPILING_IN_LIMITED_API
702static unsigned long __Pyx_Runtime_TPFLAGS_SEQUENCE;
703static unsigned long __Pyx_Runtime_TPFLAGS_MAPPING;
704#else
705#define __Pyx_Runtime_TPFLAGS_SEQUENCE Py_TPFLAGS_SEQUENCE
706#define __Pyx_Runtime_TPFLAGS_MAPPING Py_TPFLAGS_MAPPING
707#endif
708static int __Pyx_init_tpflags_variables(void);
709#ifndef Py_TPFLAGS_HAVE_FINALIZE
710 #define Py_TPFLAGS_HAVE_FINALIZE 0
711#endif
712#ifndef Py_TPFLAGS_SEQUENCE
713 #define Py_TPFLAGS_SEQUENCE (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 5)
714#endif
715#ifndef Py_TPFLAGS_MAPPING
716 #define Py_TPFLAGS_MAPPING (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 6)
717#endif
718#ifndef Py_TPFLAGS_IMMUTABLETYPE
719 #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
720#endif
721#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
722 #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
723#endif
724#ifndef METH_STACKLESS
725 #define METH_STACKLESS 0
726#endif
727#if !defined(METH_FASTCALL) || CYTHON_COMPILING_IN_PYPY
728 #ifndef METH_FASTCALL
729 #define METH_FASTCALL 0x80
730 #endif
731 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
732 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
733 Py_ssize_t nargs, PyObject *kwnames);
734#else
735 #if PY_VERSION_HEX >= 0x030d00A4
736 # define __Pyx_PyCFunctionFast PyCFunctionFast
737 # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
738 #else
739 # define __Pyx_PyCFunctionFast _PyCFunctionFast
740 # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
741 #endif
742#endif
743#if CYTHON_VECTORCALL
744 #define __Pyx_METH_FASTCALL METH_FASTCALL
745 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
746 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
747#else
748 #define __Pyx_METH_FASTCALL METH_VARARGS
749 #define __Pyx_PyCFunction_FastCall PyCFunction
750 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
751#endif
752#if CYTHON_VECTORCALL
753 #define __pyx_vectorcallfunc vectorcallfunc
754 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
755 #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
756#else
757 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
758 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
759#endif
760#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
761#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
762#if CYTHON_COMPILING_IN_CPYTHON
763#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
764#elif !CYTHON_COMPILING_IN_LIMITED_API
765#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
766#endif
767#if CYTHON_COMPILING_IN_CPYTHON
768#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
769static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
770 return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
771}
772#endif
773static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) {
774#if CYTHON_COMPILING_IN_LIMITED_API
775 return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
776#else
777 return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
778#endif
779}
780#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
781#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
782 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
783#else
784 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
785#endif
786#if CYTHON_COMPILING_IN_PYPY
787 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
788#else
789 #define __Pyx_PyCMethod PyCMethod
790#endif
791#ifndef METH_METHOD
792 #define METH_METHOD 0x200
793#endif
794#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
795 #define PyObject_Malloc(s) PyMem_Malloc(s)
796 #define PyObject_Free(p) PyMem_Free(p)
797 #define PyObject_Realloc(p) PyMem_Realloc(p)
798#endif
799#if CYTHON_COMPILING_IN_LIMITED_API
800 #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
801#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
802 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
803 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
804#elif CYTHON_COMPILING_IN_GRAAL
805 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
806 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
807#else
808 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
809 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
810#endif
811#if CYTHON_COMPILING_IN_LIMITED_API
812 #define __Pyx_PyThreadState_Current PyThreadState_Get()
813#elif !CYTHON_FAST_THREAD_STATE
814 #define __Pyx_PyThreadState_Current PyThreadState_GET()
815#elif PY_VERSION_HEX >= 0x030d00A1
816 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
817#else
818 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
819#endif
820#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
821 #define __PYX_SHARED_SIZEOF(T) -((int)sizeof(T))
822 #define __PYX_SHARED_RELATIVE_OFFSET Py_RELATIVE_OFFSET
823 #define CYTHON_OPAQUE_SHARED_TYPES 1
824#else
825 #define __PYX_SHARED_SIZEOF(T) sizeof(T)
826 #define __PYX_SHARED_RELATIVE_OFFSET 0
827 #define CYTHON_OPAQUE_SHARED_TYPES 0
828#endif
829#if CYTHON_USE_MODULE_STATE
830static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op)
831{
832 void *result;
833 result = PyModule_GetState(op);
834 if (!result)
835 Py_FatalError("Couldn't find the module state");
836 return result;
837}
838#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
839#else
840#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
841#endif
842#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
843#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
844#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
845#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
846#if CYTHON_USE_TYPE_SLOTS
847 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
848 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
849 #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
850 #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
851#else
852 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
853 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
854 ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
855 (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
856 __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
857 #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
858 #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
859#endif
860#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
861#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
862#else
863#define __Pyx_PyDict_NewPresized(n) PyDict_New()
864#endif
865#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
866#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
867#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
868#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
869static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
870 PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
871 if (res == NULL && PyErr_Occurred()) {
872 PyErr_WriteUnraisable(NULL);
873 }
874 return res;
875}
876#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
877#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
878#define __Pyx_PyDict_GetItemStr PyDict_GetItem
879#else
880static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
881#if CYTHON_COMPILING_IN_PYPY
882 return PyDict_GetItem(dict, name);
883#else
884 PyDictEntry *ep;
885 PyDictObject *mp = (PyDictObject*) dict;
886 long hash = ((PyStringObject *) name)->ob_shash;
887 assert(hash != -1);
888 ep = (mp->ma_lookup)(mp, name, hash);
889 if (ep == NULL) {
890 return NULL;
891 }
892 return ep->me_value;
893#endif
894}
895#define __Pyx_PyDict_GetItemStr PyDict_GetItem
896#endif
897#if CYTHON_USE_TYPE_SLOTS
898 #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
899 #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
900#else
901 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
902 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
903#endif
904#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
905#if CYTHON_USE_TYPE_SPECS
906#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
907 PyTypeObject *type = Py_TYPE((PyObject*)obj);\
908 assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
909 PyObject_GC_Del(obj);\
910 Py_DECREF(type);\
911}
912#else
913#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
914#endif
915#if CYTHON_COMPILING_IN_LIMITED_API
916 #define __Pyx_PyUnicode_READY(op) (0)
917 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
918 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
919 #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
920 #define __Pyx_PyUnicode_KIND_04(u) __Pyx_PyUnicode_KIND(u)
921 #define __Pyx_PyUnicode_DATA(u) ((void*)u)
922 #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
923 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
924#else
925 #if PY_VERSION_HEX >= 0x030C0000
926 #define __Pyx_PyUnicode_READY(op) (0)
927 #else
928 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
929 0 : _PyUnicode_Ready((PyObject *)(op)))
930 #endif
931 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
932 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
933 #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
934 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
935 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
936 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
937 #if PY_VERSION_HEX >= 0x030C0000
938 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
939 #else
940 #if CYTHON_COMPILING_IN_CPYTHON
941 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
942 #else
943 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
944 #endif
945 #endif
946 static CYTHON_INLINE int __Pyx_PyUnicode_KIND_04(PyObject *o) {
947 return __Pyx_PyUnicode_KIND(o) - (int) !!PyUnicode_IS_ASCII(o);
948 }
949#endif
950#if CYTHON_COMPILING_IN_PYPY
951 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
952 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
953#else
954 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
955 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
956 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
957#endif
958#if CYTHON_COMPILING_IN_PYPY
959 #if !defined(PyUnicode_DecodeUnicodeEscape)
960 #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
961 #endif
962 #if !defined(PyUnicode_Contains)
963 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
964 #endif
965 #if !defined(PyByteArray_Check)
966 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
967 #endif
968 #if !defined(PyObject_Format)
969 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
970 #endif
971#endif
972#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
973#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
974 #define __Pyx_PySequence_ListKeepNew(obj)\
975 (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
976#elif CYTHON_COMPILING_IN_CPYTHON
977 #define __Pyx_PySequence_ListKeepNew(obj)\
978 (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
979#else
980 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
981#endif
982#ifndef PySet_CheckExact
983 #define PySet_CheckExact(obj) Py_IS_TYPE(obj, &PySet_Type)
984#endif
985enum __Pyx_ReferenceSharing {
986 __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check
987 __Pyx_ReferenceSharing_OwnStrongReference,
988 __Pyx_ReferenceSharing_FunctionArgument,
989 __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar
990};
991#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
992#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
993 (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
994 (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
995 (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
996#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
997#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
998#else
999#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
1000#endif
1001#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1002 #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
1003#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1004 #if CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
1005 #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1006 #else
1007 #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
1008 #endif
1009#elif CYTHON_COMPILING_IN_LIMITED_API || !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE)
1010 #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
1011#else
1012 #define __Pyx_PyList_GetItemRef(o, i) (likely(__Pyx_is_valid_index(i, PyList_GET_SIZE(o))) ?\
1013 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1014#endif
1015#if CYTHON_AVOID_BORROWED_REFS || CYTHON_COMPILING_IN_LIMITED_API
1016 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1017 __Pyx_PyList_GetItemRef(o, i))
1018#elif CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1019 #if CYTHON_ASSUME_SAFE_MACROS
1020 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1021 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1022 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1023 #else
1024 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1025 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1026 __Pyx_XNewRef(PyList_GetItem(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1027 #endif
1028#elif CYTHON_ASSUME_SAFE_MACROS
1029 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1030 __Pyx_NewRef(PyList_GET_ITEM(o, i)))
1031#else
1032 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1033 __Pyx_XNewRef(PyList_GetItem(o, i)))
1034#endif
1035#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1036#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
1037#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1038static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1039 *result = PyObject_GetItem(dict, key);
1040 if (*result == NULL) {
1041 if (PyErr_ExceptionMatches(PyExc_KeyError)) {
1042 PyErr_Clear();
1043 return 0;
1044 }
1045 return -1;
1046 }
1047 return 1;
1048}
1049#else
1050static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1051 *result = PyDict_GetItemWithError(dict, key);
1052 if (*result == NULL) {
1053 return PyErr_Occurred() ? -1 : 0;
1054 }
1055 Py_INCREF(*result);
1056 return 1;
1057}
1058#endif
1059#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
1060 #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj)
1061#else
1062 #define __Pyx_VISIT_CONST(obj)
1063#endif
1064#if CYTHON_ASSUME_SAFE_MACROS
1065 #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1066 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1067 #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1068 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
1069 #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1070 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
1071#else
1072 #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1073 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1074 #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1075 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
1076 #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1077 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
1078#endif
1079#if CYTHON_ASSUME_SAFE_SIZE
1080 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1081 #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1082 #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1083 #define __Pyx_PyDict_GET_SIZE(o) PyDict_GET_SIZE(o)
1084 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1085 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1086 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
1087#else
1088 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1089 #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1090 #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1091 #define __Pyx_PyDict_GET_SIZE(o) PyDict_Size(o)
1092 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1093 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1094 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
1095#endif
1096#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
1097 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1098#endif
1099#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
1100#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t
1101#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1102 #define __Pyx_PySendResult PySendResult
1103#else
1104 typedef enum {
1105 PYGEN_RETURN = 0,
1106 PYGEN_ERROR = -1,
1107 PYGEN_NEXT = 1,
1108 } __Pyx_PySendResult;
1109#endif
1110#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
1111 typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
1112#else
1113 #define __Pyx_pyiter_sendfunc sendfunc
1114#endif
1115#if !CYTHON_USE_AM_SEND
1116#define __PYX_HAS_PY_AM_SEND 0
1117#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1118#define __PYX_HAS_PY_AM_SEND 1
1119#else
1120#define __PYX_HAS_PY_AM_SEND 2 // our own backported implementation
1121#endif
1122#if __PYX_HAS_PY_AM_SEND < 2
1123 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1124#else
1125 typedef struct {
1126 unaryfunc am_await;
1127 unaryfunc am_aiter;
1128 unaryfunc am_anext;
1129 __Pyx_pyiter_sendfunc am_send;
1130 } __Pyx_PyAsyncMethodsStruct;
1131 #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
1132#endif
1133#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
1134 #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
1135#else
1136 #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
1137#endif
1138#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
1139#ifdef __cplusplus
1140extern "C"
1141#endif
1142PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
1143#endif
1144#if CYTHON_COMPILING_IN_LIMITED_API
1145static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) {
1146 int value;
1147 PyObject *py_value = PyObject_GetAttrString(inspect, name);
1148 if (!py_value) return 0;
1149 value = (int) PyLong_AsLong(py_value);
1150 Py_DECREF(py_value);
1151 *write_to = value;
1152 return value != -1 || !PyErr_Occurred();
1153}
1154static int __Pyx_init_co_variables(void) {
1155 PyObject *inspect;
1156 int result;
1157 inspect = PyImport_ImportModule("inspect");
1158 result =
1159#if !defined(CO_OPTIMIZED)
1160 __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) &&
1161#endif
1162#if !defined(CO_NEWLOCALS)
1163 __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) &&
1164#endif
1165#if !defined(CO_VARARGS)
1166 __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) &&
1167#endif
1168#if !defined(CO_VARKEYWORDS)
1169 __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
1170#endif
1171#if !defined(CO_ASYNC_GENERATOR)
1172 __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
1173#endif
1174#if !defined(CO_GENERATOR)
1175 __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) &&
1176#endif
1177#if !defined(CO_COROUTINE)
1178 __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) &&
1179#endif
1180 1;
1181 Py_DECREF(inspect);
1182 return result ? 0 : -1;
1183}
1184static int __Pyx_init_tpflags_bitcount(unsigned long flag) {
1185 int count = 0;
1186 while (flag) {
1187 count += (int) (flag & 1);
1188 flag >>= 1;
1189 }
1190 return count;
1191}
1192static int __Pyx_init_tpflags_variables(void) {
1193 if (__Pyx_Runtime_TPFLAGS_SEQUENCE != 0 && __Pyx_Runtime_TPFLAGS_MAPPING != 0) {
1194 return 0;
1195 }
1196 PyObject *collections_abc = PyImport_ImportModule("collections.abc");
1197 if (!collections_abc) return -1;
1198 int result = 0;
1199 PyObject *sequence = NULL, *mapping = NULL;
1200#if __PYX_LIMITED_VERSION_HEX >= 0x030D0000
1201 if (PyObject_GetOptionalAttrString(collections_abc, "Sequence", &sequence) != 1) goto fail;
1202 if (PyObject_GetOptionalAttrString(collections_abc, "Mapping", &mapping) != 1) goto fail;
1203#else
1204 sequence = PyObject_GetAttrString(collections_abc, "Sequence");
1205 if (!sequence) goto fail_attr_lookup;
1206 mapping = PyObject_GetAttrString(collections_abc, "Mapping");
1207 if (!mapping) goto fail_attr_lookup;
1208#endif
1209 if (!PyType_Check(sequence) || !PyType_Check(mapping)) goto fail;
1210 {
1211 unsigned long sequence_flags = PyType_GetFlags((PyTypeObject*)sequence);
1212 unsigned long mapping_flags = PyType_GetFlags((PyTypeObject*)mapping);
1213 unsigned long mutual_flags = sequence_flags & mapping_flags;
1214 sequence_flags = sequence_flags ^ mutual_flags;
1215 mapping_flags = mapping_flags ^ mutual_flags;
1216 if (__Pyx_Runtime_TPFLAGS_SEQUENCE == 0 && __Pyx_init_tpflags_bitcount(sequence_flags) == 1) {
1217 __Pyx_Runtime_TPFLAGS_SEQUENCE = sequence_flags;
1218 }
1219 if (__Pyx_Runtime_TPFLAGS_MAPPING == 0 && __Pyx_init_tpflags_bitcount(mapping_flags) == 1) {
1220 __Pyx_Runtime_TPFLAGS_MAPPING = mapping_flags;
1221 }
1222 }
1223 cleanup:
1224 Py_XDECREF(mapping);
1225 Py_XDECREF(sequence);
1226 Py_DECREF(collections_abc);
1227 return result;
1228#if __PYX_LIMITED_VERSION_HEX < 0x030D0000
1229 fail_attr_lookup:
1230 if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
1231 PyErr_Clear();
1232 }
1233#endif
1234 fail:
1235 result = PyErr_Occurred() ? -1 : 0;
1236 goto cleanup;
1237}
1238#else
1239static int __Pyx_init_co_variables(void) {
1240 return 0; // It's a limited API-only feature
1241}
1242static int __Pyx_init_tpflags_variables(void) {
1243 return 0; // It's a limited API-only feature
1244}
1245#endif
1246
1247/* MathInitCode */
1248#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1249 #ifndef _USE_MATH_DEFINES
1250 #define _USE_MATH_DEFINES
1251 #endif
1252#endif
1253#include <math.h>
1254#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1255#define __Pyx_truncl trunc
1256#else
1257#define __Pyx_truncl truncl
1258#endif
1259
1260#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1261#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 1
1262#endif
1263#ifndef CYTHON_CLINE_IN_TRACEBACK
1264#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1265#endif
1266#if CYTHON_CLINE_IN_TRACEBACK
1267#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; }
1268#else
1269#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; }
1270#endif
1271#define __PYX_ERR(f_index, lineno, Ln_error) \
1272 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1273
1274#ifdef CYTHON_EXTERN_C
1275 #undef __PYX_EXTERN_C
1276 #define __PYX_EXTERN_C CYTHON_EXTERN_C
1277#elif defined(__PYX_EXTERN_C)
1278 #ifdef _MSC_VER
1279 #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1280 #else
1281 #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1282 #endif
1283#else
1284 #define __PYX_EXTERN_C extern "C++"
1285#endif
1286
1287#define __PYX_HAVE__equivalent_polynomials
1288#define __PYX_HAVE_API__equivalent_polynomials
1289/* Early includes */
1290#include "equivalent_polynomials.h"
1291#include <string.h>
1292#include <stdio.h>
1293
1294 /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */
1295
1296#include "numpy/arrayobject.h"
1297#include "numpy/ndarrayobject.h"
1298#include "numpy/ndarraytypes.h"
1299#include "numpy/arrayscalars.h"
1300#include "numpy/ufuncobject.h"
1301#include "pythread.h"
1302
1303 typedef int (*__pyx_memoryview_to_dtype_func_type)(char*, PyObject*);
1304
1305#include <stdlib.h>
1306#ifdef _OPENMP
1307#include <omp.h>
1308#endif /* _OPENMP */
1309
1310#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1311#define CYTHON_WITHOUT_ASSERTIONS
1312#endif
1313
1314#ifdef CYTHON_FREETHREADING_COMPATIBLE
1315#if CYTHON_FREETHREADING_COMPATIBLE
1316#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
1317#else
1318#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1319#endif
1320#else
1321#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1322#endif
1323#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1324#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1325#define __PYX_DEFAULT_STRING_ENCODING ""
1326#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1327#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1328#define __Pyx_uchar_cast(c) ((unsigned char)c)
1329#define __Pyx_long_cast(x) ((long)x)
1330#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1331 (sizeof(type) < sizeof(Py_ssize_t)) ||\
1332 (sizeof(type) > sizeof(Py_ssize_t) &&\
1333 likely(v < (type)PY_SSIZE_T_MAX ||\
1334 v == (type)PY_SSIZE_T_MAX) &&\
1335 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1336 v == (type)PY_SSIZE_T_MIN))) ||\
1337 (sizeof(type) == sizeof(Py_ssize_t) &&\
1338 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1339 v == (type)PY_SSIZE_T_MAX))) )
1340static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1341 return (size_t) i < (size_t) limit;
1342}
1343#if defined (__cplusplus) && __cplusplus >= 201103L
1344 #include <cstdlib>
1345 #define __Pyx_sst_abs(value) std::abs(value)
1346#elif SIZEOF_INT >= SIZEOF_SIZE_T
1347 #define __Pyx_sst_abs(value) abs(value)
1348#elif SIZEOF_LONG >= SIZEOF_SIZE_T
1349 #define __Pyx_sst_abs(value) labs(value)
1350#elif defined (_MSC_VER)
1351 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1352#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1353 #define __Pyx_sst_abs(value) llabs(value)
1354#elif defined (__GNUC__)
1355 #define __Pyx_sst_abs(value) __builtin_llabs(value)
1356#else
1357 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1358#endif
1359static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
1360static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
1361static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1362static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
1363#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1364#define __Pyx_PyBytes_FromString PyBytes_FromString
1365#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1366static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
1367#if CYTHON_ASSUME_SAFE_MACROS
1368 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1369 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1370 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1371 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1372 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1373 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1374 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
1375#else
1376 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s))
1377 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s))
1378 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s))
1379 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s))
1380 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s))
1381 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s))
1382 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
1383#endif
1384#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1385#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1386#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1387#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1388#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1389#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1390#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1391#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1392#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1393#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1394#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1395static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
1396#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
1397 return Py_NewRef(obj);
1398#else
1399 Py_INCREF(obj);
1400 return obj;
1401#endif
1402}
1403static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
1404#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
1405 return Py_XNewRef(obj);
1406#else
1407 Py_XINCREF(obj);
1408 return obj;
1409#endif
1410}
1411static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b);
1412static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
1413static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
1414static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1415static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x);
1416#define __Pyx_PyObject_RichCompareBool(a,b,cmp) __Pyx_PyObject_IsTrueAndDecref(PyObject_RichCompare((a),(b),(cmp)))
1417#define __Pyx_PySequence_Tuple(obj)\
1418 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1419static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1420static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t);
1421static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1422#if CYTHON_ASSUME_SAFE_MACROS
1423#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1424#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
1425#define __Pyx_PyFloat_IsNonZero(x) (PyFloat_AS_DOUBLE(x) != 0.0)
1426#else
1427#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1428#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
1429#define __Pyx_PyFloat_IsNonZero(x) PyObject_IsTrue(x)
1430#endif
1431#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
1432#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1433#if CYTHON_USE_PYLONG_INTERNALS
1434 #if PY_VERSION_HEX >= 0x030C00A7
1435 #ifndef _PyLong_SIGN_MASK
1436 #define _PyLong_SIGN_MASK 3
1437 #endif
1438 #ifndef _PyLong_NON_SIZE_BITS
1439 #define _PyLong_NON_SIZE_BITS 3
1440 #endif
1441 #define __Pyx_PyLong_SignBits(x) ((int) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK))
1442 #define __Pyx_PyLong_Sign(x) (1 - __Pyx_PyLong_SignBits(x))
1443 #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_SignBits(x) & 2) != 0)
1444 #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1445 #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_SignBits(x) & 1)
1446 #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_SignBits(x) == 0)
1447 #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1448 #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1449 #define __Pyx_PyLong_SignedDigitCount(x)\
1450 (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1451 #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1452 #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1453 #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1454 #else
1455 #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1456 #define __Pyx_PyLong_CompactValue(x) (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1457 #endif
1458 static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_CompareSignAndSize(PyObject *a, PyObject *b) {
1459 uintptr_t tag_a = ((PyLongObject*)a)->long_value.lv_tag;
1460 uintptr_t tag_b = ((PyLongObject*)b)->long_value.lv_tag;
1461 if (tag_a == tag_b) return 0;
1462 int sign_a = (int) (tag_a & _PyLong_SIGN_MASK);
1463 int sign_b = (int) (tag_b & _PyLong_SIGN_MASK);
1464 if (sign_a > sign_b) return -1;
1465 if (sign_a < sign_b) return 1;
1466 Py_ssize_t size_a = (Py_ssize_t) (tag_a >> _PyLong_NON_SIZE_BITS);
1467 Py_ssize_t size_b = (Py_ssize_t) (tag_b >> _PyLong_NON_SIZE_BITS);
1468 return (1 - sign_a) * (size_a - size_b);
1469 }
1470 typedef Py_ssize_t __Pyx_compact_pylong;
1471 typedef size_t __Pyx_compact_upylong;
1472 #else
1473 #define __Pyx_PyLong_Sign(x) ((int) ((Py_SIZE(x) == 0) ? 0 : (Py_SIZE(x) < 0) ? -1 : 1))
1474 #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1475 #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1476 #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1477 #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1478 #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1479 #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1480 #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1481 #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1482 #define __Pyx_PyLong_CompactValue(x)\
1483 ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1484 #define __Pyx_PyLong_CompareSignAndSize(a, b) (Py_SIZE(a) - Py_SIZE(b))
1485 typedef sdigit __Pyx_compact_pylong;
1486 typedef digit __Pyx_compact_upylong;
1487 #endif
1488 #if PY_VERSION_HEX >= 0x030C00A5
1489 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1490 #else
1491 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1492 #endif
1493 #define __Pyx_PyLong_IsNonZero(x) (!__Pyx_PyLong_IsZero(x))
1494#else
1495 #define __Pyx_PyLong_IsNonZero(x) PyObject_IsTrue(x)
1496#endif
1497#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
1498 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1499#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1500 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
1501#else
1502 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1503#endif
1504
1505
1506/* Test for GCC > 2.95 */
1507#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1508 #define likely(x) __builtin_expect(!!(x), 1)
1509 #define unlikely(x) __builtin_expect(!!(x), 0)
1510#else /* !__GNUC__ or GCC < 2.95 */
1511 #define likely(x) (x)
1512 #define unlikely(x) (x)
1513#endif /* __GNUC__ */
1514/* PretendToInitialize */
1515#ifdef __cplusplus
1516#if __cplusplus > 201103L
1517#include <type_traits>
1518#endif
1519template <typename T>
1520static void __Pyx_pretend_to_initialize(T* ptr) {
1521#if __cplusplus > 201103L
1522 if ((std::is_trivially_default_constructible<T>::value))
1523#endif
1524 *ptr = T();
1525 (void)ptr;
1526}
1527#else
1528static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1529#endif
1530
1531
1532#if !CYTHON_USE_MODULE_STATE
1533static PyObject *__pyx_m = NULL;
1534#endif
1535static const char * const __pyx_cfilenm = __FILE__;
1536
1537/* Header.proto */
1538#if !defined(CYTHON_CCOMPLEX)
1539 #if defined(__cplusplus)
1540 #define CYTHON_CCOMPLEX 1
1541 #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
1542 #define CYTHON_CCOMPLEX 1
1543 #else
1544 #define CYTHON_CCOMPLEX 0
1545 #endif
1546#endif
1547#if CYTHON_CCOMPLEX
1548 #ifdef __cplusplus
1549 #include <complex>
1550 #else
1551 #include <complex.h>
1552 #endif
1553#endif
1554#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1555 #undef _Complex_I
1556 #define _Complex_I 1.0fj
1557#endif
1558
1559/* #### Code section: filename_table ### */
1560
1561static const char* const __pyx_f[] = {
1562 "proteus/equivalent_polynomials.pyx",
1563 "View.MemoryView",
1564 "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd",
1565 "cpython/type.pxd",
1566};
1567/* #### Code section: utility_code_proto_before_types ### */
1568/* Atomics.proto (used by UnpackUnboundCMethod) */
1569#include <pythread.h>
1570#ifndef CYTHON_ATOMICS
1571 #define CYTHON_ATOMICS 1
1572#endif
1573#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1574#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1575#define __pyx_atomic_int_type int
1576#define __pyx_nonatomic_int_type int
1577#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1578 (__STDC_VERSION__ >= 201112L) &&\
1579 !defined(__STDC_NO_ATOMICS__))
1580 #include <stdatomic.h>
1581#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1582 (__cplusplus >= 201103L) ||\
1583 (defined(_MSC_VER) && _MSC_VER >= 1700)))
1584 #include <atomic>
1585#endif
1586#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1587 (__STDC_VERSION__ >= 201112L) &&\
1588 !defined(__STDC_NO_ATOMICS__) &&\
1589 ATOMIC_INT_LOCK_FREE == 2)
1590 #undef __pyx_atomic_int_type
1591 #define __pyx_atomic_int_type atomic_int
1592 #define __pyx_atomic_ptr_type atomic_uintptr_t
1593 #define __pyx_nonatomic_ptr_type uintptr_t
1594 #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
1595 #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
1596 #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
1597 #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
1598 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1599 #define __pyx_atomic_load(value) atomic_load(value)
1600 #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
1601 #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
1602 #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
1603 #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1604 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1605 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1606 #pragma message ("Using standard C atomics")
1607 #elif defined(__PYX_DEBUG_ATOMICS)
1608 #warning "Using standard C atomics"
1609 #endif
1610#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1611 (__cplusplus >= 201103L) ||\
1612\
1613 (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
1614 ATOMIC_INT_LOCK_FREE == 2)
1615 #undef __pyx_atomic_int_type
1616 #define __pyx_atomic_int_type std::atomic_int
1617 #define __pyx_atomic_ptr_type std::atomic_uintptr_t
1618 #define __pyx_nonatomic_ptr_type uintptr_t
1619 #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
1620 #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
1621 #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
1622 #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
1623 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1624 #define __pyx_atomic_load(value) std::atomic_load(value)
1625 #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
1626 #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
1627 #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
1628 #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1629 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1630 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1631 #pragma message ("Using standard C++ atomics")
1632 #elif defined(__PYX_DEBUG_ATOMICS)
1633 #warning "Using standard C++ atomics"
1634 #endif
1635#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1636 (__GNUC_MINOR__ > 1 ||\
1637 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1638 #define __pyx_atomic_ptr_type void*
1639 #define __pyx_nonatomic_ptr_type void*
1640 #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
1641 #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
1642 #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
1643 #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
1644 static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1645 __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
1646 int result = old == *expected;
1647 *expected = old;
1648 return result;
1649 }
1650 #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
1651 #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
1652 #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
1653 #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
1654 #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
1655 static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1656 __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
1657 int result = old == *expected;
1658 *expected = old;
1659 return result;
1660 }
1661 #ifdef __PYX_DEBUG_ATOMICS
1662 #warning "Using GNU atomics"
1663 #endif
1664#elif CYTHON_ATOMICS && defined(_MSC_VER)
1665 #include <intrin.h>
1666 #undef __pyx_atomic_int_type
1667 #define __pyx_atomic_int_type long
1668 #define __pyx_atomic_ptr_type void*
1669 #undef __pyx_nonatomic_int_type
1670 #define __pyx_nonatomic_int_type long
1671 #define __pyx_nonatomic_ptr_type void*
1672 #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
1673 #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
1674 #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
1675 #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
1676 #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
1677 static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1678 __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
1679 int result = old == *expected;
1680 *expected = old;
1681 return result;
1682 }
1683 #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
1684 #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
1685 #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
1686 #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
1687 #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
1688 static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1689 __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
1690 int result = old == *expected;
1691 *expected = old;
1692 return result;
1693 }
1694 #ifdef __PYX_DEBUG_ATOMICS
1695 #pragma message ("Using MSVC atomics")
1696 #endif
1697#else
1698 #undef CYTHON_ATOMICS
1699 #define CYTHON_ATOMICS 0
1700 #ifdef __PYX_DEBUG_ATOMICS
1701 #warning "Not using atomics"
1702 #endif
1703#endif
1704
1705/* CriticalSectionsDefinition.proto (used by CriticalSections) */
1706#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1707#define __Pyx_PyCriticalSection void*
1708#define __Pyx_PyCriticalSection2 void*
1709#define __Pyx_PyCriticalSection_End(cs)
1710#define __Pyx_PyCriticalSection2_End(cs)
1711#else
1712#define __Pyx_PyCriticalSection PyCriticalSection
1713#define __Pyx_PyCriticalSection2 PyCriticalSection2
1714#define __Pyx_PyCriticalSection_End PyCriticalSection_End
1715#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
1716#endif
1717
1718/* CriticalSections.proto (used by ParseKeywordsImpl) */
1719#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1720#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
1721#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
1722#else
1723#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
1724#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
1725#endif
1726#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
1727#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
1728#define __Pyx_END_CRITICAL_SECTION() }
1729#else
1730#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
1731#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
1732#endif
1733
1734/* ForceInitThreads.proto */
1735#ifndef __PYX_FORCE_INIT_THREADS
1736 #define __PYX_FORCE_INIT_THREADS 0
1737#endif
1738
1739/* NoFastGil.proto */
1740#define __Pyx_PyGILState_Ensure PyGILState_Ensure
1741#define __Pyx_PyGILState_Release PyGILState_Release
1742#define __Pyx_FastGIL_Remember()
1743#define __Pyx_FastGIL_Forget()
1744#define __Pyx_FastGilFuncInit()
1745
1746/* IncludeStructmemberH.proto (used by CythonFunctionShared) */
1747#include <structmember.h>
1748
1749/* BufferFormatStructs.proto */
1750struct __Pyx_StructField_;
1751#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1752typedef struct {
1753 const char* name;
1754 const struct __Pyx_StructField_* fields;
1755 size_t size;
1756 size_t arraysize[8];
1757 int ndim;
1758 char typegroup;
1759 char is_unsigned;
1760 int flags;
1761} __Pyx_TypeInfo;
1762typedef struct __Pyx_StructField_ {
1763 const __Pyx_TypeInfo* type;
1764 const char* name;
1765 size_t offset;
1766} __Pyx_StructField;
1767typedef struct {
1768 const __Pyx_StructField* field;
1769 size_t parent_offset;
1770} __Pyx_BufFmt_StackElem;
1771typedef struct {
1772 __Pyx_StructField root;
1773 __Pyx_BufFmt_StackElem* head;
1774 size_t fmt_offset;
1775 size_t new_count, enc_count;
1776 size_t struct_alignment;
1777 int is_complex;
1778 char enc_type;
1779 char new_packmode;
1780 char enc_packmode;
1781 char is_valid_array;
1782} __Pyx_BufFmt_Context;
1783
1784/* MemviewSliceStruct.proto */
1785struct __pyx_memoryview_obj;
1786typedef struct {
1787 struct __pyx_memoryview_obj *memview;
1788 char *data;
1789 Py_ssize_t shape[8];
1790 Py_ssize_t strides[8];
1791 Py_ssize_t suboffsets[8];
1792} __Pyx_memviewslice;
1793#define __Pyx_MemoryView_Len(m) (m.shape[0])
1794#define __Pyx_MEMVIEW_DIRECT 1
1795#define __Pyx_MEMVIEW_PTR 2
1796#define __Pyx_MEMVIEW_FULL 4
1797#define __Pyx_MEMVIEW_CONTIG 8
1798#define __Pyx_MEMVIEW_STRIDED 16
1799#define __Pyx_MEMVIEW_FOLLOW 32
1800#define __Pyx_IS_C_CONTIG 1
1801#define __Pyx_IS_F_CONTIG 2
1802#define __Pyx_MEMSLICE_INIT { 0, 0, { 0 }, { 0 }, { 0 } }
1803#if CYTHON_ATOMICS
1804 #define __pyx_add_acquisition_count(memview)\
1805 __pyx_atomic_incr_relaxed(__pyx_get_slice_count_pointer(memview))
1806 #define __pyx_sub_acquisition_count(memview)\
1807 __pyx_atomic_decr_acq_rel(__pyx_get_slice_count_pointer(memview))
1808#else
1809 #define __pyx_add_acquisition_count(memview)\
1810 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1811 #define __pyx_sub_acquisition_count(memview)\
1812 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1813#endif
1814
1815/* #### Code section: numeric_typedefs ### */
1816
1817/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":761
1818 * # in Cython to enable them only on the right systems.
1819 *
1820 * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1821 * ctypedef npy_int16 int16_t
1822 * ctypedef npy_int32 int32_t
1823*/
1824typedef npy_int8 __pyx_t_5numpy_int8_t;
1825
1826/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":762
1827 *
1828 * ctypedef npy_int8 int8_t
1829 * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1830 * ctypedef npy_int32 int32_t
1831 * ctypedef npy_int64 int64_t
1832*/
1833typedef npy_int16 __pyx_t_5numpy_int16_t;
1834
1835/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":763
1836 * ctypedef npy_int8 int8_t
1837 * ctypedef npy_int16 int16_t
1838 * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1839 * ctypedef npy_int64 int64_t
1840 *
1841*/
1842typedef npy_int32 __pyx_t_5numpy_int32_t;
1843
1844/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":764
1845 * ctypedef npy_int16 int16_t
1846 * ctypedef npy_int32 int32_t
1847 * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1848 *
1849 * ctypedef npy_uint8 uint8_t
1850*/
1851typedef npy_int64 __pyx_t_5numpy_int64_t;
1852
1853/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":766
1854 * ctypedef npy_int64 int64_t
1855 *
1856 * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1857 * ctypedef npy_uint16 uint16_t
1858 * ctypedef npy_uint32 uint32_t
1859*/
1860typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1861
1862/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":767
1863 *
1864 * ctypedef npy_uint8 uint8_t
1865 * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1866 * ctypedef npy_uint32 uint32_t
1867 * ctypedef npy_uint64 uint64_t
1868*/
1869typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1870
1871/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":768
1872 * ctypedef npy_uint8 uint8_t
1873 * ctypedef npy_uint16 uint16_t
1874 * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1875 * ctypedef npy_uint64 uint64_t
1876 *
1877*/
1878typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1879
1880/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":769
1881 * ctypedef npy_uint16 uint16_t
1882 * ctypedef npy_uint32 uint32_t
1883 * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1884 *
1885 * ctypedef npy_float32 float32_t
1886*/
1887typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1888
1889/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":771
1890 * ctypedef npy_uint64 uint64_t
1891 *
1892 * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1893 * ctypedef npy_float64 float64_t
1894 * #ctypedef npy_float80 float80_t
1895*/
1896typedef npy_float32 __pyx_t_5numpy_float32_t;
1897
1898/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":772
1899 *
1900 * ctypedef npy_float32 float32_t
1901 * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1902 * #ctypedef npy_float80 float80_t
1903 * #ctypedef npy_float128 float128_t
1904*/
1905typedef npy_float64 __pyx_t_5numpy_float64_t;
1906
1907/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":779
1908 * ctypedef double complex complex128_t
1909 *
1910 * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1911 * ctypedef npy_ulonglong ulonglong_t
1912 *
1913*/
1914typedef npy_longlong __pyx_t_5numpy_longlong_t;
1915
1916/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":780
1917 *
1918 * ctypedef npy_longlong longlong_t
1919 * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1920 *
1921 * ctypedef npy_intp intp_t
1922*/
1923typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1924
1925/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":782
1926 * ctypedef npy_ulonglong ulonglong_t
1927 *
1928 * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1929 * ctypedef npy_uintp uintp_t
1930 *
1931*/
1932typedef npy_intp __pyx_t_5numpy_intp_t;
1933
1934/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":783
1935 *
1936 * ctypedef npy_intp intp_t
1937 * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1938 *
1939 * ctypedef npy_double float_t
1940*/
1941typedef npy_uintp __pyx_t_5numpy_uintp_t;
1942
1943/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":785
1944 * ctypedef npy_uintp uintp_t
1945 *
1946 * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1947 * ctypedef npy_double double_t
1948 * ctypedef npy_longdouble longdouble_t
1949*/
1950typedef npy_double __pyx_t_5numpy_float_t;
1951
1952/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":786
1953 *
1954 * ctypedef npy_double float_t
1955 * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1956 * ctypedef npy_longdouble longdouble_t
1957 *
1958*/
1959typedef npy_double __pyx_t_5numpy_double_t;
1960
1961/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":787
1962 * ctypedef npy_double float_t
1963 * ctypedef npy_double double_t
1964 * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1965 *
1966 * ctypedef float complex cfloat_t
1967*/
1968typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1969/* #### Code section: complex_type_declarations ### */
1970/* Declarations.proto */
1971#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1972 #ifdef __cplusplus
1973 typedef ::std::complex< float > __pyx_t_float_complex;
1974 #else
1975 typedef float _Complex __pyx_t_float_complex;
1976 #endif
1977#else
1978 typedef struct { float real, imag; } __pyx_t_float_complex;
1979#endif
1980static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1981
1982/* Declarations.proto */
1983#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1984 #ifdef __cplusplus
1985 typedef ::std::complex< double > __pyx_t_double_complex;
1986 #else
1987 typedef double _Complex __pyx_t_double_complex;
1988 #endif
1989#else
1990 typedef struct { double real, imag; } __pyx_t_double_complex;
1991#endif
1992static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1993
1994/* Declarations.proto */
1995#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1996 #ifdef __cplusplus
1997 typedef ::std::complex< long double > __pyx_t_long_double_complex;
1998 #else
1999 typedef long double _Complex __pyx_t_long_double_complex;
2000 #endif
2001#else
2002 typedef struct { long double real, imag; } __pyx_t_long_double_complex;
2003#endif
2004static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double);
2005
2006/* #### Code section: type_declarations ### */
2007
2008/*--- Type declarations ---*/
2009struct __pyx_obj_22equivalent_polynomials_Simplex;
2010struct __pyx_array_obj;
2011struct __pyx_MemviewEnum_obj;
2012struct __pyx_memoryview_obj;
2013struct __pyx_memoryviewslice_obj;
2014
2015/* "equivalent_polynomials.pyx":30
2016 *
2017 *
2018 * cdef class Simplex: # <<<<<<<<<<<<<<
2019 * cdef np.ndarray xiBuffer
2020 * cdef int nSpace
2021*/
2022struct __pyx_obj_22equivalent_polynomials_Simplex {
2023 PyObject_HEAD
2024 PyArrayObject *xiBuffer;
2025 int nSpace;
2026 int nP;
2027 int nQ;
2028 int nEBQ;
2029 int q;
2030 bool inside_out;
2031 int edge;
2032 int corner;
2033 PyArrayObject *_H;
2034 PyArrayObject *_ImH;
2035 PyArrayObject *_D;
2036 equivalent_polynomials::Simplex<1,2,1,50,50> s11;
2037 equivalent_polynomials::Simplex<1,2,2,50,50> s12;
2038 equivalent_polynomials::Simplex<1,2,3,50,50> s13;
2039 equivalent_polynomials::Simplex<2,3,1,50,50> s21;
2040 equivalent_polynomials::Simplex<2,3,2,50,50> s22;
2041 equivalent_polynomials::Simplex<2,3,3,50,50> s23;
2042 equivalent_polynomials::Simplex<3,4,1,50,50> s31;
2043 equivalent_polynomials::Simplex<3,4,2,50,50> s32;
2044 equivalent_polynomials::Simplex<3,4,3,50,50> s33;
2045};
2046
2047
2048/* "View.MemoryView":128
2049 *
2050 *
2051 * @cython.collection_type("sequence") # <<<<<<<<<<<<<<
2052 * @cname("__pyx_array")
2053 * cdef class array:
2054*/
2055struct __pyx_array_obj {
2056 PyObject_HEAD
2057 struct __pyx_vtabstruct_array *__pyx_vtab;
2058 char *data;
2059 Py_ssize_t len;
2060 char *format;
2061 int ndim;
2062 Py_ssize_t *_shape;
2063 Py_ssize_t *_strides;
2064 Py_ssize_t itemsize;
2065 PyObject *mode;
2066 PyObject *_format;
2067 void (*callback_free_data)(void *);
2068 int free_data;
2069 int dtype_is_object;
2070};
2071
2072
2073/* "View.MemoryView":318
2074 *
2075 *
2076 * @cname('__pyx_MemviewEnum') # <<<<<<<<<<<<<<
2077 * cdef class Enum(object):
2078 * cdef object name
2079*/
2080struct __pyx_MemviewEnum_obj {
2081 PyObject_HEAD
2082 PyObject *name;
2083};
2084
2085
2086/* "View.MemoryView":353
2087 *
2088 *
2089 * @cname('__pyx_memoryview') # <<<<<<<<<<<<<<
2090 * cdef class memoryview:
2091 *
2092*/
2093struct __pyx_memoryview_obj {
2094 PyObject_HEAD
2095 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
2096 PyObject *obj;
2097 PyObject *_size;
2098 void *_unused;
2099 PyThread_type_lock lock;
2100 __pyx_atomic_int_type acquisition_count;
2101 Py_buffer view;
2102 int flags;
2103 int dtype_is_object;
2104 __Pyx_TypeInfo const *typeinfo;
2105};
2106
2107
2108/* "View.MemoryView":947
2109 *
2110 *
2111 * @cython.collection_type("sequence") # <<<<<<<<<<<<<<
2112 * @cname('__pyx_memoryviewslice')
2113 * cdef class _memoryviewslice(memoryview):
2114*/
2115struct __pyx_memoryviewslice_obj {
2116 struct __pyx_memoryview_obj __pyx_base;
2117 __Pyx_memviewslice from_slice;
2118 PyObject *from_object;
2119 PyObject *(*to_object_func)(char *);
2120 __pyx_memoryview_to_dtype_func_type to_dtype_func;
2121};
2122
2123
2124
2125/* "View.MemoryView":128
2126 *
2127 *
2128 * @cython.collection_type("sequence") # <<<<<<<<<<<<<<
2129 * @cname("__pyx_array")
2130 * cdef class array:
2131*/
2132
2133struct __pyx_vtabstruct_array {
2134 PyObject *(*get_memview)(struct __pyx_array_obj *);
2135};
2136static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
2137
2138
2139/* "View.MemoryView":353
2140 *
2141 *
2142 * @cname('__pyx_memoryview') # <<<<<<<<<<<<<<
2143 * cdef class memoryview:
2144 *
2145*/
2146
2147struct __pyx_vtabstruct_memoryview {
2148 char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
2149 PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
2150 PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2151 PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
2152 PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2153 PyObject *(*setitem_indexed1)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2154 PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
2155 PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
2156 PyObject *(*_get_base)(struct __pyx_memoryview_obj *);
2157};
2158static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
2159
2160
2161/* "View.MemoryView":947
2162 *
2163 *
2164 * @cython.collection_type("sequence") # <<<<<<<<<<<<<<
2165 * @cname('__pyx_memoryviewslice')
2166 * cdef class _memoryviewslice(memoryview):
2167*/
2168
2169struct __pyx_vtabstruct__memoryviewslice {
2170 struct __pyx_vtabstruct_memoryview __pyx_base;
2171};
2172static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
2173/* #### Code section: utility_code_proto ### */
2174
2175/* --- Runtime support code (head) --- */
2176/* Refnanny.proto */
2177#ifndef CYTHON_REFNANNY
2178 #define CYTHON_REFNANNY 0
2179#endif
2180#if CYTHON_REFNANNY
2181 typedef struct {
2182 void (*INCREF)(void*, PyObject*, Py_ssize_t);
2183 void (*DECREF)(void*, PyObject*, Py_ssize_t);
2184 void (*GOTREF)(void*, PyObject*, Py_ssize_t);
2185 void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
2186 void* (*SetupContext)(const char*, Py_ssize_t, const char*);
2187 void (*FinishContext)(void**);
2188 } __Pyx_RefNannyAPIStruct;
2189 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
2190 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
2191 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
2192 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2193 if (acquire_gil) {\
2194 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2195 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2196 PyGILState_Release(__pyx_gilstate_save);\
2197 } else {\
2198 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2199 }
2200 #define __Pyx_RefNannyFinishContextNogil() {\
2201 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2202 __Pyx_RefNannyFinishContext();\
2203 PyGILState_Release(__pyx_gilstate_save);\
2204 }
2205 #define __Pyx_RefNannyFinishContextNogil() {\
2206 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2207 __Pyx_RefNannyFinishContext();\
2208 PyGILState_Release(__pyx_gilstate_save);\
2209 }
2210 #define __Pyx_RefNannyFinishContext()\
2211 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
2212 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2213 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2214 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2215 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2216 #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
2217 #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
2218 #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
2219 #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
2220#else
2221 #define __Pyx_RefNannyDeclarations
2222 #define __Pyx_RefNannySetupContext(name, acquire_gil)
2223 #define __Pyx_RefNannyFinishContextNogil()
2224 #define __Pyx_RefNannyFinishContext()
2225 #define __Pyx_INCREF(r) Py_INCREF(r)
2226 #define __Pyx_DECREF(r) Py_DECREF(r)
2227 #define __Pyx_GOTREF(r)
2228 #define __Pyx_GIVEREF(r)
2229 #define __Pyx_XINCREF(r) Py_XINCREF(r)
2230 #define __Pyx_XDECREF(r) Py_XDECREF(r)
2231 #define __Pyx_XGOTREF(r)
2232 #define __Pyx_XGIVEREF(r)
2233#endif
2234#define __Pyx_Py_XDECREF_SET(r, v) do {\
2235 PyObject *tmp = (PyObject *) r;\
2236 r = v; Py_XDECREF(tmp);\
2237 } while (0)
2238#define __Pyx_XDECREF_SET(r, v) do {\
2239 PyObject *tmp = (PyObject *) r;\
2240 r = v; __Pyx_XDECREF(tmp);\
2241 } while (0)
2242#define __Pyx_DECREF_SET(r, v) do {\
2243 PyObject *tmp = (PyObject *) r;\
2244 r = v; __Pyx_DECREF(tmp);\
2245 } while (0)
2246#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2247#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2248
2249/* CopyObjectArray.proto (used by TupleOrListFromArrayImpl) */
2250#if CYTHON_COMPILING_IN_CPYTHON
2251static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length);
2252#endif
2253
2254/* TupleOrListFromArrayImpl.proto (used by TupleFromArray) */
2255#if PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API
2256#define __Pyx_PyTuple_FromArray(src, n) PyTuple_FromArray(src, ((n)<0) ? 0 : (n))
2257#else
2258CYTHON_UNUSED static PyObject *
2259__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
2260#endif
2261
2262/* TupleFromArray.proto (used by fastcall) */
2263
2264
2265/* IncludeStringH.proto (used by PyObjectCompare) */
2266#include <string.h>
2267
2268/* PyObjectCompare.proto (used by UnicodeEquals) */
2269static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2, int pyop);
2270
2271/* UnicodeEquals.proto (used by fastcall) */
2272#define __Pyx_PyUnicode_Equals(s1, s2) __Pyx_PyObject_CompareBoolEq_str_str(s1, s2, Py_EQ)
2273
2274/* fastcall.proto */
2275#if CYTHON_AVOID_BORROWED_REFS
2276 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
2277#elif CYTHON_ASSUME_SAFE_MACROS
2278 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
2279#else
2280 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
2281#endif
2282#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
2283#define __Pyx_KwValues_VARARGS(args, nargs) NULL
2284#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
2285#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
2286#if CYTHON_VECTORCALL
2287 #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
2288 #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
2289 #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
2290 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
2291 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
2292 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
2293 #else
2294 #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
2295 #endif
2296#else
2297 #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
2298 #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
2299 #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
2300 #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
2301 #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
2302#endif
2303#if CYTHON_VECTORCALL_TPNEW
2304 #if !CYTHON_VECTORCALL
2305 #error Enabling CYTHON_VECTORCALL_TPNEW without CYTHON_VECTORCALL is not supported
2306 #endif
2307 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_FASTCALL
2308 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_FASTCALL
2309 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_FASTCALL
2310 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_FASTCALL
2311 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_FASTCALL
2312#else
2313 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_VARARGS
2314 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_VARARGS
2315 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_VARARGS
2316 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_VARARGS
2317 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_VARARGS
2318#endif
2319#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
2320#if CYTHON_VECTORCALL
2321#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
2322#else
2323#define __Pyx_ArgsSlice_FASTCALL __Pyx_ArgsSlice_VARARGS
2324#endif
2325
2326/* py_dict_items.proto (used by OwnedDictNext) */
2327#define __Pyx_PyDict_items_TypePtr (&PyDictKeys_Type)
2328#define __Pyx_PyDict_items_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictItems_TypePtr)
2329#define __Pyx_PyDict_items_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictItems_TypePtr)
2330static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);
2331
2332/* CallCFunction.proto (used by CallUnboundCMethod0) */
2333#define __Pyx_CallCFunction(cfunc, self, args)\
2334 ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
2335#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
2336 ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
2337#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
2338 ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
2339#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
2340 ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)
2341
2342/* PyObjectCall.proto (used by PyObjectFastCall) */
2343#if CYTHON_COMPILING_IN_CPYTHON
2344static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2345#else
2346#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2347#endif
2348
2349/* PyObjectCallMethO.proto (used by PyObjectFastCall) */
2350#if CYTHON_COMPILING_IN_CPYTHON
2351static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2352#endif
2353
2354/* PyObjectFastCall.proto (used by PyObjectCallOneArg) */
2355#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
2356static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargsf, PyObject *kwargs);
2357
2358/* PyObjectCallOneArg.proto (used by CallUnboundCMethod0) */
2359static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2360
2361/* UnpackUnboundCMethod_decl.proto (used by UnpackUnboundCMethod) */
2362typedef struct {
2363 PyObject *type;
2364 PyObject **method_name;
2365 PyCFunction func;
2366 PyObject *method;
2367 int flag;
2368#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
2369 __pyx_atomic_int_type initialized;
2370#endif
2371} __Pyx_CachedCFunction;
2372
2373/* IgnoreException.proto (used by UnpackUnboundCMethod_impl) */
2374static CYTHON_INLINE int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception);
2375#define __Pyx_IgnoreException(ignorable_exception) __Pyx_IgnoreGivenException(NULL, ignorable_exception)
2376
2377/* FastTypeChecks.proto (used by UnpackUnboundCMethod_impl) */
2378#if CYTHON_COMPILING_IN_CPYTHON
2379#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2380#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
2381static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2382static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
2383#define __Pyx_PyAnySet_Check(obj) __Pyx_TypeCheck2(obj, &PySet_Type, &PyFrozenSet_Type)
2384#else
2385#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2386#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
2387#define __Pyx_PyAnySet_Check(obj) PyAnySet_Check(obj)
2388#endif
2389
2390/* PyObjectGetAttrStr.proto (used by UnpackUnboundCMethod_impl) */
2391#if CYTHON_USE_TYPE_SLOTS
2392static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2393#else
2394#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2395#endif
2396
2397/* UnpackUnboundCMethod_impl.export */
2398static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target);
2399
2400/* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */
2401#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
2402static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
2403#if !CYTHON_ATOMICS
2404 return 1;
2405#else
2406 __pyx_nonatomic_int_type expected = 0;
2407 if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
2408 return 0;
2409 }
2410 return expected;
2411#endif
2412}
2413static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
2414#if CYTHON_ATOMICS
2415 __pyx_atomic_store(&cfunc->initialized, 2);
2416#endif
2417}
2418#else
2419#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
2420#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
2421#endif
2422
2423/* CallUnboundCMethod0.proto */
2424CYTHON_UNUSED
2425static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2426#if CYTHON_COMPILING_IN_CPYTHON
2427static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2428#else
2429#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
2430#endif
2431
2432/* py_dict_values.proto (used by OwnedDictNext) */
2433#define __Pyx_PyDict_values_TypePtr (&PyDictKeys_Type)
2434#define __Pyx_PyDict_values_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictValues_TypePtr)
2435#define __Pyx_PyDict_values_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictValues_TypePtr)
2436static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);
2437
2438/* OwnedDictNext.proto (used by ParseKeywordsImpl) */
2439#if CYTHON_AVOID_BORROWED_REFS
2440static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
2441#else
2442CYTHON_INLINE
2443static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
2444#endif
2445
2446/* RaiseDoubleKeywords.proto (used by ParseKeywordsImpl) */
2447static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
2448
2449/* ParseKeywordsImpl.export */
2450static int __Pyx_ParseKeywordsTuple(
2451 PyObject *kwds,
2452 PyObject * const *kwvalues,
2453 PyObject ** const argnames[],
2454 PyObject *kwds2,
2455 PyObject *values[],
2456 Py_ssize_t num_pos_args,
2457 Py_ssize_t num_kwargs,
2458 const char* function_name,
2459 int ignore_unknown_kwargs
2460);
2461static int __Pyx_ParseKeywordDictToDict(
2462 PyObject *kwds,
2463 PyObject ** const argnames[],
2464 PyObject *kwds2,
2465 PyObject *values[],
2466 Py_ssize_t num_pos_args,
2467 const char* function_name
2468);
2469static int __Pyx_ParseKeywordDict(
2470 PyObject *kwds,
2471 PyObject ** const argnames[],
2472 PyObject *values[],
2473 Py_ssize_t num_pos_args,
2474 Py_ssize_t num_kwargs,
2475 const char* function_name,
2476 int ignore_unknown_kwargs
2477);
2478
2479/* CallUnboundCMethod2.proto */
2480CYTHON_UNUSED
2481static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
2482#if CYTHON_COMPILING_IN_CPYTHON
2483static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
2484#else
2485#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
2486#endif
2487
2488/* ParseKeywords.proto */
2489static CYTHON_INLINE int __Pyx_ParseKeywords(
2490 PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[],
2491 PyObject *kwds2, PyObject *values[],
2492 Py_ssize_t num_pos_args, Py_ssize_t num_kwargs,
2493 const char* function_name,
2494 int ignore_unknown_kwargs
2495);
2496
2497/* RaiseArgTupleInvalid.export */
2498static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
2499 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2500
2501/* ArgTypeTestError.export */
2502static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2503
2504/* ArgTypeTest.proto */
2505static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact);
2506
2507/* PyThreadStateGet.proto (used by PyErrFetchRestore) */
2508#if CYTHON_FAST_THREAD_STATE
2509#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2510#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2511#if PY_VERSION_HEX >= 0x030C00A6
2512#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
2513#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
2514#else
2515#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
2516#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
2517#endif
2518#else
2519#define __Pyx_PyThreadState_declare
2520#define __Pyx_PyThreadState_assign
2521#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
2522#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
2523#endif
2524
2525/* PyErrFetchRestore.proto (used by GivenExceptionMatches) */
2526#if CYTHON_FAST_THREAD_STATE
2527#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2528#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2529#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2530#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2531#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2532static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2533static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2534#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
2535#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2536#else
2537#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2538#endif
2539#else
2540#define __Pyx_PyErr_Clear() PyErr_Clear()
2541#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2542#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2543#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2544#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2545#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2546#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2547#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2548#endif
2549
2550/* GivenExceptionMatches.proto (used by PyErrExceptionMatches) */
2551#if CYTHON_COMPILING_IN_CPYTHON
2552static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2553static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2554#else
2555#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2556static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
2557 return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
2558}
2559#endif
2560#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
2561
2562/* PyErrExceptionMatches.proto (used by PyObjectGetAttrStrNoError) */
2563#if CYTHON_FAST_THREAD_STATE
2564#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2565static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2566#else
2567#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2568#endif
2569
2570/* PyObjectGetAttrStrNoError.proto (used by GetBuiltinName) */
2571static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2572
2573/* GetBuiltinName.proto */
2574static PyObject *__Pyx_GetBuiltinName(PyObject *name);
2575
2576/* PyObjectFastCallMethod.proto */
2577#if CYTHON_VECTORCALL
2578#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL)
2579#else
2580static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf);
2581#endif
2582
2583/* FormatTypeName.proto (used by RaiseErrorWithObjectType1) */
2584#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2585typedef PyObject *__Pyx_TypeName;
2586#define __Pyx_FMT_TYPENAME "%N"
2587#define __Pyx_PyType_GetFullyQualifiedName(tp) Py_NewRef((PyObject*)tp)
2588#define __Pyx_DECREF_TypeName(obj) Py_DECREF(obj)
2589#elif CYTHON_COMPILING_IN_LIMITED_API
2590typedef PyObject *__Pyx_TypeName;
2591#define __Pyx_FMT_TYPENAME "%U"
2592#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
2593static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
2594#else // !LIMITED_API
2595typedef const char *__Pyx_TypeName;
2596#define __Pyx_FMT_TYPENAME "%.200s"
2597#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
2598#define __Pyx_DECREF_TypeName(obj)
2599#endif
2600
2601/* RaiseErrorWithObjectType1.proto (used by RaiseUnexpectedTypeError) */
2602#define __Pyx_RaiseTypeErrorWithObjectType1(message, arg, obj) __Pyx_RaiseErrorWithObjectType1(PyExc_TypeError, message, arg, obj)
2603#define __Pyx_RaiseErrorWithObjectType1(exc_type, message, arg, obj) __Pyx_RaiseErrorWithType1(exc_type, message, arg, Py_TYPE(obj))
2604CYTHON_UNUSED
2605static void __Pyx_RaiseErrorWithType1(PyObject* exc_type, const char* message, const char *arg, PyTypeObject *type_obj);
2606
2607/* RaiseUnexpectedTypeError.proto */
2608CYTHON_UNUSED
2609static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);
2610
2611/* PyMemoryError_Check.proto */
2612#define __Pyx_PyExc_MemoryError_Check(obj) __Pyx_TypeCheck(obj, PyExc_MemoryError)
2613
2614/* RaiseException.export */
2615static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2616
2617/* PyValueError_Check.proto */
2618#define __Pyx_PyExc_ValueError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ValueError)
2619
2620/* BuildPyUnicode.proto (used by COrdinalToPyUnicode) */
2621static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const char* chars, int clength,
2622 int prepend_sign, char padding_char);
2623
2624/* COrdinalToPyUnicode.proto (used by CIntToPyUnicode) */
2625static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value);
2626static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t width, char padding_char);
2627
2628/* GCCDiagnostics.proto (used by CIntToPyUnicode) */
2629#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2630#define __Pyx_HAS_GCC_DIAGNOSTIC
2631#endif
2632
2633/* IncludeStdlibH.proto (used by CIntToPyUnicode) */
2634#include <stdlib.h>
2635
2636/* CIntToPyUnicode.proto */
2637#define __Pyx_PyUnicode_From_int(value, width, padding_char, format_char) (\
2638 ((format_char) == ('c')) ?\
2639 __Pyx_uchar___Pyx_PyUnicode_From_int(value, width, padding_char) :\
2640 __Pyx____Pyx_PyUnicode_From_int(value, width, padding_char, format_char)\
2641 )
2642static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char);
2643static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);
2644
2645/* CIntToPyUnicode.proto */
2646#define __Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char) (\
2647 ((format_char) == ('c')) ?\
2648 __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char) :\
2649 __Pyx____Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char)\
2650 )
2651static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char);
2652static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);
2653
2654/* JoinPyUnicode.proto */
2655#define __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH\
2656 (!CYTHON_COMPILING_IN_GRAAL && !CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API)
2657
2658/* JoinPyUnicode.export */
2659static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, int kind);
2660
2661/* UnicodeEqualsUCS4.proto (used by UnicodeEquals_uchar) */
2662#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
2663#define __Pyx_PyObject_Equals_uchar(s1, s2, ch2, equals, s1_is_str) (\
2664 ((s1) == (s2)) ? ((equals) == Py_EQ) :\
2665 ((s1) == Py_None) ? ((equals) == Py_NE) :\
2666 __Pyx_PyObject_RichCompareBool(s1, s2, equals)\
2667 )
2668#else
2669#define __Pyx_PyObject_Equals_uchar(s1, s2, ch2, equals, s1_is_str) (\
2670 ((s1) == (s2)) ? ((equals) == Py_EQ) :\
2671 ((s1) == Py_None) ? ((equals) == Py_NE) :\
2672 (likely((s1_is_str) || PyUnicode_CheckExact(s1)) ?\
2673 __Pyx__PyUnicode_EqualsUCS4(s1, ch2, equals) :\
2674 __Pyx_PyObject_RichCompareBool(s1, s2, equals)\
2675 ))
2676static CYTHON_INLINE int __Pyx__PyUnicode_EqualsUCS4(PyObject* s1, Py_UCS4 ch2, int equals);
2677#endif
2678
2679/* UnicodeEquals_uchar.proto */
2680#define __Pyx_PyObject_Equals_obj_ch99(s1, s2, equals) __Pyx_PyObject_Equals_uchar(s1, s2, 99, equals, 0)
2681
2682/* PyObjectCompare.proto */
2683static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_object_str(PyObject *op1, PyObject *op2, int pyop);
2684
2685/* PyObjectFormatSimple.proto */
2686#if CYTHON_COMPILING_IN_PYPY
2687 #define __Pyx_PyObject_FormatSimple(s, f) (\
2688 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2689 PyObject_Format(s, f))
2690#elif CYTHON_USE_TYPE_SLOTS
2691 #define __Pyx_PyObject_FormatSimple(s, f) (\
2692 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2693 likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
2694 likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
2695 PyObject_Format(s, f))
2696#else
2697 #define __Pyx_PyObject_FormatSimple(s, f) (\
2698 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2699 PyObject_Format(s, f))
2700#endif
2701
2702/* PyObjectCompare.proto */
2703static CYTHON_INLINE PyObject* __Pyx_PyObject_CompareEq_object_bytes(PyObject *op1, PyObject *op2, int pyop);
2704
2705CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2706/* UnicodeEquals_uchar.proto */
2707#define __Pyx_PyObject_Equals_str_ch99(s1, s2, equals) __Pyx_PyObject_Equals_uchar(s1, s2, 99, equals, 1)
2708
2709static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2710/* GetAttr.proto */
2711static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2712
2713/* PyFrozenDict.proto (used by GetItemInt) */
2714#if CYTHON_COMPILING_IN_LIMITED_API
2715#define __Pyx_PyFrozenDict_TypePtr ((PyTypeObject*) __pyx_mstate_global->__Pyx_PyFrozenDictType)
2716#define __Pyx_PyFrozenDict_New(it) __Pyx__PyFrozenDict_New(__pyx_mstate_global->__Pyx_PyFrozenDictType, it)
2717static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it);
2718#define __Pyx_PyFrozenDict_NewEmpty() __Pyx_PyFrozenDict_New(NULL)
2719#define __Pyx_PyFrozenDict_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyFrozenDict_TypePtr)
2720#define __Pyx_PyFrozenDict_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyFrozenDict_TypePtr)
2721#define __Pyx_PyAnyDict_Check(obj) __Pyx__PyAnyDict_Check(obj, __Pyx_PyFrozenDict_TypePtr)
2722static CYTHON_INLINE int __Pyx__PyAnyDict_Check(PyObject *obj, PyTypeObject* frozendict_type) {
2723 return PyObject_TypeCheck(obj, &PyDict_Type) || PyObject_TypeCheck(obj, frozendict_type);
2724}
2725#define __Pyx_PyAnyDict_CheckExact(obj) __Pyx__PyAnyDict_CheckExact(obj, __Pyx_PyFrozenDict_TypePtr)
2726static CYTHON_INLINE int __Pyx__PyAnyDict_CheckExact(PyObject *obj, PyTypeObject* frozendict_type) {
2727 return Py_IS_TYPE(obj, &PyDict_Type) || Py_IS_TYPE(obj, frozendict_type);
2728}
2729#elif PY_VERSION_HEX >= 0x030f00a6 ||\
2730 (defined(PyFrozenDict_Check) && defined(PyAnyDict_Check) && defined(PyFrozenDict_New))
2731#define __Pyx_PyFrozenDict_TypePtr (&PyFrozenDict_Type)
2732#define __Pyx_PyFrozenDict_New(it) PyFrozenDict_New(it)
2733#define __Pyx_PyFrozenDict_NewEmpty() PyFrozenDict_New(NULL)
2734#define __Pyx_PyFrozenDict_Check(obj) PyFrozenDict_Check(obj)
2735#define __Pyx_PyFrozenDict_CheckExact(obj) PyFrozenDict_CheckExact(obj)
2736#define __Pyx_PyAnyDict_Check(obj) PyAnyDict_Check(obj)
2737#define __Pyx_PyAnyDict_CheckExact(obj) PyAnyDict_CheckExact(obj)
2738#else
2739#define __Pyx_PyFrozenDict_TypePtr (&PyDict_Type)
2740static CYTHON_INLINE PyObject* __Pyx_PyFrozenDict_New(PyObject* it) {
2741 if (!it) {
2742 return PyDict_New();
2743 } else if (PyDict_Check(it)) {
2744 return PyDict_Copy(it);
2745 } else {
2746 PyObject *dict = PyDict_New();
2747 if (!dict) return NULL;
2748 PyObject *result = PyNumber_InPlaceOr(dict, it);
2749 Py_DECREF(dict);
2750 return result;
2751 }
2752}
2753#define __Pyx_PyFrozenDict_NewEmpty() PyDict_New()
2754#define __Pyx_PyFrozenDict_Check(obj) PyDict_Check(obj)
2755#define __Pyx_PyFrozenDict_CheckExact(obj) PyDict_CheckExact(obj)
2756#define __Pyx_PyAnyDict_Check(obj) PyDict_Check(obj)
2757#define __Pyx_PyAnyDict_CheckExact(obj) PyDict_CheckExact(obj)
2758#endif
2759
2760/* GetItemInt.proto */
2761#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2762 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2763 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2764 __Pyx_GetItemInt_Generic(o, to_py_func(i)))
2765#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2766 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2767 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2768 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2769static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2770 int wraparound, int boundscheck, int unsafe_shared);
2771#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2772 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2773 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2774 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2775static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2776 int wraparound, int boundscheck, int unsafe_shared);
2777static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2778static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2779 int wraparound, int boundscheck, int unsafe_shared);
2780
2781/* RaiseErrorWithObjectType.proto (used by ObjectGetItem) */
2782#define __Pyx_RaiseTypeErrorWithObjectType(message, obj) __Pyx_RaiseErrorWithObjectType(PyExc_TypeError, message, obj)
2783#define __Pyx_RaiseErrorWithObjectType(exc_type, message, obj) __Pyx_RaiseErrorWithType(exc_type, message, Py_TYPE(obj))
2784CYTHON_UNUSED
2785static void __Pyx_RaiseErrorWithType(PyObject* exc_type, const char* message, PyTypeObject *type_obj);
2786
2787/* ObjectGetItem.proto */
2788#if CYTHON_USE_TYPE_SLOTS
2789static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
2790#else
2791#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2792#endif
2793
2794/* RejectKeywords.export */
2795static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds);
2796
2797/* PyTypeError_Check.proto */
2798#define __Pyx_PyExc_TypeError_Check(obj) __Pyx_TypeCheck(obj, PyExc_TypeError)
2799
2800/* DivInt[Py_ssize_t].proto */
2801static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t, int b_is_constant);
2802
2803/* UnaryNegOverflows.proto */
2804#define __Pyx_UNARY_NEG_WOULD_OVERFLOW(x)\
2805 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2806
2807/* GetAttr3.proto */
2808static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2809
2810/* PyDictVersioning.proto (used by GetModuleGlobalName) */
2811#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2812#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2813#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2814#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2815 (version_var) = __PYX_GET_DICT_VERSION(dict);\
2816 (cache_var) = (value);
2817#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2818 static PY_UINT64_T __pyx_dict_version = 0;\
2819 static PyObject *__pyx_dict_cached_value = NULL;\
2820 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2821 (VAR) = __Pyx_XNewRef(__pyx_dict_cached_value);\
2822 } else {\
2823 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2824 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2825 }\
2826}
2827static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2828static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2829static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2830#else
2831#define __PYX_GET_DICT_VERSION(dict) (0)
2832#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2833#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2834#endif
2835
2836/* GetModuleGlobalName.proto */
2837#if CYTHON_USE_DICT_VERSIONS
2838#define __Pyx_GetModuleGlobalName(var, name) do {\
2839 static PY_UINT64_T __pyx_dict_version = 0;\
2840 static PyObject *__pyx_dict_cached_value = NULL;\
2841 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\
2842 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
2843 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2844} while(0)
2845#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
2846 PY_UINT64_T __pyx_dict_version;\
2847 PyObject *__pyx_dict_cached_value;\
2848 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2849} while(0)
2850static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
2851#else
2852#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2853#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2854static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
2855#endif
2856
2857/* AssertionsEnabled.proto */
2858#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000
2859 static int __pyx_assertions_enabled_flag;
2860 #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2861 #if __clang__ || __GNUC__
2862 __attribute__((no_sanitize("thread")))
2863 #endif
2864 static int __Pyx_init_assertions_enabled(void) {
2865 PyObject *builtins, *debug, *debug_str;
2866 int flag;
2867 builtins = PyEval_GetBuiltins();
2868 if (!builtins) goto bad;
2869 debug_str = PyUnicode_FromStringAndSize("__debug__", 9);
2870 if (!debug_str) goto bad;
2871 debug = PyObject_GetItem(builtins, debug_str);
2872 Py_DECREF(debug_str);
2873 if (!debug) goto bad;
2874 flag = PyObject_IsTrue(debug);
2875 Py_DECREF(debug);
2876 if (flag == -1) goto bad;
2877 __pyx_assertions_enabled_flag = flag;
2878 return 0;
2879 bad:
2880 __pyx_assertions_enabled_flag = 1;
2881 return -1;
2882 }
2883#else
2884 #define __Pyx_init_assertions_enabled() (0)
2885 #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2886#endif
2887
2888/* PyAssertionError_Check.proto */
2889#define __Pyx_PyExc_AssertionError_Check(obj) __Pyx_TypeCheck(obj, PyExc_AssertionError)
2890
2891/* RaiseTooManyValuesToUnpack.proto */
2892static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2893
2894/* RaiseNeedMoreValuesToUnpack.proto */
2895static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2896
2897/* RaiseNoneIterError.proto */
2898static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2899
2900/* GetTopmostException.proto (used by SaveResetException) */
2901#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
2902static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2903#endif
2904
2905/* SaveResetException.proto */
2906#if CYTHON_FAST_THREAD_STATE
2907#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2908static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2909#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2910static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2911#else
2912#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2913#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2914#endif
2915
2916/* RaiseErrorWithObjectTypes.proto (used by ExtTypeTest) */
2917#define __Pyx_RaiseErrorWithObjectTypes1(exc_type, message, arg, obj1, obj2) __Pyx_RaiseErrorWithTypes1(exc_type, message, arg, Py_TYPE(obj1), Py_TYPE(obj2))
2918#define __Pyx_RaiseTypeErrorWithObjectTypes(message, obj1, obj2) __Pyx_RaiseTypeErrorWithTypes(message, Py_TYPE(obj1), Py_TYPE(obj2))
2919#define __Pyx_RaiseTypeErrorWithTypes(message, type_obj1, type_obj2) __Pyx_RaiseErrorWithTypes1(PyExc_TypeError, "%.1s" message, "", type_obj1, type_obj2)
2920CYTHON_UNUSED
2921static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type, const char *message, const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2);
2922
2923/* ExtTypeTest.proto */
2924static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2925
2926/* GetException.proto */
2927#if CYTHON_FAST_THREAD_STATE
2928#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2929static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2930#else
2931static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2932#endif
2933
2934/* SwapException.proto */
2935#if CYTHON_FAST_THREAD_STATE
2936#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2937static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2938#else
2939static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2940#endif
2941
2942/* HasAttr.proto (used by ImportImpl) */
2943#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2944#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n)
2945#else
2946static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2947#endif
2948
2949/* TupleOrListFromArrayImpl.proto (used by ListFromArray) */
2950CYTHON_UNUSED static PyObject *
2951__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
2952
2953/* ListFromArray.proto (used by ImportImpl) */
2954
2955
2956/* ImportImpl.export */
2957static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level);
2958
2959/* Import.proto */
2960static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level);
2961
2962CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2963/* ListCompAppendAndDecref.proto */
2964static CYTHON_INLINE int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x);
2965
2966/* PySequenceMultiply.proto */
2967#define __Pyx_PySequence_Multiply_Left(mul, seq) __Pyx_PySequence_Multiply(seq, mul)
2968#if !CYTHON_USE_TYPE_SLOTS
2969#define __Pyx_PySequence_Multiply PySequence_Repeat
2970#else
2971static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul);
2972#endif
2973
2974/* PyNumberBinop.proto */
2975#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API
2976#define __Pyx_PyNumber_Multiply_object_int(op1, op2) PyNumber_Multiply(op1, op2)
2977#define __Pyx_PyNumber_InPlaceMultiply_object_int(op1, op2) PyNumber_InPlaceMultiply(op1, op2)
2978#else
2979#define __Pyx_PyNumber_Multiply_object_int(op1, op2) __Pyx__PyNumber_Multiply_object_int(op1, op2, 0)
2980#define __Pyx_PyNumber_InPlaceMultiply_object_int(op1, op2) __Pyx__PyNumber_Multiply_object_int(op1, op2, 1)
2981static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_object_int(PyObject *op1, PyObject *op2, int inplace);
2982#endif
2983
2984/* PyObjectFormatAndDecref.proto */
2985static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
2986static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);
2987
2988/* PyObjectFormat.proto */
2989#if CYTHON_USE_UNICODE_WRITER
2990static PyObject* __Pyx_PyObject_Format(PyObject* s, PyObject* f);
2991#else
2992#define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f)
2993#endif
2994
2995/* PyObject_Unicode.proto */
2996#define __Pyx_PyObject_Unicode(obj)\
2997 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
2998
2999/* SetItemInt.proto */
3000#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
3001 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
3002 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, wraparound, boundscheck, unsafe_shared) :\
3003 __Pyx_SetItemInt_Generic(o, to_py_func(i), v))
3004static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
3005static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
3006 int wraparound, int boundscheck, int unsafe_shared);
3007
3008/* RaiseUnboundLocalError.proto */
3009static void __Pyx_RaiseUnboundLocalError(const char *varname);
3010
3011/* DivInt[long].proto */
3012static CYTHON_INLINE long __Pyx_div_long(long, long, int b_is_constant);
3013
3014/* ListAppend.proto */
3015#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
3016static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x);
3017#else
3018#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
3019#endif
3020
3021/* PyObjectCallMethod1.proto (used by StringJoin) */
3022static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
3023
3024/* StringJoin.proto */
3025static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
3026
3027/* CIntToPyUnicode.proto */
3028#define __Pyx_PyUnicode_From_size_t(value, width, padding_char, format_char) (\
3029 ((format_char) == ('c')) ?\
3030 __Pyx_uchar___Pyx_PyUnicode_From_size_t(value, width, padding_char) :\
3031 __Pyx____Pyx_PyUnicode_From_size_t(value, width, padding_char, format_char)\
3032 )
3033static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char);
3034static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char, char format_char);
3035
3036/* PyException_Check.proto */
3037#define __Pyx_PyExc_Exception_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
3038
3039/* PyImportError_Check.proto */
3040#define __Pyx_PyExc_ImportError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ImportError)
3041
3042/* SliceObject.proto */
3043#define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
3044 __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
3045static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
3046 PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
3047 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
3048 int has_cstart, int has_cstop, int wraparound);
3049
3050/* DefaultPlacementNew.proto */
3051#include <new>
3052template<typename T>
3053void __Pyx_default_placement_construct(T* x) {
3054 new (static_cast<void*>(x)) T();
3055}
3056
3057/* AllocateExtensionType.proto */
3058static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final);
3059
3060/* CallSlotAsVectorcall.proto */
3061#if CYTHON_VECTORCALL_TPNEW
3062typedef PyObject * (*__Pyx_tpnewvectorcallfunc)(PyTypeObject* o, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames);
3063static PyObject * __Pyx_CallTpnewAsVectorcall(__Pyx_tpnewvectorcallfunc f, PyTypeObject* o, PyObject *a, PyObject *k);
3064#endif
3065
3066/* CallNewInitFromVectorcall.proto */
3067#if CYTHON_VECTORCALL_TPNEW
3068static PyObject *__Pyx_CallNewInitFromVectorcall(PyTypeObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3069#endif
3070
3071/* CallTypeTraverse.proto */
3072#if !CYTHON_USE_TYPE_SPECS
3073#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
3074#else
3075static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg);
3076#endif
3077
3078/* DeallocKeepAlive.proto */
3079#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
3080#define __Pyx_DeallocKeepAliveBegin(o) do {\
3081 _Py_atomic_store_uintptr_relaxed(&(o)->ob_tid, _Py_ThreadId());\
3082 _Py_atomic_store_uint32_relaxed(&(o)->ob_ref_local, 1);\
3083 _Py_atomic_store_ssize_relaxed(&(o)->ob_ref_shared, 0);\
3084 } while (0)
3085#define __Pyx_DeallocKeepAliveEnd(o)\
3086 _Py_atomic_store_uint32_relaxed(&(o)->ob_ref_local, 0)
3087#else
3088#define __Pyx_DeallocKeepAliveBegin(o) Py_SET_REFCNT(o, Py_REFCNT(o) + 1)
3089#define __Pyx_DeallocKeepAliveEnd(o) Py_SET_REFCNT(o, Py_REFCNT(o) - 1)
3090#endif
3091
3092/* CallSlotAsVectorcall.proto */
3093#if CYTHON_VECTORCALL_TPNEW
3094typedef int (*__Pyx_tpinitvectorcallfunc)(PyObject* o, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames);
3095static int __Pyx_CallTpinitAsVectorcall(__Pyx_tpinitvectorcallfunc f, PyObject* o, PyObject *a, PyObject *k);
3096#endif
3097
3098/* PyObjectCallMethod0.proto (used by PyType_Ready) */
3099static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
3100
3101/* GetTypeDictOffset.proto (used by ValidateBasesTuple) */
3102#if !CYTHON_USE_TYPE_SLOTS
3103CYTHON_UNUSED static Py_ssize_t __Pyx_GetTypeDictOffset(PyObject *tp, int require_cython_valid_result);
3104#endif
3105
3106/* ValidateBasesTuple.proto (used by PyType_Ready) */
3107#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
3108static int __Pyx_validate_bases_tuple(const char *type_name, int has_dictoffset, PyObject *bases);
3109#endif
3110
3111/* PyType_Ready.export */
3112CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);
3113
3114/* LimitedApiGetTypeTypeDict.proto (used by DelItemOnTypeDict) */
3115#if CYTHON_COMPILING_IN_LIMITED_API
3116static PyObject *__Pyx_GetTypeTypeDict(PyTypeObject *tp);
3117#endif
3118
3119/* DelItemOnTypeDict.proto (used by SetupReduce) */
3120#define __Pyx_DelItemOnTypeDict(tp, k) __Pyx__DelItemOnTypeDict((PyTypeObject*)tp, k)
3121
3122/* DelItemOnTypeDict.export */
3123static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k);
3124
3125/* SetItemOnTypeDict.proto (used by SetupReduce) */
3126#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)
3127
3128/* SetItemOnTypeDict.export */
3129static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v);
3130
3131/* SetupReduce.export */
3132static int __Pyx_setup_reduce(PyObject* type_obj);
3133
3134/* ApplySequenceOrMappingFlag.proto */
3135#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
3136int __Pyx_ApplySequenceOrMappingFlag(PyTypeObject *tp, int is_sequence);
3137#else
3138#define __Pyx_ApplySequenceOrMappingFlag(tp, is_sequence) (0)
3139#endif
3140
3141/* GetVTable.proto (used by MergeVTables) */
3142static int __Pyx_GetVtable(PyTypeObject *type, void** table);
3143
3144/* MergeVTables.proto (used by SetVTable) */
3145static int __Pyx_MergeVtables(PyTypeObject *type);
3146
3147/* SetVTable.export */
3148static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);
3149
3150/* TypeImport.proto */
3151#ifndef __PYX_HAVE_RT_ImportType_proto_3_3_0
3152#define __PYX_HAVE_RT_ImportType_proto_3_3_0
3153#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
3154#include <stdalign.h>
3155#endif
3156#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
3157#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) alignof(s)
3158#else
3159#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) sizeof(void*)
3160#endif
3161enum __Pyx_ImportType_CheckSize_3_3_0 {
3162 __Pyx_ImportType_CheckSize_Error_3_3_0 = 0,
3163 __Pyx_ImportType_CheckSize_Warn_3_3_0 = 1,
3164 __Pyx_ImportType_CheckSize_Ignore_3_3_0 = 2
3165};
3166static 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);
3167#endif
3168
3169/* dict_setdefault.proto (used by FetchCommonType) */
3170static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);
3171
3172/* AddModuleRef.proto (used by FetchSharedCythonModule) */
3173#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3) ||\
3174 __PYX_LIMITED_VERSION_HEX < 0x030d0000)
3175 static PyObject *__Pyx_PyImport_AddModuleRef(const char *name);
3176#else
3177 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
3178#endif
3179
3180/* FetchSharedCythonModule.proto (used by FetchCommonType) */
3181static PyObject *__Pyx_FetchSharedCythonABIModule(void);
3182
3183/* VerifyCachedType.proto (used by FetchCommonType) */
3184static int __Pyx_VerifyCachedType(PyObject *cached_type,
3185 const char *name,
3186 Py_ssize_t expected_basicsize);
3187
3188/* FetchCommonType.proto (used by CommonTypesMetaclass) */
3189static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);
3190
3191/* CommonTypesMetaclass.proto (used by CythonFunctionShared) */
3192static int __pyx_CommonTypesMetaclass_init(PyObject *module);
3193#define __Pyx_CommonTypesMetaclass_USED
3194
3195/* CythonFunctionPerModule.proto (used by CythonFunctionShared) */
3196#define __Pyx_CyFunction_USED
3197#if CYTHON_OPAQUE_SHARED_TYPES
3198#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)PyObject_GetTypeData((o), __pyx_mstate_global->__pyx_CyFunctionType))
3199#else
3200#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)o)
3201#endif
3202#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
3203#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
3204#define __Pyx_CYFUNCTION_CCLASS 0x04
3205#define __Pyx_CYFUNCTION_COROUTINE 0x08
3206#define __Pyx_CyFunction_GetClosure(f)\
3207 ((__Pyx_as_CyFunctionObject(f))->func_closure)
3208#if CYTHON_COMPILING_IN_LIMITED_API
3209 #define __Pyx__CyFunction_GetClassObj(f)\
3210 ((f)->func_classobj)
3211#else
3212 #define __Pyx__CyFunction_GetClassObj(f)\
3213 ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
3214#endif
3215#define __Pyx_CyFunction_GetClassObj(f)\
3216 __Pyx__CyFunction_GetClassObj(__Pyx_as_CyFunctionObject(f))
3217#define __Pyx_CyFunction_SetClassObj(f, classobj)\
3218 __Pyx__CyFunction_SetClassObj(__Pyx_as_CyFunctionObject(f), (classobj))
3219#define __Pyx_CyFunction_Defaults(type, f)\
3220 ((type *)((__Pyx_as_CyFunctionObject(f))->defaults))
3221#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
3222 (__Pyx_as_CyFunctionObject(f))->defaults_getter = (g)
3223typedef struct {
3224#if CYTHON_COMPILING_IN_LIMITED_API
3225#if !CYTHON_OPAQUE_OBJECTS
3226 PyObject_HEAD
3227#endif
3228 PyMethodDef *func_methoddef;
3229 PyObject *func_module;
3230#else
3231 PyCMethodObject func;
3232#endif
3233#if (CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY) && CYTHON_VECTORCALL
3234 __pyx_vectorcallfunc func_vectorcall;
3235#endif
3236#if CYTHON_COMPILING_IN_LIMITED_API
3237 PyObject *func_weakreflist;
3238#endif
3239#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
3240 PyObject *func_dict;
3241#endif
3242 PyObject *func_name;
3243 PyObject *func_qualname;
3244 PyObject *func_doc;
3245 PyObject *func_globals;
3246 PyObject *func_code;
3247 PyObject *func_closure;
3248#if CYTHON_COMPILING_IN_LIMITED_API
3249 PyObject *func_classobj;
3250#endif
3251 PyObject *defaults;
3252 int flags;
3253 PyObject *defaults_tuple;
3254 PyObject *defaults_kwdict;
3255 PyObject *(*defaults_getter)(PyObject *);
3256 PyObject *func_annotations;
3257#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
3258 PyObject *func_is_coroutine;
3259#endif
3260} __pyx_CyFunctionObject;
3261#undef __Pyx_CyOrPyCFunction_Check
3262#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType)
3263#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
3264#define __Pyx_CyFunction_CheckExact(obj) Py_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
3265static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void));
3266#undef __Pyx_IsSameCFunction
3267#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
3268static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
3269static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
3270 PyTypeObject *defaults_type);
3271static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
3272 PyObject *tuple);
3273static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
3274 PyObject *dict);
3275static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
3276 PyObject *dict);
3277static int __pyx_CyFunction_init(PyObject *module);
3278#if CYTHON_VECTORCALL
3279#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
3280#define __Pyx_CyFunction_func_vectorcall(f) ((f)->func_vectorcall)
3281#else
3282#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
3283#endif
3284#endif
3285
3286/* PyMethodNew.proto (used by CythonFunctionShared) */
3287static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);
3288
3289/* PyVectorcallFastCallDict.proto (used by CythonFunctionShared) */
3290#if CYTHON_VECTORCALL
3291static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
3292#endif
3293
3294/* CythonFunctionShared.proto (used by CythonFunction) */
3295static PyObject *__Pyx_CyFunction_Init(PyObject *op_in, PyMethodDef *ml,
3296 int flags, PyObject* qualname,
3297 PyObject *closure,
3298 PyObject *module, PyObject *globals,
3299 PyObject* code);
3300#if CYTHON_VECTORCALL
3301static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3302static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3303static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3304static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3305#endif
3306
3307/* CythonFunction.export */
3308static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
3309 int flags, PyObject* qualname,
3310 PyObject *closure,
3311 PyObject *module, PyObject *globals,
3312 PyObject* code);
3313static PyTypeObject *__Pyx_Get_CyFunction_Type(void);
3314
3315/* CLineInTraceback.proto (used by AddTraceback) */
3316#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
3317static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
3318#else
3319#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
3320#endif
3321
3322/* CodeObjectCache.proto (used by AddTraceback) */
3323#if CYTHON_COMPILING_IN_LIMITED_API
3324typedef PyObject __Pyx_CachedCodeObjectType;
3325#else
3326typedef PyCodeObject __Pyx_CachedCodeObjectType;
3327#endif
3328typedef struct {
3329 __Pyx_CachedCodeObjectType* code_object;
3330 int code_line;
3331} __Pyx_CodeObjectCacheEntry;
3332struct __Pyx_CodeObjectCache {
3333 int count;
3334 int max_count;
3335 __Pyx_CodeObjectCacheEntry* entries;
3336 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
3337 __pyx_atomic_int_type accessor_count;
3338 #endif
3339};
3340static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
3341static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line);
3342static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object);
3343
3344/* AddTraceback.proto */
3345static void __Pyx_AddTraceback(const char *funcname, int c_line,
3346 int py_line, const char *filename);
3347
3348/* MemviewDtypeToObject.proto */
3349static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp);
3350static CYTHON_INLINE int __pyx_memview_set_double(char *itemp, PyObject *obj);
3351
3352/* RealImag.proto */
3353#if CYTHON_CCOMPLEX
3354 #ifdef __cplusplus
3355 #define __Pyx_CREAL(z) ((z).real())
3356 #define __Pyx_CIMAG(z) ((z).imag())
3357 #else
3358 #define __Pyx_CREAL(z) (__real__(z))
3359 #define __Pyx_CIMAG(z) (__imag__(z))
3360 #endif
3361#else
3362 #define __Pyx_CREAL(z) ((z).real)
3363 #define __Pyx_CIMAG(z) ((z).imag)
3364#endif
3365#if defined(__cplusplus) && CYTHON_CCOMPLEX\
3366 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
3367 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
3368 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
3369#else
3370 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
3371 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
3372#endif
3373
3374/* Arithmetic.proto */
3375#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3376 #define __Pyx_c_eq_float(a, b) ((a)==(b))
3377 #define __Pyx_c_sum_float(a, b) ((a)+(b))
3378 #define __Pyx_c_diff_float(a, b) ((a)-(b))
3379 #define __Pyx_c_prod_float(a, b) ((a)*(b))
3380 #define __Pyx_c_quot_float(a, b) ((a)/(b))
3381 #define __Pyx_c_neg_float(a) (-(a))
3382 #ifdef __cplusplus
3383 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
3384 #define __Pyx_c_conj_float(z) (::std::conj(z))
3385 #if 1
3386 #define __Pyx_c_abs_float(z) (::std::abs(z))
3387 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
3388 #endif
3389 #else
3390 #define __Pyx_c_is_zero_float(z) ((z)==0)
3391 #define __Pyx_c_conj_float(z) (conjf(z))
3392 #if 1
3393 #define __Pyx_c_abs_float(z) (cabsf(z))
3394 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
3395 #endif
3396 #endif
3397#else
3398 static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
3399 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
3400 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
3401 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
3402 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
3403 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
3404 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
3405 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
3406 #if 1
3407 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
3408 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
3409 #endif
3410#endif
3411
3412/* Arithmetic.proto */
3413#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3414 #define __Pyx_c_eq_double(a, b) ((a)==(b))
3415 #define __Pyx_c_sum_double(a, b) ((a)+(b))
3416 #define __Pyx_c_diff_double(a, b) ((a)-(b))
3417 #define __Pyx_c_prod_double(a, b) ((a)*(b))
3418 #define __Pyx_c_quot_double(a, b) ((a)/(b))
3419 #define __Pyx_c_neg_double(a) (-(a))
3420 #ifdef __cplusplus
3421 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
3422 #define __Pyx_c_conj_double(z) (::std::conj(z))
3423 #if 1
3424 #define __Pyx_c_abs_double(z) (::std::abs(z))
3425 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
3426 #endif
3427 #else
3428 #define __Pyx_c_is_zero_double(z) ((z)==0)
3429 #define __Pyx_c_conj_double(z) (conj(z))
3430 #if 1
3431 #define __Pyx_c_abs_double(z) (cabs(z))
3432 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
3433 #endif
3434 #endif
3435#else
3436 static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
3437 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
3438 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
3439 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
3440 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
3441 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
3442 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
3443 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
3444 #if 1
3445 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
3446 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
3447 #endif
3448#endif
3449
3450/* Arithmetic.proto */
3451#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3452 #define __Pyx_c_eq_long__double(a, b) ((a)==(b))
3453 #define __Pyx_c_sum_long__double(a, b) ((a)+(b))
3454 #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
3455 #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
3456 #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
3457 #define __Pyx_c_neg_long__double(a) (-(a))
3458 #ifdef __cplusplus
3459 #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
3460 #define __Pyx_c_conj_long__double(z) (::std::conj(z))
3461 #if 1
3462 #define __Pyx_c_abs_long__double(z) (::std::abs(z))
3463 #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
3464 #endif
3465 #else
3466 #define __Pyx_c_is_zero_long__double(z) ((z)==0)
3467 #define __Pyx_c_conj_long__double(z) (conjl(z))
3468 #if 1
3469 #define __Pyx_c_abs_long__double(z) (cabsl(z))
3470 #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
3471 #endif
3472 #endif
3473#else
3474 static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3475 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3476 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3477 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3478 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3479 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
3480 static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
3481 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
3482 #if 1
3483 static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
3484 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3485 #endif
3486#endif
3487
3488/* BufferStructDeclare.proto */
3489typedef struct {
3490 Py_ssize_t shape, strides, suboffsets;
3491} __Pyx_Buf_DimInfo;
3492typedef struct {
3493 size_t refcount;
3494 Py_buffer pybuffer;
3495} __Pyx_Buffer;
3496typedef struct {
3497 __Pyx_Buffer *rcbuffer;
3498 char *data;
3499 __Pyx_Buf_DimInfo diminfo[8];
3500} __Pyx_LocalBuf_ND;
3501
3502/* MemviewRefcount.proto */
3503static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
3504 __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3505static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
3506 __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3507#define __pyx_get_slice_count_pointer(memview) (&memview->acquisition_count)
3508#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
3509#define __PYX_XCLEAR_MEMVIEW(slice, have_gil) __Pyx_XCLEAR_MEMVIEW(slice, have_gil, __LINE__)
3510static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
3511static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *, int, int);
3512
3513/* MemviewSliceIsContig.proto */
3514static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
3515
3516/* OverlappingSlices.proto */
3517static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
3518 __Pyx_memviewslice *slice2,
3519 int ndim, size_t itemsize);
3520
3521/* MemviewSliceInit.proto */
3522static int __Pyx_init_memviewslice(
3523 struct __pyx_memoryview_obj *memview,
3524 int ndim,
3525 __Pyx_memviewslice *memviewslice,
3526 int memview_is_new_reference);
3527
3528/* SliceMemoryviewSlice.proto */
3529static CYTHON_INLINE int __pyx_memoryview_slice_memviewslice(
3530 __Pyx_memviewslice *dst,
3531 Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
3532 int dim, int new_ndim, int *suboffset_dim,
3533 Py_ssize_t start, Py_ssize_t stop, Py_ssize_t step,
3534 int have_start, int have_stop, int have_step,
3535 int is_slice);
3536
3537/* CIntFromPy.proto */
3538static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *);
3539
3540/* PyObjectVectorcallKwds.proto (used by PyObjectVectorcallMethodKwds) */
3541#if CYTHON_VECTORCALL
3542#define __Pyx_Object_VectorcallKwds PyObject_Vectorcall
3543CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i);
3544#else
3545#define __Pyx_Object_VectorcallKwds __Pyx_PyObject_FastCallDict
3546CYTHON_UNUSED static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t n);
3547CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i);
3548#endif
3549
3550/* PyObjectVectorcallMethodKwds.proto (used by CIntToPy) */
3551#if CYTHON_VECTORCALL
3552#define __Pyx_Object_VectorcallMethodKwds PyObject_VectorcallMethod
3553#else
3554static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3555#endif
3556
3557/* CIntToPy.proto */
3558static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value);
3559
3560/* CIntToPy.proto */
3561static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value);
3562
3563/* TypeInfoToFormat.proto */
3564struct __pyx_typeinfo_string {
3565 char string[3];
3566};
3567static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(const __Pyx_TypeInfo *type);
3568
3569/* MemviewSliceCopy.proto */
3570static __Pyx_memviewslice
3571__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
3572 const char *mode, int ndim,
3573 Py_ssize_t sizeof_dtype, int contig_flag,
3574 int dtype_is_object);
3575
3576/* UpdateUnpickledDict.export */
3577static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index);
3578
3579/* CheckUnpickleChecksumError.export */
3580static void __Pyx_RaiseUnpickleChecksumError(long checksum, long checksum1, long checksum2, long checksum3, const char *members);
3581
3582/* CheckUnpickleChecksum.proto */
3583static CYTHON_INLINE int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members);
3584
3585/* CIntFromPy.proto */
3586static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *);
3587
3588/* CIntFromPy.proto */
3589static CYTHON_INLINE char __Pyx_PyLong_As_char(PyObject *);
3590
3591/* GetRuntimeVersion.proto */
3592#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
3593static unsigned long __Pyx_cached_runtime_version = 0;
3594static void __Pyx_init_runtime_version(void);
3595#else
3596#define __Pyx_init_runtime_version()
3597#endif
3598static unsigned long __Pyx_get_runtime_version(void);
3599
3600/* CheckBinaryVersion.proto */
3601static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
3602
3603/* DecompressString.proto */
3604static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo);
3605
3606/* DecompressString_LZSS.proto */
3607static PyObject *__Pyx_DecompressString_LZSS(const char *s, size_t compressed_length, size_t uncompressed_length);
3608
3609/* MultiPhaseInitModuleState.proto */
3610#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
3611#include <stdlib.h>
3612static PyObject *__Pyx_State_FindModule(void*);
3613static int __Pyx_State_AddModule(PyObject* module, void*);
3614static int __Pyx_State_RemoveModule(void*);
3615#elif CYTHON_USE_MODULE_STATE
3616#define __Pyx_State_FindModule PyState_FindModule
3617#define __Pyx_State_AddModule PyState_AddModule
3618#define __Pyx_State_RemoveModule PyState_RemoveModule
3619#endif
3620
3621/* #### Code section: module_declarations ### */
3622/* CythonABIVersion.proto */
3623#if CYTHON_COMPILING_IN_LIMITED_API
3624 #if CYTHON_VECTORCALL
3625 #define __PYX_VECTORCALL_ABI_SUFFIX "_vectorcall"
3626 #else
3627 #define __PYX_VECTORCALL_ABI_SUFFIX
3628 #endif
3629 #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_VECTORCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
3630#else
3631 #define __PYX_LIMITED_ABI_SUFFIX
3632#endif
3633#if __PYX_HAS_PY_AM_SEND == 1
3634 #define __PYX_AM_SEND_ABI_SUFFIX
3635#elif __PYX_HAS_PY_AM_SEND == 2
3636 #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
3637#else
3638 #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
3639#endif
3640#ifndef __PYX_MONITORING_ABI_SUFFIX
3641 #define __PYX_MONITORING_ABI_SUFFIX
3642#endif
3643#if CYTHON_USE_TP_FINALIZE
3644 #define __PYX_TP_FINALIZE_ABI_SUFFIX
3645#else
3646 #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
3647#endif
3648#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
3649 #define __PYX_FREELISTS_ABI_SUFFIX
3650#else
3651 #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
3652#endif
3653#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
3654 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX "opaque"
3655#else
3656 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
3657#endif
3658#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
3659#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
3660#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
3661
3662static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
3663static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
3664static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
3665static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
3666static 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*/
3667static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_value); /* proto*/
3668static PyObject *__pyx_memoryview_setitem_indexed1(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
3669static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3670static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3671static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self); /* proto*/
3672static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3673static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3674static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto*/
3675static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3676static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3677static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3678static CYTHON_INLINE char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3679static CYTHON_INLINE int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3680static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3681static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3682static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3683static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3684static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3685static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3686static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3687static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3688static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3689static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3690static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3691static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3692static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self); /* proto*/
3693static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self); /* proto*/
3694static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self); /* proto*/
3695static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self); /* proto*/
3696static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self); /* proto*/
3697static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self); /* proto*/
3698static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self); /* proto*/
3699static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3700static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3701static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3702static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3703static CYTHON_INLINE void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3704static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3705static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3706static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3707static CYTHON_INLINE void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3708static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3709static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3710
3711/* Module declarations from "libcpp" */
3712
3713/* Module declarations from "libc.string" */
3714
3715/* Module declarations from "libc.stdio" */
3716
3717/* Module declarations from "__builtin__" */
3718
3719/* Module declarations from "cpython.type" */
3720
3721/* Module declarations from "cpython" */
3722
3723/* Module declarations from "cpython.object" */
3724
3725/* Module declarations from "cpython.ref" */
3726
3727/* Module declarations from "numpy" */
3728
3729/* Module declarations from "numpy" */
3730
3731/* Module declarations from "equivalent_polynomials" */
3732static PyObject *__pyx_collections_abc_Sequence = 0;
3733static PyObject *generic = 0;
3734static PyObject *strided = 0;
3735static PyObject *indirect = 0;
3736static PyObject *contiguous = 0;
3737static PyObject *indirect_contiguous = 0;
3738static int __pyx_memoryview_thread_locks_used;
3739static PyThread_type_lock __pyx_memoryview_thread_locks[8];
3740static int __pyx_array_allocate_buffer(struct __pyx_array_obj *); /*proto*/
3741static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char const *, char *); /*proto*/
3742static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo const *); /*proto*/
3743static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
3744static int __pyx_memoryview_err_invalid_index(PyObject *); /*proto*/
3745static PyObject *_unellipsify_index_tuple(PyObject *, int); /*proto*/
3746static PyObject *_unellipsify(PyObject *, int); /*proto*/
3747static int assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
3748static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
3749static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
3750static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
3751static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), __pyx_memoryview_to_dtype_func_type, int); /*proto*/
3752static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3753static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3754static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
3755static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3756static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
3757static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
3758static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
3759static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
3760static size_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
3761static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
3762static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
3763static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
3764static int __pyx_memoryview_err_dim(PyObject *, char const *, int); /*proto*/
3765static int __pyx_memoryview_err(PyObject *, char const *); /*proto*/
3766static int __pyx_memoryview_err_no_memory(void); /*proto*/
3767static int __pyx_memoryview_err_ValueError(char const *); /*proto*/
3768static int __pyx_memoryview_err_IndexError(char const *, Py_ssize_t); /*proto*/
3769static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
3770static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
3771static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
3772static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3773static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3774static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
3775static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
3776static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
3777static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo const *); /*proto*/
3778/* #### Code section: typeinfo ### */
3779static const __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
3780/* #### Code section: before_global_var ### */
3781#define __Pyx_MODULE_NAME "equivalent_polynomials"
3782extern int __pyx_module_is_main_equivalent_polynomials;
3783int __pyx_module_is_main_equivalent_polynomials = 0;
3784
3785/* Implementation of "equivalent_polynomials" */
3786/* #### Code section: global_var ### */
3787static PyObject *__pyx_builtin___import__;
3788static PyObject *__pyx_builtin_enumerate;
3789static PyObject *__pyx_builtin_Ellipsis;
3790static PyObject *__pyx_builtin_id;
3791/* #### Code section: string_decls ### */
3792static const char __pyx_k_c[] = "c";
3793static const char __pyx_k_name[] = "name";
3794static const char __pyx_k_fortran[] = "fortran";
3795static const char __pyx_k_Dimension_d_is_not_direct[] = "Dimension %d is not direct";
3796static const char __pyx_k_Cannot_index_with_type_200U[] = "Cannot index with type \047%.200U\047";
3797static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
3798static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
3799static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
3800static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
3801static const char __pyx_k_Cannot_transpose_memoryview_with[] = "Cannot transpose memoryview with indirect dimensions";
3802static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
3803static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
3804static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %zd)";
3805static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
3806static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %zd and %zd)";
3807/* #### Code section: decls ### */
3808static 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 */
3809static 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 */
3810static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3811static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3812static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3813static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
3814static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
3815static 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 */
3816static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
3817static 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 */
3818static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
3819static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3820static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3821static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3822static 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 */
3823static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3824static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
3825static 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 */
3826static 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 */
3827static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3828static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3829static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3830static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3831static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3832static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3833static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3834static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3835static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3836static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3837static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3838static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3839static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3840static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3841static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3842static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3843static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3844static 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 */
3845static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3846static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3847static 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 */
3848static 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 */
3849static int __pyx_pf_22equivalent_polynomials_7Simplex___cinit__(struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self, PyObject *__pyx_v_nSpace, PyObject *__pyx_v_nP, PyObject *__pyx_v_nQ); /* proto */
3850static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_2calculate(struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self, PyArrayObject *__pyx_v_phi_dof, PyArrayObject *__pyx_v_phi_nodes, PyArrayObject *__pyx_v_xi); /* proto */
3851static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_4set_quad(struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self, int __pyx_v_q); /* proto */
3852static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_1H___get__(struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self); /* proto */
3853static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_3ImH___get__(struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self); /* proto */
3854static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_1D___get__(struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self); /* proto */
3855static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self); /* proto */
3856static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3857static PyObject *__pyx_pf_22equivalent_polynomials_calc_edge_H(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_phi0, double __pyx_v_phi1, int __pyx_v_nP); /* proto */
3858static PyObject *__pyx_pf_22equivalent_polynomials_2eval_edge_poly(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_C, double __pyx_v_t, int __pyx_v_nP); /* proto */
3859static PyObject *__pyx_tp_new__initialisation_22equivalent_polynomials_Simplex(PyObject *o,
3860#if CYTHON_VECTORCALL_TPNEW
3861 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
3862#else
3863 PyObject *a, PyObject *k
3864#endif
3865); /*proto*/
3866static PyObject *__pyx_tp_new_vectorcall_22equivalent_polynomials_Simplex(PyTypeObject *t,
3867#if CYTHON_VECTORCALL_TPNEW
3868 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
3869#else
3870 PyObject *a, PyObject *k
3871#endif
3872); /*proto*/
3873#if CYTHON_VECTORCALL_TPNEW
3874static PyObject *__pyx_tp_new_22equivalent_polynomials_Simplex(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3875#endif
3876#if !CYTHON_VECTORCALL_TPNEW
3877#define __pyx_tp_new_22equivalent_polynomials_Simplex __pyx_tp_new_vectorcall_22equivalent_polynomials_Simplex
3878#endif
3879#if CYTHON_VECTORCALL_TPNEW
3880static PyObject *__pyx_tp_vectorcall_22equivalent_polynomials_Simplex(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
3881#endif
3882static PyObject *__pyx_tp_new__initialisation_array(PyObject *o,
3883#if CYTHON_VECTORCALL_TPNEW
3884 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
3885#else
3886 PyObject *a, PyObject *k
3887#endif
3888); /*proto*/
3889static PyObject *__pyx_tp_new_vectorcall_array(PyTypeObject *t,
3890#if CYTHON_VECTORCALL_TPNEW
3891 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
3892#else
3893 PyObject *a, PyObject *k
3894#endif
3895); /*proto*/
3896#if CYTHON_VECTORCALL_TPNEW
3897static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3898#endif
3899#if !CYTHON_VECTORCALL_TPNEW
3900#define __pyx_tp_new_array __pyx_tp_new_vectorcall_array
3901#endif
3902#if CYTHON_VECTORCALL_TPNEW
3903static PyObject *__pyx_tp_vectorcall_array(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
3904#endif
3905static PyObject *__pyx_tp_new__initialisation_Enum(PyObject *o,
3906#if CYTHON_VECTORCALL_TPNEW
3907 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
3908#else
3909 PyObject *a, PyObject *k
3910#endif
3911); /*proto*/
3912static PyObject *__pyx_tp_new_vectorcall_Enum(PyTypeObject *t,
3913#if CYTHON_VECTORCALL_TPNEW
3914 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
3915#else
3916 PyObject *a, PyObject *k
3917#endif
3918); /*proto*/
3919#if CYTHON_VECTORCALL_TPNEW
3920static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3921#endif
3922#if !CYTHON_VECTORCALL_TPNEW
3923#define __pyx_tp_new_Enum __pyx_tp_new_vectorcall_Enum
3924#endif
3925#if CYTHON_VECTORCALL_TPNEW
3926static PyObject *__pyx_tp_vectorcall_Enum(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
3927#endif
3928#if CYTHON_VECTORCALL_TPNEW
3929static int __pyx_tp_init_Enum(PyObject *o, PyObject *args, PyObject *kwds); /*proto*/
3930#endif
3931#if !CYTHON_VECTORCALL_TPNEW
3932#define __pyx_tp_init_Enum __pyx_MemviewEnum___init__
3933#endif
3934static PyObject *__pyx_tp_new__initialisation_memoryview(PyObject *o,
3935#if CYTHON_VECTORCALL_TPNEW
3936 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
3937#else
3938 PyObject *a, PyObject *k
3939#endif
3940); /*proto*/
3941static PyObject *__pyx_tp_new_vectorcall_memoryview(PyTypeObject *t,
3942#if CYTHON_VECTORCALL_TPNEW
3943 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
3944#else
3945 PyObject *a, PyObject *k
3946#endif
3947); /*proto*/
3948#if CYTHON_VECTORCALL_TPNEW
3949static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3950#endif
3951#if !CYTHON_VECTORCALL_TPNEW
3952#define __pyx_tp_new_memoryview __pyx_tp_new_vectorcall_memoryview
3953#endif
3954#if CYTHON_VECTORCALL_TPNEW
3955static PyObject *__pyx_tp_vectorcall_memoryview(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
3956#endif
3957static PyObject *__pyx_tp_new__initialisation__memoryviewslice(PyObject *o,
3958#if CYTHON_VECTORCALL_TPNEW
3959 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
3960#else
3961 PyObject *a, PyObject *k
3962#endif
3963); /*proto*/
3964static PyObject *__pyx_tp_new_vectorcall__memoryviewslice(PyTypeObject *t,
3965#if CYTHON_VECTORCALL_TPNEW
3966 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
3967#else
3968 PyObject *a, PyObject *k
3969#endif
3970); /*proto*/
3971#if CYTHON_VECTORCALL_TPNEW
3972static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3973#endif
3974#if !CYTHON_VECTORCALL_TPNEW
3975#define __pyx_tp_new__memoryviewslice __pyx_tp_new_vectorcall__memoryviewslice
3976#endif
3977#if CYTHON_VECTORCALL_TPNEW
3978static PyObject *__pyx_tp_vectorcall__memoryviewslice(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
3979#endif
3980/* #### Code section: late_includes ### */
3981/* #### Code section: module_state ### */
3982/* SmallCodeConfig */
3983#ifndef CYTHON_SMALL_CODE
3984#if defined(__clang__)
3985 #define CYTHON_SMALL_CODE
3986#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
3987 #define CYTHON_SMALL_CODE __attribute__((cold))
3988#else
3989 #define CYTHON_SMALL_CODE
3990#endif
3991#endif
3992
3993#ifdef __cplusplus
3994namespace {
3995 #endif
3996 typedef struct {
3997 PyObject *__pyx_d;
3998 PyObject *__pyx_b;
3999 PyObject *__pyx_cython_runtime;
4000 PyObject *__pyx_empty_tuple;
4001 PyObject *__pyx_empty_bytes;
4002 PyObject *__pyx_empty_unicode;
4003 PyTypeObject *__pyx_ptype_7cpython_4type_type;
4004 PyTypeObject *__pyx_ptype_5numpy_dtype;
4005 PyTypeObject *__pyx_ptype_5numpy_flatiter;
4006 PyTypeObject *__pyx_ptype_5numpy_broadcast;
4007 PyTypeObject *__pyx_ptype_5numpy_ndarray;
4008 PyTypeObject *__pyx_ptype_5numpy_generic;
4009 PyTypeObject *__pyx_ptype_5numpy_number;
4010 PyTypeObject *__pyx_ptype_5numpy_integer;
4011 PyTypeObject *__pyx_ptype_5numpy_signedinteger;
4012 PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
4013 PyTypeObject *__pyx_ptype_5numpy_inexact;
4014 PyTypeObject *__pyx_ptype_5numpy_floating;
4015 PyTypeObject *__pyx_ptype_5numpy_complexfloating;
4016 PyTypeObject *__pyx_ptype_5numpy_flexible;
4017 PyTypeObject *__pyx_ptype_5numpy_character;
4018 PyTypeObject *__pyx_ptype_5numpy_ufunc;
4019 PyObject *__pyx_type_22equivalent_polynomials_Simplex;
4020 PyObject *__pyx_type___pyx_array;
4021 PyObject *__pyx_type___pyx_MemviewEnum;
4022 PyObject *__pyx_type___pyx_memoryview;
4023 PyObject *__pyx_type___pyx_memoryviewslice;
4024 PyTypeObject *__pyx_ptype_22equivalent_polynomials_Simplex;
4025 PyTypeObject *__pyx_array_type;
4026 PyTypeObject *__pyx_MemviewEnum_type;
4027 PyTypeObject *__pyx_memoryview_type;
4028 PyTypeObject *__pyx_memoryviewslice_type;
4029 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
4030 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
4031 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
4032 PyObject *__pyx_slice[1];
4033 PyObject *__pyx_tuple[13];
4034 PyObject *__pyx_codeobj_tab[6];
4035 PyObject *__pyx_string_tab[141];
4036 PyObject *__pyx_number_tab[9];
4037/* #### Code section: module_state_contents ### */
4038/* PyFrozenDict.module_state_decls */
4039#if CYTHON_COMPILING_IN_LIMITED_API
4040PyObject *__Pyx_PyFrozenDictType;
4041#endif
4042
4043/* CommonTypesMetaclass.module_state_decls */
4044PyTypeObject *__pyx_CommonTypesMetaclassType;
4045
4046/* CachedMethodType.module_state_decls */
4047#if CYTHON_COMPILING_IN_LIMITED_API
4048PyObject *__Pyx_CachedMethodType;
4049#endif
4050
4051/* CythonFunctionPerModule.module_state_decls */
4052PyTypeObject *__pyx_CyFunctionType;
4053
4054/* CodeObjectCache.module_state_decls */
4055struct __Pyx_CodeObjectCache __pyx_code_cache;
4056
4057/* #### Code section: module_state_end ### */
4058} __pyx_mstatetype;
4059#ifdef __cplusplus
4060} /* anonymous namespace */
4061#endif
4062
4063#if CYTHON_USE_MODULE_STATE
4064#ifdef __cplusplus
4065namespace {
4066extern struct PyModuleDef __pyx_moduledef;
4067} /* anonymous namespace */
4068#else
4069static struct PyModuleDef __pyx_moduledef;
4070#endif
4071
4072#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))
4073
4074#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
4075#else
4076static __pyx_mstatetype __pyx_mstate_global_static =
4077#ifdef __cplusplus
4078 {};
4079#else
4080 {0};
4081#endif
4082static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
4083#endif
4084/* #### Code section: constant_name_defines ### */
4085#define __pyx_kp_u_at_0x __pyx_string_tab[0]
4086#define __pyx_kp_u_object __pyx_string_tab[1]
4087#define __pyx_kp_u__9 __pyx_string_tab[2]
4088#define __pyx_kp_u_tree_fragment __pyx_string_tab[3]
4089#define __pyx_kp_u__11 __pyx_string_tab[4]
4090#define __pyx_kp_u__10 __pyx_string_tab[5]
4091#define __pyx_kp_u__3 __pyx_string_tab[6]
4092#define __pyx_kp_u__2 __pyx_string_tab[7]
4093#define __pyx_kp_u_MemoryView_of __pyx_string_tab[8]
4094#define __pyx_kp_u_contiguous_and_direct __pyx_string_tab[9]
4095#define __pyx_kp_u_contiguous_and_indirect __pyx_string_tab[10]
4096#define __pyx_kp_u_strided_and_direct_or_indirect __pyx_string_tab[11]
4097#define __pyx_kp_u_strided_and_direct __pyx_string_tab[12]
4098#define __pyx_kp_u_strided_and_indirect __pyx_string_tab[13]
4099#define __pyx_kp_u__4 __pyx_string_tab[14]
4100#define __pyx_kp_u_ __pyx_string_tab[15]
4101#define __pyx_kp_u_Cannot_assign_to_read_only_memor __pyx_string_tab[16]
4102#define __pyx_kp_u_Invalid_mode_expected_c_or_fortr __pyx_string_tab[17]
4103#define __pyx_kp_u_Invalid_shape_in_axis __pyx_string_tab[18]
4104#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[19]
4105#define __pyx_kp_u_add_note __pyx_string_tab[20]
4106#define __pyx_kp_u_collections_abc __pyx_string_tab[21]
4107#define __pyx_kp_u_disable __pyx_string_tab[22]
4108#define __pyx_kp_u_enable __pyx_string_tab[23]
4109#define __pyx_kp_u_gc __pyx_string_tab[24]
4110#define __pyx_kp_u_isenabled __pyx_string_tab[25]
4111#define __pyx_kp_u_nP_must_be_1_2_3_or_4 __pyx_string_tab[26]
4112#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[27]
4113#define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_string_tab[28]
4114#define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_string_tab[29]
4115#define __pyx_kp_u_proteus_equivalent_polynomials_p __pyx_string_tab[30]
4116#define __pyx_kp_u_unable_to_allocate_array_data __pyx_string_tab[31]
4117#define __pyx_kp_u_unable_to_allocate_shape_and_str __pyx_string_tab[32]
4118#define __pyx_n_u_ASCII __pyx_string_tab[33]
4119#define __pyx_n_u_C __pyx_string_tab[34]
4120#define __pyx_n_u_C_H __pyx_string_tab[35]
4121#define __pyx_n_u_Ellipsis __pyx_string_tab[36]
4122#define __pyx_n_u_Sequence __pyx_string_tab[37]
4123#define __pyx_n_u_Simplex __pyx_string_tab[38]
4124#define __pyx_n_u_Simplex___reduce_cython __pyx_string_tab[39]
4125#define __pyx_n_u_Simplex___setstate_cython __pyx_string_tab[40]
4126#define __pyx_n_u_Simplex_calculate __pyx_string_tab[41]
4127#define __pyx_n_u_Simplex_set_quad __pyx_string_tab[42]
4128#define __pyx_n_u_View_MemoryView __pyx_string_tab[43]
4129#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[44]
4130#define __pyx_n_u_annotate __pyx_string_tab[45]
4131#define __pyx_n_u_class __pyx_string_tab[46]
4132#define __pyx_n_u_class_getitem __pyx_string_tab[47]
4133#define __pyx_n_u_dict __pyx_string_tab[48]
4134#define __pyx_n_u_func __pyx_string_tab[49]
4135#define __pyx_n_u_getstate __pyx_string_tab[50]
4136#define __pyx_n_u_import __pyx_string_tab[51]
4137#define __pyx_n_u_main __pyx_string_tab[52]
4138#define __pyx_n_u_module __pyx_string_tab[53]
4139#define __pyx_n_u_name_2 __pyx_string_tab[54]
4140#define __pyx_n_u_new __pyx_string_tab[55]
4141#define __pyx_n_u_pyx_checksum __pyx_string_tab[56]
4142#define __pyx_n_u_pyx_state __pyx_string_tab[57]
4143#define __pyx_n_u_pyx_type __pyx_string_tab[58]
4144#define __pyx_n_u_pyx_unpickle_Enum __pyx_string_tab[59]
4145#define __pyx_n_u_pyx_vtable __pyx_string_tab[60]
4146#define __pyx_n_u_qualname __pyx_string_tab[61]
4147#define __pyx_n_u_reduce __pyx_string_tab[62]
4148#define __pyx_n_u_reduce_cython __pyx_string_tab[63]
4149#define __pyx_n_u_reduce_ex __pyx_string_tab[64]
4150#define __pyx_n_u_set_name __pyx_string_tab[65]
4151#define __pyx_n_u_setstate __pyx_string_tab[66]
4152#define __pyx_n_u_setstate_cython __pyx_string_tab[67]
4153#define __pyx_n_u_test __pyx_string_tab[68]
4154#define __pyx_n_u_is_coroutine __pyx_string_tab[69]
4155#define __pyx_n_u_abc __pyx_string_tab[70]
4156#define __pyx_n_u_allocate_buffer __pyx_string_tab[71]
4157#define __pyx_n_u_asarray __pyx_string_tab[72]
4158#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[73]
4159#define __pyx_n_u_base __pyx_string_tab[74]
4160#define __pyx_n_u_c __pyx_string_tab[75]
4161#define __pyx_n_u_calc_edge_H __pyx_string_tab[76]
4162#define __pyx_n_u_calculate __pyx_string_tab[77]
4163#define __pyx_n_u_cline_in_traceback __pyx_string_tab[78]
4164#define __pyx_n_u_count __pyx_string_tab[79]
4165#define __pyx_n_u_d __pyx_string_tab[80]
4166#define __pyx_n_u_dtype_is_object __pyx_string_tab[81]
4167#define __pyx_n_u_encode __pyx_string_tab[82]
4168#define __pyx_n_u_enumerate __pyx_string_tab[83]
4169#define __pyx_n_u_equivalent_polynomials __pyx_string_tab[84]
4170#define __pyx_n_u_error __pyx_string_tab[85]
4171#define __pyx_n_u_eval_edge_poly __pyx_string_tab[86]
4172#define __pyx_n_u_flags __pyx_string_tab[87]
4173#define __pyx_n_u_format __pyx_string_tab[88]
4174#define __pyx_n_u_fortran __pyx_string_tab[89]
4175#define __pyx_n_u_icase __pyx_string_tab[90]
4176#define __pyx_n_u_id __pyx_string_tab[91]
4177#define __pyx_n_u_index __pyx_string_tab[92]
4178#define __pyx_n_u_items __pyx_string_tab[93]
4179#define __pyx_n_u_itemsize __pyx_string_tab[94]
4180#define __pyx_n_u_join __pyx_string_tab[95]
4181#define __pyx_n_u_memview __pyx_string_tab[96]
4182#define __pyx_n_u_mode __pyx_string_tab[97]
4183#define __pyx_n_u_nP __pyx_string_tab[98]
4184#define __pyx_n_u_nQ __pyx_string_tab[99]
4185#define __pyx_n_u_nSpace __pyx_string_tab[100]
4186#define __pyx_n_u_name __pyx_string_tab[101]
4187#define __pyx_n_u_ndim __pyx_string_tab[102]
4188#define __pyx_n_u_np __pyx_string_tab[103]
4189#define __pyx_n_u_numpy __pyx_string_tab[104]
4190#define __pyx_n_u_obj __pyx_string_tab[105]
4191#define __pyx_n_u_pack __pyx_string_tab[106]
4192#define __pyx_n_u_phi0 __pyx_string_tab[107]
4193#define __pyx_n_u_phi1 __pyx_string_tab[108]
4194#define __pyx_n_u_phi_dof __pyx_string_tab[109]
4195#define __pyx_n_u_phi_nodes __pyx_string_tab[110]
4196#define __pyx_n_u_pop __pyx_string_tab[111]
4197#define __pyx_n_u_q __pyx_string_tab[112]
4198#define __pyx_n_u_register __pyx_string_tab[113]
4199#define __pyx_n_u_self __pyx_string_tab[114]
4200#define __pyx_n_u_set_quad __pyx_string_tab[115]
4201#define __pyx_n_u_setdefault __pyx_string_tab[116]
4202#define __pyx_n_u_shape __pyx_string_tab[117]
4203#define __pyx_n_u_size __pyx_string_tab[118]
4204#define __pyx_n_u_start __pyx_string_tab[119]
4205#define __pyx_n_u_step __pyx_string_tab[120]
4206#define __pyx_n_u_stop __pyx_string_tab[121]
4207#define __pyx_n_u_struct __pyx_string_tab[122]
4208#define __pyx_n_u_t __pyx_string_tab[123]
4209#define __pyx_n_u_unpack __pyx_string_tab[124]
4210#define __pyx_n_u_update __pyx_string_tab[125]
4211#define __pyx_n_u_values __pyx_string_tab[126]
4212#define __pyx_n_u_x __pyx_string_tab[127]
4213#define __pyx_n_u_xi __pyx_string_tab[128]
4214#define __pyx_n_u_zeros __pyx_string_tab[129]
4215#define __pyx_kp_b__6 __pyx_string_tab[130]
4216#define __pyx_kp_b__7 __pyx_string_tab[131]
4217#define __pyx_n_b_O __pyx_string_tab[132]
4218#define __pyx_kp_b_T __pyx_string_tab[133]
4219#define __pyx_kp_b__5 __pyx_string_tab[134]
4220#define __pyx_kp_b__8 __pyx_string_tab[135]
4221#define __pyx_kp_b_iso88591_s_U_vQiq_q_Cs_vQiq_q_Cs_vQiq_q __pyx_string_tab[136]
4222#define __pyx_kp_b_iso88591_Q __pyx_string_tab[137]
4223#define __pyx_kp_b_iso88591_F_2Qa_s_X_fAV6_Q_Cv_fAV6_Q_Cv_f __pyx_string_tab[138]
4224#define __pyx_kp_b_iso88591_A_Cq __pyx_string_tab[139]
4225#define __pyx_kp_b_iso88591_A_IRr_q_A_D_E_Rq_D_Jaz_S_eeiirry __pyx_string_tab[140]
4226#define __pyx_float_0_0 __pyx_number_tab[0]
4227#define __pyx_float_1_0 __pyx_number_tab[1]
4228#define __pyx_int_0 __pyx_number_tab[2]
4229#define __pyx_int_neg_1 __pyx_number_tab[3]
4230#define __pyx_int_1 __pyx_number_tab[4]
4231#define __pyx_int_2 __pyx_number_tab[5]
4232#define __pyx_int_3 __pyx_number_tab[6]
4233#define __pyx_int_50 __pyx_number_tab[7]
4234#define __pyx_int_136983863 __pyx_number_tab[8]
4235/* #### Code section: module_state_clear ### */
4236#if CYTHON_USE_MODULE_STATE
4237static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
4238 __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
4239 if (!clear_module_state) return 0;
4240 Py_CLEAR(clear_module_state->__pyx_d);
4241 Py_CLEAR(clear_module_state->__pyx_b);
4242 Py_CLEAR(clear_module_state->__pyx_cython_runtime);
4243 Py_CLEAR(clear_module_state->__pyx_empty_tuple);
4244 Py_CLEAR(clear_module_state->__pyx_empty_bytes);
4245 Py_CLEAR(clear_module_state->__pyx_empty_unicode);
4246 #if CYTHON_PEP489_MULTI_PHASE_INIT
4247 __Pyx_State_RemoveModule(NULL);
4248 #endif
4249 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
4250 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
4251 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
4252 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
4253 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
4254 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
4255 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
4256 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
4257 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
4258 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
4259 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
4260 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
4261 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
4262 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
4263 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
4264 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
4265 Py_CLEAR(clear_module_state->__pyx_ptype_22equivalent_polynomials_Simplex);
4266 Py_CLEAR(clear_module_state->__pyx_type_22equivalent_polynomials_Simplex);
4267 Py_CLEAR(clear_module_state->__pyx_array_type);
4268 Py_CLEAR(clear_module_state->__pyx_type___pyx_array);
4269 Py_CLEAR(clear_module_state->__pyx_MemviewEnum_type);
4270 Py_CLEAR(clear_module_state->__pyx_type___pyx_MemviewEnum);
4271 Py_CLEAR(clear_module_state->__pyx_memoryview_type);
4272 Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryview);
4273 Py_CLEAR(clear_module_state->__pyx_memoryviewslice_type);
4274 Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryviewslice);
4275 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_items.method);
4276 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_pop.method);
4277 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_values.method);
4278 for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); }
4279 for (int i=0; i<13; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
4280 for (int i=0; i<6; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
4281 for (int i=0; i<141; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
4282 for (int i=0; i<9; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); }
4283/* #### Code section: module_state_clear_contents ### */
4284/* CommonTypesMetaclass.module_state_clear */
4285Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);
4286
4287/* CythonFunctionPerModule.module_state_clear */
4288Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
4289
4290/* #### Code section: module_state_clear_end ### */
4291return 0;
4292}
4293#endif
4294/* #### Code section: module_state_traverse ### */
4295#if CYTHON_USE_MODULE_STATE
4296static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
4297 __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
4298 if (!traverse_module_state) return 0;
4299 Py_VISIT(traverse_module_state->__pyx_d);
4300 Py_VISIT(traverse_module_state->__pyx_b);
4301 Py_VISIT(traverse_module_state->__pyx_cython_runtime);
4302 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
4303 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
4304 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
4305 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
4306 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
4307 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
4308 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
4309 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
4310 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
4311 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
4312 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
4313 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
4314 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
4315 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
4316 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
4317 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
4318 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
4319 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
4320 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
4321 Py_VISIT(traverse_module_state->__pyx_ptype_22equivalent_polynomials_Simplex);
4322 Py_VISIT(traverse_module_state->__pyx_type_22equivalent_polynomials_Simplex);
4323 Py_VISIT(traverse_module_state->__pyx_array_type);
4324 Py_VISIT(traverse_module_state->__pyx_type___pyx_array);
4325 Py_VISIT(traverse_module_state->__pyx_MemviewEnum_type);
4326 Py_VISIT(traverse_module_state->__pyx_type___pyx_MemviewEnum);
4327 Py_VISIT(traverse_module_state->__pyx_memoryview_type);
4328 Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryview);
4329 Py_VISIT(traverse_module_state->__pyx_memoryviewslice_type);
4330 Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryviewslice);
4331 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_items.method);
4332 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_pop.method);
4333 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_values.method);
4334 for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); }
4335 for (int i=0; i<13; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
4336 for (int i=0; i<6; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
4337 for (int i=0; i<141; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
4338 for (int i=0; i<9; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); }
4339/* #### Code section: module_state_traverse_contents ### */
4340/* CommonTypesMetaclass.module_state_traverse */
4341Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);
4342
4343/* CythonFunctionPerModule.module_state_traverse */
4344Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
4345
4346/* #### Code section: module_state_traverse_end ### */
4347return 0;
4348}
4349#endif
4350/* #### Code section: module_code ### */
4351
4352/* "View.MemoryView":147
4353 * cdef bint dtype_is_object
4354 *
4355 * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
4356 * mode="c", bint allocate_buffer=True):
4357 *
4358*/
4359
4360/* Python wrapper */
4361static int __pyx_array___cinit__(PyObject *__pyx_v_self,
4362#if CYTHON_VECTORCALL_TPNEW
4363PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
4364#else
4365PyObject *__pyx_args, PyObject *__pyx_kwds
4366#endif
4367); /*proto*/
4368static int __pyx_array___cinit__(PyObject *__pyx_v_self,
4369#if CYTHON_VECTORCALL_TPNEW
4370PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
4371#else
4372PyObject *__pyx_args, PyObject *__pyx_kwds
4373#endif
4374) {
4375 PyObject *__pyx_v_shape = 0;
4376 Py_ssize_t __pyx_v_itemsize;
4377 PyObject *__pyx_v_format = 0;
4378 PyObject *__pyx_v_mode = 0;
4379 int __pyx_v_allocate_buffer;
4380 #if !CYTHON_VECTORCALL_TPNEW
4381 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
4382 #endif
4383 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
4384 PyObject* values[5] = {0,0,0,0,0};
4385 int __pyx_lineno = 0;
4386 const char *__pyx_filename = NULL;
4387 int __pyx_clineno = 0;
4388 int __pyx_r;
4389 __Pyx_RefNannyDeclarations
4390 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
4391 #if !CYTHON_VECTORCALL_TPNEW
4392 #if CYTHON_ASSUME_SAFE_SIZE
4393 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
4394 #else
4395 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
4396 #endif
4397 #endif
4398 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
4399 {
4400 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};
4401 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
4402 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 147, __pyx_L3_error)
4403 if (__pyx_kwds_len > 0) {
4404 switch (__pyx_nargs) {
4405 case 5:
4406 values[4] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 4);
4407 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 147, __pyx_L3_error)
4408 CYTHON_FALLTHROUGH;
4409 case 4:
4410 values[3] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 3);
4411 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 147, __pyx_L3_error)
4412 CYTHON_FALLTHROUGH;
4413 case 3:
4414 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
4415 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 147, __pyx_L3_error)
4416 CYTHON_FALLTHROUGH;
4417 case 2:
4418 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
4419 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 147, __pyx_L3_error)
4420 CYTHON_FALLTHROUGH;
4421 case 1:
4422 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
4423 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 147, __pyx_L3_error)
4424 CYTHON_FALLTHROUGH;
4425 case 0: break;
4426 default: goto __pyx_L5_argtuple_error;
4427 }
4428 const Py_ssize_t kwd_pos_args = __pyx_nargs;
4429 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)
4430 if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_c));
4431 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
4432 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, i); __PYX_ERR(1, 147, __pyx_L3_error) }
4433 }
4434 } else {
4435 switch (__pyx_nargs) {
4436 case 5:
4437 values[4] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 4);
4438 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 147, __pyx_L3_error)
4439 CYTHON_FALLTHROUGH;
4440 case 4:
4441 values[3] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 3);
4442 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 147, __pyx_L3_error)
4443 CYTHON_FALLTHROUGH;
4444 case 3:
4445 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
4446 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 147, __pyx_L3_error)
4447 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
4448 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 147, __pyx_L3_error)
4449 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
4450 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 147, __pyx_L3_error)
4451 break;
4452 default: goto __pyx_L5_argtuple_error;
4453 }
4454 if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_c));
4455 }
4456 __pyx_v_shape = ((PyObject*)values[0]);
4457 __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)
4458 __pyx_v_format = values[2];
4459 __pyx_v_mode = values[3];
4460 if (values[4]) {
4461 __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)
4462 } else {
4463
4464 /* "View.MemoryView":148
4465 *
4466 * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
4467 * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
4468 *
4469 * cdef int idx
4470*/
4471 __pyx_v_allocate_buffer = ((int)1);
4472 }
4473 }
4474 goto __pyx_L6_skip;
4475 __pyx_L5_argtuple_error:;
4476 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, __pyx_nargs); __PYX_ERR(1, 147, __pyx_L3_error)
4477 __pyx_L6_skip:;
4478 goto __pyx_L4_argument_unpacking_done;
4479 __pyx_L3_error:;
4480 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
4481 Py_XDECREF(values[__pyx_temp]);
4482 }
4483 __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4484 __Pyx_RefNannyFinishContext();
4485 return -1;
4486 __pyx_L4_argument_unpacking_done:;
4487 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 147, __pyx_L1_error)
4488 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
4489 PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 147, __pyx_L1_error)
4490 }
4491 __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);
4492
4493 /* "View.MemoryView":147
4494 * cdef bint dtype_is_object
4495 *
4496 * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
4497 * mode="c", bint allocate_buffer=True):
4498 *
4499*/
4500
4501 /* function exit code */
4502 goto __pyx_L0;
4503 __pyx_L1_error:;
4504 __pyx_r = -1;
4505 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
4506 Py_XDECREF(values[__pyx_temp]);
4507 }
4508 goto __pyx_L7_cleaned_up;
4509 __pyx_L0:;
4510 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
4511 Py_XDECREF(values[__pyx_temp]);
4512 }
4513 __pyx_L7_cleaned_up:;
4514
4515
4516 __Pyx_RefNannyFinishContext();
4517 return __pyx_r;
4518}
4519
4520static 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) {
4521 int __pyx_v_idx;
4522 Py_ssize_t __pyx_v_dim;
4523 char __pyx_v_order;
4524 int __pyx_r;
4525 __Pyx_RefNannyDeclarations
4526 Py_ssize_t __pyx_t_1;
4527 int __pyx_t_2;
4528 int __pyx_t_3;
4529 int __pyx_t_4;
4530 PyObject *__pyx_t_5 = NULL;
4531 PyObject *__pyx_t_6 = NULL;
4532 size_t __pyx_t_7;
4533 char *__pyx_t_8;
4534 Py_ssize_t __pyx_t_9;
4535 PyObject *__pyx_t_10 = NULL;
4536 PyObject *__pyx_t_11[5];
4537 int __pyx_t_12;
4538 PyObject *__pyx_t_13 = NULL;
4539 int __pyx_lineno = 0;
4540 const char *__pyx_filename = NULL;
4541 int __pyx_clineno = 0;
4542 __Pyx_RefNannySetupContext("__cinit__", 0);
4543 __Pyx_INCREF(__pyx_v_format);
4544
4545 /* "View.MemoryView":153
4546 * cdef Py_ssize_t dim
4547 *
4548 * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
4549 * self.itemsize = itemsize
4550 *
4551*/
4552 if (unlikely(__pyx_v_shape == Py_None)) {
4553 PyErr_SetString(PyExc_TypeError, "object of type \047NoneType\047 has no len()");
4554 __PYX_ERR(1, 153, __pyx_L1_error)
4555 }
4556 __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)
4557 __pyx_v_self->ndim = ((int)__pyx_t_1);
4558
4559
4560 /* "View.MemoryView":154
4561 *
4562 * self.ndim = <int> len(shape)
4563 * self.itemsize = itemsize # <<<<<<<<<<<<<<
4564 *
4565 * if cython.unlikely(not self.ndim):
4566*/
4567 __pyx_v_self->itemsize = __pyx_v_itemsize;
4568
4569 /* "View.MemoryView":156
4570 * self.itemsize = itemsize
4571 *
4572 * if cython.unlikely(not self.ndim): # <<<<<<<<<<<<<<
4573 * _err_ValueError("Empty shape tuple for cython.array")
4574 *
4575*/
4576 __pyx_t_2 = (!(__pyx_v_self->ndim != 0));
4577
4578 if (unlikely(__pyx_t_2)) {
4579
4580
4581 /* "View.MemoryView":157
4582 *
4583 * if cython.unlikely(not self.ndim):
4584 * _err_ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
4585 *
4586 * if cython.unlikely(itemsize <= 0):
4587*/
4588 __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)
4589
4590
4591 /* "View.MemoryView":156
4592 * self.itemsize = itemsize
4593 *
4594 * if cython.unlikely(not self.ndim): # <<<<<<<<<<<<<<
4595 * _err_ValueError("Empty shape tuple for cython.array")
4596 *
4597*/
4598 }
4599
4600 /* "View.MemoryView":159
4601 * _err_ValueError("Empty shape tuple for cython.array")
4602 *
4603 * if cython.unlikely(itemsize <= 0): # <<<<<<<<<<<<<<
4604 * _err_ValueError("itemsize <= 0 for cython.array")
4605 *
4606*/
4607 __pyx_t_2 = (__pyx_v_itemsize <= 0);
4608
4609 if (unlikely(__pyx_t_2)) {
4610
4611
4612 /* "View.MemoryView":160
4613 *
4614 * if cython.unlikely(itemsize <= 0):
4615 * _err_ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
4616 *
4617 * if not isinstance(format, bytes):
4618*/
4619 __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)
4620
4621
4622 /* "View.MemoryView":159
4623 * _err_ValueError("Empty shape tuple for cython.array")
4624 *
4625 * if cython.unlikely(itemsize <= 0): # <<<<<<<<<<<<<<
4626 * _err_ValueError("itemsize <= 0 for cython.array")
4627 *
4628*/
4629 }
4630
4631 /* "View.MemoryView":162
4632 * _err_ValueError("itemsize <= 0 for cython.array")
4633 *
4634 * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
4635 * format = format.encode('ASCII')
4636 * self._format = format # keep a reference to the byte string
4637*/
4638 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
4639 __pyx_t_4 = (!__pyx_t_2);
4640
4641
4642 if (__pyx_t_4) {
4643
4644
4645 /* "View.MemoryView":163
4646 *
4647 * if not isinstance(format, bytes):
4648 * format = format.encode('ASCII') # <<<<<<<<<<<<<<
4649 * self._format = format # keep a reference to the byte string
4650 * self.format = self._format
4651*/
4652 __pyx_t_6 = __pyx_v_format;
4653 __Pyx_INCREF(__pyx_t_6);
4654 __pyx_t_7 = 0;
4655 {
4656 PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ASCII};
4657 __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));
4658 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4659 if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 163, __pyx_L1_error)
4660 __Pyx_GOTREF(__pyx_t_5);
4661 }
4662 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
4663 __pyx_t_5 = 0;
4664
4665 /* "View.MemoryView":162
4666 * _err_ValueError("itemsize <= 0 for cython.array")
4667 *
4668 * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
4669 * format = format.encode('ASCII')
4670 * self._format = format # keep a reference to the byte string
4671*/
4672 }
4673
4674 /* "View.MemoryView":164
4675 * if not isinstance(format, bytes):
4676 * format = format.encode('ASCII')
4677 * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
4678 * self.format = self._format
4679 *
4680*/
4681 __pyx_t_5 = __pyx_v_format;
4682 __Pyx_INCREF(__pyx_t_5);
4683 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)
4684 __Pyx_GIVEREF(__pyx_t_5);
4685 __Pyx_GOTREF(__pyx_v_self->_format);
4686 __Pyx_DECREF(__pyx_v_self->_format);
4687 __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
4688 __pyx_t_5 = 0;
4689
4690 /* "View.MemoryView":165
4691 * format = format.encode('ASCII')
4692 * self._format = format # keep a reference to the byte string
4693 * self.format = self._format # <<<<<<<<<<<<<<
4694 *
4695 *
4696*/
4697 if (unlikely(__pyx_v_self->_format == Py_None)) {
4698 PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
4699 __PYX_ERR(1, 165, __pyx_L1_error)
4700 }
4701 __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(1, 165, __pyx_L1_error)
4702 __pyx_v_self->format = __pyx_t_8;
4703
4704 /* "View.MemoryView":168
4705 *
4706 *
4707 * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t> self.ndim) # <<<<<<<<<<<<<<
4708 * self._strides = self._shape + self.ndim
4709 *
4710*/
4711 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_self->ndim))));
4712
4713 /* "View.MemoryView":169
4714 *
4715 * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t> self.ndim)
4716 * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
4717 *
4718 * if not self._shape:
4719*/
4720 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
4721
4722 /* "View.MemoryView":171
4723 * self._strides = self._shape + self.ndim
4724 *
4725 * if not self._shape: # <<<<<<<<<<<<<<
4726 * raise MemoryError, "unable to allocate shape and strides."
4727 *
4728*/
4729 __pyx_t_4 = (!(__pyx_v_self->_shape != 0));
4730
4731 if (unlikely(__pyx_t_4)) {
4732
4733
4734 /* "View.MemoryView":172
4735 *
4736 * if not self._shape:
4737 * raise MemoryError, "unable to allocate shape and strides." # <<<<<<<<<<<<<<
4738 *
4739 *
4740*/
4741 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_MemoryError))), __pyx_mstate_global->__pyx_kp_u_unable_to_allocate_shape_and_str, 0, 0);
4742 __PYX_ERR(1, 172, __pyx_L1_error)
4743
4744 /* "View.MemoryView":171
4745 * self._strides = self._shape + self.ndim
4746 *
4747 * if not self._shape: # <<<<<<<<<<<<<<
4748 * raise MemoryError, "unable to allocate shape and strides."
4749 *
4750*/
4751 }
4752
4753 /* "View.MemoryView":175
4754 *
4755 *
4756 * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
4757 * if dim <= 0:
4758 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
4759*/
4760
4761 __pyx_t_3 = 0;
4762 __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5);
4763 __pyx_t_1 = 0;
4764 for (;;) {
4765 {
4766 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
4767 #if !CYTHON_ASSUME_SAFE_SIZE
4768 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 175, __pyx_L1_error)
4769 #endif
4770 if (__pyx_t_1 >= __pyx_temp) break;
4771 }
4772 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4773 __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1));
4774 #else
4775 __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_1);
4776 #endif
4777 ++__pyx_t_1;
4778 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 175, __pyx_L1_error)
4779 __Pyx_GOTREF(__pyx_t_6);
4780 __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)
4781 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4782 __pyx_v_dim = __pyx_t_9;
4783 __pyx_v_idx = __pyx_t_3;
4784 __pyx_t_3 = (__pyx_t_3 + 1);
4785
4786 /* "View.MemoryView":176
4787 *
4788 * for idx, dim in enumerate(shape):
4789 * if dim <= 0: # <<<<<<<<<<<<<<
4790 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
4791 * self._shape[idx] = dim
4792*/
4793 __pyx_t_4 = (__pyx_v_dim <= 0);
4794
4795 if (unlikely(__pyx_t_4)) {
4796
4797
4798 /* "View.MemoryView":177
4799 * for idx, dim in enumerate(shape):
4800 * if dim <= 0:
4801 * raise ValueError, f"Invalid shape in axis {idx}: {dim}." # <<<<<<<<<<<<<<
4802 * self._shape[idx] = dim
4803 *
4804*/
4805 __pyx_t_6 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 177, __pyx_L1_error)
4806 __Pyx_GOTREF(__pyx_t_6);
4807 __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)
4808 __Pyx_GOTREF(__pyx_t_10);
4809 __pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_Invalid_shape_in_axis;
4810 __pyx_t_11[1] = __pyx_t_6;
4811 __pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u__2;
4812 __pyx_t_11[3] = __pyx_t_10;
4813 __pyx_t_11[4] = __pyx_mstate_global->__pyx_kp_u__3;
4814 __pyx_t_9 = 25;
4815 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
4816 __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11[3]);
4817 #endif
4818 __pyx_t_12 = 0;
4819 __pyx_t_13 = __Pyx_PyUnicode_Join(__pyx_t_11, 5, __pyx_t_9, __pyx_t_12);
4820 if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 177, __pyx_L1_error)
4821 __Pyx_GOTREF(__pyx_t_13);
4822 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4823 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4824 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_t_13, 0, 0);
4825 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4826 __PYX_ERR(1, 177, __pyx_L1_error)
4827
4828 /* "View.MemoryView":176
4829 *
4830 * for idx, dim in enumerate(shape):
4831 * if dim <= 0: # <<<<<<<<<<<<<<
4832 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
4833 * self._shape[idx] = dim
4834*/
4835 }
4836
4837 /* "View.MemoryView":178
4838 * if dim <= 0:
4839 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
4840 * self._shape[idx] = dim # <<<<<<<<<<<<<<
4841 *
4842 * cdef char order
4843*/
4844 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
4845
4846 /* "View.MemoryView":175
4847 *
4848 *
4849 * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
4850 * if dim <= 0:
4851 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
4852*/
4853 }
4854 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4855
4856 /* "View.MemoryView":181
4857 *
4858 * cdef char order
4859 * if mode == 'c': # <<<<<<<<<<<<<<
4860 * order = b'C'
4861 * self.mode = u'c'
4862*/
4863 __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)
4864 if (__pyx_t_4) {
4865
4866
4867 /* "View.MemoryView":182
4868 * cdef char order
4869 * if mode == 'c':
4870 * order = b'C' # <<<<<<<<<<<<<<
4871 * self.mode = u'c'
4872 * elif mode == 'fortran':
4873*/
4874 __pyx_v_order = 'C';
4875
4876 /* "View.MemoryView":183
4877 * if mode == 'c':
4878 * order = b'C'
4879 * self.mode = u'c' # <<<<<<<<<<<<<<
4880 * elif mode == 'fortran':
4881 * order = b'F'
4882*/
4883 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_c);
4884 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_c);
4885 __Pyx_GOTREF(__pyx_v_self->mode);
4886 __Pyx_DECREF(__pyx_v_self->mode);
4887 __pyx_v_self->mode = __pyx_mstate_global->__pyx_n_u_c;
4888
4889 /* "View.MemoryView":181
4890 *
4891 * cdef char order
4892 * if mode == 'c': # <<<<<<<<<<<<<<
4893 * order = b'C'
4894 * self.mode = u'c'
4895*/
4896 goto __pyx_L11;
4897 }
4898
4899 /* "View.MemoryView":184
4900 * order = b'C'
4901 * self.mode = u'c'
4902 * elif mode == 'fortran': # <<<<<<<<<<<<<<
4903 * order = b'F'
4904 * self.mode = u'fortran'
4905*/
4906 __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)
4907 if (likely(__pyx_t_4)) {
4908
4909
4910 /* "View.MemoryView":185
4911 * self.mode = u'c'
4912 * elif mode == 'fortran':
4913 * order = b'F' # <<<<<<<<<<<<<<
4914 * self.mode = u'fortran'
4915 * else:
4916*/
4917 __pyx_v_order = 'F';
4918
4919 /* "View.MemoryView":186
4920 * elif mode == 'fortran':
4921 * order = b'F'
4922 * self.mode = u'fortran' # <<<<<<<<<<<<<<
4923 * else:
4924 * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
4925*/
4926 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_fortran);
4927 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_fortran);
4928 __Pyx_GOTREF(__pyx_v_self->mode);
4929 __Pyx_DECREF(__pyx_v_self->mode);
4930 __pyx_v_self->mode = __pyx_mstate_global->__pyx_n_u_fortran;
4931
4932 /* "View.MemoryView":184
4933 * order = b'C'
4934 * self.mode = u'c'
4935 * elif mode == 'fortran': # <<<<<<<<<<<<<<
4936 * order = b'F'
4937 * self.mode = u'fortran'
4938*/
4939 goto __pyx_L11;
4940 }
4941
4942 /* "View.MemoryView":188
4943 * self.mode = u'fortran'
4944 * else:
4945 * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}" # <<<<<<<<<<<<<<
4946 *
4947 * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
4948*/
4949 /*else*/ {
4950 __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)
4951 __Pyx_GOTREF(__pyx_t_5);
4952 __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)
4953 __Pyx_GOTREF(__pyx_t_13);
4954 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4955 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_t_13, 0, 0);
4956 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4957 __PYX_ERR(1, 188, __pyx_L1_error)
4958 }
4959 __pyx_L11:;
4960
4961 /* "View.MemoryView":190
4962 * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
4963 *
4964 * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order) # <<<<<<<<<<<<<<
4965 *
4966 * self.free_data = allocate_buffer
4967*/
4968 __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);
4969
4970 /* "View.MemoryView":192
4971 * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
4972 *
4973 * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
4974 * self.dtype_is_object = format == b'O'
4975 *
4976*/
4977 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
4978
4979 /* "View.MemoryView":193
4980 *
4981 * self.free_data = allocate_buffer
4982 * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
4983 *
4984 * if allocate_buffer:
4985*/
4986 __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)
4987 __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)
4988 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4989 __pyx_v_self->dtype_is_object = __pyx_t_4;
4990
4991 /* "View.MemoryView":195
4992 * self.dtype_is_object = format == b'O'
4993 *
4994 * if allocate_buffer: # <<<<<<<<<<<<<<
4995 * _allocate_buffer(self)
4996 *
4997*/
4998 if (__pyx_v_allocate_buffer) {
4999
5000 /* "View.MemoryView":196
5001 *
5002 * if allocate_buffer:
5003 * _allocate_buffer(self) # <<<<<<<<<<<<<<
5004 *
5005 * @cname('getbuffer')
5006*/
5007 __pyx_t_3 = __pyx_array_allocate_buffer(__pyx_v_self); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 196, __pyx_L1_error)
5008
5009
5010 /* "View.MemoryView":195
5011 * self.dtype_is_object = format == b'O'
5012 *
5013 * if allocate_buffer: # <<<<<<<<<<<<<<
5014 * _allocate_buffer(self)
5015 *
5016*/
5017 }
5018
5019 /* "View.MemoryView":147
5020 * cdef bint dtype_is_object
5021 *
5022 * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
5023 * mode="c", bint allocate_buffer=True):
5024 *
5025*/
5026
5027 /* function exit code */
5028 __pyx_r = 0;
5029 goto __pyx_L0;
5030 __pyx_L1_error:;
5031 __Pyx_XDECREF(__pyx_t_5);
5032 __Pyx_XDECREF(__pyx_t_6);
5033 __Pyx_XDECREF(__pyx_t_10);
5034 __Pyx_XDECREF(__pyx_t_13);
5035 __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5036 __pyx_r = -1;
5037 __pyx_L0:;
5038
5039
5040
5041 __Pyx_XDECREF(__pyx_v_format);
5042
5043 __Pyx_RefNannyFinishContext();
5044 return __pyx_r;
5045}
5046
5047/* "View.MemoryView":198
5048 * _allocate_buffer(self)
5049 *
5050 * @cname('getbuffer') # <<<<<<<<<<<<<<
5051 * def __getbuffer__(self, Py_buffer *info, int flags):
5052 * cdef int bufmode = -1
5053*/
5054
5055/* Python wrapper */
5056CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
5057CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5058 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5059 int __pyx_r;
5060 __Pyx_RefNannyDeclarations
5061 __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
5062 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5063 __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));
5064
5065 /* function exit code */
5066
5067
5068 __Pyx_RefNannyFinishContext();
5069 return __pyx_r;
5070}
5071
5072static 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) {
5073 int __pyx_v_bufmode;
5074 int __pyx_r;
5075 __Pyx_RefNannyDeclarations
5076 int __pyx_t_1;
5077 int __pyx_t_2;
5078 char *__pyx_t_3;
5079 Py_ssize_t __pyx_t_4;
5080 Py_ssize_t *__pyx_t_5;
5081 int __pyx_lineno = 0;
5082 const char *__pyx_filename = NULL;
5083 int __pyx_clineno = 0;
5084 if (unlikely(__pyx_v_info == NULL)) {
5085 PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
5086 return -1;
5087 }
5088 __Pyx_RefNannySetupContext("__getbuffer__", 0);
5089 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
5090 __Pyx_GIVEREF(__pyx_v_info->obj);
5091
5092 /* "View.MemoryView":200
5093 * @cname('getbuffer')
5094 * def __getbuffer__(self, Py_buffer *info, int flags):
5095 * cdef int bufmode = -1 # <<<<<<<<<<<<<<
5096 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5097 * if self.mode == u"c":
5098*/
5099 __pyx_v_bufmode = -1;
5100
5101 /* "View.MemoryView":201
5102 * def __getbuffer__(self, Py_buffer *info, int flags):
5103 * cdef int bufmode = -1
5104 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
5105 * if self.mode == u"c":
5106 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5107*/
5108 __pyx_t_1 = ((__pyx_v_flags & ((PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS) | PyBUF_ANY_CONTIGUOUS)) != 0);
5109
5110 if (__pyx_t_1) {
5111
5112
5113 /* "View.MemoryView":202
5114 * cdef int bufmode = -1
5115 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5116 * if self.mode == u"c": # <<<<<<<<<<<<<<
5117 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5118 * elif self.mode == u"fortran":
5119*/
5120 __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)
5121 if (__pyx_t_1) {
5122
5123
5124 /* "View.MemoryView":203
5125 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5126 * if self.mode == u"c":
5127 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
5128 * elif self.mode == u"fortran":
5129 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5130*/
5131 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
5132
5133 /* "View.MemoryView":202
5134 * cdef int bufmode = -1
5135 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5136 * if self.mode == u"c": # <<<<<<<<<<<<<<
5137 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5138 * elif self.mode == u"fortran":
5139*/
5140 goto __pyx_L4;
5141 }
5142
5143 /* "View.MemoryView":204
5144 * if self.mode == u"c":
5145 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5146 * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
5147 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5148 * if cython.unlikely(not (flags & bufmode)):
5149*/
5150 __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)
5151 if (__pyx_t_1) {
5152
5153
5154 /* "View.MemoryView":205
5155 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5156 * elif self.mode == u"fortran":
5157 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
5158 * if cython.unlikely(not (flags & bufmode)):
5159 * _err_ValueError("Can only create a buffer that is contiguous in memory.")
5160*/
5161 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
5162
5163 /* "View.MemoryView":204
5164 * if self.mode == u"c":
5165 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5166 * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
5167 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5168 * if cython.unlikely(not (flags & bufmode)):
5169*/
5170 }
5171 __pyx_L4:;
5172
5173 /* "View.MemoryView":206
5174 * elif self.mode == u"fortran":
5175 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5176 * if cython.unlikely(not (flags & bufmode)): # <<<<<<<<<<<<<<
5177 * _err_ValueError("Can only create a buffer that is contiguous in memory.")
5178 * info.buf = self.data
5179*/
5180 __pyx_t_1 = (!((__pyx_v_flags & __pyx_v_bufmode) != 0));
5181
5182 if (unlikely(__pyx_t_1)) {
5183
5184
5185 /* "View.MemoryView":207
5186 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5187 * if cython.unlikely(not (flags & bufmode)):
5188 * _err_ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
5189 * info.buf = self.data
5190 * info.len = self.len
5191*/
5192 __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)
5193
5194
5195 /* "View.MemoryView":206
5196 * elif self.mode == u"fortran":
5197 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5198 * if cython.unlikely(not (flags & bufmode)): # <<<<<<<<<<<<<<
5199 * _err_ValueError("Can only create a buffer that is contiguous in memory.")
5200 * info.buf = self.data
5201*/
5202 }
5203
5204 /* "View.MemoryView":201
5205 * def __getbuffer__(self, Py_buffer *info, int flags):
5206 * cdef int bufmode = -1
5207 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
5208 * if self.mode == u"c":
5209 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5210*/
5211 }
5212
5213 /* "View.MemoryView":208
5214 * if cython.unlikely(not (flags & bufmode)):
5215 * _err_ValueError("Can only create a buffer that is contiguous in memory.")
5216 * info.buf = self.data # <<<<<<<<<<<<<<
5217 * info.len = self.len
5218 *
5219*/
5220 __pyx_t_3 = __pyx_v_self->data;
5221
5222 __pyx_v_info->buf = __pyx_t_3;
5223
5224 /* "View.MemoryView":209
5225 * _err_ValueError("Can only create a buffer that is contiguous in memory.")
5226 * info.buf = self.data
5227 * info.len = self.len # <<<<<<<<<<<<<<
5228 *
5229 * if flags & PyBUF_STRIDES:
5230*/
5231 __pyx_t_4 = __pyx_v_self->len;
5232
5233 __pyx_v_info->len = __pyx_t_4;
5234
5235 /* "View.MemoryView":211
5236 * info.len = self.len
5237 *
5238 * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
5239 * info.ndim = self.ndim
5240 * info.shape = self._shape
5241*/
5242 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
5243
5244 if (__pyx_t_1) {
5245
5246
5247 /* "View.MemoryView":212
5248 *
5249 * if flags & PyBUF_STRIDES:
5250 * info.ndim = self.ndim # <<<<<<<<<<<<<<
5251 * info.shape = self._shape
5252 * info.strides = self._strides
5253*/
5254 __pyx_t_2 = __pyx_v_self->ndim;
5255
5256 __pyx_v_info->ndim = __pyx_t_2;
5257
5258 /* "View.MemoryView":213
5259 * if flags & PyBUF_STRIDES:
5260 * info.ndim = self.ndim
5261 * info.shape = self._shape # <<<<<<<<<<<<<<
5262 * info.strides = self._strides
5263 * else:
5264*/
5265 __pyx_t_5 = __pyx_v_self->_shape;
5266
5267 __pyx_v_info->shape = __pyx_t_5;
5268
5269 /* "View.MemoryView":214
5270 * info.ndim = self.ndim
5271 * info.shape = self._shape
5272 * info.strides = self._strides # <<<<<<<<<<<<<<
5273 * else:
5274 * info.ndim = 1
5275*/
5276 __pyx_t_5 = __pyx_v_self->_strides;
5277
5278 __pyx_v_info->strides = __pyx_t_5;
5279
5280 /* "View.MemoryView":211
5281 * info.len = self.len
5282 *
5283 * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
5284 * info.ndim = self.ndim
5285 * info.shape = self._shape
5286*/
5287 goto __pyx_L6;
5288 }
5289
5290 /* "View.MemoryView":216
5291 * info.strides = self._strides
5292 * else:
5293 * info.ndim = 1 # <<<<<<<<<<<<<<
5294 * info.shape = &self.len if flags & PyBUF_ND else NULL
5295 * info.strides = NULL
5296*/
5297 /*else*/ {
5298 __pyx_v_info->ndim = 1;
5299
5300 /* "View.MemoryView":217
5301 * else:
5302 * info.ndim = 1
5303 * info.shape = &self.len if flags & PyBUF_ND else NULL # <<<<<<<<<<<<<<
5304 * info.strides = NULL
5305 *
5306*/
5307 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
5308
5309 if (__pyx_t_1) {
5310
5311 __pyx_t_5 = (&__pyx_v_self->len);
5312 } else {
5313
5314 __pyx_t_5 = NULL;
5315 }
5316
5317 __pyx_v_info->shape = __pyx_t_5;
5318
5319 /* "View.MemoryView":218
5320 * info.ndim = 1
5321 * info.shape = &self.len if flags & PyBUF_ND else NULL
5322 * info.strides = NULL # <<<<<<<<<<<<<<
5323 *
5324 * info.suboffsets = NULL
5325*/
5326 __pyx_v_info->strides = NULL;
5327 }
5328 __pyx_L6:;
5329
5330 /* "View.MemoryView":220
5331 * info.strides = NULL
5332 *
5333 * info.suboffsets = NULL # <<<<<<<<<<<<<<
5334 * info.itemsize = self.itemsize
5335 * info.readonly = 0
5336*/
5337 __pyx_v_info->suboffsets = NULL;
5338
5339 /* "View.MemoryView":221
5340 *
5341 * info.suboffsets = NULL
5342 * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
5343 * info.readonly = 0
5344 * info.format = self.format if flags & PyBUF_FORMAT else NULL
5345*/
5346 __pyx_t_4 = __pyx_v_self->itemsize;
5347
5348 __pyx_v_info->itemsize = __pyx_t_4;
5349
5350 /* "View.MemoryView":222
5351 * info.suboffsets = NULL
5352 * info.itemsize = self.itemsize
5353 * info.readonly = 0 # <<<<<<<<<<<<<<
5354 * info.format = self.format if flags & PyBUF_FORMAT else NULL
5355 * info.obj = self
5356*/
5357 __pyx_v_info->readonly = 0;
5358
5359 /* "View.MemoryView":223
5360 * info.itemsize = self.itemsize
5361 * info.readonly = 0
5362 * info.format = self.format if flags & PyBUF_FORMAT else NULL # <<<<<<<<<<<<<<
5363 * info.obj = self
5364 *
5365*/
5366 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
5367
5368 if (__pyx_t_1) {
5369
5370 __pyx_t_3 = __pyx_v_self->format;
5371 } else {
5372
5373 __pyx_t_3 = NULL;
5374 }
5375
5376 __pyx_v_info->format = __pyx_t_3;
5377
5378 /* "View.MemoryView":224
5379 * info.readonly = 0
5380 * info.format = self.format if flags & PyBUF_FORMAT else NULL
5381 * info.obj = self # <<<<<<<<<<<<<<
5382 *
5383 * def __dealloc__(array self):
5384*/
5385 __Pyx_INCREF((PyObject *)__pyx_v_self);
5386 __Pyx_GIVEREF((PyObject *)__pyx_v_self);
5387 __Pyx_GOTREF(__pyx_v_info->obj);
5388 __Pyx_DECREF(__pyx_v_info->obj);
5389 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
5390
5391 /* "View.MemoryView":198
5392 * _allocate_buffer(self)
5393 *
5394 * @cname('getbuffer') # <<<<<<<<<<<<<<
5395 * def __getbuffer__(self, Py_buffer *info, int flags):
5396 * cdef int bufmode = -1
5397*/
5398
5399 /* function exit code */
5400 __pyx_r = 0;
5401 goto __pyx_L0;
5402 __pyx_L1_error:;
5403 __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5404 __pyx_r = -1;
5405 if (__pyx_v_info->obj != NULL) {
5406 __Pyx_GOTREF(__pyx_v_info->obj);
5407 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5408 }
5409 goto __pyx_L2;
5410 __pyx_L0:;
5411 if (__pyx_v_info->obj == Py_None) {
5412 __Pyx_GOTREF(__pyx_v_info->obj);
5413 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5414 }
5415 __pyx_L2:;
5416
5417
5418 __Pyx_RefNannyFinishContext();
5419 return __pyx_r;
5420}
5421
5422/* "View.MemoryView":226
5423 * info.obj = self
5424 *
5425 * def __dealloc__(array self): # <<<<<<<<<<<<<<
5426 * if self.callback_free_data != NULL:
5427 * self.callback_free_data(self.data)
5428*/
5429
5430/* Python wrapper */
5431static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
5432static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
5433 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5434 __Pyx_RefNannyDeclarations
5435 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
5436 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5437 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
5438
5439 /* function exit code */
5440 __Pyx_RefNannyFinishContext();
5441}
5442
5443static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
5444 int __pyx_t_1;
5445 int __pyx_t_2;
5446
5447 /* "View.MemoryView":227
5448 *
5449 * def __dealloc__(array self):
5450 * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
5451 * self.callback_free_data(self.data)
5452 * elif self.free_data and self.data is not NULL:
5453*/
5454 __pyx_t_1 = (__pyx_v_self->callback_free_data != NULL);
5455
5456 if (__pyx_t_1) {
5457
5458
5459 /* "View.MemoryView":228
5460 * def __dealloc__(array self):
5461 * if self.callback_free_data != NULL:
5462 * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
5463 * elif self.free_data and self.data is not NULL:
5464 * if self.dtype_is_object:
5465*/
5466 __pyx_v_self->callback_free_data(__pyx_v_self->data);
5467
5468 /* "View.MemoryView":227
5469 *
5470 * def __dealloc__(array self):
5471 * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
5472 * self.callback_free_data(self.data)
5473 * elif self.free_data and self.data is not NULL:
5474*/
5475 goto __pyx_L3;
5476 }
5477
5478 /* "View.MemoryView":229
5479 * if self.callback_free_data != NULL:
5480 * self.callback_free_data(self.data)
5481 * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
5482 * if self.dtype_is_object:
5483 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5484*/
5485 if (__pyx_v_self->free_data) {
5486 } else {
5487
5488 __pyx_t_1 = __pyx_v_self->free_data;
5489 goto __pyx_L4_bool_binop_done;
5490 }
5491 __pyx_t_2 = (__pyx_v_self->data != NULL);
5492
5493
5494 __pyx_t_1 = __pyx_t_2;
5495
5496 __pyx_L4_bool_binop_done:;
5497 if (__pyx_t_1) {
5498
5499
5500 /* "View.MemoryView":230
5501 * self.callback_free_data(self.data)
5502 * elif self.free_data and self.data is not NULL:
5503 * if self.dtype_is_object: # <<<<<<<<<<<<<<
5504 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5505 * free(self.data)
5506*/
5507 if (__pyx_v_self->dtype_is_object) {
5508
5509 /* "View.MemoryView":231
5510 * elif self.free_data and self.data is not NULL:
5511 * if self.dtype_is_object:
5512 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False) # <<<<<<<<<<<<<<
5513 * free(self.data)
5514 * PyObject_Free(self._shape)
5515*/
5516 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
5517
5518 /* "View.MemoryView":230
5519 * self.callback_free_data(self.data)
5520 * elif self.free_data and self.data is not NULL:
5521 * if self.dtype_is_object: # <<<<<<<<<<<<<<
5522 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5523 * free(self.data)
5524*/
5525 }
5526
5527 /* "View.MemoryView":232
5528 * if self.dtype_is_object:
5529 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5530 * free(self.data) # <<<<<<<<<<<<<<
5531 * PyObject_Free(self._shape)
5532 *
5533*/
5534 free(__pyx_v_self->data);
5535
5536 /* "View.MemoryView":229
5537 * if self.callback_free_data != NULL:
5538 * self.callback_free_data(self.data)
5539 * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
5540 * if self.dtype_is_object:
5541 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5542*/
5543 }
5544 __pyx_L3:;
5545
5546 /* "View.MemoryView":233
5547 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5548 * free(self.data)
5549 * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
5550 *
5551 * @property
5552*/
5553 PyObject_Free(__pyx_v_self->_shape);
5554
5555 /* "View.MemoryView":226
5556 * info.obj = self
5557 *
5558 * def __dealloc__(array self): # <<<<<<<<<<<<<<
5559 * if self.callback_free_data != NULL:
5560 * self.callback_free_data(self.data)
5561*/
5562
5563 /* function exit code */
5564
5565}
5566
5567/* "View.MemoryView":235
5568 * PyObject_Free(self._shape)
5569 *
5570 * @property # <<<<<<<<<<<<<<
5571 * def memview(self):
5572 * return array.get_memview(self)
5573*/
5574
5575/* Python wrapper */
5576static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
5577static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
5578 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5579 PyObject *__pyx_r = 0;
5580 __Pyx_RefNannyDeclarations
5581 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5582 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5583 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
5584
5585 /* function exit code */
5586 __Pyx_RefNannyFinishContext();
5587 return __pyx_r;
5588}
5589
5590static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
5591 PyObject *__pyx_r = NULL;
5592 __Pyx_RefNannyDeclarations
5593 PyObject *__pyx_t_1 = NULL;
5594 int __pyx_lineno = 0;
5595 const char *__pyx_filename = NULL;
5596 int __pyx_clineno = 0;
5597 __Pyx_RefNannySetupContext("__get__", 0);
5598
5599 /* "View.MemoryView":237
5600 * @property
5601 * def memview(self):
5602 * return array.get_memview(self) # <<<<<<<<<<<<<<
5603 *
5604 *
5605*/
5606 __pyx_t_1 = __pyx_array_get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
5607 __Pyx_GOTREF(__pyx_t_1);
5608 {
5609 PyObject *__pyx_temp;
5610 {
5611 __pyx_temp = __pyx_r;
5612 __pyx_r = __pyx_t_1;
5613 }
5614 __Pyx_XDECREF(__pyx_temp);
5615 }
5616 __pyx_t_1 = 0;
5617 goto __pyx_L0;
5618
5619 /* "View.MemoryView":235
5620 * PyObject_Free(self._shape)
5621 *
5622 * @property # <<<<<<<<<<<<<<
5623 * def memview(self):
5624 * return array.get_memview(self)
5625*/
5626
5627 /* function exit code */
5628 __pyx_L1_error:;
5629 __Pyx_XDECREF(__pyx_t_1);
5630 __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5631 __pyx_r = NULL;
5632 __pyx_L0:;
5633 __Pyx_XGIVEREF(__pyx_r);
5634 __Pyx_RefNannyFinishContext();
5635 return __pyx_r;
5636}
5637
5638/* "View.MemoryView":240
5639 *
5640 *
5641 * @cname('get_memview') # <<<<<<<<<<<<<<
5642 * cdef get_memview(self):
5643 * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
5644*/
5645
5646static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
5647 int __pyx_v_flags;
5648 PyObject *__pyx_r = NULL;
5649 __Pyx_RefNannyDeclarations
5650 PyObject *__pyx_t_1 = NULL;
5651 PyObject *__pyx_t_2 = NULL;
5652 PyObject *__pyx_t_3 = NULL;
5653 PyObject *__pyx_t_4 = NULL;
5654 size_t __pyx_t_5;
5655 int __pyx_lineno = 0;
5656 const char *__pyx_filename = NULL;
5657 int __pyx_clineno = 0;
5658 __Pyx_RefNannySetupContext("get_memview", 0);
5659
5660 /* "View.MemoryView":242
5661 * @cname('get_memview')
5662 * cdef get_memview(self):
5663 * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
5664 * return memoryview(self, flags, self.dtype_is_object)
5665 *
5666*/
5667 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
5668
5669 /* "View.MemoryView":243
5670 * cdef get_memview(self):
5671 * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
5672 * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
5673 *
5674 * def __len__(self):
5675*/
5676 __pyx_t_2 = NULL;
5677 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 243, __pyx_L1_error)
5678 __Pyx_GOTREF(__pyx_t_3);
5679 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 243, __pyx_L1_error)
5680 __Pyx_GOTREF(__pyx_t_4);
5681 __pyx_t_5 = 1;
5682 {
5683 PyObject *__pyx_callargs[4] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_t_3, __pyx_t_4};
5684 __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));
5685 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5686 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5687 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5688 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 243, __pyx_L1_error)
5689 __Pyx_GOTREF((PyObject *)__pyx_t_1);
5690 }
5691 {
5692 PyObject *__pyx_temp;
5693 {
5694 __pyx_temp = __pyx_r;
5695 __pyx_r = ((PyObject *)__pyx_t_1);
5696 }
5697 __Pyx_XDECREF(__pyx_temp);
5698 }
5699 __pyx_t_1 = 0;
5700 goto __pyx_L0;
5701
5702 /* "View.MemoryView":240
5703 *
5704 *
5705 * @cname('get_memview') # <<<<<<<<<<<<<<
5706 * cdef get_memview(self):
5707 * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
5708*/
5709
5710 /* function exit code */
5711 __pyx_L1_error:;
5712 __Pyx_XDECREF(__pyx_t_1);
5713 __Pyx_XDECREF(__pyx_t_2);
5714 __Pyx_XDECREF(__pyx_t_3);
5715 __Pyx_XDECREF(__pyx_t_4);
5716 __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
5717 __pyx_r = 0;
5718 __pyx_L0:;
5719
5720 __Pyx_XGIVEREF(__pyx_r);
5721 __Pyx_RefNannyFinishContext();
5722 return __pyx_r;
5723}
5724
5725/* "View.MemoryView":245
5726 * return memoryview(self, flags, self.dtype_is_object)
5727 *
5728 * def __len__(self): # <<<<<<<<<<<<<<
5729 * return self._shape[0]
5730 *
5731*/
5732
5733/* Python wrapper */
5734static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
5735static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
5736 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5737 Py_ssize_t __pyx_r;
5738 __Pyx_RefNannyDeclarations
5739 __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
5740 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5741 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
5742
5743 /* function exit code */
5744 __Pyx_RefNannyFinishContext();
5745 return __pyx_r;
5746}
5747
5748static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
5749 Py_ssize_t __pyx_r;
5750
5751 /* "View.MemoryView":246
5752 *
5753 * def __len__(self):
5754 * return self._shape[0] # <<<<<<<<<<<<<<
5755 *
5756 * def __getattr__(self, attr):
5757*/
5758 {
5759
5760 __pyx_r = (__pyx_v_self->_shape[0]);
5761 }
5762 goto __pyx_L0;
5763
5764 /* "View.MemoryView":245
5765 * return memoryview(self, flags, self.dtype_is_object)
5766 *
5767 * def __len__(self): # <<<<<<<<<<<<<<
5768 * return self._shape[0]
5769 *
5770*/
5771
5772 /* function exit code */
5773 __pyx_L0:;
5774
5775 return __pyx_r;
5776}
5777
5778/* "View.MemoryView":248
5779 * return self._shape[0]
5780 *
5781 * def __getattr__(self, attr): # <<<<<<<<<<<<<<
5782 * return getattr(self.memview, attr)
5783 *
5784*/
5785
5786/* Python wrapper */
5787static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
5788static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
5789 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5790 PyObject *__pyx_r = 0;
5791 __Pyx_RefNannyDeclarations
5792 __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
5793 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5794 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
5795
5796 /* function exit code */
5797 __Pyx_RefNannyFinishContext();
5798 return __pyx_r;
5799}
5800
5801static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
5802 PyObject *__pyx_r = NULL;
5803 __Pyx_RefNannyDeclarations
5804 PyObject *__pyx_t_1 = NULL;
5805 PyObject *__pyx_t_2 = NULL;
5806 int __pyx_lineno = 0;
5807 const char *__pyx_filename = NULL;
5808 int __pyx_clineno = 0;
5809 __Pyx_RefNannySetupContext("__getattr__", 0);
5810
5811 /* "View.MemoryView":249
5812 *
5813 * def __getattr__(self, attr):
5814 * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
5815 *
5816 * def __getitem__(self, item):
5817*/
5818 __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)
5819 __Pyx_GOTREF(__pyx_t_1);
5820 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
5821 __Pyx_GOTREF(__pyx_t_2);
5822 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5823 {
5824 PyObject *__pyx_temp;
5825 {
5826 __pyx_temp = __pyx_r;
5827 __pyx_r = __pyx_t_2;
5828 }
5829 __Pyx_XDECREF(__pyx_temp);
5830 }
5831 __pyx_t_2 = 0;
5832 goto __pyx_L0;
5833
5834 /* "View.MemoryView":248
5835 * return self._shape[0]
5836 *
5837 * def __getattr__(self, attr): # <<<<<<<<<<<<<<
5838 * return getattr(self.memview, attr)
5839 *
5840*/
5841
5842 /* function exit code */
5843 __pyx_L1_error:;
5844 __Pyx_XDECREF(__pyx_t_1);
5845 __Pyx_XDECREF(__pyx_t_2);
5846 __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5847 __pyx_r = NULL;
5848 __pyx_L0:;
5849 __Pyx_XGIVEREF(__pyx_r);
5850 __Pyx_RefNannyFinishContext();
5851 return __pyx_r;
5852}
5853
5854/* "View.MemoryView":251
5855 * return getattr(self.memview, attr)
5856 *
5857 * def __getitem__(self, item): # <<<<<<<<<<<<<<
5858 * return self.memview[item]
5859 *
5860*/
5861
5862/* Python wrapper */
5863static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
5864static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
5865 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5866 PyObject *__pyx_r = 0;
5867 __Pyx_RefNannyDeclarations
5868 __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
5869 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5870 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
5871
5872 /* function exit code */
5873 __Pyx_RefNannyFinishContext();
5874 return __pyx_r;
5875}
5876
5877static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
5878 PyObject *__pyx_r = NULL;
5879 __Pyx_RefNannyDeclarations
5880 PyObject *__pyx_t_1 = NULL;
5881 PyObject *__pyx_t_2 = NULL;
5882 int __pyx_lineno = 0;
5883 const char *__pyx_filename = NULL;
5884 int __pyx_clineno = 0;
5885 __Pyx_RefNannySetupContext("__getitem__", 0);
5886
5887 /* "View.MemoryView":252
5888 *
5889 * def __getitem__(self, item):
5890 * return self.memview[item] # <<<<<<<<<<<<<<
5891 *
5892 * def __setitem__(self, item, value):
5893*/
5894 __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)
5895 __Pyx_GOTREF(__pyx_t_1);
5896 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 252, __pyx_L1_error)
5897 __Pyx_GOTREF(__pyx_t_2);
5898 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5899 {
5900 PyObject *__pyx_temp;
5901 {
5902 __pyx_temp = __pyx_r;
5903 __pyx_r = __pyx_t_2;
5904 }
5905 __Pyx_XDECREF(__pyx_temp);
5906 }
5907 __pyx_t_2 = 0;
5908 goto __pyx_L0;
5909
5910 /* "View.MemoryView":251
5911 * return getattr(self.memview, attr)
5912 *
5913 * def __getitem__(self, item): # <<<<<<<<<<<<<<
5914 * return self.memview[item]
5915 *
5916*/
5917
5918 /* function exit code */
5919 __pyx_L1_error:;
5920 __Pyx_XDECREF(__pyx_t_1);
5921 __Pyx_XDECREF(__pyx_t_2);
5922 __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5923 __pyx_r = NULL;
5924 __pyx_L0:;
5925 __Pyx_XGIVEREF(__pyx_r);
5926 __Pyx_RefNannyFinishContext();
5927 return __pyx_r;
5928}
5929
5930/* "View.MemoryView":254
5931 * return self.memview[item]
5932 *
5933 * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
5934 * self.memview[item] = value
5935 *
5936*/
5937
5938/* Python wrapper */
5939static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
5940static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
5941 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5942 int __pyx_r;
5943 __Pyx_RefNannyDeclarations
5944 __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
5945 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5946 __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));
5947
5948 /* function exit code */
5949 __Pyx_RefNannyFinishContext();
5950 return __pyx_r;
5951}
5952
5953static 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) {
5954 int __pyx_r;
5955 __Pyx_RefNannyDeclarations
5956 PyObject *__pyx_t_1 = NULL;
5957 int __pyx_lineno = 0;
5958 const char *__pyx_filename = NULL;
5959 int __pyx_clineno = 0;
5960 __Pyx_RefNannySetupContext("__setitem__", 0);
5961
5962 /* "View.MemoryView":255
5963 *
5964 * def __setitem__(self, item, value):
5965 * self.memview[item] = value # <<<<<<<<<<<<<<
5966 *
5967 *
5968*/
5969 __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)
5970 __Pyx_GOTREF(__pyx_t_1);
5971 if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0))) __PYX_ERR(1, 255, __pyx_L1_error)
5972 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5973
5974 /* "View.MemoryView":254
5975 * return self.memview[item]
5976 *
5977 * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
5978 * self.memview[item] = value
5979 *
5980*/
5981
5982 /* function exit code */
5983 __pyx_r = 0;
5984 goto __pyx_L0;
5985 __pyx_L1_error:;
5986 __Pyx_XDECREF(__pyx_t_1);
5987 __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5988 __pyx_r = -1;
5989 __pyx_L0:;
5990
5991 __Pyx_RefNannyFinishContext();
5992 return __pyx_r;
5993}
5994
5995/* "(tree fragment)":1
5996 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5997 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
5998 * def __setstate_cython__(self, __pyx_state):
5999*/
6000
6001/* Python wrapper */
6002static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
6003#if CYTHON_VECTORCALL
6004PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6005#else
6006PyObject *__pyx_args, PyObject *__pyx_kwds
6007#endif
6008); /*proto*/
6009static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
6010#if CYTHON_VECTORCALL
6011PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6012#else
6013PyObject *__pyx_args, PyObject *__pyx_kwds
6014#endif
6015) {
6016 #if !CYTHON_VECTORCALL
6017 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6018 #endif
6019 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6020 PyObject *__pyx_r = 0;
6021 __Pyx_RefNannyDeclarations
6022 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6023 #if !CYTHON_VECTORCALL
6024 #if CYTHON_ASSUME_SAFE_SIZE
6025 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6026 #else
6027 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6028 #endif
6029 #endif
6030 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6031 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
6032 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6033 if (unlikely(__pyx_kwds_len < 0)) return NULL;
6034 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
6035 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
6036
6037 /* function exit code */
6038 __Pyx_RefNannyFinishContext();
6039 return __pyx_r;
6040}
6041
6042static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
6043 PyObject *__pyx_r = NULL;
6044 __Pyx_RefNannyDeclarations
6045 int __pyx_lineno = 0;
6046 const char *__pyx_filename = NULL;
6047 int __pyx_clineno = 0;
6048 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
6049
6050 /* "(tree fragment)":2
6051 * def __reduce_cython__(self):
6052 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
6053 * def __setstate_cython__(self, __pyx_state):
6054 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6055*/
6056 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
6057 __PYX_ERR(1, 2, __pyx_L1_error)
6058
6059 /* "(tree fragment)":1
6060 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6061 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6062 * def __setstate_cython__(self, __pyx_state):
6063*/
6064
6065 /* function exit code */
6066 __pyx_L1_error:;
6067 __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6068 __pyx_r = NULL;
6069 __Pyx_XGIVEREF(__pyx_r);
6070 __Pyx_RefNannyFinishContext();
6071 return __pyx_r;
6072}
6073
6074/* "(tree fragment)":3
6075 * def __reduce_cython__(self):
6076 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6077 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6078 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6079*/
6080
6081/* Python wrapper */
6082static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
6083#if CYTHON_VECTORCALL
6084PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6085#else
6086PyObject *__pyx_args, PyObject *__pyx_kwds
6087#endif
6088); /*proto*/
6089static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
6090#if CYTHON_VECTORCALL
6091PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6092#else
6093PyObject *__pyx_args, PyObject *__pyx_kwds
6094#endif
6095) {
6096 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
6097 #if !CYTHON_VECTORCALL
6098 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6099 #endif
6100 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6101 PyObject* values[1] = {0};
6102 int __pyx_lineno = 0;
6103 const char *__pyx_filename = NULL;
6104 int __pyx_clineno = 0;
6105 PyObject *__pyx_r = 0;
6106 __Pyx_RefNannyDeclarations
6107 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
6108 #if !CYTHON_VECTORCALL
6109 #if CYTHON_ASSUME_SAFE_SIZE
6110 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6111 #else
6112 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6113 #endif
6114 #endif
6115 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6116 {
6117 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
6118 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6119 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
6120 if (__pyx_kwds_len > 0) {
6121 switch (__pyx_nargs) {
6122 case 1:
6123 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6124 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
6125 CYTHON_FALLTHROUGH;
6126 case 0: break;
6127 default: goto __pyx_L5_argtuple_error;
6128 }
6129 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6130 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)
6131 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
6132 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
6133 }
6134 } else if (unlikely(__pyx_nargs != 1)) {
6135 goto __pyx_L5_argtuple_error;
6136 } else {
6137 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6138 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
6139 }
6140 __pyx_v___pyx_state = values[0];
6141 }
6142 goto __pyx_L6_skip;
6143 __pyx_L5_argtuple_error:;
6144 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
6145 __pyx_L6_skip:;
6146 goto __pyx_L4_argument_unpacking_done;
6147 __pyx_L3_error:;
6148 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6149 Py_XDECREF(values[__pyx_temp]);
6150 }
6151 __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6152 __Pyx_RefNannyFinishContext();
6153 return NULL;
6154 __pyx_L4_argument_unpacking_done:;
6155 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v___pyx_state);
6156
6157 /* function exit code */
6158 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6159 Py_XDECREF(values[__pyx_temp]);
6160 }
6161 __Pyx_RefNannyFinishContext();
6162 return __pyx_r;
6163}
6164
6165static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6166 PyObject *__pyx_r = NULL;
6167 __Pyx_RefNannyDeclarations
6168 int __pyx_lineno = 0;
6169 const char *__pyx_filename = NULL;
6170 int __pyx_clineno = 0;
6171 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
6172
6173 /* "(tree fragment)":4
6174 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6175 * def __setstate_cython__(self, __pyx_state):
6176 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
6177*/
6178 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
6179 __PYX_ERR(1, 4, __pyx_L1_error)
6180
6181 /* "(tree fragment)":3
6182 * def __reduce_cython__(self):
6183 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6184 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6185 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6186*/
6187
6188 /* function exit code */
6189 __pyx_L1_error:;
6190 __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6191 __pyx_r = NULL;
6192 __Pyx_XGIVEREF(__pyx_r);
6193 __Pyx_RefNannyFinishContext();
6194 return __pyx_r;
6195}
6196
6197/* "View.MemoryView":264
6198 * pass
6199 *
6200 * @cname("__pyx_array_allocate_buffer") # <<<<<<<<<<<<<<
6201 * cdef int _allocate_buffer(array self) except -1:
6202 *
6203*/
6204
6205static int __pyx_array_allocate_buffer(struct __pyx_array_obj *__pyx_v_self) {
6206 Py_ssize_t __pyx_v_i;
6207 PyObject **__pyx_v_p;
6208 int __pyx_r;
6209 int __pyx_t_1;
6210 Py_ssize_t __pyx_t_2;
6211 Py_ssize_t __pyx_t_3;
6212 Py_ssize_t __pyx_t_4;
6213 int __pyx_lineno = 0;
6214 const char *__pyx_filename = NULL;
6215 int __pyx_clineno = 0;
6216
6217 /* "View.MemoryView":271
6218 * cdef PyObject **p
6219 *
6220 * self.free_data = True # <<<<<<<<<<<<<<
6221 * self.data = <char *>malloc(<size_t> self.len)
6222 * if not self.data:
6223*/
6224 __pyx_v_self->free_data = 1;
6225
6226 /* "View.MemoryView":272
6227 *
6228 * self.free_data = True
6229 * self.data = <char *>malloc(<size_t> self.len) # <<<<<<<<<<<<<<
6230 * if not self.data:
6231 * raise MemoryError, "unable to allocate array data."
6232*/
6233 __pyx_v_self->data = ((char *)malloc(((size_t)__pyx_v_self->len)));
6234
6235 /* "View.MemoryView":273
6236 * self.free_data = True
6237 * self.data = <char *>malloc(<size_t> self.len)
6238 * if not self.data: # <<<<<<<<<<<<<<
6239 * raise MemoryError, "unable to allocate array data."
6240 *
6241*/
6242 __pyx_t_1 = (!(__pyx_v_self->data != 0));
6243
6244 if (unlikely(__pyx_t_1)) {
6245
6246
6247 /* "View.MemoryView":274
6248 * self.data = <char *>malloc(<size_t> self.len)
6249 * if not self.data:
6250 * raise MemoryError, "unable to allocate array data." # <<<<<<<<<<<<<<
6251 *
6252 * if self.dtype_is_object:
6253*/
6254 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_MemoryError))), __pyx_mstate_global->__pyx_kp_u_unable_to_allocate_array_data, 0, 0);
6255 __PYX_ERR(1, 274, __pyx_L1_error)
6256
6257 /* "View.MemoryView":273
6258 * self.free_data = True
6259 * self.data = <char *>malloc(<size_t> self.len)
6260 * if not self.data: # <<<<<<<<<<<<<<
6261 * raise MemoryError, "unable to allocate array data."
6262 *
6263*/
6264 }
6265
6266 /* "View.MemoryView":276
6267 * raise MemoryError, "unable to allocate array data."
6268 *
6269 * if self.dtype_is_object: # <<<<<<<<<<<<<<
6270 * p = <PyObject **> self.data
6271 * for i in range(self.len // self.itemsize):
6272*/
6273 if (__pyx_v_self->dtype_is_object) {
6274
6275 /* "View.MemoryView":277
6276 *
6277 * if self.dtype_is_object:
6278 * p = <PyObject **> self.data # <<<<<<<<<<<<<<
6279 * for i in range(self.len // self.itemsize):
6280 * p[i] = Py_None
6281*/
6282 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
6283
6284 /* "View.MemoryView":278
6285 * if self.dtype_is_object:
6286 * p = <PyObject **> self.data
6287 * for i in range(self.len // self.itemsize): # <<<<<<<<<<<<<<
6288 * p[i] = Py_None
6289 * Py_INCREF(Py_None)
6290*/
6291 if (unlikely(__pyx_v_self->itemsize == 0)) {
6292 PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
6293 __PYX_ERR(1, 278, __pyx_L1_error)
6294 }
6295 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))) {
6296 PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
6297 __PYX_ERR(1, 278, __pyx_L1_error)
6298 }
6299
6300 __pyx_t_2 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_self->itemsize, 0);
6301 __pyx_t_3 = __pyx_t_2;
6302
6303 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
6304 __pyx_v_i = __pyx_t_4;
6305
6306 /* "View.MemoryView":279
6307 * p = <PyObject **> self.data
6308 * for i in range(self.len // self.itemsize):
6309 * p[i] = Py_None # <<<<<<<<<<<<<<
6310 * Py_INCREF(Py_None)
6311 * return 0
6312*/
6313 (__pyx_v_p[__pyx_v_i]) = Py_None;
6314
6315 /* "View.MemoryView":280
6316 * for i in range(self.len // self.itemsize):
6317 * p[i] = Py_None
6318 * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
6319 * return 0
6320 *
6321*/
6322 Py_INCREF(Py_None);
6323 }
6324
6325
6326 /* "View.MemoryView":276
6327 * raise MemoryError, "unable to allocate array data."
6328 *
6329 * if self.dtype_is_object: # <<<<<<<<<<<<<<
6330 * p = <PyObject **> self.data
6331 * for i in range(self.len // self.itemsize):
6332*/
6333 }
6334
6335 /* "View.MemoryView":281
6336 * p[i] = Py_None
6337 * Py_INCREF(Py_None)
6338 * return 0 # <<<<<<<<<<<<<<
6339 *
6340 *
6341*/
6342 {
6343
6344 __pyx_r = 0;
6345 }
6346 goto __pyx_L0;
6347
6348 /* "View.MemoryView":264
6349 * pass
6350 *
6351 * @cname("__pyx_array_allocate_buffer") # <<<<<<<<<<<<<<
6352 * cdef int _allocate_buffer(array self) except -1:
6353 *
6354*/
6355
6356 /* function exit code */
6357 __pyx_L1_error:;
6358 __Pyx_AddTraceback("View.MemoryView._allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
6359 __pyx_r = -1;
6360 __pyx_L0:;
6361
6362
6363
6364 return __pyx_r;
6365}
6366
6367/* "View.MemoryView":284
6368 *
6369 *
6370 * @cname("__pyx_array_new") # <<<<<<<<<<<<<<
6371 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
6372 * cdef array result
6373*/
6374
6375static 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) {
6376 struct __pyx_array_obj *__pyx_v_result = 0;
6377 PyObject *__pyx_v_mode = 0;
6378 struct __pyx_array_obj *__pyx_r = NULL;
6379 __Pyx_RefNannyDeclarations
6380 PyObject *__pyx_t_1 = NULL;
6381 int __pyx_t_2;
6382 PyObject *__pyx_t_3 = NULL;
6383 PyObject *__pyx_t_4 = NULL;
6384 int __pyx_lineno = 0;
6385 const char *__pyx_filename = NULL;
6386 int __pyx_clineno = 0;
6387 __Pyx_RefNannySetupContext("array_cwrapper", 0);
6388
6389 /* "View.MemoryView":287
6390 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
6391 * cdef array result
6392 * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string. # <<<<<<<<<<<<<<
6393 *
6394 * if buf is NULL:
6395*/
6396 __pyx_t_2 = ((__pyx_v_c_mode[0]) == 'f');
6397
6398 if (__pyx_t_2) {
6399 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_fortran);
6400 __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_fortran;
6401 } else {
6402 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_c);
6403 __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_c;
6404 }
6405
6406 __pyx_v_mode = ((PyObject*)__pyx_t_1);
6407 __pyx_t_1 = 0;
6408
6409 /* "View.MemoryView":289
6410 * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
6411 *
6412 * if buf is NULL: # <<<<<<<<<<<<<<
6413 * result = array.__new__(array, shape, itemsize, format, mode)
6414 * else:
6415*/
6416 __pyx_t_2 = (__pyx_v_buf == NULL);
6417
6418 if (__pyx_t_2) {
6419
6420
6421 /* "View.MemoryView":290
6422 *
6423 * if buf is NULL:
6424 * result = array.__new__(array, shape, itemsize, format, mode) # <<<<<<<<<<<<<<
6425 * else:
6426 * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
6427*/
6428 __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 290, __pyx_L1_error)
6429 __Pyx_GOTREF(__pyx_t_1);
6430 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 290, __pyx_L1_error)
6431 __Pyx_GOTREF(__pyx_t_3);
6432 __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 290, __pyx_L1_error)
6433 __Pyx_GOTREF(__pyx_t_4);
6434 __Pyx_INCREF(__pyx_v_shape);
6435 __Pyx_GIVEREF(__pyx_v_shape);
6436 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6437 __Pyx_GIVEREF(__pyx_t_1);
6438 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6439 __Pyx_GIVEREF(__pyx_t_3);
6440 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6441 __Pyx_INCREF(__pyx_v_mode);
6442 __Pyx_GIVEREF(__pyx_v_mode);
6443 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_mode) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6444 __pyx_t_1 = 0;
6445 __pyx_t_3 = 0;
6446 __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)
6447 __Pyx_GOTREF(__pyx_t_3);
6448 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6449 __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
6450 __pyx_t_3 = 0;
6451
6452 /* "View.MemoryView":289
6453 * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
6454 *
6455 * if buf is NULL: # <<<<<<<<<<<<<<
6456 * result = array.__new__(array, shape, itemsize, format, mode)
6457 * else:
6458*/
6459 goto __pyx_L3;
6460 }
6461
6462 /* "View.MemoryView":292
6463 * result = array.__new__(array, shape, itemsize, format, mode)
6464 * else:
6465 * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False) # <<<<<<<<<<<<<<
6466 * result.data = buf
6467 *
6468*/
6469 /*else*/ {
6470 __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 292, __pyx_L1_error)
6471 __Pyx_GOTREF(__pyx_t_3);
6472 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 292, __pyx_L1_error)
6473 __Pyx_GOTREF(__pyx_t_4);
6474 __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
6475 __Pyx_GOTREF(__pyx_t_1);
6476 __Pyx_INCREF(__pyx_v_shape);
6477 __Pyx_GIVEREF(__pyx_v_shape);
6478 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_shape) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6479 __Pyx_GIVEREF(__pyx_t_3);
6480 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6481 __Pyx_GIVEREF(__pyx_t_4);
6482 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6483 __Pyx_INCREF(__pyx_v_mode);
6484 __Pyx_GIVEREF(__pyx_v_mode);
6485 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_mode) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6486 __pyx_t_3 = 0;
6487 __pyx_t_4 = 0;
6488 __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 292, __pyx_L1_error)
6489 __Pyx_GOTREF(__pyx_t_4);
6490 if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_allocate_buffer, Py_False) < (0)) __PYX_ERR(1, 292, __pyx_L1_error)
6491 __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)
6492 __Pyx_GOTREF(__pyx_t_3);
6493 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6494 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6495 __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
6496 __pyx_t_3 = 0;
6497
6498 /* "View.MemoryView":293
6499 * else:
6500 * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
6501 * result.data = buf # <<<<<<<<<<<<<<
6502 *
6503 * return result
6504*/
6505 __pyx_v_result->data = __pyx_v_buf;
6506 }
6507 __pyx_L3:;
6508
6509 /* "View.MemoryView":295
6510 * result.data = buf
6511 *
6512 * return result # <<<<<<<<<<<<<<
6513 *
6514 *
6515*/
6516 {
6517 struct __pyx_array_obj *__pyx_temp;
6518 {
6519 __pyx_temp = __pyx_r;
6520 __Pyx_INCREF((PyObject *)__pyx_v_result);
6521 __pyx_r = __pyx_v_result;
6522 }
6523 __Pyx_XDECREF((PyObject *)__pyx_temp);
6524 }
6525 goto __pyx_L0;
6526
6527 /* "View.MemoryView":284
6528 *
6529 *
6530 * @cname("__pyx_array_new") # <<<<<<<<<<<<<<
6531 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
6532 * cdef array result
6533*/
6534
6535 /* function exit code */
6536 __pyx_L1_error:;
6537 __Pyx_XDECREF(__pyx_t_1);
6538 __Pyx_XDECREF(__pyx_t_3);
6539 __Pyx_XDECREF(__pyx_t_4);
6540 __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
6541 __pyx_r = 0;
6542 __pyx_L0:;
6543 __Pyx_XDECREF((PyObject *)__pyx_v_result);
6544 __Pyx_XDECREF(__pyx_v_mode);
6545 __Pyx_XGIVEREF((PyObject *)__pyx_r);
6546 __Pyx_RefNannyFinishContext();
6547 return __pyx_r;
6548}
6549
6550/* "View.MemoryView":321
6551 * cdef class Enum(object):
6552 * cdef object name
6553 * def __init__(self, name): # <<<<<<<<<<<<<<
6554 * self.name = name
6555 * def __repr__(self):
6556*/
6557
6558/* Python wrapper */
6559static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self,
6560#if CYTHON_VECTORCALL_TPNEW
6561PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6562#else
6563PyObject *__pyx_args, PyObject *__pyx_kwds
6564#endif
6565); /*proto*/
6566static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self,
6567#if CYTHON_VECTORCALL_TPNEW
6568PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6569#else
6570PyObject *__pyx_args, PyObject *__pyx_kwds
6571#endif
6572) {
6573 PyObject *__pyx_v_name = 0;
6574 #if !CYTHON_VECTORCALL_TPNEW
6575 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6576 #endif
6577 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6578 PyObject* values[1] = {0};
6579 int __pyx_lineno = 0;
6580 const char *__pyx_filename = NULL;
6581 int __pyx_clineno = 0;
6582 int __pyx_r;
6583 __Pyx_RefNannyDeclarations
6584 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
6585 #if !CYTHON_VECTORCALL_TPNEW
6586 #if CYTHON_ASSUME_SAFE_SIZE
6587 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6588 #else
6589 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
6590 #endif
6591 #endif
6592 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
6593 {
6594 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
6595 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
6596 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 321, __pyx_L3_error)
6597 if (__pyx_kwds_len > 0) {
6598 switch (__pyx_nargs) {
6599 case 1:
6600 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
6601 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 321, __pyx_L3_error)
6602 CYTHON_FALLTHROUGH;
6603 case 0: break;
6604 default: goto __pyx_L5_argtuple_error;
6605 }
6606 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6607 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)
6608 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
6609 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, i); __PYX_ERR(1, 321, __pyx_L3_error) }
6610 }
6611 } else if (unlikely(__pyx_nargs != 1)) {
6612 goto __pyx_L5_argtuple_error;
6613 } else {
6614 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
6615 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 321, __pyx_L3_error)
6616 }
6617 __pyx_v_name = values[0];
6618 }
6619 goto __pyx_L6_skip;
6620 __pyx_L5_argtuple_error:;
6621 __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 321, __pyx_L3_error)
6622 __pyx_L6_skip:;
6623 goto __pyx_L4_argument_unpacking_done;
6624 __pyx_L3_error:;
6625 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6626 Py_XDECREF(values[__pyx_temp]);
6627 }
6628 __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6629 __Pyx_RefNannyFinishContext();
6630 return -1;
6631 __pyx_L4_argument_unpacking_done:;
6632 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
6633
6634 /* function exit code */
6635 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6636 Py_XDECREF(values[__pyx_temp]);
6637 }
6638 __Pyx_RefNannyFinishContext();
6639 return __pyx_r;
6640}
6641
6642static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
6643 int __pyx_r;
6644 __Pyx_RefNannyDeclarations
6645 __Pyx_RefNannySetupContext("__init__", 0);
6646
6647 /* "View.MemoryView":322
6648 * cdef object name
6649 * def __init__(self, name):
6650 * self.name = name # <<<<<<<<<<<<<<
6651 * def __repr__(self):
6652 * return self.name
6653*/
6654 __Pyx_INCREF(__pyx_v_name);
6655 __Pyx_GIVEREF(__pyx_v_name);
6656 __Pyx_GOTREF(__pyx_v_self->name);
6657 __Pyx_DECREF(__pyx_v_self->name);
6658 __pyx_v_self->name = __pyx_v_name;
6659
6660 /* "View.MemoryView":321
6661 * cdef class Enum(object):
6662 * cdef object name
6663 * def __init__(self, name): # <<<<<<<<<<<<<<
6664 * self.name = name
6665 * def __repr__(self):
6666*/
6667
6668 /* function exit code */
6669 __pyx_r = 0;
6670
6671 __Pyx_RefNannyFinishContext();
6672 return __pyx_r;
6673}
6674
6675/* "View.MemoryView":323
6676 * def __init__(self, name):
6677 * self.name = name
6678 * def __repr__(self): # <<<<<<<<<<<<<<
6679 * return self.name
6680 *
6681*/
6682
6683/* Python wrapper */
6684static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
6685static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
6686 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6687 PyObject *__pyx_r = 0;
6688 __Pyx_RefNannyDeclarations
6689 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
6690 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6691 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
6692
6693 /* function exit code */
6694 __Pyx_RefNannyFinishContext();
6695 return __pyx_r;
6696}
6697
6698static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
6699 PyObject *__pyx_r = NULL;
6700 __Pyx_RefNannyDeclarations
6701 __Pyx_RefNannySetupContext("__repr__", 0);
6702
6703 /* "View.MemoryView":324
6704 * self.name = name
6705 * def __repr__(self):
6706 * return self.name # <<<<<<<<<<<<<<
6707 *
6708 * cdef generic = Enum("<strided and direct or indirect>")
6709*/
6710 {
6711 PyObject *__pyx_temp;
6712 {
6713 __pyx_temp = __pyx_r;
6714 __Pyx_INCREF(__pyx_v_self->name);
6715 __pyx_r = __pyx_v_self->name;
6716 }
6717 __Pyx_XDECREF(__pyx_temp);
6718 }
6719 goto __pyx_L0;
6720
6721 /* "View.MemoryView":323
6722 * def __init__(self, name):
6723 * self.name = name
6724 * def __repr__(self): # <<<<<<<<<<<<<<
6725 * return self.name
6726 *
6727*/
6728
6729 /* function exit code */
6730 __pyx_L0:;
6731 __Pyx_XGIVEREF(__pyx_r);
6732 __Pyx_RefNannyFinishContext();
6733 return __pyx_r;
6734}
6735
6736/* "(tree fragment)":1
6737 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6738 * cdef tuple state
6739 * cdef object _dict
6740*/
6741
6742/* Python wrapper */
6743static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
6744#if CYTHON_VECTORCALL
6745PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6746#else
6747PyObject *__pyx_args, PyObject *__pyx_kwds
6748#endif
6749); /*proto*/
6750static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
6751#if CYTHON_VECTORCALL
6752PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6753#else
6754PyObject *__pyx_args, PyObject *__pyx_kwds
6755#endif
6756) {
6757 #if !CYTHON_VECTORCALL
6758 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6759 #endif
6760 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6761 PyObject *__pyx_r = 0;
6762 __Pyx_RefNannyDeclarations
6763 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6764 #if !CYTHON_VECTORCALL
6765 #if CYTHON_ASSUME_SAFE_SIZE
6766 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6767 #else
6768 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6769 #endif
6770 #endif
6771 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6772 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
6773 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6774 if (unlikely(__pyx_kwds_len < 0)) return NULL;
6775 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
6776 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
6777
6778 /* function exit code */
6779 __Pyx_RefNannyFinishContext();
6780 return __pyx_r;
6781}
6782
6783static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
6784 PyObject *__pyx_v_state = 0;
6785 PyObject *__pyx_v__dict = 0;
6786 int __pyx_v_use_setstate;
6787 PyObject *__pyx_r = NULL;
6788 __Pyx_RefNannyDeclarations
6789 PyObject *__pyx_t_1 = NULL;
6790 PyObject *__pyx_t_2 = NULL;
6791 int __pyx_t_3;
6792 int __pyx_t_4;
6793 PyObject *__pyx_t_5 = NULL;
6794 int __pyx_lineno = 0;
6795 const char *__pyx_filename = NULL;
6796 int __pyx_clineno = 0;
6797 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
6798
6799 /* "(tree fragment)":5
6800 * cdef object _dict
6801 * cdef bint use_setstate
6802 * with CRITICAL_SECTION(self): # <<<<<<<<<<<<<<
6803 * state = (self.name,)
6804 * _dict = getattr(self, '__dict__', None)
6805*/
6806 {
6807 __Pyx_PyCriticalSection __pyx_cs;
6808 __pyx_t_1 = ((PyObject *)__pyx_v_self);
6809 __Pyx_INCREF(__pyx_t_1);
6810 __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
6811 /*try:*/ {
6812
6813 /* "(tree fragment)":6
6814 * cdef bint use_setstate
6815 * with CRITICAL_SECTION(self):
6816 * state = (self.name,) # <<<<<<<<<<<<<<
6817 * _dict = getattr(self, '__dict__', None)
6818 * if _dict is not None and _dict:
6819*/
6820 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L4_error)
6821 __Pyx_GOTREF(__pyx_t_2);
6822 __Pyx_INCREF(__pyx_v_self->name);
6823 __Pyx_GIVEREF(__pyx_v_self->name);
6824 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->name) != (0)) __PYX_ERR(1, 6, __pyx_L4_error);
6825 __pyx_v_state = ((PyObject*)__pyx_t_2);
6826 __pyx_t_2 = 0;
6827
6828 /* "(tree fragment)":7
6829 * with CRITICAL_SECTION(self):
6830 * state = (self.name,)
6831 * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
6832 * if _dict is not None and _dict:
6833 * state += (_dict,)
6834*/
6835 __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)
6836 __Pyx_GOTREF(__pyx_t_2);
6837 __pyx_v__dict = __pyx_t_2;
6838 __pyx_t_2 = 0;
6839 }
6840
6841 /* "(tree fragment)":5
6842 * cdef object _dict
6843 * cdef bint use_setstate
6844 * with CRITICAL_SECTION(self): # <<<<<<<<<<<<<<
6845 * state = (self.name,)
6846 * _dict = getattr(self, '__dict__', None)
6847*/
6848 /*finally:*/ {
6849 /*normal exit:*/{
6850 __Pyx_PyCriticalSection_End(&__pyx_cs);
6851 goto __pyx_L5;
6852 }
6853 __pyx_L4_error: {
6854 __Pyx_PyCriticalSection_End(&__pyx_cs);
6855 goto __pyx_L1_error;
6856 }
6857 __pyx_L5:;
6858 }
6859 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6860 }
6861
6862 /* "(tree fragment)":8
6863 * state = (self.name,)
6864 * _dict = getattr(self, '__dict__', None)
6865 * if _dict is not None and _dict: # <<<<<<<<<<<<<<
6866 * state += (_dict,)
6867 * use_setstate = True
6868*/
6869 __pyx_t_4 = (__pyx_v__dict != Py_None);
6870 if (__pyx_t_4) {
6871
6872 } else {
6873
6874 __pyx_t_3 = __pyx_t_4;
6875
6876 goto __pyx_L7_bool_binop_done;
6877 }
6878 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 8, __pyx_L1_error)
6879
6880 __pyx_t_3 = __pyx_t_4;
6881
6882 __pyx_L7_bool_binop_done:;
6883 if (__pyx_t_3) {
6884
6885
6886 /* "(tree fragment)":9
6887 * _dict = getattr(self, '__dict__', None)
6888 * if _dict is not None and _dict:
6889 * state += (_dict,) # <<<<<<<<<<<<<<
6890 * use_setstate = True
6891 * else:
6892*/
6893 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
6894 __Pyx_GOTREF(__pyx_t_1);
6895 __Pyx_INCREF(__pyx_v__dict);
6896 __Pyx_GIVEREF(__pyx_v__dict);
6897 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 9, __pyx_L1_error);
6898 __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
6899 __Pyx_GOTREF(__pyx_t_2);
6900 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6901 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
6902 __pyx_t_2 = 0;
6903
6904 /* "(tree fragment)":10
6905 * if _dict is not None and _dict:
6906 * state += (_dict,)
6907 * use_setstate = True # <<<<<<<<<<<<<<
6908 * else:
6909 * use_setstate = self.name is not None
6910*/
6911 __pyx_v_use_setstate = 1;
6912
6913 /* "(tree fragment)":8
6914 * state = (self.name,)
6915 * _dict = getattr(self, '__dict__', None)
6916 * if _dict is not None and _dict: # <<<<<<<<<<<<<<
6917 * state += (_dict,)
6918 * use_setstate = True
6919*/
6920 goto __pyx_L6;
6921 }
6922
6923 /* "(tree fragment)":12
6924 * use_setstate = True
6925 * else:
6926 * use_setstate = self.name is not None # <<<<<<<<<<<<<<
6927 * if use_setstate:
6928 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
6929*/
6930 /*else*/ {
6931 __pyx_t_3 = (__pyx_v_self->name != Py_None);
6932 __pyx_v_use_setstate = __pyx_t_3;
6933 }
6934 __pyx_L6:;
6935
6936 /* "(tree fragment)":13
6937 * else:
6938 * use_setstate = self.name is not None
6939 * if use_setstate: # <<<<<<<<<<<<<<
6940 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
6941 * else:
6942*/
6943 if (__pyx_v_use_setstate) {
6944
6945 /* "(tree fragment)":14
6946 * use_setstate = self.name is not None
6947 * if use_setstate:
6948 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state # <<<<<<<<<<<<<<
6949 * else:
6950 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
6951*/
6952 __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)
6953 __Pyx_GOTREF(__pyx_t_2);
6954 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
6955 __Pyx_GOTREF(__pyx_t_1);
6956 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6957 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6958 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
6959 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_136983863);
6960 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_136983863);
6961 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_136983863) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
6962 __Pyx_INCREF(Py_None);
6963 __Pyx_GIVEREF(Py_None);
6964 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
6965 __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
6966 __Pyx_GOTREF(__pyx_t_5);
6967 __Pyx_GIVEREF(__pyx_t_2);
6968 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
6969 __Pyx_GIVEREF(__pyx_t_1);
6970 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
6971 __Pyx_INCREF(__pyx_v_state);
6972 __Pyx_GIVEREF(__pyx_v_state);
6973 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
6974 __pyx_t_2 = 0;
6975 __pyx_t_1 = 0;
6976 {
6977 PyObject *__pyx_temp;
6978 {
6979 __pyx_temp = __pyx_r;
6980 __pyx_r = __pyx_t_5;
6981 }
6982 __Pyx_XDECREF(__pyx_temp);
6983 }
6984 __pyx_t_5 = 0;
6985 goto __pyx_L0;
6986
6987 /* "(tree fragment)":13
6988 * else:
6989 * use_setstate = self.name is not None
6990 * if use_setstate: # <<<<<<<<<<<<<<
6991 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
6992 * else:
6993*/
6994 }
6995
6996 /* "(tree fragment)":16
6997 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
6998 * else:
6999 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state) # <<<<<<<<<<<<<<
7000 * def __setstate_cython__(self, __pyx_state):
7001 * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7002*/
7003 /*else*/ {
7004 __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)
7005 __Pyx_GOTREF(__pyx_t_5);
7006 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
7007 __Pyx_GOTREF(__pyx_t_1);
7008 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7009 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7010 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7011 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_136983863);
7012 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_136983863);
7013 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_136983863) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7014 __Pyx_INCREF(__pyx_v_state);
7015 __Pyx_GIVEREF(__pyx_v_state);
7016 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7017 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error)
7018 __Pyx_GOTREF(__pyx_t_2);
7019 __Pyx_GIVEREF(__pyx_t_5);
7020 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7021 __Pyx_GIVEREF(__pyx_t_1);
7022 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7023 __pyx_t_5 = 0;
7024 __pyx_t_1 = 0;
7025 {
7026 PyObject *__pyx_temp;
7027 {
7028 __pyx_temp = __pyx_r;
7029 __pyx_r = __pyx_t_2;
7030 }
7031 __Pyx_XDECREF(__pyx_temp);
7032 }
7033 __pyx_t_2 = 0;
7034 goto __pyx_L0;
7035 }
7036
7037 /* "(tree fragment)":1
7038 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7039 * cdef tuple state
7040 * cdef object _dict
7041*/
7042
7043 /* function exit code */
7044 __pyx_L1_error:;
7045 __Pyx_XDECREF(__pyx_t_1);
7046 __Pyx_XDECREF(__pyx_t_2);
7047 __Pyx_XDECREF(__pyx_t_5);
7048 __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7049 __pyx_r = NULL;
7050 __pyx_L0:;
7051 __Pyx_XDECREF(__pyx_v_state);
7052 __Pyx_XDECREF(__pyx_v__dict);
7053
7054 __Pyx_XGIVEREF(__pyx_r);
7055 __Pyx_RefNannyFinishContext();
7056 return __pyx_r;
7057}
7058
7059/* "(tree fragment)":17
7060 * else:
7061 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7062 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7063 * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7064*/
7065
7066/* Python wrapper */
7067static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
7068#if CYTHON_VECTORCALL
7069PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7070#else
7071PyObject *__pyx_args, PyObject *__pyx_kwds
7072#endif
7073); /*proto*/
7074static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
7075#if CYTHON_VECTORCALL
7076PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7077#else
7078PyObject *__pyx_args, PyObject *__pyx_kwds
7079#endif
7080) {
7081 PyObject *__pyx_v___pyx_state = 0;
7082 #if !CYTHON_VECTORCALL
7083 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7084 #endif
7085 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7086 PyObject* values[1] = {0};
7087 int __pyx_lineno = 0;
7088 const char *__pyx_filename = NULL;
7089 int __pyx_clineno = 0;
7090 PyObject *__pyx_r = 0;
7091 __Pyx_RefNannyDeclarations
7092 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
7093 #if !CYTHON_VECTORCALL
7094 #if CYTHON_ASSUME_SAFE_SIZE
7095 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7096 #else
7097 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7098 #endif
7099 #endif
7100 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7101 {
7102 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
7103 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
7104 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 17, __pyx_L3_error)
7105 if (__pyx_kwds_len > 0) {
7106 switch (__pyx_nargs) {
7107 case 1:
7108 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
7109 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 17, __pyx_L3_error)
7110 CYTHON_FALLTHROUGH;
7111 case 0: break;
7112 default: goto __pyx_L5_argtuple_error;
7113 }
7114 const Py_ssize_t kwd_pos_args = __pyx_nargs;
7115 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)
7116 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
7117 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 17, __pyx_L3_error) }
7118 }
7119 } else if (unlikely(__pyx_nargs != 1)) {
7120 goto __pyx_L5_argtuple_error;
7121 } else {
7122 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
7123 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 17, __pyx_L3_error)
7124 }
7125 __pyx_v___pyx_state = values[0];
7126 }
7127 goto __pyx_L6_skip;
7128 __pyx_L5_argtuple_error:;
7129 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 17, __pyx_L3_error)
7130 __pyx_L6_skip:;
7131 goto __pyx_L4_argument_unpacking_done;
7132 __pyx_L3_error:;
7133 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7134 Py_XDECREF(values[__pyx_temp]);
7135 }
7136 __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7137 __Pyx_RefNannyFinishContext();
7138 return NULL;
7139 __pyx_L4_argument_unpacking_done:;
7140 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v___pyx_state);
7141
7142 /* function exit code */
7143 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7144 Py_XDECREF(values[__pyx_temp]);
7145 }
7146 __Pyx_RefNannyFinishContext();
7147 return __pyx_r;
7148}
7149
7150static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7151 PyObject *__pyx_r = NULL;
7152 __Pyx_RefNannyDeclarations
7153 PyObject *__pyx_t_1 = NULL;
7154 PyObject *__pyx_t_2 = NULL;
7155 int __pyx_lineno = 0;
7156 const char *__pyx_filename = NULL;
7157 int __pyx_clineno = 0;
7158 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
7159
7160 /* "(tree fragment)":18
7161 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7162 * def __setstate_cython__(self, __pyx_state):
7163 * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
7164*/
7165 __pyx_t_1 = __pyx_v___pyx_state;
7166 __Pyx_INCREF(__pyx_t_1);
7167 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)
7168 if (unlikely(__pyx_t_1 == Py_None)) {
7169 PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
7170 __PYX_ERR(1, 18, __pyx_L1_error)
7171 }
7172 __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)
7173 __Pyx_GOTREF(__pyx_t_2);
7174 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7175 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7176
7177 /* "(tree fragment)":17
7178 * else:
7179 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7180 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7181 * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7182*/
7183
7184 /* function exit code */
7185 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7186 goto __pyx_L0;
7187 __pyx_L1_error:;
7188 __Pyx_XDECREF(__pyx_t_1);
7189 __Pyx_XDECREF(__pyx_t_2);
7190 __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7191 __pyx_r = NULL;
7192 __pyx_L0:;
7193 __Pyx_XGIVEREF(__pyx_r);
7194 __Pyx_RefNannyFinishContext();
7195 return __pyx_r;
7196}
7197
7198/* "View.MemoryView":367
7199 * cdef const __Pyx_TypeInfo *typeinfo
7200 *
7201 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
7202 * self.obj = obj
7203 * self.flags = flags
7204*/
7205
7206/* Python wrapper */
7207static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self,
7208#if CYTHON_VECTORCALL_TPNEW
7209PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7210#else
7211PyObject *__pyx_args, PyObject *__pyx_kwds
7212#endif
7213); /*proto*/
7214static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self,
7215#if CYTHON_VECTORCALL_TPNEW
7216PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7217#else
7218PyObject *__pyx_args, PyObject *__pyx_kwds
7219#endif
7220) {
7221 PyObject *__pyx_v_obj = 0;
7222 int __pyx_v_flags;
7223 int __pyx_v_dtype_is_object;
7224 #if !CYTHON_VECTORCALL_TPNEW
7225 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7226 #endif
7227 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7228 PyObject* values[3] = {0,0,0};
7229 int __pyx_lineno = 0;
7230 const char *__pyx_filename = NULL;
7231 int __pyx_clineno = 0;
7232 int __pyx_r;
7233 __Pyx_RefNannyDeclarations
7234 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
7235 #if !CYTHON_VECTORCALL_TPNEW
7236 #if CYTHON_ASSUME_SAFE_SIZE
7237 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7238 #else
7239 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
7240 #endif
7241 #endif
7242 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
7243 {
7244 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};
7245 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
7246 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 367, __pyx_L3_error)
7247 if (__pyx_kwds_len > 0) {
7248 switch (__pyx_nargs) {
7249 case 3:
7250 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
7251 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 367, __pyx_L3_error)
7252 CYTHON_FALLTHROUGH;
7253 case 2:
7254 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
7255 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 367, __pyx_L3_error)
7256 CYTHON_FALLTHROUGH;
7257 case 1:
7258 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
7259 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 367, __pyx_L3_error)
7260 CYTHON_FALLTHROUGH;
7261 case 0: break;
7262 default: goto __pyx_L5_argtuple_error;
7263 }
7264 const Py_ssize_t kwd_pos_args = __pyx_nargs;
7265 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)
7266 for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
7267 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, i); __PYX_ERR(1, 367, __pyx_L3_error) }
7268 }
7269 } else {
7270 switch (__pyx_nargs) {
7271 case 3:
7272 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
7273 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 367, __pyx_L3_error)
7274 CYTHON_FALLTHROUGH;
7275 case 2:
7276 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
7277 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 367, __pyx_L3_error)
7278 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
7279 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 367, __pyx_L3_error)
7280 break;
7281 default: goto __pyx_L5_argtuple_error;
7282 }
7283 }
7284 __pyx_v_obj = values[0];
7285 __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)
7286 if (values[2]) {
7287 __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)
7288 } else {
7289 __pyx_v_dtype_is_object = ((int)0);
7290 }
7291 }
7292 goto __pyx_L6_skip;
7293 __pyx_L5_argtuple_error:;
7294 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 367, __pyx_L3_error)
7295 __pyx_L6_skip:;
7296 goto __pyx_L4_argument_unpacking_done;
7297 __pyx_L3_error:;
7298 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7299 Py_XDECREF(values[__pyx_temp]);
7300 }
7301 __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7302 __Pyx_RefNannyFinishContext();
7303 return -1;
7304 __pyx_L4_argument_unpacking_done:;
7305 __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);
7306
7307 /* function exit code */
7308 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7309 Py_XDECREF(values[__pyx_temp]);
7310 }
7311
7312
7313 __Pyx_RefNannyFinishContext();
7314 return __pyx_r;
7315}
7316
7317static 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) {
7318 int __pyx_r;
7319 __Pyx_RefNannyDeclarations
7320 int __pyx_t_1;
7321 int __pyx_t_2;
7322 int __pyx_t_3;
7323 int __pyx_lineno = 0;
7324 const char *__pyx_filename = NULL;
7325 int __pyx_clineno = 0;
7326 __Pyx_RefNannySetupContext("__cinit__", 0);
7327
7328 /* "View.MemoryView":368
7329 *
7330 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
7331 * self.obj = obj # <<<<<<<<<<<<<<
7332 * self.flags = flags
7333 * if type(self) is memoryview or obj is not None:
7334*/
7335 __Pyx_INCREF(__pyx_v_obj);
7336 __Pyx_GIVEREF(__pyx_v_obj);
7337 __Pyx_GOTREF(__pyx_v_self->obj);
7338 __Pyx_DECREF(__pyx_v_self->obj);
7339 __pyx_v_self->obj = __pyx_v_obj;
7340
7341 /* "View.MemoryView":369
7342 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
7343 * self.obj = obj
7344 * self.flags = flags # <<<<<<<<<<<<<<
7345 * if type(self) is memoryview or obj is not None:
7346 * PyObject_GetBuffer(obj, &self.view, flags)
7347*/
7348 __pyx_v_self->flags = __pyx_v_flags;
7349
7350 /* "View.MemoryView":370
7351 * self.obj = obj
7352 * self.flags = flags
7353 * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
7354 * PyObject_GetBuffer(obj, &self.view, flags)
7355 * if <PyObject *> self.view.obj == NULL:
7356*/
7357 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_mstate_global->__pyx_memoryview_type));
7358 if (!__pyx_t_2) {
7359
7360 } else {
7361
7362 __pyx_t_1 = __pyx_t_2;
7363
7364 goto __pyx_L4_bool_binop_done;
7365 }
7366 __pyx_t_2 = (__pyx_v_obj != Py_None);
7367
7368 __pyx_t_1 = __pyx_t_2;
7369
7370 __pyx_L4_bool_binop_done:;
7371 if (__pyx_t_1) {
7372
7373
7374 /* "View.MemoryView":371
7375 * self.flags = flags
7376 * if type(self) is memoryview or obj is not None:
7377 * PyObject_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
7378 * if <PyObject *> self.view.obj == NULL:
7379 * (<__pyx_buffer *> &self.view).obj = Py_None
7380*/
7381 __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)
7382
7383
7384 /* "View.MemoryView":372
7385 * if type(self) is memoryview or obj is not None:
7386 * PyObject_GetBuffer(obj, &self.view, flags)
7387 * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
7388 * (<__pyx_buffer *> &self.view).obj = Py_None
7389 * Py_INCREF(Py_None)
7390*/
7391 __pyx_t_1 = (((PyObject *)__pyx_v_self->view.obj) == NULL);
7392
7393 if (__pyx_t_1) {
7394
7395
7396 /* "View.MemoryView":373
7397 * PyObject_GetBuffer(obj, &self.view, flags)
7398 * if <PyObject *> self.view.obj == NULL:
7399 * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
7400 * Py_INCREF(Py_None)
7401 *
7402*/
7403 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
7404
7405 /* "View.MemoryView":374
7406 * if <PyObject *> self.view.obj == NULL:
7407 * (<__pyx_buffer *> &self.view).obj = Py_None
7408 * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
7409 *
7410 * if not __PYX_CYTHON_ATOMICS_ENABLED():
7411*/
7412 Py_INCREF(Py_None);
7413
7414 /* "View.MemoryView":372
7415 * if type(self) is memoryview or obj is not None:
7416 * PyObject_GetBuffer(obj, &self.view, flags)
7417 * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
7418 * (<__pyx_buffer *> &self.view).obj = Py_None
7419 * Py_INCREF(Py_None)
7420*/
7421 }
7422
7423 /* "View.MemoryView":370
7424 * self.obj = obj
7425 * self.flags = flags
7426 * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
7427 * PyObject_GetBuffer(obj, &self.view, flags)
7428 * if <PyObject *> self.view.obj == NULL:
7429*/
7430 }
7431
7432 /* "View.MemoryView":376
7433 * Py_INCREF(Py_None)
7434 *
7435 * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
7436 * global __pyx_memoryview_thread_locks_used
7437 * if (__pyx_memoryview_thread_locks_used < 8 and
7438*/
7439 __pyx_t_1 = (!__PYX_CYTHON_ATOMICS_ENABLED());
7440
7441 if (__pyx_t_1) {
7442
7443
7444 /* "View.MemoryView":378
7445 * if not __PYX_CYTHON_ATOMICS_ENABLED():
7446 * global __pyx_memoryview_thread_locks_used
7447 * if (__pyx_memoryview_thread_locks_used < 8 and # <<<<<<<<<<<<<<
7448 *
7449 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
7450*/
7451 __pyx_t_2 = (__pyx_memoryview_thread_locks_used < 8);
7452
7453 if (__pyx_t_2) {
7454
7455 } else {
7456
7457 __pyx_t_1 = __pyx_t_2;
7458
7459 goto __pyx_L9_bool_binop_done;
7460 }
7461
7462 /* "View.MemoryView":380
7463 * if (__pyx_memoryview_thread_locks_used < 8 and
7464 *
7465 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()): # <<<<<<<<<<<<<<
7466 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7467 * __pyx_memoryview_thread_locks_used += 1
7468*/
7469 __pyx_t_2 = (!__PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING());
7470
7471
7472 __pyx_t_1 = __pyx_t_2;
7473
7474 __pyx_L9_bool_binop_done:;
7475
7476 /* "View.MemoryView":378
7477 * if not __PYX_CYTHON_ATOMICS_ENABLED():
7478 * global __pyx_memoryview_thread_locks_used
7479 * if (__pyx_memoryview_thread_locks_used < 8 and # <<<<<<<<<<<<<<
7480 *
7481 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
7482*/
7483 if (__pyx_t_1) {
7484
7485
7486 /* "View.MemoryView":381
7487 *
7488 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
7489 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
7490 * __pyx_memoryview_thread_locks_used += 1
7491 * if self.lock is NULL:
7492*/
7493 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
7494
7495 /* "View.MemoryView":382
7496 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
7497 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7498 * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
7499 * if self.lock is NULL:
7500 * self.lock = PyThread_allocate_lock()
7501*/
7502 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
7503
7504 /* "View.MemoryView":378
7505 * if not __PYX_CYTHON_ATOMICS_ENABLED():
7506 * global __pyx_memoryview_thread_locks_used
7507 * if (__pyx_memoryview_thread_locks_used < 8 and # <<<<<<<<<<<<<<
7508 *
7509 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
7510*/
7511 }
7512
7513 /* "View.MemoryView":383
7514 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7515 * __pyx_memoryview_thread_locks_used += 1
7516 * if self.lock is NULL: # <<<<<<<<<<<<<<
7517 * self.lock = PyThread_allocate_lock()
7518 * if self.lock is NULL:
7519*/
7520 __pyx_t_1 = (__pyx_v_self->lock == NULL);
7521
7522 if (__pyx_t_1) {
7523
7524
7525 /* "View.MemoryView":384
7526 * __pyx_memoryview_thread_locks_used += 1
7527 * if self.lock is NULL:
7528 * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
7529 * if self.lock is NULL:
7530 * raise MemoryError
7531*/
7532 __pyx_v_self->lock = PyThread_allocate_lock();
7533
7534 /* "View.MemoryView":385
7535 * if self.lock is NULL:
7536 * self.lock = PyThread_allocate_lock()
7537 * if self.lock is NULL: # <<<<<<<<<<<<<<
7538 * raise MemoryError
7539 *
7540*/
7541 __pyx_t_1 = (__pyx_v_self->lock == NULL);
7542
7543 if (unlikely(__pyx_t_1)) {
7544
7545
7546 /* "View.MemoryView":386
7547 * self.lock = PyThread_allocate_lock()
7548 * if self.lock is NULL:
7549 * raise MemoryError # <<<<<<<<<<<<<<
7550 *
7551 * if flags & PyBUF_FORMAT:
7552*/
7553 PyErr_NoMemory(); __PYX_ERR(1, 386, __pyx_L1_error)
7554
7555 /* "View.MemoryView":385
7556 * if self.lock is NULL:
7557 * self.lock = PyThread_allocate_lock()
7558 * if self.lock is NULL: # <<<<<<<<<<<<<<
7559 * raise MemoryError
7560 *
7561*/
7562 }
7563
7564 /* "View.MemoryView":383
7565 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7566 * __pyx_memoryview_thread_locks_used += 1
7567 * if self.lock is NULL: # <<<<<<<<<<<<<<
7568 * self.lock = PyThread_allocate_lock()
7569 * if self.lock is NULL:
7570*/
7571 }
7572
7573 /* "View.MemoryView":376
7574 * Py_INCREF(Py_None)
7575 *
7576 * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
7577 * global __pyx_memoryview_thread_locks_used
7578 * if (__pyx_memoryview_thread_locks_used < 8 and
7579*/
7580 }
7581
7582 /* "View.MemoryView":388
7583 * raise MemoryError
7584 *
7585 * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
7586 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
7587 * else:
7588*/
7589 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
7590
7591 if (__pyx_t_1) {
7592
7593
7594 /* "View.MemoryView":389
7595 *
7596 * if flags & PyBUF_FORMAT:
7597 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
7598 * else:
7599 * self.dtype_is_object = dtype_is_object
7600*/
7601 __pyx_t_2 = ((__pyx_v_self->view.format[0]) == 'O');
7602
7603 if (__pyx_t_2) {
7604
7605 } else {
7606
7607 __pyx_t_1 = __pyx_t_2;
7608
7609 goto __pyx_L14_bool_binop_done;
7610 }
7611 __pyx_t_2 = ((__pyx_v_self->view.format[1]) == '\x00');
7612
7613
7614 __pyx_t_1 = __pyx_t_2;
7615
7616 __pyx_L14_bool_binop_done:;
7617 __pyx_v_self->dtype_is_object = __pyx_t_1;
7618
7619 /* "View.MemoryView":388
7620 * raise MemoryError
7621 *
7622 * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
7623 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
7624 * else:
7625*/
7626 goto __pyx_L13;
7627 }
7628
7629 /* "View.MemoryView":391
7630 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
7631 * else:
7632 * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
7633 *
7634 * with cython.cdivision(True):
7635*/
7636 /*else*/ {
7637 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
7638 }
7639 __pyx_L13:;
7640
7641 /* "View.MemoryView":394
7642 *
7643 * with cython.cdivision(True):
7644 * assert <uintptr_t>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0 # <<<<<<<<<<<<<<
7645 * self.typeinfo = NULL
7646 *
7647*/
7648 #ifndef CYTHON_WITHOUT_ASSERTIONS
7649 if (unlikely(__pyx_assertions_enabled())) {
7650 __pyx_t_1 = ((((__pyx_uintptr_t)(&__pyx_v_self->acquisition_count)) % (sizeof(__pyx_atomic_int_type))) == 0);
7651
7652 if (unlikely(!__pyx_t_1)) {
7653 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
7654 __PYX_ERR(1, 394, __pyx_L1_error)
7655 }
7656
7657 }
7658 #else
7659 if ((1)); else __PYX_ERR(1, 394, __pyx_L1_error)
7660 #endif
7661
7662 /* "View.MemoryView":395
7663 * with cython.cdivision(True):
7664 * assert <uintptr_t>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
7665 * self.typeinfo = NULL # <<<<<<<<<<<<<<
7666 *
7667 * def __dealloc__(memoryview self):
7668*/
7669 __pyx_v_self->typeinfo = NULL;
7670
7671 /* "View.MemoryView":367
7672 * cdef const __Pyx_TypeInfo *typeinfo
7673 *
7674 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
7675 * self.obj = obj
7676 * self.flags = flags
7677*/
7678
7679 /* function exit code */
7680 __pyx_r = 0;
7681 goto __pyx_L0;
7682 __pyx_L1_error:;
7683 __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7684 __pyx_r = -1;
7685 __pyx_L0:;
7686
7687 __Pyx_RefNannyFinishContext();
7688 return __pyx_r;
7689}
7690
7691/* "View.MemoryView":397
7692 * self.typeinfo = NULL
7693 *
7694 * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
7695 * if self.obj is not None:
7696 * PyBuffer_Release(&self.view)
7697*/
7698
7699/* Python wrapper */
7700static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
7701static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
7702 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7703 __Pyx_RefNannyDeclarations
7704 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
7705 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7706 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
7707
7708 /* function exit code */
7709 __Pyx_RefNannyFinishContext();
7710}
7711
7712static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
7713 int __pyx_v_i;
7714 int __pyx_t_1;
7715 Py_ssize_t __pyx_t_2;
7716 Py_ssize_t __pyx_t_3;
7717 int __pyx_t_4;
7718 PyThread_type_lock __pyx_t_5;
7719 PyThread_type_lock __pyx_t_6;
7720
7721 /* "View.MemoryView":398
7722 *
7723 * def __dealloc__(memoryview self):
7724 * if self.obj is not None: # <<<<<<<<<<<<<<
7725 * PyBuffer_Release(&self.view)
7726 * elif (<__pyx_buffer *> &self.view).obj == Py_None:
7727*/
7728 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
7729 if (__pyx_t_1) {
7730
7731
7732 /* "View.MemoryView":399
7733 * def __dealloc__(memoryview self):
7734 * if self.obj is not None:
7735 * PyBuffer_Release(&self.view) # <<<<<<<<<<<<<<
7736 * elif (<__pyx_buffer *> &self.view).obj == Py_None:
7737 *
7738*/
7739 PyBuffer_Release((&__pyx_v_self->view));
7740
7741 /* "View.MemoryView":398
7742 *
7743 * def __dealloc__(memoryview self):
7744 * if self.obj is not None: # <<<<<<<<<<<<<<
7745 * PyBuffer_Release(&self.view)
7746 * elif (<__pyx_buffer *> &self.view).obj == Py_None:
7747*/
7748 goto __pyx_L3;
7749 }
7750
7751 /* "View.MemoryView":400
7752 * if self.obj is not None:
7753 * PyBuffer_Release(&self.view)
7754 * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
7755 *
7756 * (<__pyx_buffer *> &self.view).obj = NULL
7757*/
7758 __pyx_t_1 = (((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None);
7759
7760 if (__pyx_t_1) {
7761
7762
7763 /* "View.MemoryView":402
7764 * elif (<__pyx_buffer *> &self.view).obj == Py_None:
7765 *
7766 * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
7767 * Py_DECREF(Py_None)
7768 *
7769*/
7770 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
7771
7772 /* "View.MemoryView":403
7773 *
7774 * (<__pyx_buffer *> &self.view).obj = NULL
7775 * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
7776 *
7777 * cdef int i
7778*/
7779 Py_DECREF(Py_None);
7780
7781 /* "View.MemoryView":400
7782 * if self.obj is not None:
7783 * PyBuffer_Release(&self.view)
7784 * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
7785 *
7786 * (<__pyx_buffer *> &self.view).obj = NULL
7787*/
7788 }
7789 __pyx_L3:;
7790
7791 /* "View.MemoryView":407
7792 * cdef int i
7793 * global __pyx_memoryview_thread_locks_used
7794 * if self.lock != NULL: # <<<<<<<<<<<<<<
7795 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
7796 * if __pyx_memoryview_thread_locks[i] is self.lock:
7797*/
7798 __pyx_t_1 = (__pyx_v_self->lock != NULL);
7799
7800 if (__pyx_t_1) {
7801
7802
7803 /* "View.MemoryView":408
7804 * global __pyx_memoryview_thread_locks_used
7805 * if self.lock != NULL:
7806 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
7807 * if __pyx_memoryview_thread_locks[i] is self.lock:
7808 * __pyx_memoryview_thread_locks_used -= 1
7809*/
7810 __pyx_t_1 = __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING();
7811
7812 if (__pyx_t_1) {
7813
7814 __pyx_t_2 = 0;
7815 } else {
7816
7817 __pyx_t_2 = __pyx_memoryview_thread_locks_used;
7818 }
7819
7820 __pyx_t_3 = __pyx_t_2;
7821
7822 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
7823 __pyx_v_i = __pyx_t_4;
7824
7825 /* "View.MemoryView":409
7826 * if self.lock != NULL:
7827 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
7828 * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
7829 * __pyx_memoryview_thread_locks_used -= 1
7830 * if i != __pyx_memoryview_thread_locks_used:
7831*/
7832 __pyx_t_1 = ((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock);
7833
7834 if (__pyx_t_1) {
7835
7836
7837 /* "View.MemoryView":410
7838 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
7839 * if __pyx_memoryview_thread_locks[i] is self.lock:
7840 * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
7841 * if i != __pyx_memoryview_thread_locks_used:
7842 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
7843*/
7844 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
7845
7846 /* "View.MemoryView":411
7847 * if __pyx_memoryview_thread_locks[i] is self.lock:
7848 * __pyx_memoryview_thread_locks_used -= 1
7849 * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
7850 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
7851 * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
7852*/
7853 __pyx_t_1 = (__pyx_v_i != __pyx_memoryview_thread_locks_used);
7854
7855 if (__pyx_t_1) {
7856
7857
7858 /* "View.MemoryView":413
7859 * if i != __pyx_memoryview_thread_locks_used:
7860 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
7861 * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
7862 * break
7863 * else:
7864*/
7865 __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
7866
7867 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
7868
7869
7870 /* "View.MemoryView":412
7871 * __pyx_memoryview_thread_locks_used -= 1
7872 * if i != __pyx_memoryview_thread_locks_used:
7873 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
7874 * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
7875 * break
7876*/
7877 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
7878
7879 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
7880
7881
7882 /* "View.MemoryView":411
7883 * if __pyx_memoryview_thread_locks[i] is self.lock:
7884 * __pyx_memoryview_thread_locks_used -= 1
7885 * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
7886 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
7887 * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
7888*/
7889 }
7890
7891 /* "View.MemoryView":414
7892 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
7893 * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
7894 * break # <<<<<<<<<<<<<<
7895 * else:
7896 * PyThread_free_lock(self.lock)
7897*/
7898 goto __pyx_L6_break;
7899
7900 /* "View.MemoryView":409
7901 * if self.lock != NULL:
7902 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
7903 * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
7904 * __pyx_memoryview_thread_locks_used -= 1
7905 * if i != __pyx_memoryview_thread_locks_used:
7906*/
7907 }
7908 }
7909 /*else*/ {
7910
7911 /* "View.MemoryView":416
7912 * break
7913 * else:
7914 * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
7915 *
7916 *
7917*/
7918 PyThread_free_lock(__pyx_v_self->lock);
7919 }
7920 __pyx_L6_break:;
7921
7922
7923
7924 /* "View.MemoryView":407
7925 * cdef int i
7926 * global __pyx_memoryview_thread_locks_used
7927 * if self.lock != NULL: # <<<<<<<<<<<<<<
7928 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
7929 * if __pyx_memoryview_thread_locks[i] is self.lock:
7930*/
7931 }
7932
7933 /* "View.MemoryView":397
7934 * self.typeinfo = NULL
7935 *
7936 * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
7937 * if self.obj is not None:
7938 * PyBuffer_Release(&self.view)
7939*/
7940
7941 /* function exit code */
7942
7943
7944}
7945
7946/* "View.MemoryView":419
7947 *
7948 *
7949 * cdef char *get_item_pointer(memoryview self, index: tuple) except NULL: # <<<<<<<<<<<<<<
7950 * cdef Py_ssize_t dim
7951 * cdef char *itemp = <char *> self.view.buf
7952*/
7953
7954static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
7955 Py_ssize_t __pyx_v_dim;
7956 char *__pyx_v_itemp;
7957 PyObject *__pyx_v_idx = NULL;
7958 char *__pyx_r;
7959 __Pyx_RefNannyDeclarations
7960 Py_ssize_t __pyx_t_1;
7961 PyObject *__pyx_t_2 = NULL;
7962 Py_ssize_t __pyx_t_3;
7963 PyObject *__pyx_t_4 = NULL;
7964 Py_ssize_t __pyx_t_5;
7965 char *__pyx_t_6;
7966 int __pyx_lineno = 0;
7967 const char *__pyx_filename = NULL;
7968 int __pyx_clineno = 0;
7969 __Pyx_RefNannySetupContext("get_item_pointer", 0);
7970
7971 /* "View.MemoryView":421
7972 * cdef char *get_item_pointer(memoryview self, index: tuple) except NULL:
7973 * cdef Py_ssize_t dim
7974 * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
7975 *
7976 * for dim, idx in enumerate(index):
7977*/
7978 __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
7979
7980 /* "View.MemoryView":423
7981 * cdef char *itemp = <char *> self.view.buf
7982 *
7983 * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
7984 * itemp = pybuffer_index(&self.view, itemp, idx, dim)
7985 *
7986*/
7987
7988 __pyx_t_1 = 0;
7989 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2);
7990 __pyx_t_3 = 0;
7991 for (;;) {
7992 {
7993 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
7994 #if !CYTHON_ASSUME_SAFE_SIZE
7995 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 423, __pyx_L1_error)
7996 #endif
7997 if (__pyx_t_3 >= __pyx_temp) break;
7998 }
7999 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8000 __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
8001 #else
8002 __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
8003 #endif
8004 ++__pyx_t_3;
8005 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 423, __pyx_L1_error)
8006 __Pyx_GOTREF(__pyx_t_4);
8007 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_4);
8008 __pyx_t_4 = 0;
8009 __pyx_v_dim = __pyx_t_1;
8010 __pyx_t_1 = (__pyx_t_1 + 1);
8011
8012 /* "View.MemoryView":424
8013 *
8014 * for dim, idx in enumerate(index):
8015 * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
8016 *
8017 * return itemp
8018*/
8019 __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)
8020 __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)
8021 __pyx_v_itemp = __pyx_t_6;
8022
8023
8024 /* "View.MemoryView":423
8025 * cdef char *itemp = <char *> self.view.buf
8026 *
8027 * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
8028 * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8029 *
8030*/
8031 }
8032 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8033
8034 /* "View.MemoryView":426
8035 * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8036 *
8037 * return itemp # <<<<<<<<<<<<<<
8038 *
8039 *
8040*/
8041 {
8042
8043 __pyx_r = __pyx_v_itemp;
8044 }
8045 goto __pyx_L0;
8046
8047 /* "View.MemoryView":419
8048 *
8049 *
8050 * cdef char *get_item_pointer(memoryview self, index: tuple) except NULL: # <<<<<<<<<<<<<<
8051 * cdef Py_ssize_t dim
8052 * cdef char *itemp = <char *> self.view.buf
8053*/
8054
8055 /* function exit code */
8056 __pyx_L1_error:;
8057 __Pyx_XDECREF(__pyx_t_2);
8058 __Pyx_XDECREF(__pyx_t_4);
8059 __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
8060 __pyx_r = NULL;
8061 __pyx_L0:;
8062
8063
8064 __Pyx_XDECREF(__pyx_v_idx);
8065
8066 __Pyx_RefNannyFinishContext();
8067 return __pyx_r;
8068}
8069
8070/* "View.MemoryView":429
8071 *
8072 *
8073 * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
8074 * cdef char *buffer
8075 * if self.view.ndim == 1 and isinstance(index, int):
8076*/
8077
8078/* Python wrapper */
8079static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
8080static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
8081 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8082 PyObject *__pyx_r = 0;
8083 __Pyx_RefNannyDeclarations
8084 __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
8085 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8086 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
8087
8088 /* function exit code */
8089 __Pyx_RefNannyFinishContext();
8090 return __pyx_r;
8091}
8092
8093static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8094 char *__pyx_v_buffer;
8095 int __pyx_v_have_slices;
8096 PyObject *__pyx_v_indices = NULL;
8097 char *__pyx_v_itemp;
8098 PyObject *__pyx_r = NULL;
8099 __Pyx_RefNannyDeclarations
8100 int __pyx_t_1;
8101 int __pyx_t_2;
8102 Py_ssize_t __pyx_t_3;
8103 char *__pyx_t_4;
8104 PyObject *__pyx_t_5 = NULL;
8105 PyObject *__pyx_t_6 = NULL;
8106 PyObject *__pyx_t_7 = NULL;
8107 int __pyx_lineno = 0;
8108 const char *__pyx_filename = NULL;
8109 int __pyx_clineno = 0;
8110 __Pyx_RefNannySetupContext("__getitem__", 0);
8111
8112 /* "View.MemoryView":431
8113 * def __getitem__(memoryview self, object index):
8114 * cdef char *buffer
8115 * if self.view.ndim == 1 and isinstance(index, int): # <<<<<<<<<<<<<<
8116 * buffer = <char *> self.view.buf
8117 * return self.convert_item_to_object(
8118*/
8119 __pyx_t_2 = (__pyx_v_self->view.ndim == 1);
8120
8121 if (__pyx_t_2) {
8122
8123 } else {
8124
8125 __pyx_t_1 = __pyx_t_2;
8126
8127 goto __pyx_L4_bool_binop_done;
8128 }
8129 __pyx_t_2 = PyLong_Check(__pyx_v_index);
8130
8131 __pyx_t_1 = __pyx_t_2;
8132
8133 __pyx_L4_bool_binop_done:;
8134 if (__pyx_t_1) {
8135
8136
8137 /* "View.MemoryView":432
8138 * cdef char *buffer
8139 * if self.view.ndim == 1 and isinstance(index, int):
8140 * buffer = <char *> self.view.buf # <<<<<<<<<<<<<<
8141 * return self.convert_item_to_object(
8142 * pybuffer_index(&self.view, buffer, index, 0))
8143*/
8144 __pyx_v_buffer = ((char *)__pyx_v_self->view.buf);
8145
8146 /* "View.MemoryView":434
8147 * buffer = <char *> self.view.buf
8148 * return self.convert_item_to_object(
8149 * pybuffer_index(&self.view, buffer, index, 0)) # <<<<<<<<<<<<<<
8150 *
8151 * if index is Ellipsis:
8152*/
8153 __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)
8154 __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)
8155
8156 /* "View.MemoryView":433
8157 * if self.view.ndim == 1 and isinstance(index, int):
8158 * buffer = <char *> self.view.buf
8159 * return self.convert_item_to_object( # <<<<<<<<<<<<<<
8160 * pybuffer_index(&self.view, buffer, index, 0))
8161 *
8162*/
8163 __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)
8164 __Pyx_GOTREF(__pyx_t_5);
8165
8166
8167 {
8168 PyObject *__pyx_temp;
8169 {
8170 __pyx_temp = __pyx_r;
8171 __pyx_r = __pyx_t_5;
8172 }
8173 __Pyx_XDECREF(__pyx_temp);
8174 }
8175 __pyx_t_5 = 0;
8176 goto __pyx_L0;
8177
8178 /* "View.MemoryView":431
8179 * def __getitem__(memoryview self, object index):
8180 * cdef char *buffer
8181 * if self.view.ndim == 1 and isinstance(index, int): # <<<<<<<<<<<<<<
8182 * buffer = <char *> self.view.buf
8183 * return self.convert_item_to_object(
8184*/
8185 }
8186
8187 /* "View.MemoryView":436
8188 * pybuffer_index(&self.view, buffer, index, 0))
8189 *
8190 * if index is Ellipsis: # <<<<<<<<<<<<<<
8191 * return self
8192 *
8193*/
8194 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
8195 if (__pyx_t_1) {
8196
8197
8198 /* "View.MemoryView":437
8199 *
8200 * if index is Ellipsis:
8201 * return self # <<<<<<<<<<<<<<
8202 *
8203 * have_slices, indices = _unellipsify(index, self.view.ndim)
8204*/
8205 {
8206 PyObject *__pyx_temp;
8207 {
8208 __pyx_temp = __pyx_r;
8209 __Pyx_INCREF((PyObject *)__pyx_v_self);
8210 __pyx_r = ((PyObject *)__pyx_v_self);
8211 }
8212 __Pyx_XDECREF(__pyx_temp);
8213 }
8214 goto __pyx_L0;
8215
8216 /* "View.MemoryView":436
8217 * pybuffer_index(&self.view, buffer, index, 0))
8218 *
8219 * if index is Ellipsis: # <<<<<<<<<<<<<<
8220 * return self
8221 *
8222*/
8223 }
8224
8225 /* "View.MemoryView":439
8226 * return self
8227 *
8228 * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
8229 *
8230 * cdef char *itemp
8231*/
8232 __pyx_t_5 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 439, __pyx_L1_error)
8233 __Pyx_GOTREF(__pyx_t_5);
8234 if (likely(__pyx_t_5 != Py_None)) {
8235 PyObject* sequence = __pyx_t_5;
8236 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
8237 if (unlikely(size != 2)) {
8238 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8239 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8240 __PYX_ERR(1, 439, __pyx_L1_error)
8241 }
8242 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8243 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
8244 __Pyx_INCREF(__pyx_t_6);
8245 __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
8246 __Pyx_INCREF(__pyx_t_7);
8247 #else
8248 __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 439, __pyx_L1_error)
8249 __Pyx_GOTREF(__pyx_t_6);
8250 __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 439, __pyx_L1_error)
8251 __Pyx_GOTREF(__pyx_t_7);
8252 #endif
8253 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8254 } else {
8255 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 439, __pyx_L1_error)
8256 }
8257 __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)
8258 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8259 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)
8260 __pyx_v_have_slices = __pyx_t_1;
8261 __pyx_v_indices = ((PyObject*)__pyx_t_7);
8262 __pyx_t_7 = 0;
8263
8264 /* "View.MemoryView":442
8265 *
8266 * cdef char *itemp
8267 * if have_slices: # <<<<<<<<<<<<<<
8268 * return memview_slice(self, indices)
8269 * else:
8270*/
8271 if (__pyx_v_have_slices) {
8272
8273 /* "View.MemoryView":443
8274 * cdef char *itemp
8275 * if have_slices:
8276 * return memview_slice(self, indices) # <<<<<<<<<<<<<<
8277 * else:
8278 * itemp = memoryview.get_item_pointer(self, <tuple> indices)
8279*/
8280 __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)
8281 __Pyx_GOTREF(__pyx_t_5);
8282 {
8283 PyObject *__pyx_temp;
8284 {
8285 __pyx_temp = __pyx_r;
8286 __pyx_r = __pyx_t_5;
8287 }
8288 __Pyx_XDECREF(__pyx_temp);
8289 }
8290 __pyx_t_5 = 0;
8291 goto __pyx_L0;
8292
8293 /* "View.MemoryView":442
8294 *
8295 * cdef char *itemp
8296 * if have_slices: # <<<<<<<<<<<<<<
8297 * return memview_slice(self, indices)
8298 * else:
8299*/
8300 }
8301
8302 /* "View.MemoryView":445
8303 * return memview_slice(self, indices)
8304 * else:
8305 * itemp = memoryview.get_item_pointer(self, <tuple> indices) # <<<<<<<<<<<<<<
8306 * return self.convert_item_to_object(itemp)
8307 *
8308*/
8309 /*else*/ {
8310 if (unlikely(__pyx_v_indices == Py_None)) {
8311 PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
8312 __PYX_ERR(1, 445, __pyx_L1_error)
8313 }
8314 __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)
8315 __pyx_v_itemp = __pyx_t_4;
8316
8317 /* "View.MemoryView":446
8318 * else:
8319 * itemp = memoryview.get_item_pointer(self, <tuple> indices)
8320 * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
8321 *
8322 * def __setitem__(memoryview self, object index, object value):
8323*/
8324 __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)
8325 __Pyx_GOTREF(__pyx_t_5);
8326 {
8327 PyObject *__pyx_temp;
8328 {
8329 __pyx_temp = __pyx_r;
8330 __pyx_r = __pyx_t_5;
8331 }
8332 __Pyx_XDECREF(__pyx_temp);
8333 }
8334 __pyx_t_5 = 0;
8335 goto __pyx_L0;
8336 }
8337
8338 /* "View.MemoryView":429
8339 *
8340 *
8341 * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
8342 * cdef char *buffer
8343 * if self.view.ndim == 1 and isinstance(index, int):
8344*/
8345
8346 /* function exit code */
8347 __pyx_L1_error:;
8348 __Pyx_XDECREF(__pyx_t_5);
8349 __Pyx_XDECREF(__pyx_t_6);
8350 __Pyx_XDECREF(__pyx_t_7);
8351 __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8352 __pyx_r = NULL;
8353 __pyx_L0:;
8354
8355
8356 __Pyx_XDECREF(__pyx_v_indices);
8357
8358 __Pyx_XGIVEREF(__pyx_r);
8359 __Pyx_RefNannyFinishContext();
8360 return __pyx_r;
8361}
8362
8363/* "View.MemoryView":448
8364 * return self.convert_item_to_object(itemp)
8365 *
8366 * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
8367 * if self.view.readonly:
8368 * raise TypeError, "Cannot assign to read-only memoryview"
8369*/
8370
8371/* Python wrapper */
8372static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
8373static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
8374 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8375 int __pyx_r;
8376 __Pyx_RefNannyDeclarations
8377 __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
8378 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8379 __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));
8380
8381 /* function exit code */
8382 __Pyx_RefNannyFinishContext();
8383 return __pyx_r;
8384}
8385
8386static 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) {
8387 int __pyx_v_have_slices;
8388 PyObject *__pyx_v_indices = NULL;
8389 PyObject *__pyx_v_obj = NULL;
8390 struct __pyx_memoryview_obj *__pyx_v_target_slice = NULL;
8391 int __pyx_r;
8392 __Pyx_RefNannyDeclarations
8393 int __pyx_t_1;
8394 int __pyx_t_2;
8395 PyObject *__pyx_t_3 = NULL;
8396 PyObject *__pyx_t_4 = NULL;
8397 PyObject *__pyx_t_5 = NULL;
8398 int __pyx_lineno = 0;
8399 const char *__pyx_filename = NULL;
8400 int __pyx_clineno = 0;
8401 __Pyx_RefNannySetupContext("__setitem__", 0);
8402
8403 /* "View.MemoryView":449
8404 *
8405 * def __setitem__(memoryview self, object index, object value):
8406 * if self.view.readonly: # <<<<<<<<<<<<<<
8407 * raise TypeError, "Cannot assign to read-only memoryview"
8408 *
8409*/
8410 if (unlikely(__pyx_v_self->view.readonly)) {
8411
8412 /* "View.MemoryView":450
8413 * def __setitem__(memoryview self, object index, object value):
8414 * if self.view.readonly:
8415 * raise TypeError, "Cannot assign to read-only memoryview" # <<<<<<<<<<<<<<
8416 *
8417 * if self.view.ndim == 1 and isinstance(index, int):
8418*/
8419 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_Cannot_assign_to_read_only_memor, 0, 0);
8420 __PYX_ERR(1, 450, __pyx_L1_error)
8421
8422 /* "View.MemoryView":449
8423 *
8424 * def __setitem__(memoryview self, object index, object value):
8425 * if self.view.readonly: # <<<<<<<<<<<<<<
8426 * raise TypeError, "Cannot assign to read-only memoryview"
8427 *
8428*/
8429 }
8430
8431 /* "View.MemoryView":452
8432 * raise TypeError, "Cannot assign to read-only memoryview"
8433 *
8434 * if self.view.ndim == 1 and isinstance(index, int): # <<<<<<<<<<<<<<
8435 * memoryview.setitem_indexed1(self, index, value)
8436 * return
8437*/
8438 __pyx_t_2 = (__pyx_v_self->view.ndim == 1);
8439
8440 if (__pyx_t_2) {
8441
8442 } else {
8443
8444 __pyx_t_1 = __pyx_t_2;
8445
8446 goto __pyx_L5_bool_binop_done;
8447 }
8448 __pyx_t_2 = PyLong_Check(__pyx_v_index);
8449
8450 __pyx_t_1 = __pyx_t_2;
8451
8452 __pyx_L5_bool_binop_done:;
8453 if (__pyx_t_1) {
8454
8455
8456 /* "View.MemoryView":453
8457 *
8458 * if self.view.ndim == 1 and isinstance(index, int):
8459 * memoryview.setitem_indexed1(self, index, value) # <<<<<<<<<<<<<<
8460 * return
8461 *
8462*/
8463 __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)
8464 __Pyx_GOTREF(__pyx_t_3);
8465 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8466
8467 /* "View.MemoryView":454
8468 * if self.view.ndim == 1 and isinstance(index, int):
8469 * memoryview.setitem_indexed1(self, index, value)
8470 * return # <<<<<<<<<<<<<<
8471 *
8472 * have_slices, indices = _unellipsify(index, self.view.ndim)
8473*/
8474 {
8475 __pyx_r = 0;
8476 }
8477 goto __pyx_L0;
8478
8479 /* "View.MemoryView":452
8480 * raise TypeError, "Cannot assign to read-only memoryview"
8481 *
8482 * if self.view.ndim == 1 and isinstance(index, int): # <<<<<<<<<<<<<<
8483 * memoryview.setitem_indexed1(self, index, value)
8484 * return
8485*/
8486 }
8487
8488 /* "View.MemoryView":456
8489 * return
8490 *
8491 * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
8492 *
8493 * if have_slices:
8494*/
8495 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 456, __pyx_L1_error)
8496 __Pyx_GOTREF(__pyx_t_3);
8497 if (likely(__pyx_t_3 != Py_None)) {
8498 PyObject* sequence = __pyx_t_3;
8499 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
8500 if (unlikely(size != 2)) {
8501 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8502 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8503 __PYX_ERR(1, 456, __pyx_L1_error)
8504 }
8505 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8506 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
8507 __Pyx_INCREF(__pyx_t_4);
8508 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
8509 __Pyx_INCREF(__pyx_t_5);
8510 #else
8511 __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 456, __pyx_L1_error)
8512 __Pyx_GOTREF(__pyx_t_4);
8513 __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 456, __pyx_L1_error)
8514 __Pyx_GOTREF(__pyx_t_5);
8515 #endif
8516 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8517 } else {
8518 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 456, __pyx_L1_error)
8519 }
8520 __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)
8521 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8522 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)
8523 __pyx_v_have_slices = __pyx_t_1;
8524 __pyx_v_indices = ((PyObject*)__pyx_t_5);
8525 __pyx_t_5 = 0;
8526
8527 /* "View.MemoryView":458
8528 * have_slices, indices = _unellipsify(index, self.view.ndim)
8529 *
8530 * if have_slices: # <<<<<<<<<<<<<<
8531 * obj = memoryview.is_slice(self, value)
8532 * target_slice = memview_slice(self, indices)
8533*/
8534 if (__pyx_v_have_slices) {
8535
8536 /* "View.MemoryView":459
8537 *
8538 * if have_slices:
8539 * obj = memoryview.is_slice(self, value) # <<<<<<<<<<<<<<
8540 * target_slice = memview_slice(self, indices)
8541 * if obj is not None:
8542*/
8543 __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)
8544 __Pyx_GOTREF(__pyx_t_3);
8545 __pyx_v_obj = __pyx_t_3;
8546 __pyx_t_3 = 0;
8547
8548 /* "View.MemoryView":460
8549 * if have_slices:
8550 * obj = memoryview.is_slice(self, value)
8551 * target_slice = memview_slice(self, indices) # <<<<<<<<<<<<<<
8552 * if obj is not None:
8553 * memoryview.setitem_slice_assignment(self, target_slice, obj)
8554*/
8555 __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)
8556 __Pyx_GOTREF(__pyx_t_3);
8557 __pyx_v_target_slice = ((struct __pyx_memoryview_obj *)__pyx_t_3);
8558 __pyx_t_3 = 0;
8559
8560 /* "View.MemoryView":461
8561 * obj = memoryview.is_slice(self, value)
8562 * target_slice = memview_slice(self, indices)
8563 * if obj is not None: # <<<<<<<<<<<<<<
8564 * memoryview.setitem_slice_assignment(self, target_slice, obj)
8565 * else:
8566*/
8567 __pyx_t_1 = (__pyx_v_obj != Py_None);
8568 if (__pyx_t_1) {
8569
8570
8571 /* "View.MemoryView":462
8572 * target_slice = memview_slice(self, indices)
8573 * if obj is not None:
8574 * memoryview.setitem_slice_assignment(self, target_slice, obj) # <<<<<<<<<<<<<<
8575 * else:
8576 * memoryview.setitem_slice_assign_scalar(self, target_slice, value)
8577*/
8578 __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)
8579 __Pyx_GOTREF(__pyx_t_3);
8580 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8581
8582 /* "View.MemoryView":461
8583 * obj = memoryview.is_slice(self, value)
8584 * target_slice = memview_slice(self, indices)
8585 * if obj is not None: # <<<<<<<<<<<<<<
8586 * memoryview.setitem_slice_assignment(self, target_slice, obj)
8587 * else:
8588*/
8589 goto __pyx_L8;
8590 }
8591
8592 /* "View.MemoryView":464
8593 * memoryview.setitem_slice_assignment(self, target_slice, obj)
8594 * else:
8595 * memoryview.setitem_slice_assign_scalar(self, target_slice, value) # <<<<<<<<<<<<<<
8596 * else:
8597 * memoryview.setitem_indexed(self, <tuple> indices, value)
8598*/
8599 /*else*/ {
8600 __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)
8601 __Pyx_GOTREF(__pyx_t_3);
8602 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8603 }
8604 __pyx_L8:;
8605
8606 /* "View.MemoryView":458
8607 * have_slices, indices = _unellipsify(index, self.view.ndim)
8608 *
8609 * if have_slices: # <<<<<<<<<<<<<<
8610 * obj = memoryview.is_slice(self, value)
8611 * target_slice = memview_slice(self, indices)
8612*/
8613 goto __pyx_L7;
8614 }
8615
8616 /* "View.MemoryView":466
8617 * memoryview.setitem_slice_assign_scalar(self, target_slice, value)
8618 * else:
8619 * memoryview.setitem_indexed(self, <tuple> indices, value) # <<<<<<<<<<<<<<
8620 *
8621 *
8622*/
8623 /*else*/ {
8624 if (unlikely(__pyx_v_indices == Py_None)) {
8625 PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
8626 __PYX_ERR(1, 466, __pyx_L1_error)
8627 }
8628 __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)
8629 __Pyx_GOTREF(__pyx_t_3);
8630 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8631 }
8632 __pyx_L7:;
8633
8634 /* "View.MemoryView":448
8635 * return self.convert_item_to_object(itemp)
8636 *
8637 * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
8638 * if self.view.readonly:
8639 * raise TypeError, "Cannot assign to read-only memoryview"
8640*/
8641
8642 /* function exit code */
8643 __pyx_r = 0;
8644 goto __pyx_L0;
8645 __pyx_L1_error:;
8646 __Pyx_XDECREF(__pyx_t_3);
8647 __Pyx_XDECREF(__pyx_t_4);
8648 __Pyx_XDECREF(__pyx_t_5);
8649 __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8650 __pyx_r = -1;
8651 __pyx_L0:;
8652
8653 __Pyx_XDECREF(__pyx_v_indices);
8654 __Pyx_XDECREF(__pyx_v_obj);
8655 __Pyx_XDECREF((PyObject *)__pyx_v_target_slice);
8656
8657 __Pyx_RefNannyFinishContext();
8658 return __pyx_r;
8659}
8660
8661/* "View.MemoryView":469
8662 *
8663 *
8664 * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
8665 * if not isinstance(obj, memoryview):
8666 * try:
8667*/
8668
8669static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
8670 PyObject *__pyx_r = NULL;
8671 __Pyx_RefNannyDeclarations
8672 int __pyx_t_1;
8673 int __pyx_t_2;
8674 PyObject *__pyx_t_3 = NULL;
8675 PyObject *__pyx_t_4 = NULL;
8676 PyObject *__pyx_t_5 = NULL;
8677 PyObject *__pyx_t_6 = NULL;
8678 PyObject *__pyx_t_7 = NULL;
8679 PyObject *__pyx_t_8 = NULL;
8680 PyObject *__pyx_t_9 = NULL;
8681 size_t __pyx_t_10;
8682 int __pyx_t_11;
8683 int __pyx_lineno = 0;
8684 const char *__pyx_filename = NULL;
8685 int __pyx_clineno = 0;
8686 __Pyx_RefNannySetupContext("is_slice", 0);
8687 __Pyx_INCREF(__pyx_v_obj);
8688
8689 /* "View.MemoryView":470
8690 *
8691 * cdef is_slice(self, obj):
8692 * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
8693 * try:
8694 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8695*/
8696 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_mstate_global->__pyx_memoryview_type);
8697 __pyx_t_2 = (!__pyx_t_1);
8698
8699
8700 if (__pyx_t_2) {
8701
8702
8703 /* "View.MemoryView":471
8704 * cdef is_slice(self, obj):
8705 * if not isinstance(obj, memoryview):
8706 * try: # <<<<<<<<<<<<<<
8707 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8708 * self.dtype_is_object)
8709*/
8710 {
8711 __Pyx_PyThreadState_declare
8712 __Pyx_PyThreadState_assign
8713 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
8714 __Pyx_XGOTREF(__pyx_t_3);
8715 __Pyx_XGOTREF(__pyx_t_4);
8716 __Pyx_XGOTREF(__pyx_t_5);
8717 /*try:*/ {
8718
8719 /* "View.MemoryView":472
8720 * if not isinstance(obj, memoryview):
8721 * try:
8722 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
8723 * self.dtype_is_object)
8724 * except TypeError:
8725*/
8726 __pyx_t_7 = NULL;
8727 __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)
8728 __Pyx_GOTREF(__pyx_t_8);
8729
8730 /* "View.MemoryView":473
8731 * try:
8732 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8733 * self.dtype_is_object) # <<<<<<<<<<<<<<
8734 * except TypeError:
8735 * return None
8736*/
8737 __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 473, __pyx_L4_error)
8738 __Pyx_GOTREF(__pyx_t_9);
8739 __pyx_t_10 = 1;
8740 {
8741 PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_v_obj, __pyx_t_8, __pyx_t_9};
8742 __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));
8743 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8744 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8745 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8746 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 472, __pyx_L4_error)
8747 __Pyx_GOTREF((PyObject *)__pyx_t_6);
8748 }
8749 __Pyx_DECREF_SET(__pyx_v_obj, ((PyObject *)__pyx_t_6));
8750 __pyx_t_6 = 0;
8751
8752 /* "View.MemoryView":471
8753 * cdef is_slice(self, obj):
8754 * if not isinstance(obj, memoryview):
8755 * try: # <<<<<<<<<<<<<<
8756 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8757 * self.dtype_is_object)
8758*/
8759 }
8760 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8761 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8762 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8763 goto __pyx_L9_try_end;
8764 __pyx_L4_error:;
8765 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8766 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8767 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
8768 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
8769
8770 /* "View.MemoryView":474
8771 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8772 * self.dtype_is_object)
8773 * except TypeError: # <<<<<<<<<<<<<<
8774 * return None
8775 *
8776*/
8777 __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_TypeError))));
8778 if (__pyx_t_11) {
8779 __Pyx_ErrRestore(0,0,0);
8780
8781 /* "View.MemoryView":475
8782 * self.dtype_is_object)
8783 * except TypeError:
8784 * return None # <<<<<<<<<<<<<<
8785 *
8786 * return obj
8787*/
8788 {
8789 PyObject *__pyx_temp;
8790 {
8791 __pyx_temp = __pyx_r;
8792 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8793 }
8794 __Pyx_XDECREF(__pyx_temp);
8795 }
8796 goto __pyx_L7_except_return;
8797 }
8798 goto __pyx_L6_except_error;
8799
8800 /* "View.MemoryView":471
8801 * cdef is_slice(self, obj):
8802 * if not isinstance(obj, memoryview):
8803 * try: # <<<<<<<<<<<<<<
8804 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8805 * self.dtype_is_object)
8806*/
8807 __pyx_L6_except_error:;
8808 __Pyx_XGIVEREF(__pyx_t_3);
8809 __Pyx_XGIVEREF(__pyx_t_4);
8810 __Pyx_XGIVEREF(__pyx_t_5);
8811 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
8812 goto __pyx_L1_error;
8813 __pyx_L7_except_return:;
8814 __Pyx_XGIVEREF(__pyx_t_3);
8815 __Pyx_XGIVEREF(__pyx_t_4);
8816 __Pyx_XGIVEREF(__pyx_t_5);
8817 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
8818 goto __pyx_L0;
8819 __pyx_L9_try_end:;
8820 }
8821
8822 /* "View.MemoryView":470
8823 *
8824 * cdef is_slice(self, obj):
8825 * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
8826 * try:
8827 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8828*/
8829 }
8830
8831 /* "View.MemoryView":477
8832 * return None
8833 *
8834 * return obj # <<<<<<<<<<<<<<
8835 *
8836 *
8837*/
8838 {
8839 PyObject *__pyx_temp;
8840 {
8841 __pyx_temp = __pyx_r;
8842 __Pyx_INCREF(__pyx_v_obj);
8843 __pyx_r = __pyx_v_obj;
8844 }
8845 __Pyx_XDECREF(__pyx_temp);
8846 }
8847 goto __pyx_L0;
8848
8849 /* "View.MemoryView":469
8850 *
8851 *
8852 * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
8853 * if not isinstance(obj, memoryview):
8854 * try:
8855*/
8856
8857 /* function exit code */
8858 __pyx_L1_error:;
8859 __Pyx_XDECREF(__pyx_t_6);
8860 __Pyx_XDECREF(__pyx_t_7);
8861 __Pyx_XDECREF(__pyx_t_8);
8862 __Pyx_XDECREF(__pyx_t_9);
8863 __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
8864 __pyx_r = 0;
8865 __pyx_L0:;
8866 __Pyx_XDECREF(__pyx_v_obj);
8867 __Pyx_XGIVEREF(__pyx_r);
8868 __Pyx_RefNannyFinishContext();
8869 return __pyx_r;
8870}
8871
8872/* "View.MemoryView":480
8873 *
8874 *
8875 * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
8876 * cdef __Pyx_memviewslice dst_slice
8877 * cdef __Pyx_memviewslice src_slice
8878*/
8879
8880static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
8881 __Pyx_memviewslice __pyx_v_dst_slice;
8882 __Pyx_memviewslice __pyx_v_src_slice;
8883 __Pyx_memviewslice __pyx_v_msrc;
8884 __Pyx_memviewslice __pyx_v_mdst;
8885 PyObject *__pyx_r = NULL;
8886 __Pyx_RefNannyDeclarations
8887 __Pyx_memviewslice *__pyx_t_1;
8888 PyObject *__pyx_t_2 = NULL;
8889 int __pyx_t_3;
8890 int __pyx_t_4;
8891 int __pyx_t_5;
8892 int __pyx_lineno = 0;
8893 const char *__pyx_filename = NULL;
8894 int __pyx_clineno = 0;
8895 __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
8896
8897 /* "View.MemoryView":483
8898 * cdef __Pyx_memviewslice dst_slice
8899 * cdef __Pyx_memviewslice src_slice
8900 * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0] # <<<<<<<<<<<<<<
8901 * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
8902 *
8903*/
8904 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)
8905 __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)
8906 __pyx_v_msrc = (__pyx_t_1[0]);
8907
8908
8909 /* "View.MemoryView":484
8910 * cdef __Pyx_memviewslice src_slice
8911 * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0]
8912 * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0] # <<<<<<<<<<<<<<
8913 *
8914 * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
8915*/
8916 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)
8917 __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)
8918 __pyx_v_mdst = (__pyx_t_1[0]);
8919
8920
8921 /* "View.MemoryView":486
8922 * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
8923 *
8924 * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
8925 *
8926 *
8927*/
8928 __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)
8929 __Pyx_GOTREF(__pyx_t_2);
8930 __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)
8931 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8932 __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)
8933 __Pyx_GOTREF(__pyx_t_2);
8934 __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)
8935 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8936 __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)
8937
8938
8939
8940
8941 /* "View.MemoryView":480
8942 *
8943 *
8944 * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
8945 * cdef __Pyx_memviewslice dst_slice
8946 * cdef __Pyx_memviewslice src_slice
8947*/
8948
8949 /* function exit code */
8950 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8951 goto __pyx_L0;
8952 __pyx_L1_error:;
8953 __Pyx_XDECREF(__pyx_t_2);
8954 __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
8955 __pyx_r = 0;
8956 __pyx_L0:;
8957
8958
8959
8960
8961 __Pyx_XGIVEREF(__pyx_r);
8962 __Pyx_RefNannyFinishContext();
8963 return __pyx_r;
8964}
8965
8966/* "View.MemoryView":489
8967 *
8968 *
8969 * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
8970 * cdef int array[128]
8971 * cdef void *tmp = NULL
8972*/
8973
8974static 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) {
8975 int __pyx_v_array[128];
8976 void *__pyx_v_tmp;
8977 void *__pyx_v_item;
8978 __Pyx_memviewslice *__pyx_v_dst_slice;
8979 __Pyx_memviewslice __pyx_v_tmp_slice;
8980 PyObject *__pyx_r = NULL;
8981 __Pyx_RefNannyDeclarations
8982 __Pyx_memviewslice *__pyx_t_1;
8983 int __pyx_t_2;
8984 PyObject *__pyx_t_3 = NULL;
8985 int __pyx_t_4;
8986 int __pyx_t_5;
8987 char const *__pyx_t_6;
8988 PyObject *__pyx_t_7 = NULL;
8989 PyObject *__pyx_t_8 = NULL;
8990 PyObject *__pyx_t_9 = NULL;
8991 PyObject *__pyx_t_10 = NULL;
8992 PyObject *__pyx_t_11 = NULL;
8993 PyObject *__pyx_t_12 = NULL;
8994 int __pyx_lineno = 0;
8995 const char *__pyx_filename = NULL;
8996 int __pyx_clineno = 0;
8997 __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
8998
8999 /* "View.MemoryView":491
9000 * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
9001 * cdef int array[128]
9002 * cdef void *tmp = NULL # <<<<<<<<<<<<<<
9003 * cdef void *item
9004 *
9005*/
9006 __pyx_v_tmp = NULL;
9007
9008 /* "View.MemoryView":496
9009 * cdef __Pyx_memviewslice *dst_slice
9010 * cdef __Pyx_memviewslice tmp_slice
9011 * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
9012 *
9013 * if <size_t>self.view.itemsize > sizeof(array):
9014*/
9015 __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)
9016 __pyx_v_dst_slice = __pyx_t_1;
9017
9018 /* "View.MemoryView":498
9019 * dst_slice = get_slice_from_memview(dst, &tmp_slice)
9020 *
9021 * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
9022 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9023 * if tmp == NULL:
9024*/
9025 __pyx_t_2 = (((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array)));
9026
9027 if (__pyx_t_2) {
9028
9029
9030 /* "View.MemoryView":499
9031 *
9032 * if <size_t>self.view.itemsize > sizeof(array):
9033 * tmp = PyMem_Malloc(<size_t> self.view.itemsize) # <<<<<<<<<<<<<<
9034 * if tmp == NULL:
9035 * raise MemoryError
9036*/
9037 __pyx_v_tmp = PyMem_Malloc(((size_t)__pyx_v_self->view.itemsize));
9038
9039 /* "View.MemoryView":500
9040 * if <size_t>self.view.itemsize > sizeof(array):
9041 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9042 * if tmp == NULL: # <<<<<<<<<<<<<<
9043 * raise MemoryError
9044 * item = tmp
9045*/
9046 __pyx_t_2 = (__pyx_v_tmp == NULL);
9047
9048 if (unlikely(__pyx_t_2)) {
9049
9050
9051 /* "View.MemoryView":501
9052 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9053 * if tmp == NULL:
9054 * raise MemoryError # <<<<<<<<<<<<<<
9055 * item = tmp
9056 * else:
9057*/
9058 PyErr_NoMemory(); __PYX_ERR(1, 501, __pyx_L1_error)
9059
9060 /* "View.MemoryView":500
9061 * if <size_t>self.view.itemsize > sizeof(array):
9062 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9063 * if tmp == NULL: # <<<<<<<<<<<<<<
9064 * raise MemoryError
9065 * item = tmp
9066*/
9067 }
9068
9069 /* "View.MemoryView":502
9070 * if tmp == NULL:
9071 * raise MemoryError
9072 * item = tmp # <<<<<<<<<<<<<<
9073 * else:
9074 * item = <void *> array
9075*/
9076 __pyx_v_item = __pyx_v_tmp;
9077
9078 /* "View.MemoryView":498
9079 * dst_slice = get_slice_from_memview(dst, &tmp_slice)
9080 *
9081 * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
9082 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9083 * if tmp == NULL:
9084*/
9085 goto __pyx_L3;
9086 }
9087
9088 /* "View.MemoryView":504
9089 * item = tmp
9090 * else:
9091 * item = <void *> array # <<<<<<<<<<<<<<
9092 *
9093 * try:
9094*/
9095 /*else*/ {
9096 __pyx_v_item = ((void *)__pyx_v_array);
9097 }
9098 __pyx_L3:;
9099
9100 /* "View.MemoryView":506
9101 * item = <void *> array
9102 *
9103 * try: # <<<<<<<<<<<<<<
9104 * if self.dtype_is_object:
9105 * (<PyObject **> item)[0] = <PyObject *> value
9106*/
9107 /*try:*/ {
9108
9109 /* "View.MemoryView":507
9110 *
9111 * try:
9112 * if self.dtype_is_object: # <<<<<<<<<<<<<<
9113 * (<PyObject **> item)[0] = <PyObject *> value
9114 * else:
9115*/
9116 if (__pyx_v_self->dtype_is_object) {
9117
9118 /* "View.MemoryView":508
9119 * try:
9120 * if self.dtype_is_object:
9121 * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
9122 * else:
9123 * self.assign_item_from_object(<char *> item, value)
9124*/
9125 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
9126
9127 /* "View.MemoryView":507
9128 *
9129 * try:
9130 * if self.dtype_is_object: # <<<<<<<<<<<<<<
9131 * (<PyObject **> item)[0] = <PyObject *> value
9132 * else:
9133*/
9134 goto __pyx_L8;
9135 }
9136
9137 /* "View.MemoryView":510
9138 * (<PyObject **> item)[0] = <PyObject *> value
9139 * else:
9140 * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
9141 *
9142 *
9143*/
9144 /*else*/ {
9145 __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)
9146 __Pyx_GOTREF(__pyx_t_3);
9147 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9148 }
9149 __pyx_L8:;
9150
9151 /* "View.MemoryView":514
9152 *
9153 *
9154 * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
9155 * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9156 * slice_assign_scalar(dst_slice, dst.view.ndim, <size_t> self.view.itemsize,
9157*/
9158 __pyx_t_2 = (__pyx_v_self->view.suboffsets != NULL);
9159
9160 if (__pyx_t_2) {
9161
9162
9163 /* "View.MemoryView":515
9164 *
9165 * if self.view.suboffsets != NULL:
9166 * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
9167 * slice_assign_scalar(dst_slice, dst.view.ndim, <size_t> self.view.itemsize,
9168 * item, self.dtype_is_object)
9169*/
9170 __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)
9171
9172
9173 /* "View.MemoryView":514
9174 *
9175 *
9176 * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
9177 * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9178 * slice_assign_scalar(dst_slice, dst.view.ndim, <size_t> self.view.itemsize,
9179*/
9180 }
9181
9182 /* "View.MemoryView":516
9183 * if self.view.suboffsets != NULL:
9184 * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9185 * slice_assign_scalar(dst_slice, dst.view.ndim, <size_t> self.view.itemsize, # <<<<<<<<<<<<<<
9186 * item, self.dtype_is_object)
9187 * finally:
9188*/
9189 __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);
9190 }
9191
9192 /* "View.MemoryView":519
9193 * item, self.dtype_is_object)
9194 * finally:
9195 * PyMem_Free(tmp) # <<<<<<<<<<<<<<
9196 *
9197 *
9198*/
9199 /*finally:*/ {
9200 /*normal exit:*/{
9201 PyMem_Free(__pyx_v_tmp);
9202 goto __pyx_L7;
9203 }
9204 __pyx_L6_error:;
9205 /*exception exit:*/{
9206 __Pyx_PyThreadState_declare
9207 __Pyx_PyThreadState_assign
9208 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9209 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9210 __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
9211 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);
9212 __Pyx_XGOTREF(__pyx_t_7);
9213 __Pyx_XGOTREF(__pyx_t_8);
9214 __Pyx_XGOTREF(__pyx_t_9);
9215 __Pyx_XGOTREF(__pyx_t_10);
9216 __Pyx_XGOTREF(__pyx_t_11);
9217 __Pyx_XGOTREF(__pyx_t_12);
9218 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
9219 {
9220 PyMem_Free(__pyx_v_tmp);
9221 }
9222 __Pyx_XGIVEREF(__pyx_t_10);
9223 __Pyx_XGIVEREF(__pyx_t_11);
9224 __Pyx_XGIVEREF(__pyx_t_12);
9225 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
9226 __Pyx_XGIVEREF(__pyx_t_7);
9227 __Pyx_XGIVEREF(__pyx_t_8);
9228 __Pyx_XGIVEREF(__pyx_t_9);
9229 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
9230 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9231 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
9232 goto __pyx_L1_error;
9233 }
9234 __pyx_L7:;
9235 }
9236
9237 /* "View.MemoryView":489
9238 *
9239 *
9240 * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
9241 * cdef int array[128]
9242 * cdef void *tmp = NULL
9243*/
9244
9245 /* function exit code */
9246 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9247 goto __pyx_L0;
9248 __pyx_L1_error:;
9249 __Pyx_XDECREF(__pyx_t_3);
9250 __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
9251 __pyx_r = 0;
9252 __pyx_L0:;
9253
9254
9255
9256
9257
9258 __Pyx_XGIVEREF(__pyx_r);
9259 __Pyx_RefNannyFinishContext();
9260 return __pyx_r;
9261}
9262
9263/* "View.MemoryView":522
9264 *
9265 *
9266 * cdef setitem_indexed(self, indices: tuple, value): # <<<<<<<<<<<<<<
9267 * cdef char *itemp = memoryview.get_item_pointer(self, indices)
9268 * self.assign_item_from_object(itemp, value)
9269*/
9270
9271static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_value) {
9272 char *__pyx_v_itemp;
9273 PyObject *__pyx_r = NULL;
9274 __Pyx_RefNannyDeclarations
9275 char *__pyx_t_1;
9276 PyObject *__pyx_t_2 = NULL;
9277 int __pyx_lineno = 0;
9278 const char *__pyx_filename = NULL;
9279 int __pyx_clineno = 0;
9280 __Pyx_RefNannySetupContext("setitem_indexed", 0);
9281
9282 /* "View.MemoryView":523
9283 *
9284 * cdef setitem_indexed(self, indices: tuple, value):
9285 * cdef char *itemp = memoryview.get_item_pointer(self, indices) # <<<<<<<<<<<<<<
9286 * self.assign_item_from_object(itemp, value)
9287 *
9288*/
9289 __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)
9290 __pyx_v_itemp = __pyx_t_1;
9291
9292 /* "View.MemoryView":524
9293 * cdef setitem_indexed(self, indices: tuple, value):
9294 * cdef char *itemp = memoryview.get_item_pointer(self, indices)
9295 * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
9296 *
9297 *
9298*/
9299 __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)
9300 __Pyx_GOTREF(__pyx_t_2);
9301 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9302
9303 /* "View.MemoryView":522
9304 *
9305 *
9306 * cdef setitem_indexed(self, indices: tuple, value): # <<<<<<<<<<<<<<
9307 * cdef char *itemp = memoryview.get_item_pointer(self, indices)
9308 * self.assign_item_from_object(itemp, value)
9309*/
9310
9311 /* function exit code */
9312 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9313 goto __pyx_L0;
9314 __pyx_L1_error:;
9315 __Pyx_XDECREF(__pyx_t_2);
9316 __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
9317 __pyx_r = 0;
9318 __pyx_L0:;
9319
9320 __Pyx_XGIVEREF(__pyx_r);
9321 __Pyx_RefNannyFinishContext();
9322 return __pyx_r;
9323}
9324
9325/* "View.MemoryView":527
9326 *
9327 *
9328 * cdef setitem_indexed1(self, index, value): # <<<<<<<<<<<<<<
9329 * cdef char *buffer = <char *> self.view.buf
9330 * cdef char *itemp = pybuffer_index(&self.view, buffer, index, 0)
9331*/
9332
9333static PyObject *__pyx_memoryview_setitem_indexed1(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9334 char *__pyx_v_buffer;
9335 char *__pyx_v_itemp;
9336 PyObject *__pyx_r = NULL;
9337 __Pyx_RefNannyDeclarations
9338 Py_ssize_t __pyx_t_1;
9339 char *__pyx_t_2;
9340 PyObject *__pyx_t_3 = NULL;
9341 int __pyx_lineno = 0;
9342 const char *__pyx_filename = NULL;
9343 int __pyx_clineno = 0;
9344 __Pyx_RefNannySetupContext("setitem_indexed1", 0);
9345
9346 /* "View.MemoryView":528
9347 *
9348 * cdef setitem_indexed1(self, index, value):
9349 * cdef char *buffer = <char *> self.view.buf # <<<<<<<<<<<<<<
9350 * cdef char *itemp = pybuffer_index(&self.view, buffer, index, 0)
9351 * self.assign_item_from_object(itemp, value)
9352*/
9353 __pyx_v_buffer = ((char *)__pyx_v_self->view.buf);
9354
9355 /* "View.MemoryView":529
9356 * cdef setitem_indexed1(self, index, value):
9357 * cdef char *buffer = <char *> self.view.buf
9358 * cdef char *itemp = pybuffer_index(&self.view, buffer, index, 0) # <<<<<<<<<<<<<<
9359 * self.assign_item_from_object(itemp, value)
9360 *
9361*/
9362 __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)
9363 __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)
9364 __pyx_v_itemp = __pyx_t_2;
9365
9366
9367 /* "View.MemoryView":530
9368 * cdef char *buffer = <char *> self.view.buf
9369 * cdef char *itemp = pybuffer_index(&self.view, buffer, index, 0)
9370 * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
9371 *
9372 * cdef convert_item_to_object(self, char *itemp):
9373*/
9374 __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)
9375 __Pyx_GOTREF(__pyx_t_3);
9376 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9377
9378 /* "View.MemoryView":527
9379 *
9380 *
9381 * cdef setitem_indexed1(self, index, value): # <<<<<<<<<<<<<<
9382 * cdef char *buffer = <char *> self.view.buf
9383 * cdef char *itemp = pybuffer_index(&self.view, buffer, index, 0)
9384*/
9385
9386 /* function exit code */
9387 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9388 goto __pyx_L0;
9389 __pyx_L1_error:;
9390 __Pyx_XDECREF(__pyx_t_3);
9391 __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed1", __pyx_clineno, __pyx_lineno, __pyx_filename);
9392 __pyx_r = 0;
9393 __pyx_L0:;
9394
9395
9396 __Pyx_XGIVEREF(__pyx_r);
9397 __Pyx_RefNannyFinishContext();
9398 return __pyx_r;
9399}
9400
9401/* "View.MemoryView":532
9402 * self.assign_item_from_object(itemp, value)
9403 *
9404 * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
9405 * """Only used if instantiated manually by the user, or if Cython doesn't
9406 * know how to convert the type"""
9407*/
9408
9409static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
9410 PyObject *__pyx_v_struct = NULL;
9411 PyObject *__pyx_v_bytesitem = 0;
9412 PyObject *__pyx_v_result = NULL;
9413 PyObject *__pyx_r = NULL;
9414 __Pyx_RefNannyDeclarations
9415 PyObject *__pyx_t_1 = NULL;
9416 PyObject *__pyx_t_2 = NULL;
9417 PyObject *__pyx_t_3 = NULL;
9418 PyObject *__pyx_t_4 = NULL;
9419 PyObject *__pyx_t_5 = NULL;
9420 PyObject *__pyx_t_6 = NULL;
9421 size_t __pyx_t_7;
9422 Py_ssize_t __pyx_t_8;
9423 int __pyx_t_9;
9424 PyObject *__pyx_t_10 = NULL;
9425 int __pyx_t_11;
9426 int __pyx_lineno = 0;
9427 const char *__pyx_filename = NULL;
9428 int __pyx_clineno = 0;
9429 __Pyx_RefNannySetupContext("convert_item_to_object", 0);
9430
9431 /* "View.MemoryView":535
9432 * """Only used if instantiated manually by the user, or if Cython doesn't
9433 * know how to convert the type"""
9434 * import struct # <<<<<<<<<<<<<<
9435 * cdef bytes bytesitem
9436 *
9437*/
9438 __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)
9439 __pyx_t_1 = __pyx_t_2;
9440 __Pyx_GOTREF(__pyx_t_1);
9441 __pyx_v_struct = __pyx_t_1;
9442 __pyx_t_1 = 0;
9443
9444 /* "View.MemoryView":538
9445 * cdef bytes bytesitem
9446 *
9447 * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
9448 * try:
9449 * result = struct.unpack(self.view.format, bytesitem)
9450*/
9451 __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)
9452 __Pyx_GOTREF(__pyx_t_1);
9453 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
9454 __pyx_t_1 = 0;
9455
9456 /* "View.MemoryView":539
9457 *
9458 * bytesitem = itemp[:self.view.itemsize]
9459 * try: # <<<<<<<<<<<<<<
9460 * result = struct.unpack(self.view.format, bytesitem)
9461 * except struct.error:
9462*/
9463 {
9464 __Pyx_PyThreadState_declare
9465 __Pyx_PyThreadState_assign
9466 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
9467 __Pyx_XGOTREF(__pyx_t_2);
9468 __Pyx_XGOTREF(__pyx_t_3);
9469 __Pyx_XGOTREF(__pyx_t_4);
9470 /*try:*/ {
9471
9472 /* "View.MemoryView":540
9473 * bytesitem = itemp[:self.view.itemsize]
9474 * try:
9475 * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
9476 * except struct.error:
9477 * _err_ValueError("Unable to convert item to object")
9478*/
9479 __pyx_t_5 = __pyx_v_struct;
9480 __Pyx_INCREF(__pyx_t_5);
9481 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 540, __pyx_L3_error)
9482 __Pyx_GOTREF(__pyx_t_6);
9483 __pyx_t_7 = 0;
9484 {
9485 PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_6, __pyx_v_bytesitem};
9486 __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));
9487 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9488 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9489 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __pyx_L3_error)
9490 __Pyx_GOTREF(__pyx_t_1);
9491 }
9492 __pyx_v_result = __pyx_t_1;
9493 __pyx_t_1 = 0;
9494
9495 /* "View.MemoryView":539
9496 *
9497 * bytesitem = itemp[:self.view.itemsize]
9498 * try: # <<<<<<<<<<<<<<
9499 * result = struct.unpack(self.view.format, bytesitem)
9500 * except struct.error:
9501*/
9502 }
9503
9504 /* "View.MemoryView":544
9505 * _err_ValueError("Unable to convert item to object")
9506 * else:
9507 * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
9508 * return result[0]
9509 * return result
9510*/
9511 /*else:*/ {
9512 __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)
9513 __pyx_t_9 = (__pyx_t_8 == 1);
9514
9515
9516 if (__pyx_t_9) {
9517
9518
9519 /* "View.MemoryView":545
9520 * else:
9521 * if len(self.view.format) == 1:
9522 * return result[0] # <<<<<<<<<<<<<<
9523 * return result
9524 *
9525*/
9526 __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)
9527 __Pyx_GOTREF(__pyx_t_1);
9528 {
9529 PyObject *__pyx_temp;
9530 {
9531 __pyx_temp = __pyx_r;
9532 __pyx_r = __pyx_t_1;
9533 }
9534 __Pyx_XDECREF(__pyx_temp);
9535 }
9536 __pyx_t_1 = 0;
9537 goto __pyx_L6_except_return;
9538
9539 /* "View.MemoryView":544
9540 * _err_ValueError("Unable to convert item to object")
9541 * else:
9542 * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
9543 * return result[0]
9544 * return result
9545*/
9546 }
9547
9548 /* "View.MemoryView":546
9549 * if len(self.view.format) == 1:
9550 * return result[0]
9551 * return result # <<<<<<<<<<<<<<
9552 *
9553 * cdef assign_item_from_object(self, char *itemp, object value):
9554*/
9555 {
9556 PyObject *__pyx_temp;
9557 {
9558 __pyx_temp = __pyx_r;
9559 __Pyx_INCREF(__pyx_v_result);
9560 __pyx_r = __pyx_v_result;
9561 }
9562 __Pyx_XDECREF(__pyx_temp);
9563 }
9564 goto __pyx_L6_except_return;
9565 }
9566 __pyx_L3_error:;
9567 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9568 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9569 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9570
9571 /* "View.MemoryView":541
9572 * try:
9573 * result = struct.unpack(self.view.format, bytesitem)
9574 * except struct.error: # <<<<<<<<<<<<<<
9575 * _err_ValueError("Unable to convert item to object")
9576 * else:
9577*/
9578 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_6, &__pyx_t_5);
9579 __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)
9580 __Pyx_GOTREF(__pyx_t_10);
9581 __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_10);
9582 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9583 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_6, __pyx_t_5);
9584 __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_5 = 0;
9585 if (__pyx_t_11) {
9586 __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9587 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_1) < 0) __PYX_ERR(1, 541, __pyx_L5_except_error)
9588 __Pyx_XGOTREF(__pyx_t_5);
9589 __Pyx_XGOTREF(__pyx_t_6);
9590 __Pyx_XGOTREF(__pyx_t_1);
9591
9592 /* "View.MemoryView":542
9593 * result = struct.unpack(self.view.format, bytesitem)
9594 * except struct.error:
9595 * _err_ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
9596 * else:
9597 * if len(self.view.format) == 1:
9598*/
9599 __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)
9600
9601 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9602 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9603 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9604 goto __pyx_L4_exception_handled;
9605 }
9606 goto __pyx_L5_except_error;
9607
9608 /* "View.MemoryView":539
9609 *
9610 * bytesitem = itemp[:self.view.itemsize]
9611 * try: # <<<<<<<<<<<<<<
9612 * result = struct.unpack(self.view.format, bytesitem)
9613 * except struct.error:
9614*/
9615 __pyx_L5_except_error:;
9616 __Pyx_XGIVEREF(__pyx_t_2);
9617 __Pyx_XGIVEREF(__pyx_t_3);
9618 __Pyx_XGIVEREF(__pyx_t_4);
9619 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9620 goto __pyx_L1_error;
9621 __pyx_L6_except_return:;
9622 __Pyx_XGIVEREF(__pyx_t_2);
9623 __Pyx_XGIVEREF(__pyx_t_3);
9624 __Pyx_XGIVEREF(__pyx_t_4);
9625 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9626 goto __pyx_L0;
9627 __pyx_L4_exception_handled:;
9628 __Pyx_XGIVEREF(__pyx_t_2);
9629 __Pyx_XGIVEREF(__pyx_t_3);
9630 __Pyx_XGIVEREF(__pyx_t_4);
9631 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9632 }
9633
9634 /* "View.MemoryView":532
9635 * self.assign_item_from_object(itemp, value)
9636 *
9637 * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
9638 * """Only used if instantiated manually by the user, or if Cython doesn't
9639 * know how to convert the type"""
9640*/
9641
9642 /* function exit code */
9643 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9644 goto __pyx_L0;
9645 __pyx_L1_error:;
9646 __Pyx_XDECREF(__pyx_t_1);
9647 __Pyx_XDECREF(__pyx_t_5);
9648 __Pyx_XDECREF(__pyx_t_6);
9649 __Pyx_XDECREF(__pyx_t_10);
9650 __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9651 __pyx_r = 0;
9652 __pyx_L0:;
9653 __Pyx_XDECREF(__pyx_v_struct);
9654 __Pyx_XDECREF(__pyx_v_bytesitem);
9655 __Pyx_XDECREF(__pyx_v_result);
9656 __Pyx_XGIVEREF(__pyx_r);
9657 __Pyx_RefNannyFinishContext();
9658 return __pyx_r;
9659}
9660
9661/* "View.MemoryView":548
9662 * return result
9663 *
9664 * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
9665 * """Only used if instantiated manually by the user, or if Cython doesn't
9666 * know how to convert the type"""
9667*/
9668
9669static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
9670 PyObject *__pyx_v_struct = NULL;
9671 char __pyx_v_c;
9672 PyObject *__pyx_v_bytesvalue = 0;
9673 Py_ssize_t __pyx_v_i;
9674 PyObject *__pyx_r = NULL;
9675 __Pyx_RefNannyDeclarations
9676 PyObject *__pyx_t_1 = NULL;
9677 PyObject *__pyx_t_2 = NULL;
9678 int __pyx_t_3;
9679 PyObject *__pyx_t_4 = NULL;
9680 PyObject *__pyx_t_5 = NULL;
9681 PyObject *__pyx_t_6 = NULL;
9682 size_t __pyx_t_7;
9683 Py_ssize_t __pyx_t_8;
9684 PyObject *__pyx_t_9 = NULL;
9685 char *__pyx_t_10;
9686 char *__pyx_t_11;
9687 Py_ssize_t __pyx_t_12;
9688 char *__pyx_t_13;
9689 char *__pyx_t_14;
9690 int __pyx_lineno = 0;
9691 const char *__pyx_filename = NULL;
9692 int __pyx_clineno = 0;
9693 __Pyx_RefNannySetupContext("assign_item_from_object", 0);
9694
9695 /* "View.MemoryView":551
9696 * """Only used if instantiated manually by the user, or if Cython doesn't
9697 * know how to convert the type"""
9698 * import struct # <<<<<<<<<<<<<<
9699 * cdef char c
9700 * cdef bytes bytesvalue
9701*/
9702 __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)
9703 __pyx_t_1 = __pyx_t_2;
9704 __Pyx_GOTREF(__pyx_t_1);
9705 __pyx_v_struct = __pyx_t_1;
9706 __pyx_t_1 = 0;
9707
9708 /* "View.MemoryView":556
9709 * cdef Py_ssize_t i
9710 *
9711 * if isinstance(value, tuple): # <<<<<<<<<<<<<<
9712 * bytesvalue = struct.pack(self.view.format, *value)
9713 * else:
9714*/
9715 __pyx_t_3 = PyTuple_Check(__pyx_v_value);
9716 if (__pyx_t_3) {
9717
9718
9719 /* "View.MemoryView":557
9720 *
9721 * if isinstance(value, tuple):
9722 * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
9723 * else:
9724 * bytesvalue = struct.pack(self.view.format, value)
9725*/
9726 __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)
9727 __Pyx_GOTREF(__pyx_t_1);
9728 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 557, __pyx_L1_error)
9729 __Pyx_GOTREF(__pyx_t_4);
9730 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 557, __pyx_L1_error)
9731 __Pyx_GOTREF(__pyx_t_5);
9732 __Pyx_GIVEREF(__pyx_t_4);
9733 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4) != (0)) __PYX_ERR(1, 557, __pyx_L1_error);
9734 __pyx_t_4 = 0;
9735 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 557, __pyx_L1_error)
9736 __Pyx_GOTREF(__pyx_t_4);
9737 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 557, __pyx_L1_error)
9738 __Pyx_GOTREF(__pyx_t_6);
9739 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9740 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9741 __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)
9742 __Pyx_GOTREF(__pyx_t_4);
9743 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9744 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9745 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)
9746 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
9747 __pyx_t_4 = 0;
9748
9749 /* "View.MemoryView":556
9750 * cdef Py_ssize_t i
9751 *
9752 * if isinstance(value, tuple): # <<<<<<<<<<<<<<
9753 * bytesvalue = struct.pack(self.view.format, *value)
9754 * else:
9755*/
9756 goto __pyx_L3;
9757 }
9758
9759 /* "View.MemoryView":559
9760 * bytesvalue = struct.pack(self.view.format, *value)
9761 * else:
9762 * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
9763 *
9764 * for i, c in enumerate(bytesvalue):
9765*/
9766 /*else*/ {
9767 __pyx_t_6 = __pyx_v_struct;
9768 __Pyx_INCREF(__pyx_t_6);
9769 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 559, __pyx_L1_error)
9770 __Pyx_GOTREF(__pyx_t_1);
9771 __pyx_t_7 = 0;
9772 {
9773 PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_1, __pyx_v_value};
9774 __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));
9775 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9776 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9777 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 559, __pyx_L1_error)
9778 __Pyx_GOTREF(__pyx_t_4);
9779 }
9780 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)
9781 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
9782 __pyx_t_4 = 0;
9783 }
9784 __pyx_L3:;
9785
9786 /* "View.MemoryView":561
9787 * bytesvalue = struct.pack(self.view.format, value)
9788 *
9789 * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
9790 * itemp[i] = c
9791 *
9792*/
9793
9794 __pyx_t_8 = 0;
9795 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
9796 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 is not iterable");
9797 __PYX_ERR(1, 561, __pyx_L1_error)
9798 }
9799 __Pyx_INCREF(__pyx_v_bytesvalue);
9800 __pyx_t_9 = __pyx_v_bytesvalue;
9801 __pyx_t_11 = __Pyx_PyBytes_AsWritableString(__pyx_t_9); if (unlikely(__pyx_t_11 == ((char *)NULL))) __PYX_ERR(1, 561, __pyx_L1_error)
9802 __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)
9803 __pyx_t_13 = (__pyx_t_11 + __pyx_t_12);
9804
9805 for (__pyx_t_14 = __pyx_t_11; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
9806 __pyx_t_10 = __pyx_t_14;
9807 __pyx_v_c = (__pyx_t_10[0]);
9808
9809 /* "View.MemoryView":562
9810 *
9811 * for i, c in enumerate(bytesvalue):
9812 * itemp[i] = c # <<<<<<<<<<<<<<
9813 *
9814 * @cname('getbuffer')
9815*/
9816 __pyx_v_i = __pyx_t_8;
9817
9818 /* "View.MemoryView":561
9819 * bytesvalue = struct.pack(self.view.format, value)
9820 *
9821 * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
9822 * itemp[i] = c
9823 *
9824*/
9825 __pyx_t_8 = (__pyx_t_8 + 1);
9826
9827 /* "View.MemoryView":562
9828 *
9829 * for i, c in enumerate(bytesvalue):
9830 * itemp[i] = c # <<<<<<<<<<<<<<
9831 *
9832 * @cname('getbuffer')
9833*/
9834 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
9835 }
9836
9837
9838
9839 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9840
9841 /* "View.MemoryView":548
9842 * return result
9843 *
9844 * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
9845 * """Only used if instantiated manually by the user, or if Cython doesn't
9846 * know how to convert the type"""
9847*/
9848
9849 /* function exit code */
9850 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9851 goto __pyx_L0;
9852 __pyx_L1_error:;
9853 __Pyx_XDECREF(__pyx_t_1);
9854 __Pyx_XDECREF(__pyx_t_4);
9855 __Pyx_XDECREF(__pyx_t_5);
9856 __Pyx_XDECREF(__pyx_t_6);
9857 __Pyx_XDECREF(__pyx_t_9);
9858 __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9859 __pyx_r = 0;
9860 __pyx_L0:;
9861 __Pyx_XDECREF(__pyx_v_struct);
9862
9863 __Pyx_XDECREF(__pyx_v_bytesvalue);
9864
9865 __Pyx_XGIVEREF(__pyx_r);
9866 __Pyx_RefNannyFinishContext();
9867 return __pyx_r;
9868}
9869
9870/* "View.MemoryView":564
9871 * itemp[i] = c
9872 *
9873 * @cname('getbuffer') # <<<<<<<<<<<<<<
9874 * def __getbuffer__(self, Py_buffer *info, int flags):
9875 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly):
9876*/
9877
9878/* Python wrapper */
9879CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
9880CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9881 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
9882 int __pyx_r;
9883 __Pyx_RefNannyDeclarations
9884 __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
9885 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
9886 __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));
9887
9888 /* function exit code */
9889
9890
9891 __Pyx_RefNannyFinishContext();
9892 return __pyx_r;
9893}
9894
9895static 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) {
9896 int __pyx_r;
9897 __Pyx_RefNannyDeclarations
9898 int __pyx_t_1;
9899 int __pyx_t_2;
9900 int __pyx_t_3;
9901 Py_ssize_t *__pyx_t_4;
9902 char *__pyx_t_5;
9903 void *__pyx_t_6;
9904 Py_ssize_t __pyx_t_7;
9905 int __pyx_lineno = 0;
9906 const char *__pyx_filename = NULL;
9907 int __pyx_clineno = 0;
9908 if (unlikely(__pyx_v_info == NULL)) {
9909 PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
9910 return -1;
9911 }
9912 __Pyx_RefNannySetupContext("__getbuffer__", 0);
9913 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
9914 __Pyx_GIVEREF(__pyx_v_info->obj);
9915
9916 /* "View.MemoryView":566
9917 * @cname('getbuffer')
9918 * def __getbuffer__(self, Py_buffer *info, int flags):
9919 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly): # <<<<<<<<<<<<<<
9920 * _err_ValueError("Cannot create writable memory view from read-only memoryview")
9921 *
9922*/
9923 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
9924
9925 if (__pyx_t_2) {
9926
9927 } else {
9928
9929 __pyx_t_1 = __pyx_t_2;
9930
9931 goto __pyx_L4_bool_binop_done;
9932 }
9933
9934 __pyx_t_1 = __pyx_v_self->view.readonly;
9935 __pyx_L4_bool_binop_done:;
9936 if (unlikely(__pyx_t_1)) {
9937
9938
9939 /* "View.MemoryView":567
9940 * def __getbuffer__(self, Py_buffer *info, int flags):
9941 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly):
9942 * _err_ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
9943 *
9944 * if flags & PyBUF_ND:
9945*/
9946 __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)
9947
9948
9949 /* "View.MemoryView":566
9950 * @cname('getbuffer')
9951 * def __getbuffer__(self, Py_buffer *info, int flags):
9952 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly): # <<<<<<<<<<<<<<
9953 * _err_ValueError("Cannot create writable memory view from read-only memoryview")
9954 *
9955*/
9956 }
9957
9958 /* "View.MemoryView":569
9959 * _err_ValueError("Cannot create writable memory view from read-only memoryview")
9960 *
9961 * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
9962 * info.shape = self.view.shape
9963 * else:
9964*/
9965 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
9966
9967 if (__pyx_t_1) {
9968
9969
9970 /* "View.MemoryView":570
9971 *
9972 * if flags & PyBUF_ND:
9973 * info.shape = self.view.shape # <<<<<<<<<<<<<<
9974 * else:
9975 * info.shape = NULL
9976*/
9977 __pyx_t_4 = __pyx_v_self->view.shape;
9978
9979 __pyx_v_info->shape = __pyx_t_4;
9980
9981 /* "View.MemoryView":569
9982 * _err_ValueError("Cannot create writable memory view from read-only memoryview")
9983 *
9984 * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
9985 * info.shape = self.view.shape
9986 * else:
9987*/
9988 goto __pyx_L6;
9989 }
9990
9991 /* "View.MemoryView":572
9992 * info.shape = self.view.shape
9993 * else:
9994 * info.shape = NULL # <<<<<<<<<<<<<<
9995 *
9996 * if flags & PyBUF_STRIDES:
9997*/
9998 /*else*/ {
9999 __pyx_v_info->shape = NULL;
10000 }
10001 __pyx_L6:;
10002
10003 /* "View.MemoryView":574
10004 * info.shape = NULL
10005 *
10006 * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
10007 * info.strides = self.view.strides
10008 * else:
10009*/
10010 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
10011
10012 if (__pyx_t_1) {
10013
10014
10015 /* "View.MemoryView":575
10016 *
10017 * if flags & PyBUF_STRIDES:
10018 * info.strides = self.view.strides # <<<<<<<<<<<<<<
10019 * else:
10020 * info.strides = NULL
10021*/
10022 __pyx_t_4 = __pyx_v_self->view.strides;
10023
10024 __pyx_v_info->strides = __pyx_t_4;
10025
10026 /* "View.MemoryView":574
10027 * info.shape = NULL
10028 *
10029 * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
10030 * info.strides = self.view.strides
10031 * else:
10032*/
10033 goto __pyx_L7;
10034 }
10035
10036 /* "View.MemoryView":577
10037 * info.strides = self.view.strides
10038 * else:
10039 * info.strides = NULL # <<<<<<<<<<<<<<
10040 *
10041 * if flags & PyBUF_INDIRECT:
10042*/
10043 /*else*/ {
10044 __pyx_v_info->strides = NULL;
10045 }
10046 __pyx_L7:;
10047
10048 /* "View.MemoryView":579
10049 * info.strides = NULL
10050 *
10051 * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
10052 * info.suboffsets = self.view.suboffsets
10053 * else:
10054*/
10055 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
10056
10057 if (__pyx_t_1) {
10058
10059
10060 /* "View.MemoryView":580
10061 *
10062 * if flags & PyBUF_INDIRECT:
10063 * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
10064 * else:
10065 * info.suboffsets = NULL
10066*/
10067 __pyx_t_4 = __pyx_v_self->view.suboffsets;
10068
10069 __pyx_v_info->suboffsets = __pyx_t_4;
10070
10071 /* "View.MemoryView":579
10072 * info.strides = NULL
10073 *
10074 * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
10075 * info.suboffsets = self.view.suboffsets
10076 * else:
10077*/
10078 goto __pyx_L8;
10079 }
10080
10081 /* "View.MemoryView":582
10082 * info.suboffsets = self.view.suboffsets
10083 * else:
10084 * info.suboffsets = NULL # <<<<<<<<<<<<<<
10085 *
10086 * if flags & PyBUF_FORMAT:
10087*/
10088 /*else*/ {
10089 __pyx_v_info->suboffsets = NULL;
10090 }
10091 __pyx_L8:;
10092
10093 /* "View.MemoryView":584
10094 * info.suboffsets = NULL
10095 *
10096 * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10097 * info.format = self.view.format
10098 * else:
10099*/
10100 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10101
10102 if (__pyx_t_1) {
10103
10104
10105 /* "View.MemoryView":585
10106 *
10107 * if flags & PyBUF_FORMAT:
10108 * info.format = self.view.format # <<<<<<<<<<<<<<
10109 * else:
10110 * info.format = NULL
10111*/
10112 __pyx_t_5 = __pyx_v_self->view.format;
10113
10114 __pyx_v_info->format = __pyx_t_5;
10115
10116 /* "View.MemoryView":584
10117 * info.suboffsets = NULL
10118 *
10119 * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10120 * info.format = self.view.format
10121 * else:
10122*/
10123 goto __pyx_L9;
10124 }
10125
10126 /* "View.MemoryView":587
10127 * info.format = self.view.format
10128 * else:
10129 * info.format = NULL # <<<<<<<<<<<<<<
10130 *
10131 * info.buf = self.view.buf
10132*/
10133 /*else*/ {
10134 __pyx_v_info->format = NULL;
10135 }
10136 __pyx_L9:;
10137
10138 /* "View.MemoryView":589
10139 * info.format = NULL
10140 *
10141 * info.buf = self.view.buf # <<<<<<<<<<<<<<
10142 * info.ndim = self.view.ndim
10143 * info.itemsize = self.view.itemsize
10144*/
10145 __pyx_t_6 = __pyx_v_self->view.buf;
10146
10147 __pyx_v_info->buf = __pyx_t_6;
10148
10149 /* "View.MemoryView":590
10150 *
10151 * info.buf = self.view.buf
10152 * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
10153 * info.itemsize = self.view.itemsize
10154 * info.len = self.view.len
10155*/
10156 __pyx_t_3 = __pyx_v_self->view.ndim;
10157
10158 __pyx_v_info->ndim = __pyx_t_3;
10159
10160 /* "View.MemoryView":591
10161 * info.buf = self.view.buf
10162 * info.ndim = self.view.ndim
10163 * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
10164 * info.len = self.view.len
10165 * info.readonly = self.view.readonly
10166*/
10167 __pyx_t_7 = __pyx_v_self->view.itemsize;
10168
10169 __pyx_v_info->itemsize = __pyx_t_7;
10170
10171 /* "View.MemoryView":592
10172 * info.ndim = self.view.ndim
10173 * info.itemsize = self.view.itemsize
10174 * info.len = self.view.len # <<<<<<<<<<<<<<
10175 * info.readonly = self.view.readonly
10176 * info.obj = self
10177*/
10178 __pyx_t_7 = __pyx_v_self->view.len;
10179
10180 __pyx_v_info->len = __pyx_t_7;
10181
10182 /* "View.MemoryView":593
10183 * info.itemsize = self.view.itemsize
10184 * info.len = self.view.len
10185 * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
10186 * info.obj = self
10187 *
10188*/
10189 __pyx_t_1 = __pyx_v_self->view.readonly;
10190
10191 __pyx_v_info->readonly = __pyx_t_1;
10192
10193 /* "View.MemoryView":594
10194 * info.len = self.view.len
10195 * info.readonly = self.view.readonly
10196 * info.obj = self # <<<<<<<<<<<<<<
10197 *
10198 *
10199*/
10200 __Pyx_INCREF((PyObject *)__pyx_v_self);
10201 __Pyx_GIVEREF((PyObject *)__pyx_v_self);
10202 __Pyx_GOTREF(__pyx_v_info->obj);
10203 __Pyx_DECREF(__pyx_v_info->obj);
10204 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
10205
10206 /* "View.MemoryView":564
10207 * itemp[i] = c
10208 *
10209 * @cname('getbuffer') # <<<<<<<<<<<<<<
10210 * def __getbuffer__(self, Py_buffer *info, int flags):
10211 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly):
10212*/
10213
10214 /* function exit code */
10215 __pyx_r = 0;
10216 goto __pyx_L0;
10217 __pyx_L1_error:;
10218 __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10219 __pyx_r = -1;
10220 if (__pyx_v_info->obj != NULL) {
10221 __Pyx_GOTREF(__pyx_v_info->obj);
10222 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10223 }
10224 goto __pyx_L2;
10225 __pyx_L0:;
10226 if (__pyx_v_info->obj == Py_None) {
10227 __Pyx_GOTREF(__pyx_v_info->obj);
10228 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10229 }
10230 __pyx_L2:;
10231
10232 __Pyx_RefNannyFinishContext();
10233 return __pyx_r;
10234}
10235
10236/* "View.MemoryView":597
10237 *
10238 *
10239 * @property # <<<<<<<<<<<<<<
10240 * def T(self):
10241 * cdef _memoryviewslice result = memoryview_copy(self)
10242*/
10243
10244/* Python wrapper */
10245static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
10246static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
10247 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10248 PyObject *__pyx_r = 0;
10249 __Pyx_RefNannyDeclarations
10250 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10251 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10252 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10253
10254 /* function exit code */
10255 __Pyx_RefNannyFinishContext();
10256 return __pyx_r;
10257}
10258
10259static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10260 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
10261 PyObject *__pyx_r = NULL;
10262 __Pyx_RefNannyDeclarations
10263 PyObject *__pyx_t_1 = NULL;
10264 int __pyx_t_2;
10265 int __pyx_lineno = 0;
10266 const char *__pyx_filename = NULL;
10267 int __pyx_clineno = 0;
10268 __Pyx_RefNannySetupContext("__get__", 0);
10269
10270 /* "View.MemoryView":599
10271 * @property
10272 * def T(self):
10273 * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
10274 * transpose_memslice(&result.from_slice)
10275 * return result
10276*/
10277 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 599, __pyx_L1_error)
10278 __Pyx_GOTREF(__pyx_t_1);
10279 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)
10280 __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
10281 __pyx_t_1 = 0;
10282
10283 /* "View.MemoryView":600
10284 * def T(self):
10285 * cdef _memoryviewslice result = memoryview_copy(self)
10286 * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
10287 * return result
10288 *
10289*/
10290 __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)
10291
10292
10293 /* "View.MemoryView":601
10294 * cdef _memoryviewslice result = memoryview_copy(self)
10295 * transpose_memslice(&result.from_slice)
10296 * return result # <<<<<<<<<<<<<<
10297 *
10298 * @property
10299*/
10300 {
10301 PyObject *__pyx_temp;
10302 {
10303 __pyx_temp = __pyx_r;
10304 __Pyx_INCREF((PyObject *)__pyx_v_result);
10305 __pyx_r = ((PyObject *)__pyx_v_result);
10306 }
10307 __Pyx_XDECREF(__pyx_temp);
10308 }
10309 goto __pyx_L0;
10310
10311 /* "View.MemoryView":597
10312 *
10313 *
10314 * @property # <<<<<<<<<<<<<<
10315 * def T(self):
10316 * cdef _memoryviewslice result = memoryview_copy(self)
10317*/
10318
10319 /* function exit code */
10320 __pyx_L1_error:;
10321 __Pyx_XDECREF(__pyx_t_1);
10322 __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10323 __pyx_r = NULL;
10324 __pyx_L0:;
10325 __Pyx_XDECREF((PyObject *)__pyx_v_result);
10326 __Pyx_XGIVEREF(__pyx_r);
10327 __Pyx_RefNannyFinishContext();
10328 return __pyx_r;
10329}
10330
10331/* "View.MemoryView":603
10332 * return result
10333 *
10334 * @property # <<<<<<<<<<<<<<
10335 * def base(self):
10336 * return self._get_base()
10337*/
10338
10339/* Python wrapper */
10340static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
10341static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
10342 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10343 PyObject *__pyx_r = 0;
10344 __Pyx_RefNannyDeclarations
10345 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10346 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10347 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10348
10349 /* function exit code */
10350 __Pyx_RefNannyFinishContext();
10351 return __pyx_r;
10352}
10353
10354static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10355 PyObject *__pyx_r = NULL;
10356 __Pyx_RefNannyDeclarations
10357 PyObject *__pyx_t_1 = NULL;
10358 int __pyx_lineno = 0;
10359 const char *__pyx_filename = NULL;
10360 int __pyx_clineno = 0;
10361 __Pyx_RefNannySetupContext("__get__", 0);
10362
10363 /* "View.MemoryView":605
10364 * @property
10365 * def base(self):
10366 * return self._get_base() # <<<<<<<<<<<<<<
10367 *
10368 * cdef _get_base(self):
10369*/
10370 __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)
10371 __Pyx_GOTREF(__pyx_t_1);
10372 {
10373 PyObject *__pyx_temp;
10374 {
10375 __pyx_temp = __pyx_r;
10376 __pyx_r = __pyx_t_1;
10377 }
10378 __Pyx_XDECREF(__pyx_temp);
10379 }
10380 __pyx_t_1 = 0;
10381 goto __pyx_L0;
10382
10383 /* "View.MemoryView":603
10384 * return result
10385 *
10386 * @property # <<<<<<<<<<<<<<
10387 * def base(self):
10388 * return self._get_base()
10389*/
10390
10391 /* function exit code */
10392 __pyx_L1_error:;
10393 __Pyx_XDECREF(__pyx_t_1);
10394 __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10395 __pyx_r = NULL;
10396 __pyx_L0:;
10397 __Pyx_XGIVEREF(__pyx_r);
10398 __Pyx_RefNannyFinishContext();
10399 return __pyx_r;
10400}
10401
10402/* "View.MemoryView":607
10403 * return self._get_base()
10404 *
10405 * cdef _get_base(self): # <<<<<<<<<<<<<<
10406 * return self.obj
10407 *
10408*/
10409
10410static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self) {
10411 PyObject *__pyx_r = NULL;
10412 __Pyx_RefNannyDeclarations
10413 __Pyx_RefNannySetupContext("_get_base", 0);
10414
10415 /* "View.MemoryView":608
10416 *
10417 * cdef _get_base(self):
10418 * return self.obj # <<<<<<<<<<<<<<
10419 *
10420 * @property
10421*/
10422 {
10423 PyObject *__pyx_temp;
10424 {
10425 __pyx_temp = __pyx_r;
10426 __Pyx_INCREF(__pyx_v_self->obj);
10427 __pyx_r = __pyx_v_self->obj;
10428 }
10429 __Pyx_XDECREF(__pyx_temp);
10430 }
10431 goto __pyx_L0;
10432
10433 /* "View.MemoryView":607
10434 * return self._get_base()
10435 *
10436 * cdef _get_base(self): # <<<<<<<<<<<<<<
10437 * return self.obj
10438 *
10439*/
10440
10441 /* function exit code */
10442 __pyx_L0:;
10443 __Pyx_XGIVEREF(__pyx_r);
10444 __Pyx_RefNannyFinishContext();
10445 return __pyx_r;
10446}
10447
10448/* "View.MemoryView":610
10449 * return self.obj
10450 *
10451 * @property # <<<<<<<<<<<<<<
10452 * def shape(self):
10453 * return tuple([length for length in self.view.shape[:self.view.ndim]])
10454*/
10455
10456/* Python wrapper */
10457static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
10458static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
10459 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10460 PyObject *__pyx_r = 0;
10461 __Pyx_RefNannyDeclarations
10462 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10463 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10464 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10465
10466 /* function exit code */
10467 __Pyx_RefNannyFinishContext();
10468 return __pyx_r;
10469}
10470
10471static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10472 Py_ssize_t __pyx_7genexpr__pyx_v_length;
10473 PyObject *__pyx_r = NULL;
10474 __Pyx_RefNannyDeclarations
10475 PyObject *__pyx_t_1 = NULL;
10476 Py_ssize_t *__pyx_t_2;
10477 Py_ssize_t *__pyx_t_3;
10478 Py_ssize_t *__pyx_t_4;
10479 PyObject *__pyx_t_5 = NULL;
10480 int __pyx_lineno = 0;
10481 const char *__pyx_filename = NULL;
10482 int __pyx_clineno = 0;
10483 __Pyx_RefNannySetupContext("__get__", 0);
10484
10485 /* "View.MemoryView":612
10486 * @property
10487 * def shape(self):
10488 * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
10489 *
10490 * @property
10491*/
10492 { /* enter inner scope */
10493 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
10494 __Pyx_GOTREF(__pyx_t_1);
10495 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
10496
10497 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
10498 __pyx_t_2 = __pyx_t_4;
10499 __pyx_7genexpr__pyx_v_length = (__pyx_t_2[0]);
10500 __pyx_t_5 = PyLong_FromSsize_t(__pyx_7genexpr__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 612, __pyx_L1_error)
10501 __Pyx_GOTREF(__pyx_t_5);
10502 __Pyx_GIVEREF(__pyx_t_5);
10503 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_1, __pyx_t_5))) __PYX_ERR(1, 612, __pyx_L1_error)
10504 __pyx_t_5 = 0;
10505 }
10506
10507 } /* exit inner scope */
10508 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 612, __pyx_L1_error)
10509 __Pyx_GOTREF(__pyx_t_5);
10510 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10511 {
10512 PyObject *__pyx_temp;
10513 {
10514 __pyx_temp = __pyx_r;
10515 __pyx_r = __pyx_t_5;
10516 }
10517 __Pyx_XDECREF(__pyx_temp);
10518 }
10519 __pyx_t_5 = 0;
10520 goto __pyx_L0;
10521
10522 /* "View.MemoryView":610
10523 * return self.obj
10524 *
10525 * @property # <<<<<<<<<<<<<<
10526 * def shape(self):
10527 * return tuple([length for length in self.view.shape[:self.view.ndim]])
10528*/
10529
10530 /* function exit code */
10531 __pyx_L1_error:;
10532 __Pyx_XDECREF(__pyx_t_1);
10533 __Pyx_XDECREF(__pyx_t_5);
10534 __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10535 __pyx_r = NULL;
10536 __pyx_L0:;
10537
10538 __Pyx_XGIVEREF(__pyx_r);
10539 __Pyx_RefNannyFinishContext();
10540 return __pyx_r;
10541}
10542
10543/* "View.MemoryView":614
10544 * return tuple([length for length in self.view.shape[:self.view.ndim]])
10545 *
10546 * @property # <<<<<<<<<<<<<<
10547 * def strides(self):
10548 * if cython.unlikely(self.view.strides == NULL):
10549*/
10550
10551/* Python wrapper */
10552static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
10553static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
10554 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10555 PyObject *__pyx_r = 0;
10556 __Pyx_RefNannyDeclarations
10557 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10558 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10559 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10560
10561 /* function exit code */
10562 __Pyx_RefNannyFinishContext();
10563 return __pyx_r;
10564}
10565
10566static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10567 Py_ssize_t __pyx_8genexpr1__pyx_v_stride;
10568 PyObject *__pyx_r = NULL;
10569 __Pyx_RefNannyDeclarations
10570 int __pyx_t_1;
10571 int __pyx_t_2;
10572 PyObject *__pyx_t_3 = NULL;
10573 Py_ssize_t *__pyx_t_4;
10574 Py_ssize_t *__pyx_t_5;
10575 Py_ssize_t *__pyx_t_6;
10576 PyObject *__pyx_t_7 = NULL;
10577 int __pyx_lineno = 0;
10578 const char *__pyx_filename = NULL;
10579 int __pyx_clineno = 0;
10580 __Pyx_RefNannySetupContext("__get__", 0);
10581
10582 /* "View.MemoryView":616
10583 * @property
10584 * def strides(self):
10585 * if cython.unlikely(self.view.strides == NULL): # <<<<<<<<<<<<<<
10586 *
10587 * _err_ValueError("Buffer view does not expose strides")
10588*/
10589 __pyx_t_1 = (__pyx_v_self->view.strides == NULL);
10590
10591 if (unlikely(__pyx_t_1)) {
10592
10593
10594 /* "View.MemoryView":618
10595 * if cython.unlikely(self.view.strides == NULL):
10596 *
10597 * _err_ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
10598 *
10599 * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
10600*/
10601 __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)
10602
10603
10604 /* "View.MemoryView":616
10605 * @property
10606 * def strides(self):
10607 * if cython.unlikely(self.view.strides == NULL): # <<<<<<<<<<<<<<
10608 *
10609 * _err_ValueError("Buffer view does not expose strides")
10610*/
10611 }
10612
10613 /* "View.MemoryView":620
10614 * _err_ValueError("Buffer view does not expose strides")
10615 *
10616 * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
10617 *
10618 * @property
10619*/
10620 { /* enter inner scope */
10621 __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 620, __pyx_L1_error)
10622 __Pyx_GOTREF(__pyx_t_3);
10623 __pyx_t_5 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
10624
10625 for (__pyx_t_6 = __pyx_v_self->view.strides; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
10626 __pyx_t_4 = __pyx_t_6;
10627 __pyx_8genexpr1__pyx_v_stride = (__pyx_t_4[0]);
10628 __pyx_t_7 = PyLong_FromSsize_t(__pyx_8genexpr1__pyx_v_stride); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 620, __pyx_L1_error)
10629 __Pyx_GOTREF(__pyx_t_7);
10630 __Pyx_GIVEREF(__pyx_t_7);
10631 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_3, __pyx_t_7))) __PYX_ERR(1, 620, __pyx_L1_error)
10632 __pyx_t_7 = 0;
10633 }
10634
10635 } /* exit inner scope */
10636 __pyx_t_7 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 620, __pyx_L1_error)
10637 __Pyx_GOTREF(__pyx_t_7);
10638 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10639 {
10640 PyObject *__pyx_temp;
10641 {
10642 __pyx_temp = __pyx_r;
10643 __pyx_r = __pyx_t_7;
10644 }
10645 __Pyx_XDECREF(__pyx_temp);
10646 }
10647 __pyx_t_7 = 0;
10648 goto __pyx_L0;
10649
10650 /* "View.MemoryView":614
10651 * return tuple([length for length in self.view.shape[:self.view.ndim]])
10652 *
10653 * @property # <<<<<<<<<<<<<<
10654 * def strides(self):
10655 * if cython.unlikely(self.view.strides == NULL):
10656*/
10657
10658 /* function exit code */
10659 __pyx_L1_error:;
10660 __Pyx_XDECREF(__pyx_t_3);
10661 __Pyx_XDECREF(__pyx_t_7);
10662 __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10663 __pyx_r = NULL;
10664 __pyx_L0:;
10665
10666 __Pyx_XGIVEREF(__pyx_r);
10667 __Pyx_RefNannyFinishContext();
10668 return __pyx_r;
10669}
10670
10671/* "View.MemoryView":622
10672 * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
10673 *
10674 * @property # <<<<<<<<<<<<<<
10675 * def suboffsets(self):
10676 * if self.view.suboffsets == NULL:
10677*/
10678
10679/* Python wrapper */
10680static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
10681static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
10682 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10683 PyObject *__pyx_r = 0;
10684 __Pyx_RefNannyDeclarations
10685 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10686 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10687 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10688
10689 /* function exit code */
10690 __Pyx_RefNannyFinishContext();
10691 return __pyx_r;
10692}
10693
10694static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10695 Py_ssize_t __pyx_8genexpr2__pyx_v_suboffset;
10696 PyObject *__pyx_r = NULL;
10697 __Pyx_RefNannyDeclarations
10698 int __pyx_t_1;
10699 PyObject *__pyx_t_2 = NULL;
10700 Py_ssize_t *__pyx_t_3;
10701 Py_ssize_t *__pyx_t_4;
10702 Py_ssize_t *__pyx_t_5;
10703 PyObject *__pyx_t_6 = NULL;
10704 int __pyx_lineno = 0;
10705 const char *__pyx_filename = NULL;
10706 int __pyx_clineno = 0;
10707 __Pyx_RefNannySetupContext("__get__", 0);
10708
10709 /* "View.MemoryView":624
10710 * @property
10711 * def suboffsets(self):
10712 * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
10713 * return (-1,) * self.view.ndim
10714 *
10715*/
10716 __pyx_t_1 = (__pyx_v_self->view.suboffsets == NULL);
10717
10718 if (__pyx_t_1) {
10719
10720
10721 /* "View.MemoryView":625
10722 * def suboffsets(self):
10723 * if self.view.suboffsets == NULL:
10724 * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
10725 *
10726 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
10727*/
10728 __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)
10729 __Pyx_GOTREF(__pyx_t_2);
10730 {
10731 PyObject *__pyx_temp;
10732 {
10733 __pyx_temp = __pyx_r;
10734 __pyx_r = __pyx_t_2;
10735 }
10736 __Pyx_XDECREF(__pyx_temp);
10737 }
10738 __pyx_t_2 = 0;
10739 goto __pyx_L0;
10740
10741 /* "View.MemoryView":624
10742 * @property
10743 * def suboffsets(self):
10744 * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
10745 * return (-1,) * self.view.ndim
10746 *
10747*/
10748 }
10749
10750 /* "View.MemoryView":627
10751 * return (-1,) * self.view.ndim
10752 *
10753 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
10754 *
10755 * @property
10756*/
10757 { /* enter inner scope */
10758 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 627, __pyx_L1_error)
10759 __Pyx_GOTREF(__pyx_t_2);
10760 __pyx_t_4 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
10761
10762 for (__pyx_t_5 = __pyx_v_self->view.suboffsets; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
10763 __pyx_t_3 = __pyx_t_5;
10764 __pyx_8genexpr2__pyx_v_suboffset = (__pyx_t_3[0]);
10765 __pyx_t_6 = PyLong_FromSsize_t(__pyx_8genexpr2__pyx_v_suboffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 627, __pyx_L1_error)
10766 __Pyx_GOTREF(__pyx_t_6);
10767 __Pyx_GIVEREF(__pyx_t_6);
10768 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_2, __pyx_t_6))) __PYX_ERR(1, 627, __pyx_L1_error)
10769 __pyx_t_6 = 0;
10770 }
10771
10772 } /* exit inner scope */
10773 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 627, __pyx_L1_error)
10774 __Pyx_GOTREF(__pyx_t_6);
10775 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10776 {
10777 PyObject *__pyx_temp;
10778 {
10779 __pyx_temp = __pyx_r;
10780 __pyx_r = __pyx_t_6;
10781 }
10782 __Pyx_XDECREF(__pyx_temp);
10783 }
10784 __pyx_t_6 = 0;
10785 goto __pyx_L0;
10786
10787 /* "View.MemoryView":622
10788 * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
10789 *
10790 * @property # <<<<<<<<<<<<<<
10791 * def suboffsets(self):
10792 * if self.view.suboffsets == NULL:
10793*/
10794
10795 /* function exit code */
10796 __pyx_L1_error:;
10797 __Pyx_XDECREF(__pyx_t_2);
10798 __Pyx_XDECREF(__pyx_t_6);
10799 __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10800 __pyx_r = NULL;
10801 __pyx_L0:;
10802
10803 __Pyx_XGIVEREF(__pyx_r);
10804 __Pyx_RefNannyFinishContext();
10805 return __pyx_r;
10806}
10807
10808/* "View.MemoryView":629
10809 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
10810 *
10811 * @property # <<<<<<<<<<<<<<
10812 * def ndim(self):
10813 * return self.view.ndim
10814*/
10815
10816/* Python wrapper */
10817static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
10818static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
10819 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10820 PyObject *__pyx_r = 0;
10821 __Pyx_RefNannyDeclarations
10822 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10823 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10824 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10825
10826 /* function exit code */
10827 __Pyx_RefNannyFinishContext();
10828 return __pyx_r;
10829}
10830
10831static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10832 PyObject *__pyx_r = NULL;
10833 __Pyx_RefNannyDeclarations
10834 PyObject *__pyx_t_1 = NULL;
10835 int __pyx_lineno = 0;
10836 const char *__pyx_filename = NULL;
10837 int __pyx_clineno = 0;
10838 __Pyx_RefNannySetupContext("__get__", 0);
10839
10840 /* "View.MemoryView":631
10841 * @property
10842 * def ndim(self):
10843 * return self.view.ndim # <<<<<<<<<<<<<<
10844 *
10845 * @property
10846*/
10847 __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 631, __pyx_L1_error)
10848 __Pyx_GOTREF(__pyx_t_1);
10849 {
10850 PyObject *__pyx_temp;
10851 {
10852 __pyx_temp = __pyx_r;
10853 __pyx_r = __pyx_t_1;
10854 }
10855 __Pyx_XDECREF(__pyx_temp);
10856 }
10857 __pyx_t_1 = 0;
10858 goto __pyx_L0;
10859
10860 /* "View.MemoryView":629
10861 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
10862 *
10863 * @property # <<<<<<<<<<<<<<
10864 * def ndim(self):
10865 * return self.view.ndim
10866*/
10867
10868 /* function exit code */
10869 __pyx_L1_error:;
10870 __Pyx_XDECREF(__pyx_t_1);
10871 __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10872 __pyx_r = NULL;
10873 __pyx_L0:;
10874 __Pyx_XGIVEREF(__pyx_r);
10875 __Pyx_RefNannyFinishContext();
10876 return __pyx_r;
10877}
10878
10879/* "View.MemoryView":633
10880 * return self.view.ndim
10881 *
10882 * @property # <<<<<<<<<<<<<<
10883 * def itemsize(self):
10884 * return self.view.itemsize
10885*/
10886
10887/* Python wrapper */
10888static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
10889static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
10890 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10891 PyObject *__pyx_r = 0;
10892 __Pyx_RefNannyDeclarations
10893 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10894 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10895 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10896
10897 /* function exit code */
10898 __Pyx_RefNannyFinishContext();
10899 return __pyx_r;
10900}
10901
10902static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10903 PyObject *__pyx_r = NULL;
10904 __Pyx_RefNannyDeclarations
10905 PyObject *__pyx_t_1 = NULL;
10906 int __pyx_lineno = 0;
10907 const char *__pyx_filename = NULL;
10908 int __pyx_clineno = 0;
10909 __Pyx_RefNannySetupContext("__get__", 0);
10910
10911 /* "View.MemoryView":635
10912 * @property
10913 * def itemsize(self):
10914 * return self.view.itemsize # <<<<<<<<<<<<<<
10915 *
10916 * @property
10917*/
10918 __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 635, __pyx_L1_error)
10919 __Pyx_GOTREF(__pyx_t_1);
10920 {
10921 PyObject *__pyx_temp;
10922 {
10923 __pyx_temp = __pyx_r;
10924 __pyx_r = __pyx_t_1;
10925 }
10926 __Pyx_XDECREF(__pyx_temp);
10927 }
10928 __pyx_t_1 = 0;
10929 goto __pyx_L0;
10930
10931 /* "View.MemoryView":633
10932 * return self.view.ndim
10933 *
10934 * @property # <<<<<<<<<<<<<<
10935 * def itemsize(self):
10936 * return self.view.itemsize
10937*/
10938
10939 /* function exit code */
10940 __pyx_L1_error:;
10941 __Pyx_XDECREF(__pyx_t_1);
10942 __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10943 __pyx_r = NULL;
10944 __pyx_L0:;
10945 __Pyx_XGIVEREF(__pyx_r);
10946 __Pyx_RefNannyFinishContext();
10947 return __pyx_r;
10948}
10949
10950/* "View.MemoryView":637
10951 * return self.view.itemsize
10952 *
10953 * @property # <<<<<<<<<<<<<<
10954 * def nbytes(self):
10955 * return self.size * self.view.itemsize
10956*/
10957
10958/* Python wrapper */
10959static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
10960static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
10961 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10962 PyObject *__pyx_r = 0;
10963 __Pyx_RefNannyDeclarations
10964 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10965 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10966 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10967
10968 /* function exit code */
10969 __Pyx_RefNannyFinishContext();
10970 return __pyx_r;
10971}
10972
10973static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10974 PyObject *__pyx_r = NULL;
10975 __Pyx_RefNannyDeclarations
10976 PyObject *__pyx_t_1 = NULL;
10977 PyObject *__pyx_t_2 = NULL;
10978 PyObject *__pyx_t_3 = NULL;
10979 int __pyx_lineno = 0;
10980 const char *__pyx_filename = NULL;
10981 int __pyx_clineno = 0;
10982 __Pyx_RefNannySetupContext("__get__", 0);
10983
10984 /* "View.MemoryView":639
10985 * @property
10986 * def nbytes(self):
10987 * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
10988 *
10989 * @property
10990*/
10991 __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)
10992 __Pyx_GOTREF(__pyx_t_1);
10993 __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 639, __pyx_L1_error)
10994 __Pyx_GOTREF(__pyx_t_2);
10995 __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)
10996 __Pyx_GOTREF(__pyx_t_3);
10997 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10998 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10999 {
11000 PyObject *__pyx_temp;
11001 {
11002 __pyx_temp = __pyx_r;
11003 __pyx_r = __pyx_t_3;
11004 }
11005 __Pyx_XDECREF(__pyx_temp);
11006 }
11007 __pyx_t_3 = 0;
11008 goto __pyx_L0;
11009
11010 /* "View.MemoryView":637
11011 * return self.view.itemsize
11012 *
11013 * @property # <<<<<<<<<<<<<<
11014 * def nbytes(self):
11015 * return self.size * self.view.itemsize
11016*/
11017
11018 /* function exit code */
11019 __pyx_L1_error:;
11020 __Pyx_XDECREF(__pyx_t_1);
11021 __Pyx_XDECREF(__pyx_t_2);
11022 __Pyx_XDECREF(__pyx_t_3);
11023 __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11024 __pyx_r = NULL;
11025 __pyx_L0:;
11026 __Pyx_XGIVEREF(__pyx_r);
11027 __Pyx_RefNannyFinishContext();
11028 return __pyx_r;
11029}
11030
11031/* "View.MemoryView":641
11032 * return self.size * self.view.itemsize
11033 *
11034 * @property # <<<<<<<<<<<<<<
11035 * def size(self):
11036 * cdef size_t result
11037*/
11038
11039/* Python wrapper */
11040static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
11041static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
11042 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11043 PyObject *__pyx_r = 0;
11044 __Pyx_RefNannyDeclarations
11045 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11046 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11047 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11048
11049 /* function exit code */
11050 __Pyx_RefNannyFinishContext();
11051 return __pyx_r;
11052}
11053
11054static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11055 size_t __pyx_v_result;
11056 Py_ssize_t __pyx_v_length;
11057 PyObject *__pyx_r = NULL;
11058 __Pyx_RefNannyDeclarations
11059 int __pyx_t_1;
11060 Py_ssize_t *__pyx_t_2;
11061 Py_ssize_t *__pyx_t_3;
11062 Py_ssize_t *__pyx_t_4;
11063 PyObject *__pyx_t_5 = NULL;
11064 int __pyx_lineno = 0;
11065 const char *__pyx_filename = NULL;
11066 int __pyx_clineno = 0;
11067 __Pyx_RefNannySetupContext("__get__", 0);
11068
11069 /* "View.MemoryView":644
11070 * def size(self):
11071 * cdef size_t result
11072 * if self._size is None: # <<<<<<<<<<<<<<
11073 * result = 1
11074 *
11075*/
11076 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
11077 if (__pyx_t_1) {
11078
11079
11080 /* "View.MemoryView":645
11081 * cdef size_t result
11082 * if self._size is None:
11083 * result = 1 # <<<<<<<<<<<<<<
11084 *
11085 * for length in self.view.shape[:self.view.ndim]:
11086*/
11087 __pyx_v_result = 1;
11088
11089 /* "View.MemoryView":647
11090 * result = 1
11091 *
11092 * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
11093 * result *= <size_t> length
11094 *
11095*/
11096 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
11097
11098 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
11099 __pyx_t_2 = __pyx_t_4;
11100 __pyx_v_length = (__pyx_t_2[0]);
11101
11102 /* "View.MemoryView":648
11103 *
11104 * for length in self.view.shape[:self.view.ndim]:
11105 * result *= <size_t> length # <<<<<<<<<<<<<<
11106 *
11107 * self._size = result
11108*/
11109 __pyx_v_result = (__pyx_v_result * ((size_t)__pyx_v_length));
11110 }
11111
11112
11113 /* "View.MemoryView":650
11114 * result *= <size_t> length
11115 *
11116 * self._size = result # <<<<<<<<<<<<<<
11117 *
11118 * return self._size
11119*/
11120 __pyx_t_5 = __Pyx_PyLong_FromSize_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 650, __pyx_L1_error)
11121 __Pyx_GOTREF(__pyx_t_5);
11122 __Pyx_GIVEREF(__pyx_t_5);
11123 __Pyx_GOTREF(__pyx_v_self->_size);
11124 __Pyx_DECREF(__pyx_v_self->_size);
11125 __pyx_v_self->_size = __pyx_t_5;
11126 __pyx_t_5 = 0;
11127
11128 /* "View.MemoryView":644
11129 * def size(self):
11130 * cdef size_t result
11131 * if self._size is None: # <<<<<<<<<<<<<<
11132 * result = 1
11133 *
11134*/
11135 }
11136
11137 /* "View.MemoryView":652
11138 * self._size = result
11139 *
11140 * return self._size # <<<<<<<<<<<<<<
11141 *
11142 * def __len__(self):
11143*/
11144 {
11145 PyObject *__pyx_temp;
11146 {
11147 __pyx_temp = __pyx_r;
11148 __Pyx_INCREF(__pyx_v_self->_size);
11149 __pyx_r = __pyx_v_self->_size;
11150 }
11151 __Pyx_XDECREF(__pyx_temp);
11152 }
11153 goto __pyx_L0;
11154
11155 /* "View.MemoryView":641
11156 * return self.size * self.view.itemsize
11157 *
11158 * @property # <<<<<<<<<<<<<<
11159 * def size(self):
11160 * cdef size_t result
11161*/
11162
11163 /* function exit code */
11164 __pyx_L1_error:;
11165 __Pyx_XDECREF(__pyx_t_5);
11166 __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11167 __pyx_r = NULL;
11168 __pyx_L0:;
11169
11170
11171 __Pyx_XGIVEREF(__pyx_r);
11172 __Pyx_RefNannyFinishContext();
11173 return __pyx_r;
11174}
11175
11176/* "View.MemoryView":654
11177 * return self._size
11178 *
11179 * def __len__(self): # <<<<<<<<<<<<<<
11180 * if self.view.ndim >= 1:
11181 * return self.view.shape[0]
11182*/
11183
11184/* Python wrapper */
11185static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
11186static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
11187 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11188 Py_ssize_t __pyx_r;
11189 __Pyx_RefNannyDeclarations
11190 __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
11191 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11192 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11193
11194 /* function exit code */
11195 __Pyx_RefNannyFinishContext();
11196 return __pyx_r;
11197}
11198
11199static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
11200 Py_ssize_t __pyx_r;
11201 int __pyx_t_1;
11202
11203 /* "View.MemoryView":655
11204 *
11205 * def __len__(self):
11206 * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
11207 * return self.view.shape[0]
11208 *
11209*/
11210 __pyx_t_1 = (__pyx_v_self->view.ndim >= 1);
11211
11212 if (__pyx_t_1) {
11213
11214
11215 /* "View.MemoryView":656
11216 * def __len__(self):
11217 * if self.view.ndim >= 1:
11218 * return self.view.shape[0] # <<<<<<<<<<<<<<
11219 *
11220 * return 0
11221*/
11222 {
11223
11224 __pyx_r = (__pyx_v_self->view.shape[0]);
11225 }
11226 goto __pyx_L0;
11227
11228 /* "View.MemoryView":655
11229 *
11230 * def __len__(self):
11231 * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
11232 * return self.view.shape[0]
11233 *
11234*/
11235 }
11236
11237 /* "View.MemoryView":658
11238 * return self.view.shape[0]
11239 *
11240 * return 0 # <<<<<<<<<<<<<<
11241 *
11242 * def __repr__(self):
11243*/
11244 {
11245
11246 __pyx_r = 0;
11247 }
11248 goto __pyx_L0;
11249
11250 /* "View.MemoryView":654
11251 * return self._size
11252 *
11253 * def __len__(self): # <<<<<<<<<<<<<<
11254 * if self.view.ndim >= 1:
11255 * return self.view.shape[0]
11256*/
11257
11258 /* function exit code */
11259 __pyx_L0:;
11260
11261 return __pyx_r;
11262}
11263
11264/* "View.MemoryView":660
11265 * return 0
11266 *
11267 * def __repr__(self): # <<<<<<<<<<<<<<
11268 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11269 * id(self))
11270*/
11271
11272/* Python wrapper */
11273static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
11274static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
11275 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11276 PyObject *__pyx_r = 0;
11277 __Pyx_RefNannyDeclarations
11278 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
11279 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11280 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11281
11282 /* function exit code */
11283 __Pyx_RefNannyFinishContext();
11284 return __pyx_r;
11285}
11286
11287static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
11288 PyObject *__pyx_r = NULL;
11289 __Pyx_RefNannyDeclarations
11290 PyObject *__pyx_t_1 = NULL;
11291 PyObject *__pyx_t_2 = NULL;
11292 PyObject *__pyx_t_3 = NULL;
11293 PyObject *__pyx_t_4[5];
11294 Py_ssize_t __pyx_t_5;
11295 int __pyx_t_6;
11296 int __pyx_lineno = 0;
11297 const char *__pyx_filename = NULL;
11298 int __pyx_clineno = 0;
11299 __Pyx_RefNannySetupContext("__repr__", 0);
11300
11301 /* "View.MemoryView":661
11302 *
11303 * def __repr__(self):
11304 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
11305 * id(self))
11306 *
11307*/
11308 __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)
11309 __Pyx_GOTREF(__pyx_t_1);
11310 __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)
11311 __Pyx_GOTREF(__pyx_t_2);
11312 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11313 __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)
11314 __Pyx_GOTREF(__pyx_t_1);
11315 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11316 __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)
11317 __Pyx_GOTREF(__pyx_t_2);
11318 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11319
11320 /* "View.MemoryView":662
11321 * def __repr__(self):
11322 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11323 * id(self)) # <<<<<<<<<<<<<<
11324 *
11325 * def __str__(self):
11326*/
11327 __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)
11328 __Pyx_GOTREF(__pyx_t_1);
11329 __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)
11330 __Pyx_GOTREF(__pyx_t_3);
11331 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11332 __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_MemoryView_of;
11333 __pyx_t_4[1] = __pyx_t_2;
11334 __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u_at_0x;
11335 __pyx_t_4[3] = __pyx_t_3;
11336 __pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u__4;
11337
11338 /* "View.MemoryView":661
11339 *
11340 * def __repr__(self):
11341 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
11342 * id(self))
11343 *
11344*/
11345 __pyx_t_5 = 22;
11346 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11347 __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4[3]);
11348 #endif
11349 __pyx_t_6 = 0;
11350 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11351 __pyx_t_6 |= __Pyx_PyUnicode_KIND_04(__pyx_t_4[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_4[3]);
11352 #endif
11353 __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, __pyx_t_5, __pyx_t_6);
11354 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 661, __pyx_L1_error)
11355 __Pyx_GOTREF(__pyx_t_1);
11356 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11357 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11358 {
11359 PyObject *__pyx_temp;
11360 {
11361 __pyx_temp = __pyx_r;
11362 __pyx_r = __pyx_t_1;
11363 }
11364 __Pyx_XDECREF(__pyx_temp);
11365 }
11366 __pyx_t_1 = 0;
11367 goto __pyx_L0;
11368
11369 /* "View.MemoryView":660
11370 * return 0
11371 *
11372 * def __repr__(self): # <<<<<<<<<<<<<<
11373 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11374 * id(self))
11375*/
11376
11377 /* function exit code */
11378 __pyx_L1_error:;
11379 __Pyx_XDECREF(__pyx_t_1);
11380 __Pyx_XDECREF(__pyx_t_2);
11381 __Pyx_XDECREF(__pyx_t_3);
11382 __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11383 __pyx_r = NULL;
11384 __pyx_L0:;
11385 __Pyx_XGIVEREF(__pyx_r);
11386 __Pyx_RefNannyFinishContext();
11387 return __pyx_r;
11388}
11389
11390/* "View.MemoryView":664
11391 * id(self))
11392 *
11393 * def __str__(self): # <<<<<<<<<<<<<<
11394 * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
11395 *
11396*/
11397
11398/* Python wrapper */
11399static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
11400static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
11401 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11402 PyObject *__pyx_r = 0;
11403 __Pyx_RefNannyDeclarations
11404 __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
11405 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11406 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11407
11408 /* function exit code */
11409 __Pyx_RefNannyFinishContext();
11410 return __pyx_r;
11411}
11412
11413static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
11414 PyObject *__pyx_r = NULL;
11415 __Pyx_RefNannyDeclarations
11416 PyObject *__pyx_t_1 = NULL;
11417 PyObject *__pyx_t_2 = NULL;
11418 PyObject *__pyx_t_3[3];
11419 Py_ssize_t __pyx_t_4;
11420 int __pyx_t_5;
11421 int __pyx_lineno = 0;
11422 const char *__pyx_filename = NULL;
11423 int __pyx_clineno = 0;
11424 __Pyx_RefNannySetupContext("__str__", 0);
11425
11426 /* "View.MemoryView":665
11427 *
11428 * def __str__(self):
11429 * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
11430 *
11431 *
11432*/
11433 __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)
11434 __Pyx_GOTREF(__pyx_t_1);
11435 __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)
11436 __Pyx_GOTREF(__pyx_t_2);
11437 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11438 __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)
11439 __Pyx_GOTREF(__pyx_t_1);
11440 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11441 __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)
11442 __Pyx_GOTREF(__pyx_t_2);
11443 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11444 __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u_MemoryView_of;
11445 __pyx_t_3[1] = __pyx_t_2;
11446 __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u_object;
11447 __pyx_t_4 = 23;
11448 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11449 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3[1]);
11450 #endif
11451 __pyx_t_5 = 0;
11452 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11453 __pyx_t_5 |= __Pyx_PyUnicode_KIND_04(__pyx_t_3[1]);
11454 #endif
11455 __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_4, __pyx_t_5);
11456 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 665, __pyx_L1_error)
11457 __Pyx_GOTREF(__pyx_t_1);
11458 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11459 {
11460 PyObject *__pyx_temp;
11461 {
11462 __pyx_temp = __pyx_r;
11463 __pyx_r = __pyx_t_1;
11464 }
11465 __Pyx_XDECREF(__pyx_temp);
11466 }
11467 __pyx_t_1 = 0;
11468 goto __pyx_L0;
11469
11470 /* "View.MemoryView":664
11471 * id(self))
11472 *
11473 * def __str__(self): # <<<<<<<<<<<<<<
11474 * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
11475 *
11476*/
11477
11478 /* function exit code */
11479 __pyx_L1_error:;
11480 __Pyx_XDECREF(__pyx_t_1);
11481 __Pyx_XDECREF(__pyx_t_2);
11482 __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11483 __pyx_r = NULL;
11484 __pyx_L0:;
11485 __Pyx_XGIVEREF(__pyx_r);
11486 __Pyx_RefNannyFinishContext();
11487 return __pyx_r;
11488}
11489
11490/* "View.MemoryView":668
11491 *
11492 *
11493 * def is_c_contig(self): # <<<<<<<<<<<<<<
11494 * cdef __Pyx_memviewslice *mslice
11495 * cdef __Pyx_memviewslice tmp
11496*/
11497
11498/* Python wrapper */
11499static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
11500#if CYTHON_VECTORCALL
11501PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11502#else
11503PyObject *__pyx_args, PyObject *__pyx_kwds
11504#endif
11505); /*proto*/
11506static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
11507#if CYTHON_VECTORCALL
11508PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11509#else
11510PyObject *__pyx_args, PyObject *__pyx_kwds
11511#endif
11512) {
11513 #if !CYTHON_VECTORCALL
11514 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11515 #endif
11516 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11517 PyObject *__pyx_r = 0;
11518 __Pyx_RefNannyDeclarations
11519 __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
11520 #if !CYTHON_VECTORCALL
11521 #if CYTHON_ASSUME_SAFE_SIZE
11522 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11523 #else
11524 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11525 #endif
11526 #endif
11527 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11528 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_c_contig", 1, 0, 0, __pyx_nargs); return NULL; }
11529 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
11530 if (unlikely(__pyx_kwds_len < 0)) return NULL;
11531 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_c_contig", __pyx_kwds); return NULL;}
11532 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
11533
11534 /* function exit code */
11535 __Pyx_RefNannyFinishContext();
11536 return __pyx_r;
11537}
11538
11539static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
11540 __Pyx_memviewslice *__pyx_v_mslice;
11541 __Pyx_memviewslice __pyx_v_tmp;
11542 PyObject *__pyx_r = NULL;
11543 __Pyx_RefNannyDeclarations
11544 __Pyx_memviewslice *__pyx_t_1;
11545 PyObject *__pyx_t_2 = NULL;
11546 int __pyx_lineno = 0;
11547 const char *__pyx_filename = NULL;
11548 int __pyx_clineno = 0;
11549 __Pyx_RefNannySetupContext("is_c_contig", 0);
11550
11551 /* "View.MemoryView":671
11552 * cdef __Pyx_memviewslice *mslice
11553 * cdef __Pyx_memviewslice tmp
11554 * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
11555 * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11556 *
11557*/
11558 __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)
11559 __pyx_v_mslice = __pyx_t_1;
11560
11561 /* "View.MemoryView":672
11562 * cdef __Pyx_memviewslice tmp
11563 * mslice = get_slice_from_memview(self, &tmp)
11564 * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
11565 *
11566 * def is_f_contig(self):
11567*/
11568 __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)
11569 __Pyx_GOTREF(__pyx_t_2);
11570 {
11571 PyObject *__pyx_temp;
11572 {
11573 __pyx_temp = __pyx_r;
11574 __pyx_r = __pyx_t_2;
11575 }
11576 __Pyx_XDECREF(__pyx_temp);
11577 }
11578 __pyx_t_2 = 0;
11579 goto __pyx_L0;
11580
11581 /* "View.MemoryView":668
11582 *
11583 *
11584 * def is_c_contig(self): # <<<<<<<<<<<<<<
11585 * cdef __Pyx_memviewslice *mslice
11586 * cdef __Pyx_memviewslice tmp
11587*/
11588
11589 /* function exit code */
11590 __pyx_L1_error:;
11591 __Pyx_XDECREF(__pyx_t_2);
11592 __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11593 __pyx_r = NULL;
11594 __pyx_L0:;
11595
11596
11597 __Pyx_XGIVEREF(__pyx_r);
11598 __Pyx_RefNannyFinishContext();
11599 return __pyx_r;
11600}
11601
11602/* "View.MemoryView":674
11603 * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11604 *
11605 * def is_f_contig(self): # <<<<<<<<<<<<<<
11606 * cdef __Pyx_memviewslice *mslice
11607 * cdef __Pyx_memviewslice tmp
11608*/
11609
11610/* Python wrapper */
11611static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
11612#if CYTHON_VECTORCALL
11613PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11614#else
11615PyObject *__pyx_args, PyObject *__pyx_kwds
11616#endif
11617); /*proto*/
11618static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
11619#if CYTHON_VECTORCALL
11620PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11621#else
11622PyObject *__pyx_args, PyObject *__pyx_kwds
11623#endif
11624) {
11625 #if !CYTHON_VECTORCALL
11626 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11627 #endif
11628 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11629 PyObject *__pyx_r = 0;
11630 __Pyx_RefNannyDeclarations
11631 __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
11632 #if !CYTHON_VECTORCALL
11633 #if CYTHON_ASSUME_SAFE_SIZE
11634 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11635 #else
11636 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11637 #endif
11638 #endif
11639 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11640 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_f_contig", 1, 0, 0, __pyx_nargs); return NULL; }
11641 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
11642 if (unlikely(__pyx_kwds_len < 0)) return NULL;
11643 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_f_contig", __pyx_kwds); return NULL;}
11644 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
11645
11646 /* function exit code */
11647 __Pyx_RefNannyFinishContext();
11648 return __pyx_r;
11649}
11650
11651static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
11652 __Pyx_memviewslice *__pyx_v_mslice;
11653 __Pyx_memviewslice __pyx_v_tmp;
11654 PyObject *__pyx_r = NULL;
11655 __Pyx_RefNannyDeclarations
11656 __Pyx_memviewslice *__pyx_t_1;
11657 PyObject *__pyx_t_2 = NULL;
11658 int __pyx_lineno = 0;
11659 const char *__pyx_filename = NULL;
11660 int __pyx_clineno = 0;
11661 __Pyx_RefNannySetupContext("is_f_contig", 0);
11662
11663 /* "View.MemoryView":677
11664 * cdef __Pyx_memviewslice *mslice
11665 * cdef __Pyx_memviewslice tmp
11666 * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
11667 * return slice_is_contig(mslice[0], 'F', self.view.ndim)
11668 *
11669*/
11670 __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)
11671 __pyx_v_mslice = __pyx_t_1;
11672
11673 /* "View.MemoryView":678
11674 * cdef __Pyx_memviewslice tmp
11675 * mslice = get_slice_from_memview(self, &tmp)
11676 * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
11677 *
11678 * def copy(self):
11679*/
11680 __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)
11681 __Pyx_GOTREF(__pyx_t_2);
11682 {
11683 PyObject *__pyx_temp;
11684 {
11685 __pyx_temp = __pyx_r;
11686 __pyx_r = __pyx_t_2;
11687 }
11688 __Pyx_XDECREF(__pyx_temp);
11689 }
11690 __pyx_t_2 = 0;
11691 goto __pyx_L0;
11692
11693 /* "View.MemoryView":674
11694 * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11695 *
11696 * def is_f_contig(self): # <<<<<<<<<<<<<<
11697 * cdef __Pyx_memviewslice *mslice
11698 * cdef __Pyx_memviewslice tmp
11699*/
11700
11701 /* function exit code */
11702 __pyx_L1_error:;
11703 __Pyx_XDECREF(__pyx_t_2);
11704 __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11705 __pyx_r = NULL;
11706 __pyx_L0:;
11707
11708
11709 __Pyx_XGIVEREF(__pyx_r);
11710 __Pyx_RefNannyFinishContext();
11711 return __pyx_r;
11712}
11713
11714/* "View.MemoryView":680
11715 * return slice_is_contig(mslice[0], 'F', self.view.ndim)
11716 *
11717 * def copy(self): # <<<<<<<<<<<<<<
11718 * cdef __Pyx_memviewslice mslice
11719 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
11720*/
11721
11722/* Python wrapper */
11723static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
11724#if CYTHON_VECTORCALL
11725PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11726#else
11727PyObject *__pyx_args, PyObject *__pyx_kwds
11728#endif
11729); /*proto*/
11730static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
11731#if CYTHON_VECTORCALL
11732PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11733#else
11734PyObject *__pyx_args, PyObject *__pyx_kwds
11735#endif
11736) {
11737 #if !CYTHON_VECTORCALL
11738 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11739 #endif
11740 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11741 PyObject *__pyx_r = 0;
11742 __Pyx_RefNannyDeclarations
11743 __Pyx_RefNannySetupContext("copy (wrapper)", 0);
11744 #if !CYTHON_VECTORCALL
11745 #if CYTHON_ASSUME_SAFE_SIZE
11746 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11747 #else
11748 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11749 #endif
11750 #endif
11751 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11752 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL; }
11753 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
11754 if (unlikely(__pyx_kwds_len < 0)) return NULL;
11755 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("copy", __pyx_kwds); return NULL;}
11756 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
11757
11758 /* function exit code */
11759 __Pyx_RefNannyFinishContext();
11760 return __pyx_r;
11761}
11762
11763static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
11764 __Pyx_memviewslice __pyx_v_mslice;
11765 int __pyx_v_flags;
11766 PyObject *__pyx_r = NULL;
11767 __Pyx_RefNannyDeclarations
11768 __Pyx_memviewslice __pyx_t_1;
11769 PyObject *__pyx_t_2 = NULL;
11770 int __pyx_lineno = 0;
11771 const char *__pyx_filename = NULL;
11772 int __pyx_clineno = 0;
11773 __Pyx_RefNannySetupContext("copy", 0);
11774
11775 /* "View.MemoryView":682
11776 * def copy(self):
11777 * cdef __Pyx_memviewslice mslice
11778 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
11779 *
11780 * slice_copy(self, &mslice)
11781*/
11782 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
11783
11784 /* "View.MemoryView":684
11785 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
11786 *
11787 * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
11788 * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
11789 * self.view.itemsize,
11790*/
11791 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
11792
11793 /* "View.MemoryView":685
11794 *
11795 * slice_copy(self, &mslice)
11796 * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
11797 * self.view.itemsize,
11798 * flags|PyBUF_C_CONTIGUOUS,
11799*/
11800 __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)
11801 __pyx_v_mslice = __pyx_t_1;
11802
11803 /* "View.MemoryView":690
11804 * self.dtype_is_object)
11805 *
11806 * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
11807 *
11808 * def copy_fortran(self):
11809*/
11810 __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)
11811 __Pyx_GOTREF(__pyx_t_2);
11812 {
11813 PyObject *__pyx_temp;
11814 {
11815 __pyx_temp = __pyx_r;
11816 __pyx_r = __pyx_t_2;
11817 }
11818 __Pyx_XDECREF(__pyx_temp);
11819 }
11820 __pyx_t_2 = 0;
11821 goto __pyx_L0;
11822
11823 /* "View.MemoryView":680
11824 * return slice_is_contig(mslice[0], 'F', self.view.ndim)
11825 *
11826 * def copy(self): # <<<<<<<<<<<<<<
11827 * cdef __Pyx_memviewslice mslice
11828 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
11829*/
11830
11831 /* function exit code */
11832 __pyx_L1_error:;
11833 __Pyx_XDECREF(__pyx_t_2);
11834 __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
11835 __pyx_r = NULL;
11836 __pyx_L0:;
11837
11838
11839 __Pyx_XGIVEREF(__pyx_r);
11840 __Pyx_RefNannyFinishContext();
11841 return __pyx_r;
11842}
11843
11844/* "View.MemoryView":692
11845 * return memoryview_copy_from_slice(self, &mslice)
11846 *
11847 * def copy_fortran(self): # <<<<<<<<<<<<<<
11848 * cdef __Pyx_memviewslice src, dst
11849 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
11850*/
11851
11852/* Python wrapper */
11853static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
11854#if CYTHON_VECTORCALL
11855PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11856#else
11857PyObject *__pyx_args, PyObject *__pyx_kwds
11858#endif
11859); /*proto*/
11860static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
11861#if CYTHON_VECTORCALL
11862PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11863#else
11864PyObject *__pyx_args, PyObject *__pyx_kwds
11865#endif
11866) {
11867 #if !CYTHON_VECTORCALL
11868 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11869 #endif
11870 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11871 PyObject *__pyx_r = 0;
11872 __Pyx_RefNannyDeclarations
11873 __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
11874 #if !CYTHON_VECTORCALL
11875 #if CYTHON_ASSUME_SAFE_SIZE
11876 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11877 #else
11878 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11879 #endif
11880 #endif
11881 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11882 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy_fortran", 1, 0, 0, __pyx_nargs); return NULL; }
11883 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
11884 if (unlikely(__pyx_kwds_len < 0)) return NULL;
11885 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("copy_fortran", __pyx_kwds); return NULL;}
11886 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
11887
11888 /* function exit code */
11889 __Pyx_RefNannyFinishContext();
11890 return __pyx_r;
11891}
11892
11893static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
11894 __Pyx_memviewslice __pyx_v_src;
11895 __Pyx_memviewslice __pyx_v_dst;
11896 int __pyx_v_flags;
11897 PyObject *__pyx_r = NULL;
11898 __Pyx_RefNannyDeclarations
11899 __Pyx_memviewslice __pyx_t_1;
11900 PyObject *__pyx_t_2 = NULL;
11901 int __pyx_lineno = 0;
11902 const char *__pyx_filename = NULL;
11903 int __pyx_clineno = 0;
11904 __Pyx_RefNannySetupContext("copy_fortran", 0);
11905
11906 /* "View.MemoryView":694
11907 * def copy_fortran(self):
11908 * cdef __Pyx_memviewslice src, dst
11909 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
11910 *
11911 * slice_copy(self, &src)
11912*/
11913 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
11914
11915 /* "View.MemoryView":696
11916 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
11917 *
11918 * slice_copy(self, &src) # <<<<<<<<<<<<<<
11919 * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
11920 * self.view.itemsize,
11921*/
11922 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
11923
11924 /* "View.MemoryView":697
11925 *
11926 * slice_copy(self, &src)
11927 * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
11928 * self.view.itemsize,
11929 * flags|PyBUF_F_CONTIGUOUS,
11930*/
11931 __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)
11932 __pyx_v_dst = __pyx_t_1;
11933
11934 /* "View.MemoryView":702
11935 * self.dtype_is_object)
11936 *
11937 * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
11938 *
11939 *
11940*/
11941 __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)
11942 __Pyx_GOTREF(__pyx_t_2);
11943 {
11944 PyObject *__pyx_temp;
11945 {
11946 __pyx_temp = __pyx_r;
11947 __pyx_r = __pyx_t_2;
11948 }
11949 __Pyx_XDECREF(__pyx_temp);
11950 }
11951 __pyx_t_2 = 0;
11952 goto __pyx_L0;
11953
11954 /* "View.MemoryView":692
11955 * return memoryview_copy_from_slice(self, &mslice)
11956 *
11957 * def copy_fortran(self): # <<<<<<<<<<<<<<
11958 * cdef __Pyx_memviewslice src, dst
11959 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
11960*/
11961
11962 /* function exit code */
11963 __pyx_L1_error:;
11964 __Pyx_XDECREF(__pyx_t_2);
11965 __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
11966 __pyx_r = NULL;
11967 __pyx_L0:;
11968
11969
11970
11971 __Pyx_XGIVEREF(__pyx_r);
11972 __Pyx_RefNannyFinishContext();
11973 return __pyx_r;
11974}
11975
11976/* "(tree fragment)":1
11977 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11978 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11979 * def __setstate_cython__(self, __pyx_state):
11980*/
11981
11982/* Python wrapper */
11983static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
11984#if CYTHON_VECTORCALL
11985PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11986#else
11987PyObject *__pyx_args, PyObject *__pyx_kwds
11988#endif
11989); /*proto*/
11990static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
11991#if CYTHON_VECTORCALL
11992PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11993#else
11994PyObject *__pyx_args, PyObject *__pyx_kwds
11995#endif
11996) {
11997 #if !CYTHON_VECTORCALL
11998 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11999 #endif
12000 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12001 PyObject *__pyx_r = 0;
12002 __Pyx_RefNannyDeclarations
12003 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
12004 #if !CYTHON_VECTORCALL
12005 #if CYTHON_ASSUME_SAFE_SIZE
12006 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12007 #else
12008 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12009 #endif
12010 #endif
12011 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12012 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
12013 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
12014 if (unlikely(__pyx_kwds_len < 0)) return NULL;
12015 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
12016 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12017
12018 /* function exit code */
12019 __Pyx_RefNannyFinishContext();
12020 return __pyx_r;
12021}
12022
12023static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
12024 PyObject *__pyx_r = NULL;
12025 __Pyx_RefNannyDeclarations
12026 int __pyx_lineno = 0;
12027 const char *__pyx_filename = NULL;
12028 int __pyx_clineno = 0;
12029 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
12030
12031 /* "(tree fragment)":2
12032 * def __reduce_cython__(self):
12033 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
12034 * def __setstate_cython__(self, __pyx_state):
12035 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12036*/
12037 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
12038 __PYX_ERR(1, 2, __pyx_L1_error)
12039
12040 /* "(tree fragment)":1
12041 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
12042 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12043 * def __setstate_cython__(self, __pyx_state):
12044*/
12045
12046 /* function exit code */
12047 __pyx_L1_error:;
12048 __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12049 __pyx_r = NULL;
12050 __Pyx_XGIVEREF(__pyx_r);
12051 __Pyx_RefNannyFinishContext();
12052 return __pyx_r;
12053}
12054
12055/* "(tree fragment)":3
12056 * def __reduce_cython__(self):
12057 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12058 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
12059 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12060*/
12061
12062/* Python wrapper */
12063static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
12064#if CYTHON_VECTORCALL
12065PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12066#else
12067PyObject *__pyx_args, PyObject *__pyx_kwds
12068#endif
12069); /*proto*/
12070static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
12071#if CYTHON_VECTORCALL
12072PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12073#else
12074PyObject *__pyx_args, PyObject *__pyx_kwds
12075#endif
12076) {
12077 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
12078 #if !CYTHON_VECTORCALL
12079 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12080 #endif
12081 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12082 PyObject* values[1] = {0};
12083 int __pyx_lineno = 0;
12084 const char *__pyx_filename = NULL;
12085 int __pyx_clineno = 0;
12086 PyObject *__pyx_r = 0;
12087 __Pyx_RefNannyDeclarations
12088 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
12089 #if !CYTHON_VECTORCALL
12090 #if CYTHON_ASSUME_SAFE_SIZE
12091 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12092 #else
12093 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12094 #endif
12095 #endif
12096 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12097 {
12098 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
12099 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
12100 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
12101 if (__pyx_kwds_len > 0) {
12102 switch (__pyx_nargs) {
12103 case 1:
12104 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
12105 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
12106 CYTHON_FALLTHROUGH;
12107 case 0: break;
12108 default: goto __pyx_L5_argtuple_error;
12109 }
12110 const Py_ssize_t kwd_pos_args = __pyx_nargs;
12111 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)
12112 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
12113 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
12114 }
12115 } else if (unlikely(__pyx_nargs != 1)) {
12116 goto __pyx_L5_argtuple_error;
12117 } else {
12118 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
12119 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
12120 }
12121 __pyx_v___pyx_state = values[0];
12122 }
12123 goto __pyx_L6_skip;
12124 __pyx_L5_argtuple_error:;
12125 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
12126 __pyx_L6_skip:;
12127 goto __pyx_L4_argument_unpacking_done;
12128 __pyx_L3_error:;
12129 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
12130 Py_XDECREF(values[__pyx_temp]);
12131 }
12132 __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12133 __Pyx_RefNannyFinishContext();
12134 return NULL;
12135 __pyx_L4_argument_unpacking_done:;
12136 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v___pyx_state);
12137
12138 /* function exit code */
12139 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
12140 Py_XDECREF(values[__pyx_temp]);
12141 }
12142 __Pyx_RefNannyFinishContext();
12143 return __pyx_r;
12144}
12145
12146static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
12147 PyObject *__pyx_r = NULL;
12148 __Pyx_RefNannyDeclarations
12149 int __pyx_lineno = 0;
12150 const char *__pyx_filename = NULL;
12151 int __pyx_clineno = 0;
12152 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
12153
12154 /* "(tree fragment)":4
12155 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12156 * def __setstate_cython__(self, __pyx_state):
12157 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
12158*/
12159 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
12160 __PYX_ERR(1, 4, __pyx_L1_error)
12161
12162 /* "(tree fragment)":3
12163 * def __reduce_cython__(self):
12164 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12165 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
12166 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12167*/
12168
12169 /* function exit code */
12170 __pyx_L1_error:;
12171 __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12172 __pyx_r = NULL;
12173 __Pyx_XGIVEREF(__pyx_r);
12174 __Pyx_RefNannyFinishContext();
12175 return __pyx_r;
12176}
12177
12178/* "View.MemoryView":705
12179 *
12180 *
12181 * @cname('__pyx_memoryview_new') # <<<<<<<<<<<<<<
12182 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
12183 * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12184*/
12185
12186static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo const *__pyx_v_typeinfo) {
12187 struct __pyx_memoryview_obj *__pyx_v_result = 0;
12188 PyObject *__pyx_r = NULL;
12189 __Pyx_RefNannyDeclarations
12190 PyObject *__pyx_t_1 = NULL;
12191 PyObject *__pyx_t_2 = NULL;
12192 PyObject *__pyx_t_3 = NULL;
12193 PyObject *__pyx_t_4 = NULL;
12194 size_t __pyx_t_5;
12195 int __pyx_lineno = 0;
12196 const char *__pyx_filename = NULL;
12197 int __pyx_clineno = 0;
12198 __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
12199
12200 /* "View.MemoryView":707
12201 * @cname('__pyx_memoryview_new')
12202 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
12203 * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
12204 * result.typeinfo = typeinfo
12205 * return result
12206*/
12207 __pyx_t_2 = NULL;
12208 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 707, __pyx_L1_error)
12209 __Pyx_GOTREF(__pyx_t_3);
12210 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 707, __pyx_L1_error)
12211 __Pyx_GOTREF(__pyx_t_4);
12212 __pyx_t_5 = 1;
12213 {
12214 PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_o, __pyx_t_3, __pyx_t_4};
12215 __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));
12216 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12217 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12218 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12219 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 707, __pyx_L1_error)
12220 __Pyx_GOTREF((PyObject *)__pyx_t_1);
12221 }
12222 __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_1);
12223 __pyx_t_1 = 0;
12224
12225 /* "View.MemoryView":708
12226 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
12227 * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12228 * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
12229 * return result
12230 *
12231*/
12232 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
12233
12234 /* "View.MemoryView":709
12235 * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12236 * result.typeinfo = typeinfo
12237 * return result # <<<<<<<<<<<<<<
12238 *
12239 * @cname('__pyx_memoryview_check')
12240*/
12241 {
12242 PyObject *__pyx_temp;
12243 {
12244 __pyx_temp = __pyx_r;
12245 __Pyx_INCREF((PyObject *)__pyx_v_result);
12246 __pyx_r = ((PyObject *)__pyx_v_result);
12247 }
12248 __Pyx_XDECREF(__pyx_temp);
12249 }
12250 goto __pyx_L0;
12251
12252 /* "View.MemoryView":705
12253 *
12254 *
12255 * @cname('__pyx_memoryview_new') # <<<<<<<<<<<<<<
12256 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
12257 * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12258*/
12259
12260 /* function exit code */
12261 __pyx_L1_error:;
12262 __Pyx_XDECREF(__pyx_t_1);
12263 __Pyx_XDECREF(__pyx_t_2);
12264 __Pyx_XDECREF(__pyx_t_3);
12265 __Pyx_XDECREF(__pyx_t_4);
12266 __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
12267 __pyx_r = 0;
12268 __pyx_L0:;
12269 __Pyx_XDECREF((PyObject *)__pyx_v_result);
12270 __Pyx_XGIVEREF(__pyx_r);
12271 __Pyx_RefNannyFinishContext();
12272 return __pyx_r;
12273}
12274
12275/* "View.MemoryView":711
12276 * return result
12277 *
12278 * @cname('__pyx_memoryview_check') # <<<<<<<<<<<<<<
12279 * cdef inline bint memoryview_check(object o) noexcept:
12280 * return isinstance(o, memoryview)
12281*/
12282
12283static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
12284 int __pyx_r;
12285 int __pyx_t_1;
12286
12287 /* "View.MemoryView":713
12288 * @cname('__pyx_memoryview_check')
12289 * cdef inline bint memoryview_check(object o) noexcept:
12290 * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
12291 *
12292 *
12293*/
12294 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_mstate_global->__pyx_memoryview_type);
12295 {
12296 __pyx_r = __pyx_t_1;
12297 }
12298 goto __pyx_L0;
12299
12300 /* "View.MemoryView":711
12301 * return result
12302 *
12303 * @cname('__pyx_memoryview_check') # <<<<<<<<<<<<<<
12304 * cdef inline bint memoryview_check(object o) noexcept:
12305 * return isinstance(o, memoryview)
12306*/
12307
12308 /* function exit code */
12309 __pyx_L0:;
12310
12311 return __pyx_r;
12312}
12313
12314/* "View.MemoryView":716
12315 *
12316 *
12317 * @cname('__pyx_memoryview_err_invalid_index') # <<<<<<<<<<<<<<
12318 * cdef int _err_invalid_index(item) except -1:
12319 * type_name = str(type(item))
12320*/
12321
12322static int __pyx_memoryview_err_invalid_index(PyObject *__pyx_v_item) {
12323 PyObject *__pyx_v_type_name = NULL;
12324 int __pyx_r;
12325 __Pyx_RefNannyDeclarations
12326 PyObject *__pyx_t_1 = NULL;
12327 int __pyx_lineno = 0;
12328 const char *__pyx_filename = NULL;
12329 int __pyx_clineno = 0;
12330 __Pyx_RefNannySetupContext("_err_invalid_index", 0);
12331
12332 /* "View.MemoryView":718
12333 * @cname('__pyx_memoryview_err_invalid_index')
12334 * cdef int _err_invalid_index(item) except -1:
12335 * type_name = str(type(item)) # <<<<<<<<<<<<<<
12336 * PyErr_Format(PyExc_TypeError, "Cannot index with type '%.200U'", <PyObject*> type_name)
12337 * return -1
12338*/
12339 __pyx_t_1 = __Pyx_PyObject_Unicode(((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 718, __pyx_L1_error)
12340 __Pyx_GOTREF(__pyx_t_1);
12341 __pyx_v_type_name = ((PyObject*)__pyx_t_1);
12342 __pyx_t_1 = 0;
12343
12344 /* "View.MemoryView":719
12345 * cdef int _err_invalid_index(item) except -1:
12346 * type_name = str(type(item))
12347 * PyErr_Format(PyExc_TypeError, "Cannot index with type '%.200U'", <PyObject*> type_name) # <<<<<<<<<<<<<<
12348 * return -1
12349 *
12350*/
12351 (void)(PyErr_Format(PyExc_TypeError, __pyx_k_Cannot_index_with_type_200U, ((PyObject *)__pyx_v_type_name)));
12352
12353 /* "View.MemoryView":720
12354 * type_name = str(type(item))
12355 * PyErr_Format(PyExc_TypeError, "Cannot index with type '%.200U'", <PyObject*> type_name)
12356 * return -1 # <<<<<<<<<<<<<<
12357 *
12358 *
12359*/
12360 {
12361
12362 __pyx_r = -1;
12363 }
12364 goto __pyx_L0;
12365
12366 /* "View.MemoryView":716
12367 *
12368 *
12369 * @cname('__pyx_memoryview_err_invalid_index') # <<<<<<<<<<<<<<
12370 * cdef int _err_invalid_index(item) except -1:
12371 * type_name = str(type(item))
12372*/
12373
12374 /* function exit code */
12375 __pyx_L1_error:;
12376 __Pyx_XDECREF(__pyx_t_1);
12377 __Pyx_AddTraceback("View.MemoryView._err_invalid_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
12378 __pyx_r = -1;
12379 __pyx_L0:;
12380 __Pyx_XDECREF(__pyx_v_type_name);
12381
12382 __Pyx_RefNannyFinishContext();
12383 return __pyx_r;
12384}
12385
12386/* "View.MemoryView":723
12387 *
12388 *
12389 * cdef tuple[bint, tuple] _unellipsify_index_tuple(index_tuple: tuple, int ndim): # <<<<<<<<<<<<<<
12390 * """
12391 * Replace all ellipses with full slices and fill incomplete indices with full slices.
12392*/
12393
12394static PyObject *_unellipsify_index_tuple(PyObject *__pyx_v_index_tuple, int __pyx_v_ndim) {
12395 Py_ssize_t __pyx_v_first_ellipsis_index;
12396 Py_ssize_t __pyx_v_idx;
12397 Py_ssize_t __pyx_v_ellipsis_end;
12398 Py_ssize_t __pyx_v_indices_from_ellipsis;
12399 int __pyx_v_have_slices;
12400 PyObject *__pyx_v_item = NULL;
12401 PyObject *__pyx_v_result = NULL;
12402 PyObject *__pyx_r = NULL;
12403 __Pyx_RefNannyDeclarations
12404 PyObject *__pyx_t_1 = NULL;
12405 Py_ssize_t __pyx_t_2;
12406 PyObject *__pyx_t_3 = NULL;
12407 int __pyx_t_4;
12408 int __pyx_t_5;
12409 Py_ssize_t __pyx_t_6;
12410 Py_ssize_t __pyx_t_7;
12411 Py_ssize_t __pyx_t_8;
12412 int __pyx_lineno = 0;
12413 const char *__pyx_filename = NULL;
12414 int __pyx_clineno = 0;
12415 __Pyx_RefNannySetupContext("_unellipsify_index_tuple", 0);
12416 __Pyx_INCREF(__pyx_v_index_tuple);
12417
12418 /* "View.MemoryView":727
12419 * Replace all ellipses with full slices and fill incomplete indices with full slices.
12420 * """
12421 * cdef Py_ssize_t first_ellipsis_index = -1 # <<<<<<<<<<<<<<
12422 * cdef Py_ssize_t idx, ellipsis_end, indices_from_ellipsis
12423 *
12424*/
12425 __pyx_v_first_ellipsis_index = -1L;
12426
12427 /* "View.MemoryView":730
12428 * cdef Py_ssize_t idx, ellipsis_end, indices_from_ellipsis
12429 *
12430 * have_slices = False # <<<<<<<<<<<<<<
12431 *
12432 * idx = 0
12433*/
12434 __pyx_v_have_slices = 0;
12435
12436 /* "View.MemoryView":732
12437 * have_slices = False
12438 *
12439 * idx = 0 # <<<<<<<<<<<<<<
12440 * for item in index_tuple:
12441 * if item is Ellipsis:
12442*/
12443 __pyx_v_idx = 0;
12444
12445 /* "View.MemoryView":733
12446 *
12447 * idx = 0
12448 * for item in index_tuple: # <<<<<<<<<<<<<<
12449 * if item is Ellipsis:
12450 * have_slices = True
12451*/
12452 __pyx_t_1 = __pyx_v_index_tuple; __Pyx_INCREF(__pyx_t_1);
12453 __pyx_t_2 = 0;
12454 for (;;) {
12455 {
12456 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
12457 #if !CYTHON_ASSUME_SAFE_SIZE
12458 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 733, __pyx_L1_error)
12459 #endif
12460 if (__pyx_t_2 >= __pyx_temp) break;
12461 }
12462 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12463 __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
12464 #else
12465 __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
12466 #endif
12467 ++__pyx_t_2;
12468 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 733, __pyx_L1_error)
12469 __Pyx_GOTREF(__pyx_t_3);
12470 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
12471 __pyx_t_3 = 0;
12472
12473 /* "View.MemoryView":734
12474 * idx = 0
12475 * for item in index_tuple:
12476 * if item is Ellipsis: # <<<<<<<<<<<<<<
12477 * have_slices = True
12478 * if first_ellipsis_index == -1:
12479*/
12480 __pyx_t_4 = (__pyx_v_item == __pyx_builtin_Ellipsis);
12481 if (__pyx_t_4) {
12482
12483
12484 /* "View.MemoryView":735
12485 * for item in index_tuple:
12486 * if item is Ellipsis:
12487 * have_slices = True # <<<<<<<<<<<<<<
12488 * if first_ellipsis_index == -1:
12489 * first_ellipsis_index = idx
12490*/
12491 __pyx_v_have_slices = 1;
12492
12493 /* "View.MemoryView":736
12494 * if item is Ellipsis:
12495 * have_slices = True
12496 * if first_ellipsis_index == -1: # <<<<<<<<<<<<<<
12497 * first_ellipsis_index = idx
12498 * elif isinstance(item, slice):
12499*/
12500 __pyx_t_4 = (__pyx_v_first_ellipsis_index == -1L);
12501
12502 if (__pyx_t_4) {
12503
12504
12505 /* "View.MemoryView":737
12506 * have_slices = True
12507 * if first_ellipsis_index == -1:
12508 * first_ellipsis_index = idx # <<<<<<<<<<<<<<
12509 * elif isinstance(item, slice):
12510 * have_slices = True
12511*/
12512 __pyx_v_first_ellipsis_index = __pyx_v_idx;
12513
12514 /* "View.MemoryView":736
12515 * if item is Ellipsis:
12516 * have_slices = True
12517 * if first_ellipsis_index == -1: # <<<<<<<<<<<<<<
12518 * first_ellipsis_index = idx
12519 * elif isinstance(item, slice):
12520*/
12521 }
12522
12523 /* "View.MemoryView":734
12524 * idx = 0
12525 * for item in index_tuple:
12526 * if item is Ellipsis: # <<<<<<<<<<<<<<
12527 * have_slices = True
12528 * if first_ellipsis_index == -1:
12529*/
12530 goto __pyx_L5;
12531 }
12532
12533 /* "View.MemoryView":738
12534 * if first_ellipsis_index == -1:
12535 * first_ellipsis_index = idx
12536 * elif isinstance(item, slice): # <<<<<<<<<<<<<<
12537 * have_slices = True
12538 * elif cython.unlikely(not PyIndex_Check(item)):
12539*/
12540 __pyx_t_4 = PySlice_Check(__pyx_v_item);
12541 if (__pyx_t_4) {
12542
12543
12544 /* "View.MemoryView":739
12545 * first_ellipsis_index = idx
12546 * elif isinstance(item, slice):
12547 * have_slices = True # <<<<<<<<<<<<<<
12548 * elif cython.unlikely(not PyIndex_Check(item)):
12549 * _err_invalid_index(item)
12550*/
12551 __pyx_v_have_slices = 1;
12552
12553 /* "View.MemoryView":738
12554 * if first_ellipsis_index == -1:
12555 * first_ellipsis_index = idx
12556 * elif isinstance(item, slice): # <<<<<<<<<<<<<<
12557 * have_slices = True
12558 * elif cython.unlikely(not PyIndex_Check(item)):
12559*/
12560 goto __pyx_L5;
12561 }
12562
12563 /* "View.MemoryView":740
12564 * elif isinstance(item, slice):
12565 * have_slices = True
12566 * elif cython.unlikely(not PyIndex_Check(item)): # <<<<<<<<<<<<<<
12567 * _err_invalid_index(item)
12568 * idx += 1
12569*/
12570 __pyx_t_4 = (!(PyIndex_Check(__pyx_v_item) != 0));
12571
12572 if (unlikely(__pyx_t_4)) {
12573
12574
12575 /* "View.MemoryView":741
12576 * have_slices = True
12577 * elif cython.unlikely(not PyIndex_Check(item)):
12578 * _err_invalid_index(item) # <<<<<<<<<<<<<<
12579 * idx += 1
12580 *
12581*/
12582 __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)
12583
12584
12585 /* "View.MemoryView":740
12586 * elif isinstance(item, slice):
12587 * have_slices = True
12588 * elif cython.unlikely(not PyIndex_Check(item)): # <<<<<<<<<<<<<<
12589 * _err_invalid_index(item)
12590 * idx += 1
12591*/
12592 }
12593 __pyx_L5:;
12594
12595 /* "View.MemoryView":742
12596 * elif cython.unlikely(not PyIndex_Check(item)):
12597 * _err_invalid_index(item)
12598 * idx += 1 # <<<<<<<<<<<<<<
12599 *
12600 * if first_ellipsis_index >= 0:
12601*/
12602 __pyx_v_idx = (__pyx_v_idx + 1);
12603
12604 /* "View.MemoryView":733
12605 *
12606 * idx = 0
12607 * for item in index_tuple: # <<<<<<<<<<<<<<
12608 * if item is Ellipsis:
12609 * have_slices = True
12610*/
12611 }
12612 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12613
12614 /* "View.MemoryView":744
12615 * idx += 1
12616 *
12617 * if first_ellipsis_index >= 0: # <<<<<<<<<<<<<<
12618 * result = [slice(None)] * ndim
12619 *
12620*/
12621 __pyx_t_4 = (__pyx_v_first_ellipsis_index >= 0);
12622
12623 if (__pyx_t_4) {
12624
12625
12626 /* "View.MemoryView":745
12627 *
12628 * if first_ellipsis_index >= 0:
12629 * result = [slice(None)] * ndim # <<<<<<<<<<<<<<
12630 *
12631 * for idx in range(first_ellipsis_index):
12632*/
12633 __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)
12634 __Pyx_GOTREF(__pyx_t_1);
12635 { Py_ssize_t __pyx_temp;
12636 for (__pyx_temp=0; __pyx_temp < __pyx_v_ndim; __pyx_temp++) {
12637 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
12638 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
12639 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 745, __pyx_L1_error);
12640 }
12641 }
12642 __pyx_v_result = ((PyObject*)__pyx_t_1);
12643 __pyx_t_1 = 0;
12644
12645 /* "View.MemoryView":747
12646 * result = [slice(None)] * ndim
12647 *
12648 * for idx in range(first_ellipsis_index): # <<<<<<<<<<<<<<
12649 * result[idx] = index_tuple[idx]
12650 *
12651*/
12652
12653 __pyx_t_2 = __pyx_v_first_ellipsis_index;
12654 __pyx_t_6 = __pyx_t_2;
12655
12656 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
12657 __pyx_v_idx = __pyx_t_7;
12658
12659 /* "View.MemoryView":748
12660 *
12661 * for idx in range(first_ellipsis_index):
12662 * result[idx] = index_tuple[idx] # <<<<<<<<<<<<<<
12663 *
12664 * indices_from_ellipsis = len(index_tuple) - first_ellipsis_index
12665*/
12666 __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)
12667 __Pyx_GOTREF(__pyx_t_1);
12668 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)
12669 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12670 }
12671
12672
12673 /* "View.MemoryView":750
12674 * result[idx] = index_tuple[idx]
12675 *
12676 * indices_from_ellipsis = len(index_tuple) - first_ellipsis_index # <<<<<<<<<<<<<<
12677 * ellipsis_end = ndim - indices_from_ellipsis
12678 *
12679*/
12680 __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)
12681 __pyx_v_indices_from_ellipsis = (__pyx_t_2 - __pyx_v_first_ellipsis_index);
12682
12683
12684 /* "View.MemoryView":751
12685 *
12686 * indices_from_ellipsis = len(index_tuple) - first_ellipsis_index
12687 * ellipsis_end = ndim - indices_from_ellipsis # <<<<<<<<<<<<<<
12688 *
12689 * for idx in range(1, indices_from_ellipsis):
12690*/
12691 __pyx_v_ellipsis_end = (__pyx_v_ndim - __pyx_v_indices_from_ellipsis);
12692
12693 /* "View.MemoryView":753
12694 * ellipsis_end = ndim - indices_from_ellipsis
12695 *
12696 * for idx in range(1, indices_from_ellipsis): # <<<<<<<<<<<<<<
12697 * item = index_tuple[first_ellipsis_index + idx]
12698 * if item is not Ellipsis:
12699*/
12700
12701 __pyx_t_2 = __pyx_v_indices_from_ellipsis;
12702 __pyx_t_6 = __pyx_t_2;
12703
12704 for (__pyx_t_7 = 1; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
12705 __pyx_v_idx = __pyx_t_7;
12706
12707 /* "View.MemoryView":754
12708 *
12709 * for idx in range(1, indices_from_ellipsis):
12710 * item = index_tuple[first_ellipsis_index + idx] # <<<<<<<<<<<<<<
12711 * if item is not Ellipsis:
12712 * result[ellipsis_end + idx] = item
12713*/
12714 __pyx_t_8 = (__pyx_v_first_ellipsis_index + __pyx_v_idx);
12715
12716 __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)
12717 __Pyx_GOTREF(__pyx_t_1);
12718
12719 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1);
12720 __pyx_t_1 = 0;
12721
12722 /* "View.MemoryView":755
12723 * for idx in range(1, indices_from_ellipsis):
12724 * item = index_tuple[first_ellipsis_index + idx]
12725 * if item is not Ellipsis: # <<<<<<<<<<<<<<
12726 * result[ellipsis_end + idx] = item
12727 *
12728*/
12729 __pyx_t_4 = (__pyx_v_item != __pyx_builtin_Ellipsis);
12730 if (__pyx_t_4) {
12731
12732
12733 /* "View.MemoryView":756
12734 * item = index_tuple[first_ellipsis_index + idx]
12735 * if item is not Ellipsis:
12736 * result[ellipsis_end + idx] = item # <<<<<<<<<<<<<<
12737 *
12738 * index_tuple = tuple(result)
12739*/
12740 __pyx_t_8 = (__pyx_v_ellipsis_end + __pyx_v_idx);
12741
12742 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)
12743
12744
12745 /* "View.MemoryView":755
12746 * for idx in range(1, indices_from_ellipsis):
12747 * item = index_tuple[first_ellipsis_index + idx]
12748 * if item is not Ellipsis: # <<<<<<<<<<<<<<
12749 * result[ellipsis_end + idx] = item
12750 *
12751*/
12752 }
12753 }
12754
12755
12756 /* "View.MemoryView":758
12757 * result[ellipsis_end + idx] = item
12758 *
12759 * index_tuple = tuple(result) # <<<<<<<<<<<<<<
12760 *
12761 * elif ndim > idx:
12762*/
12763 __pyx_t_1 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 758, __pyx_L1_error)
12764 __Pyx_GOTREF(__pyx_t_1);
12765 __Pyx_DECREF_SET(__pyx_v_index_tuple, ((PyObject*)__pyx_t_1));
12766 __pyx_t_1 = 0;
12767
12768 /* "View.MemoryView":744
12769 * idx += 1
12770 *
12771 * if first_ellipsis_index >= 0: # <<<<<<<<<<<<<<
12772 * result = [slice(None)] * ndim
12773 *
12774*/
12775 goto __pyx_L8;
12776 }
12777
12778 /* "View.MemoryView":760
12779 * index_tuple = tuple(result)
12780 *
12781 * elif ndim > idx: # <<<<<<<<<<<<<<
12782 *
12783 * have_slices = True
12784*/
12785 __pyx_t_4 = (__pyx_v_ndim > __pyx_v_idx);
12786
12787 if (__pyx_t_4) {
12788
12789
12790 /* "View.MemoryView":762
12791 * elif ndim > idx:
12792 *
12793 * have_slices = True # <<<<<<<<<<<<<<
12794 * index_tuple += (slice(None),) * (ndim - idx)
12795 *
12796*/
12797 __pyx_v_have_slices = 1;
12798
12799 /* "View.MemoryView":763
12800 *
12801 * have_slices = True
12802 * index_tuple += (slice(None),) * (ndim - idx) # <<<<<<<<<<<<<<
12803 *
12804 * return have_slices, index_tuple
12805*/
12806 __pyx_t_2 = (__pyx_v_ndim - __pyx_v_idx);
12807
12808 __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)
12809 __Pyx_GOTREF(__pyx_t_1);
12810
12811 __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_index_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 763, __pyx_L1_error)
12812 __Pyx_GOTREF(__pyx_t_3);
12813 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12814 __Pyx_DECREF_SET(__pyx_v_index_tuple, ((PyObject*)__pyx_t_3));
12815 __pyx_t_3 = 0;
12816
12817 /* "View.MemoryView":760
12818 * index_tuple = tuple(result)
12819 *
12820 * elif ndim > idx: # <<<<<<<<<<<<<<
12821 *
12822 * have_slices = True
12823*/
12824 }
12825 __pyx_L8:;
12826
12827 /* "View.MemoryView":765
12828 * index_tuple += (slice(None),) * (ndim - idx)
12829 *
12830 * return have_slices, index_tuple # <<<<<<<<<<<<<<
12831 *
12832 *
12833*/
12834 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 765, __pyx_L1_error)
12835 __Pyx_GOTREF(__pyx_t_3);
12836 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 765, __pyx_L1_error)
12837 __Pyx_GOTREF(__pyx_t_1);
12838 __Pyx_GIVEREF(__pyx_t_3);
12839 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3) != (0)) __PYX_ERR(1, 765, __pyx_L1_error);
12840 __Pyx_INCREF(__pyx_v_index_tuple);
12841 __Pyx_GIVEREF(__pyx_v_index_tuple);
12842 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_index_tuple) != (0)) __PYX_ERR(1, 765, __pyx_L1_error);
12843 __pyx_t_3 = 0;
12844 {
12845 PyObject *__pyx_temp;
12846 {
12847 __pyx_temp = __pyx_r;
12848 __pyx_r = ((PyObject*)__pyx_t_1);
12849 }
12850 __Pyx_XDECREF(__pyx_temp);
12851 }
12852 __pyx_t_1 = 0;
12853 goto __pyx_L0;
12854
12855 /* "View.MemoryView":723
12856 *
12857 *
12858 * cdef tuple[bint, tuple] _unellipsify_index_tuple(index_tuple: tuple, int ndim): # <<<<<<<<<<<<<<
12859 * """
12860 * Replace all ellipses with full slices and fill incomplete indices with full slices.
12861*/
12862
12863 /* function exit code */
12864 __pyx_L1_error:;
12865 __Pyx_XDECREF(__pyx_t_1);
12866 __Pyx_XDECREF(__pyx_t_3);
12867 __Pyx_AddTraceback("View.MemoryView._unellipsify_index_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename);
12868 __pyx_r = 0;
12869 __pyx_L0:;
12870
12871
12872
12873
12874
12875 __Pyx_XDECREF(__pyx_v_item);
12876 __Pyx_XDECREF(__pyx_v_result);
12877 __Pyx_XDECREF(__pyx_v_index_tuple);
12878 __Pyx_XGIVEREF(__pyx_r);
12879 __Pyx_RefNannyFinishContext();
12880 return __pyx_r;
12881}
12882
12883/* "View.MemoryView":768
12884 *
12885 *
12886 * cdef tuple[bint, tuple] _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
12887 * """
12888 * Replace all ellipses with full slices and fill incomplete indices with full slices.
12889*/
12890
12891static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
12892 PyObject *__pyx_v_result = 0;
12893 int __pyx_v_have_slices;
12894 PyObject *__pyx_r = NULL;
12895 __Pyx_RefNannyDeclarations
12896 int __pyx_t_1;
12897 PyObject *__pyx_t_2 = NULL;
12898 int __pyx_t_3;
12899 long __pyx_t_4;
12900 PyObject *__pyx_t_5 = NULL;
12901 PyObject *__pyx_t_6 = NULL;
12902 int __pyx_lineno = 0;
12903 const char *__pyx_filename = NULL;
12904 int __pyx_clineno = 0;
12905 __Pyx_RefNannySetupContext("_unellipsify", 0);
12906
12907 /* "View.MemoryView":773
12908 * """
12909 * result: tuple
12910 * have_slices = False # <<<<<<<<<<<<<<
12911 *
12912 * if index is Ellipsis:
12913*/
12914 __pyx_v_have_slices = 0;
12915
12916 /* "View.MemoryView":775
12917 * have_slices = False
12918 *
12919 * if index is Ellipsis: # <<<<<<<<<<<<<<
12920 * have_slices = True
12921 * result = (slice(None),) * ndim
12922*/
12923 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
12924 if (__pyx_t_1) {
12925
12926
12927 /* "View.MemoryView":776
12928 *
12929 * if index is Ellipsis:
12930 * have_slices = True # <<<<<<<<<<<<<<
12931 * result = (slice(None),) * ndim
12932 *
12933*/
12934 __pyx_v_have_slices = 1;
12935
12936 /* "View.MemoryView":777
12937 * if index is Ellipsis:
12938 * have_slices = True
12939 * result = (slice(None),) * ndim # <<<<<<<<<<<<<<
12940 *
12941 * elif isinstance(index, tuple):
12942*/
12943 __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)
12944 __Pyx_GOTREF(__pyx_t_2);
12945 __pyx_v_result = ((PyObject*)__pyx_t_2);
12946 __pyx_t_2 = 0;
12947
12948 /* "View.MemoryView":775
12949 * have_slices = False
12950 *
12951 * if index is Ellipsis: # <<<<<<<<<<<<<<
12952 * have_slices = True
12953 * result = (slice(None),) * ndim
12954*/
12955 goto __pyx_L3;
12956 }
12957
12958 /* "View.MemoryView":779
12959 * result = (slice(None),) * ndim
12960 *
12961 * elif isinstance(index, tuple): # <<<<<<<<<<<<<<
12962 * return _unellipsify_index_tuple(<tuple> index, ndim)
12963 *
12964*/
12965 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
12966 if (__pyx_t_1) {
12967
12968
12969 /* "View.MemoryView":780
12970 *
12971 * elif isinstance(index, tuple):
12972 * return _unellipsify_index_tuple(<tuple> index, ndim) # <<<<<<<<<<<<<<
12973 *
12974 * else:
12975*/
12976 if (unlikely(__pyx_v_index == Py_None)) {
12977 PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
12978 __PYX_ERR(1, 780, __pyx_L1_error)
12979 }
12980 __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)
12981 __Pyx_GOTREF(__pyx_t_2);
12982 {
12983 PyObject *__pyx_temp;
12984 {
12985 __pyx_temp = __pyx_r;
12986 __pyx_r = ((PyObject*)__pyx_t_2);
12987 }
12988 __Pyx_XDECREF(__pyx_temp);
12989 }
12990 __pyx_t_2 = 0;
12991 goto __pyx_L0;
12992
12993 /* "View.MemoryView":779
12994 * result = (slice(None),) * ndim
12995 *
12996 * elif isinstance(index, tuple): # <<<<<<<<<<<<<<
12997 * return _unellipsify_index_tuple(<tuple> index, ndim)
12998 *
12999*/
13000 }
13001
13002 /* "View.MemoryView":783
13003 *
13004 * else:
13005 * if isinstance(index, slice): # <<<<<<<<<<<<<<
13006 * have_slices = True
13007 * elif cython.unlikely(not PyIndex_Check(index)):
13008*/
13009 /*else*/ {
13010 __pyx_t_1 = PySlice_Check(__pyx_v_index);
13011 if (__pyx_t_1) {
13012
13013
13014 /* "View.MemoryView":784
13015 * else:
13016 * if isinstance(index, slice):
13017 * have_slices = True # <<<<<<<<<<<<<<
13018 * elif cython.unlikely(not PyIndex_Check(index)):
13019 * _err_invalid_index(index)
13020*/
13021 __pyx_v_have_slices = 1;
13022
13023 /* "View.MemoryView":783
13024 *
13025 * else:
13026 * if isinstance(index, slice): # <<<<<<<<<<<<<<
13027 * have_slices = True
13028 * elif cython.unlikely(not PyIndex_Check(index)):
13029*/
13030 goto __pyx_L4;
13031 }
13032
13033 /* "View.MemoryView":785
13034 * if isinstance(index, slice):
13035 * have_slices = True
13036 * elif cython.unlikely(not PyIndex_Check(index)): # <<<<<<<<<<<<<<
13037 * _err_invalid_index(index)
13038 *
13039*/
13040 __pyx_t_1 = (!(PyIndex_Check(__pyx_v_index) != 0));
13041
13042 if (unlikely(__pyx_t_1)) {
13043
13044
13045 /* "View.MemoryView":786
13046 * have_slices = True
13047 * elif cython.unlikely(not PyIndex_Check(index)):
13048 * _err_invalid_index(index) # <<<<<<<<<<<<<<
13049 *
13050 *
13051*/
13052 __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)
13053
13054
13055 /* "View.MemoryView":785
13056 * if isinstance(index, slice):
13057 * have_slices = True
13058 * elif cython.unlikely(not PyIndex_Check(index)): # <<<<<<<<<<<<<<
13059 * _err_invalid_index(index)
13060 *
13061*/
13062 }
13063 __pyx_L4:;
13064
13065 /* "View.MemoryView":789
13066 *
13067 *
13068 * if ndim == 1: # <<<<<<<<<<<<<<
13069 * result = (index,)
13070 * elif ndim == 2:
13071*/
13072 switch (__pyx_v_ndim) {
13073 case 1:
13074
13075 /* "View.MemoryView":790
13076 *
13077 * if ndim == 1:
13078 * result = (index,) # <<<<<<<<<<<<<<
13079 * elif ndim == 2:
13080 * have_slices = True
13081*/
13082 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 790, __pyx_L1_error)
13083 __Pyx_GOTREF(__pyx_t_2);
13084 __Pyx_INCREF(__pyx_v_index);
13085 __Pyx_GIVEREF(__pyx_v_index);
13086 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index) != (0)) __PYX_ERR(1, 790, __pyx_L1_error);
13087 __pyx_v_result = ((PyObject*)__pyx_t_2);
13088 __pyx_t_2 = 0;
13089
13090 /* "View.MemoryView":789
13091 *
13092 *
13093 * if ndim == 1: # <<<<<<<<<<<<<<
13094 * result = (index,)
13095 * elif ndim == 2:
13096*/
13097 break;
13098 case 2:
13099
13100 /* "View.MemoryView":792
13101 * result = (index,)
13102 * elif ndim == 2:
13103 * have_slices = True # <<<<<<<<<<<<<<
13104 * result = (index, slice(None))
13105 * else:
13106*/
13107 __pyx_v_have_slices = 1;
13108
13109 /* "View.MemoryView":793
13110 * elif ndim == 2:
13111 * have_slices = True
13112 * result = (index, slice(None)) # <<<<<<<<<<<<<<
13113 * else:
13114 * have_slices = True
13115*/
13116 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 793, __pyx_L1_error)
13117 __Pyx_GOTREF(__pyx_t_2);
13118 __Pyx_INCREF(__pyx_v_index);
13119 __Pyx_GIVEREF(__pyx_v_index);
13120 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index) != (0)) __PYX_ERR(1, 793, __pyx_L1_error);
13121 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
13122 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
13123 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 793, __pyx_L1_error);
13124 __pyx_v_result = ((PyObject*)__pyx_t_2);
13125 __pyx_t_2 = 0;
13126
13127 /* "View.MemoryView":791
13128 * if ndim == 1:
13129 * result = (index,)
13130 * elif ndim == 2: # <<<<<<<<<<<<<<
13131 * have_slices = True
13132 * result = (index, slice(None))
13133*/
13134 break;
13135 default:
13136
13137 /* "View.MemoryView":795
13138 * result = (index, slice(None))
13139 * else:
13140 * have_slices = True # <<<<<<<<<<<<<<
13141 * result = (index,) + (slice(None),) * (ndim - 1)
13142 *
13143*/
13144 __pyx_v_have_slices = 1;
13145
13146 /* "View.MemoryView":796
13147 * else:
13148 * have_slices = True
13149 * result = (index,) + (slice(None),) * (ndim - 1) # <<<<<<<<<<<<<<
13150 *
13151 * return have_slices, result
13152*/
13153 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 796, __pyx_L1_error)
13154 __Pyx_GOTREF(__pyx_t_2);
13155 __Pyx_INCREF(__pyx_v_index);
13156 __Pyx_GIVEREF(__pyx_v_index);
13157 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index) != (0)) __PYX_ERR(1, 796, __pyx_L1_error);
13158 __pyx_t_4 = (__pyx_v_ndim - 1);
13159
13160 __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)
13161 __Pyx_GOTREF(__pyx_t_5);
13162
13163 __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 796, __pyx_L1_error)
13164 __Pyx_GOTREF(__pyx_t_6);
13165 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13166 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13167 __pyx_v_result = ((PyObject*)__pyx_t_6);
13168 __pyx_t_6 = 0;
13169 break;
13170 }
13171 }
13172 __pyx_L3:;
13173
13174 /* "View.MemoryView":798
13175 * result = (index,) + (slice(None),) * (ndim - 1)
13176 *
13177 * return have_slices, result # <<<<<<<<<<<<<<
13178 *
13179 *
13180*/
13181 __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 798, __pyx_L1_error)
13182 __Pyx_GOTREF(__pyx_t_6);
13183 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 798, __pyx_L1_error)
13184 __Pyx_GOTREF(__pyx_t_5);
13185 __Pyx_GIVEREF(__pyx_t_6);
13186 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6) != (0)) __PYX_ERR(1, 798, __pyx_L1_error);
13187 __Pyx_INCREF(__pyx_v_result);
13188 __Pyx_GIVEREF(__pyx_v_result);
13189 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_result) != (0)) __PYX_ERR(1, 798, __pyx_L1_error);
13190 __pyx_t_6 = 0;
13191 {
13192 PyObject *__pyx_temp;
13193 {
13194 __pyx_temp = __pyx_r;
13195 __pyx_r = ((PyObject*)__pyx_t_5);
13196 }
13197 __Pyx_XDECREF(__pyx_temp);
13198 }
13199 __pyx_t_5 = 0;
13200 goto __pyx_L0;
13201
13202 /* "View.MemoryView":768
13203 *
13204 *
13205 * cdef tuple[bint, tuple] _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
13206 * """
13207 * Replace all ellipses with full slices and fill incomplete indices with full slices.
13208*/
13209
13210 /* function exit code */
13211 __pyx_L1_error:;
13212 __Pyx_XDECREF(__pyx_t_2);
13213 __Pyx_XDECREF(__pyx_t_5);
13214 __Pyx_XDECREF(__pyx_t_6);
13215 __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
13216 __pyx_r = 0;
13217 __pyx_L0:;
13218 __Pyx_XDECREF(__pyx_v_result);
13219
13220 __Pyx_XGIVEREF(__pyx_r);
13221 __Pyx_RefNannyFinishContext();
13222 return __pyx_r;
13223}
13224
13225/* "View.MemoryView":801
13226 *
13227 *
13228 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
13229 * for suboffset in suboffsets[:ndim]:
13230 * if cython.unlikely(suboffset >= 0):
13231*/
13232
13233static int assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
13234 Py_ssize_t __pyx_v_suboffset;
13235 int __pyx_r;
13236 Py_ssize_t *__pyx_t_1;
13237 Py_ssize_t *__pyx_t_2;
13238 Py_ssize_t *__pyx_t_3;
13239 int __pyx_t_4;
13240 int __pyx_t_5;
13241 int __pyx_lineno = 0;
13242 const char *__pyx_filename = NULL;
13243 int __pyx_clineno = 0;
13244
13245 /* "View.MemoryView":802
13246 *
13247 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13248 * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
13249 * if cython.unlikely(suboffset >= 0):
13250 * _err_ValueError("Indirect dimensions not supported")
13251*/
13252 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
13253
13254 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
13255 __pyx_t_1 = __pyx_t_3;
13256 __pyx_v_suboffset = (__pyx_t_1[0]);
13257
13258 /* "View.MemoryView":803
13259 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13260 * for suboffset in suboffsets[:ndim]:
13261 * if cython.unlikely(suboffset >= 0): # <<<<<<<<<<<<<<
13262 * _err_ValueError("Indirect dimensions not supported")
13263 * return 0 # return type just used as an error flag
13264*/
13265 __pyx_t_4 = (__pyx_v_suboffset >= 0);
13266
13267 if (unlikely(__pyx_t_4)) {
13268
13269
13270 /* "View.MemoryView":804
13271 * for suboffset in suboffsets[:ndim]:
13272 * if cython.unlikely(suboffset >= 0):
13273 * _err_ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
13274 * return 0 # return type just used as an error flag
13275 *
13276*/
13277 __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)
13278
13279
13280 /* "View.MemoryView":803
13281 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13282 * for suboffset in suboffsets[:ndim]:
13283 * if cython.unlikely(suboffset >= 0): # <<<<<<<<<<<<<<
13284 * _err_ValueError("Indirect dimensions not supported")
13285 * return 0 # return type just used as an error flag
13286*/
13287 }
13288 }
13289
13290
13291 /* "View.MemoryView":805
13292 * if cython.unlikely(suboffset >= 0):
13293 * _err_ValueError("Indirect dimensions not supported")
13294 * return 0 # return type just used as an error flag # <<<<<<<<<<<<<<
13295 *
13296 *
13297*/
13298 {
13299
13300 __pyx_r = 0;
13301 }
13302 goto __pyx_L0;
13303
13304 /* "View.MemoryView":801
13305 *
13306 *
13307 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
13308 * for suboffset in suboffsets[:ndim]:
13309 * if cython.unlikely(suboffset >= 0):
13310*/
13311
13312 /* function exit code */
13313 __pyx_L1_error:;
13314 __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
13315 __pyx_r = -1;
13316 __pyx_L0:;
13317
13318
13319 return __pyx_r;
13320}
13321
13322/* "View.MemoryView":811
13323 *
13324 *
13325 * @cname('__pyx_memview_slice') # <<<<<<<<<<<<<<
13326 * cdef memoryview memview_slice(memoryview memview, tuple indices):
13327 * cdef int new_ndim = 0, suboffset_dim = -1, dim
13328*/
13329
13330static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
13331 int __pyx_v_new_ndim;
13332 int __pyx_v_suboffset_dim;
13333 int __pyx_v_dim;
13334 __Pyx_memviewslice __pyx_v_src;
13335 __Pyx_memviewslice __pyx_v_dst;
13336 __Pyx_memviewslice *__pyx_v_p_src;
13337 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
13338 __Pyx_memviewslice *__pyx_v_p_dst;
13339 int *__pyx_v_p_suboffset_dim;
13340 Py_ssize_t __pyx_v_start;
13341 Py_ssize_t __pyx_v_stop;
13342 Py_ssize_t __pyx_v_step;
13343 Py_ssize_t __pyx_v_cindex;
13344 int __pyx_v_have_start;
13345 int __pyx_v_have_stop;
13346 int __pyx_v_have_step;
13347 PyObject *__pyx_v_index = NULL;
13348 struct __pyx_memoryview_obj *__pyx_r = NULL;
13349 __Pyx_RefNannyDeclarations
13350 int __pyx_t_1;
13351 PyObject *__pyx_t_2 = NULL;
13352 struct __pyx_memoryview_obj *__pyx_t_3;
13353 char *__pyx_t_4;
13354 int __pyx_t_5;
13355 Py_ssize_t __pyx_t_6;
13356 PyObject *__pyx_t_7 = NULL;
13357 Py_ssize_t __pyx_t_8;
13358 int __pyx_t_9;
13359 Py_ssize_t __pyx_t_10;
13360 int __pyx_lineno = 0;
13361 const char *__pyx_filename = NULL;
13362 int __pyx_clineno = 0;
13363 __Pyx_RefNannySetupContext("memview_slice", 0);
13364
13365 /* "View.MemoryView":813
13366 * @cname('__pyx_memview_slice')
13367 * cdef memoryview memview_slice(memoryview memview, tuple indices):
13368 * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
13369 * cdef bint negative_step
13370 * cdef __Pyx_memviewslice src, dst
13371*/
13372 __pyx_v_new_ndim = 0;
13373 __pyx_v_suboffset_dim = -1;
13374
13375 /* "View.MemoryView":820
13376 *
13377 *
13378 * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
13379 *
13380 * cdef _memoryviewslice memviewsliceobj
13381*/
13382 (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
13383
13384 /* "View.MemoryView":824
13385 * cdef _memoryviewslice memviewsliceobj
13386 *
13387 * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
13388 *
13389 * if isinstance(memview, _memoryviewslice):
13390*/
13391 #ifndef CYTHON_WITHOUT_ASSERTIONS
13392 if (unlikely(__pyx_assertions_enabled())) {
13393 __pyx_t_1 = (__pyx_v_memview->view.ndim > 0);
13394
13395 if (unlikely(!__pyx_t_1)) {
13396 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
13397 __PYX_ERR(1, 824, __pyx_L1_error)
13398 }
13399
13400 }
13401 #else
13402 if ((1)); else __PYX_ERR(1, 824, __pyx_L1_error)
13403 #endif
13404
13405 /* "View.MemoryView":826
13406 * assert memview.view.ndim > 0
13407 *
13408 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13409 * memviewsliceobj = memview
13410 * p_src = &memviewsliceobj.from_slice
13411*/
13412 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
13413 if (__pyx_t_1) {
13414
13415
13416 /* "View.MemoryView":827
13417 *
13418 * if isinstance(memview, _memoryviewslice):
13419 * memviewsliceobj = memview # <<<<<<<<<<<<<<
13420 * p_src = &memviewsliceobj.from_slice
13421 * else:
13422*/
13423 __pyx_t_2 = ((PyObject *)__pyx_v_memview);
13424 __Pyx_INCREF(__pyx_t_2);
13425 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)
13426 __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
13427 __pyx_t_2 = 0;
13428
13429 /* "View.MemoryView":828
13430 * if isinstance(memview, _memoryviewslice):
13431 * memviewsliceobj = memview
13432 * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
13433 * else:
13434 * slice_copy(memview, &src)
13435*/
13436 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
13437
13438 /* "View.MemoryView":826
13439 * assert memview.view.ndim > 0
13440 *
13441 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13442 * memviewsliceobj = memview
13443 * p_src = &memviewsliceobj.from_slice
13444*/
13445 goto __pyx_L3;
13446 }
13447
13448 /* "View.MemoryView":830
13449 * p_src = &memviewsliceobj.from_slice
13450 * else:
13451 * slice_copy(memview, &src) # <<<<<<<<<<<<<<
13452 * p_src = &src
13453 *
13454*/
13455 /*else*/ {
13456 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
13457
13458 /* "View.MemoryView":831
13459 * else:
13460 * slice_copy(memview, &src)
13461 * p_src = &src # <<<<<<<<<<<<<<
13462 *
13463 *
13464*/
13465 __pyx_v_p_src = (&__pyx_v_src);
13466 }
13467 __pyx_L3:;
13468
13469 /* "View.MemoryView":837
13470 *
13471 *
13472 * dst.memview = p_src.memview # <<<<<<<<<<<<<<
13473 * dst.data = p_src.data
13474 *
13475*/
13476 __pyx_t_3 = __pyx_v_p_src->memview;
13477
13478 __pyx_v_dst.memview = __pyx_t_3;
13479
13480 /* "View.MemoryView":838
13481 *
13482 * dst.memview = p_src.memview
13483 * dst.data = p_src.data # <<<<<<<<<<<<<<
13484 *
13485 *
13486*/
13487 __pyx_t_4 = __pyx_v_p_src->data;
13488
13489 __pyx_v_dst.data = __pyx_t_4;
13490
13491 /* "View.MemoryView":843
13492 *
13493 *
13494 * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
13495 * cdef int *p_suboffset_dim = &suboffset_dim
13496 * cdef Py_ssize_t start, stop, step, cindex
13497*/
13498 __pyx_v_p_dst = (&__pyx_v_dst);
13499
13500 /* "View.MemoryView":844
13501 *
13502 * cdef __Pyx_memviewslice *p_dst = &dst
13503 * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
13504 * cdef Py_ssize_t start, stop, step, cindex
13505 * cdef bint have_start, have_stop, have_step
13506*/
13507 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
13508
13509 /* "View.MemoryView":848
13510 * cdef bint have_start, have_stop, have_step
13511 *
13512 * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
13513 * if PyIndex_Check(index):
13514 * cindex = index
13515*/
13516
13517 __pyx_t_5 = 0;
13518 __pyx_t_2 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_2);
13519 __pyx_t_6 = 0;
13520 for (;;) {
13521 {
13522 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
13523 #if !CYTHON_ASSUME_SAFE_SIZE
13524 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 848, __pyx_L1_error)
13525 #endif
13526 if (__pyx_t_6 >= __pyx_temp) break;
13527 }
13528 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13529 __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6));
13530 #else
13531 __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6);
13532 #endif
13533 ++__pyx_t_6;
13534 if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 848, __pyx_L1_error)
13535 __Pyx_GOTREF(__pyx_t_7);
13536 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_7);
13537 __pyx_t_7 = 0;
13538 __pyx_v_dim = __pyx_t_5;
13539 __pyx_t_5 = (__pyx_t_5 + 1);
13540
13541 /* "View.MemoryView":849
13542 *
13543 * for dim, index in enumerate(indices):
13544 * if PyIndex_Check(index): # <<<<<<<<<<<<<<
13545 * cindex = index
13546 * slice_memviewslice(
13547*/
13548 __pyx_t_1 = (PyIndex_Check(__pyx_v_index) != 0);
13549
13550 if (__pyx_t_1) {
13551
13552
13553 /* "View.MemoryView":850
13554 * for dim, index in enumerate(indices):
13555 * if PyIndex_Check(index):
13556 * cindex = index # <<<<<<<<<<<<<<
13557 * slice_memviewslice(
13558 * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13559*/
13560 __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)
13561 __pyx_v_cindex = __pyx_t_8;
13562
13563 /* "View.MemoryView":851
13564 * if PyIndex_Check(index):
13565 * cindex = index
13566 * slice_memviewslice( # <<<<<<<<<<<<<<
13567 * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13568 * dim, new_ndim, p_suboffset_dim,
13569*/
13570 __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)
13571
13572
13573 /* "View.MemoryView":849
13574 *
13575 * for dim, index in enumerate(indices):
13576 * if PyIndex_Check(index): # <<<<<<<<<<<<<<
13577 * cindex = index
13578 * slice_memviewslice(
13579*/
13580 goto __pyx_L6;
13581 }
13582
13583 /* "View.MemoryView":857
13584 * 0, 0, 0, # have_{start,stop,step}
13585 * False)
13586 * elif index is None: # <<<<<<<<<<<<<<
13587 * p_dst.shape[new_ndim] = 1
13588 * p_dst.strides[new_ndim] = 0
13589*/
13590 __pyx_t_1 = (__pyx_v_index == Py_None);
13591 if (__pyx_t_1) {
13592
13593
13594 /* "View.MemoryView":858
13595 * False)
13596 * elif index is None:
13597 * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
13598 * p_dst.strides[new_ndim] = 0
13599 * p_dst.suboffsets[new_ndim] = -1
13600*/
13601 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
13602
13603 /* "View.MemoryView":859
13604 * elif index is None:
13605 * p_dst.shape[new_ndim] = 1
13606 * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
13607 * p_dst.suboffsets[new_ndim] = -1
13608 * new_ndim += 1
13609*/
13610 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
13611
13612 /* "View.MemoryView":860
13613 * p_dst.shape[new_ndim] = 1
13614 * p_dst.strides[new_ndim] = 0
13615 * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
13616 * new_ndim += 1
13617 * else:
13618*/
13619 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
13620
13621 /* "View.MemoryView":861
13622 * p_dst.strides[new_ndim] = 0
13623 * p_dst.suboffsets[new_ndim] = -1
13624 * new_ndim += 1 # <<<<<<<<<<<<<<
13625 * else:
13626 * start = index.start or 0
13627*/
13628 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13629
13630 /* "View.MemoryView":857
13631 * 0, 0, 0, # have_{start,stop,step}
13632 * False)
13633 * elif index is None: # <<<<<<<<<<<<<<
13634 * p_dst.shape[new_ndim] = 1
13635 * p_dst.strides[new_ndim] = 0
13636*/
13637 goto __pyx_L6;
13638 }
13639
13640 /* "View.MemoryView":863
13641 * new_ndim += 1
13642 * else:
13643 * start = index.start or 0 # <<<<<<<<<<<<<<
13644 * stop = index.stop or 0
13645 * step = index.step or 0
13646*/
13647 /*else*/ {
13648 __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)
13649 __Pyx_GOTREF(__pyx_t_7);
13650 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 863, __pyx_L1_error)
13651 if (!__pyx_t_1) {
13652 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13653 } else {
13654 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 863, __pyx_L1_error)
13655 __pyx_t_8 = __pyx_t_10;
13656 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13657 goto __pyx_L7_bool_binop_done;
13658 }
13659
13660 __pyx_t_8 = 0;
13661 __pyx_L7_bool_binop_done:;
13662 __pyx_v_start = __pyx_t_8;
13663
13664 /* "View.MemoryView":864
13665 * else:
13666 * start = index.start or 0
13667 * stop = index.stop or 0 # <<<<<<<<<<<<<<
13668 * step = index.step or 0
13669 *
13670*/
13671 __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)
13672 __Pyx_GOTREF(__pyx_t_7);
13673 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 864, __pyx_L1_error)
13674 if (!__pyx_t_1) {
13675 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13676 } else {
13677 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 864, __pyx_L1_error)
13678 __pyx_t_8 = __pyx_t_10;
13679 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13680 goto __pyx_L9_bool_binop_done;
13681 }
13682
13683 __pyx_t_8 = 0;
13684 __pyx_L9_bool_binop_done:;
13685 __pyx_v_stop = __pyx_t_8;
13686
13687 /* "View.MemoryView":865
13688 * start = index.start or 0
13689 * stop = index.stop or 0
13690 * step = index.step or 0 # <<<<<<<<<<<<<<
13691 *
13692 * have_start = index.start is not None
13693*/
13694 __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)
13695 __Pyx_GOTREF(__pyx_t_7);
13696 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 865, __pyx_L1_error)
13697 if (!__pyx_t_1) {
13698 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13699 } else {
13700 __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)
13701 __pyx_t_8 = __pyx_t_10;
13702 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13703 goto __pyx_L11_bool_binop_done;
13704 }
13705
13706 __pyx_t_8 = 0;
13707 __pyx_L11_bool_binop_done:;
13708 __pyx_v_step = __pyx_t_8;
13709
13710 /* "View.MemoryView":867
13711 * step = index.step or 0
13712 *
13713 * have_start = index.start is not None # <<<<<<<<<<<<<<
13714 * have_stop = index.stop is not None
13715 * have_step = index.step is not None
13716*/
13717 __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)
13718 __Pyx_GOTREF(__pyx_t_7);
13719 __pyx_t_1 = (__pyx_t_7 != Py_None);
13720 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13721 __pyx_v_have_start = __pyx_t_1;
13722
13723 /* "View.MemoryView":868
13724 *
13725 * have_start = index.start is not None
13726 * have_stop = index.stop is not None # <<<<<<<<<<<<<<
13727 * have_step = index.step is not None
13728 *
13729*/
13730 __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)
13731 __Pyx_GOTREF(__pyx_t_7);
13732 __pyx_t_1 = (__pyx_t_7 != Py_None);
13733 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13734 __pyx_v_have_stop = __pyx_t_1;
13735
13736 /* "View.MemoryView":869
13737 * have_start = index.start is not None
13738 * have_stop = index.stop is not None
13739 * have_step = index.step is not None # <<<<<<<<<<<<<<
13740 *
13741 * slice_memviewslice(
13742*/
13743 __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)
13744 __Pyx_GOTREF(__pyx_t_7);
13745 __pyx_t_1 = (__pyx_t_7 != Py_None);
13746 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13747 __pyx_v_have_step = __pyx_t_1;
13748
13749 /* "View.MemoryView":871
13750 * have_step = index.step is not None
13751 *
13752 * slice_memviewslice( # <<<<<<<<<<<<<<
13753 * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13754 * dim, new_ndim, p_suboffset_dim,
13755*/
13756 __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)
13757
13758
13759 /* "View.MemoryView":877
13760 * have_start, have_stop, have_step,
13761 * True)
13762 * new_ndim += 1 # <<<<<<<<<<<<<<
13763 *
13764 * if isinstance(memview, _memoryviewslice):
13765*/
13766 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13767 }
13768 __pyx_L6:;
13769
13770 /* "View.MemoryView":848
13771 * cdef bint have_start, have_stop, have_step
13772 *
13773 * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
13774 * if PyIndex_Check(index):
13775 * cindex = index
13776*/
13777 }
13778 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13779
13780 /* "View.MemoryView":879
13781 * new_ndim += 1
13782 *
13783 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13784 * return memoryview_fromslice(dst, new_ndim,
13785 * memviewsliceobj.to_object_func,
13786*/
13787 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
13788 if (__pyx_t_1) {
13789
13790
13791 /* "View.MemoryView":881
13792 * if isinstance(memview, _memoryviewslice):
13793 * return memoryview_fromslice(dst, new_ndim,
13794 * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
13795 * memviewsliceobj.to_dtype_func,
13796 * memview.dtype_is_object)
13797*/
13798 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 881, __pyx_L1_error) }
13799
13800 /* "View.MemoryView":882
13801 * return memoryview_fromslice(dst, new_ndim,
13802 * memviewsliceobj.to_object_func,
13803 * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
13804 * memview.dtype_is_object)
13805 * else:
13806*/
13807 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 882, __pyx_L1_error) }
13808
13809 /* "View.MemoryView":880
13810 *
13811 * if isinstance(memview, _memoryviewslice):
13812 * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
13813 * memviewsliceobj.to_object_func,
13814 * memviewsliceobj.to_dtype_func,
13815*/
13816 __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)
13817 __Pyx_GOTREF(__pyx_t_2);
13818 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)
13819 {
13820 struct __pyx_memoryview_obj *__pyx_temp;
13821 {
13822 __pyx_temp = __pyx_r;
13823 __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
13824 }
13825 __Pyx_XDECREF((PyObject *)__pyx_temp);
13826 }
13827 __pyx_t_2 = 0;
13828 goto __pyx_L0;
13829
13830 /* "View.MemoryView":879
13831 * new_ndim += 1
13832 *
13833 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13834 * return memoryview_fromslice(dst, new_ndim,
13835 * memviewsliceobj.to_object_func,
13836*/
13837 }
13838
13839 /* "View.MemoryView":885
13840 * memview.dtype_is_object)
13841 * else:
13842 * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
13843 * memview.dtype_is_object)
13844 *
13845*/
13846 /*else*/ {
13847
13848 /* "View.MemoryView":886
13849 * else:
13850 * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
13851 * memview.dtype_is_object) # <<<<<<<<<<<<<<
13852 *
13853 *
13854*/
13855 __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)
13856 __Pyx_GOTREF(__pyx_t_2);
13857
13858 /* "View.MemoryView":885
13859 * memview.dtype_is_object)
13860 * else:
13861 * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
13862 * memview.dtype_is_object)
13863 *
13864*/
13865 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)
13866 {
13867 struct __pyx_memoryview_obj *__pyx_temp;
13868 {
13869 __pyx_temp = __pyx_r;
13870 __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
13871 }
13872 __Pyx_XDECREF((PyObject *)__pyx_temp);
13873 }
13874 __pyx_t_2 = 0;
13875 goto __pyx_L0;
13876 }
13877
13878 /* "View.MemoryView":811
13879 *
13880 *
13881 * @cname('__pyx_memview_slice') # <<<<<<<<<<<<<<
13882 * cdef memoryview memview_slice(memoryview memview, tuple indices):
13883 * cdef int new_ndim = 0, suboffset_dim = -1, dim
13884*/
13885
13886 /* function exit code */
13887 __pyx_L1_error:;
13888 __Pyx_XDECREF(__pyx_t_2);
13889 __Pyx_XDECREF(__pyx_t_7);
13890 __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
13891 __pyx_r = 0;
13892 __pyx_L0:;
13893
13894
13895
13896
13897
13898
13899 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909 __Pyx_XDECREF(__pyx_v_index);
13910 __Pyx_XGIVEREF((PyObject *)__pyx_r);
13911 __Pyx_RefNannyFinishContext();
13912 return __pyx_r;
13913}
13914
13915/* "View.MemoryView":892
13916 *
13917 *
13918 * @cname('__pyx_pybuffer_index') # <<<<<<<<<<<<<<
13919 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
13920 * Py_ssize_t dim) except NULL:
13921*/
13922
13923static 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) {
13924 Py_ssize_t __pyx_v_shape;
13925 Py_ssize_t __pyx_v_stride;
13926 Py_ssize_t __pyx_v_suboffset;
13927 Py_ssize_t __pyx_v_itemsize;
13928 char *__pyx_v_resultp;
13929 char *__pyx_r;
13930 Py_ssize_t __pyx_t_1;
13931 int __pyx_t_2;
13932 int __pyx_t_3;
13933 int __pyx_lineno = 0;
13934 const char *__pyx_filename = NULL;
13935 int __pyx_clineno = 0;
13936
13937
13938 /* "View.MemoryView":895
13939 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
13940 * Py_ssize_t dim) except NULL:
13941 * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
13942 * cdef Py_ssize_t itemsize = view.itemsize
13943 * cdef char *resultp
13944*/
13945 __pyx_v_suboffset = -1L;
13946
13947 /* "View.MemoryView":896
13948 * Py_ssize_t dim) except NULL:
13949 * cdef Py_ssize_t shape, stride, suboffset = -1
13950 * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
13951 * cdef char *resultp
13952 *
13953*/
13954 __pyx_t_1 = __pyx_v_view->itemsize;
13955
13956 __pyx_v_itemsize = __pyx_t_1;
13957
13958 /* "View.MemoryView":899
13959 * cdef char *resultp
13960 *
13961 * if view.ndim == 0: # <<<<<<<<<<<<<<
13962 * shape = view.len // itemsize
13963 * stride = itemsize
13964*/
13965 __pyx_t_2 = (__pyx_v_view->ndim == 0);
13966
13967 if (__pyx_t_2) {
13968
13969
13970 /* "View.MemoryView":900
13971 *
13972 * if view.ndim == 0:
13973 * shape = view.len // itemsize # <<<<<<<<<<<<<<
13974 * stride = itemsize
13975 * else:
13976*/
13977 if (unlikely(__pyx_v_itemsize == 0)) {
13978 PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
13979 __PYX_ERR(1, 900, __pyx_L1_error)
13980 }
13981 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))) {
13982 PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
13983 __PYX_ERR(1, 900, __pyx_L1_error)
13984 }
13985 __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize, 0);
13986
13987 /* "View.MemoryView":901
13988 * if view.ndim == 0:
13989 * shape = view.len // itemsize
13990 * stride = itemsize # <<<<<<<<<<<<<<
13991 * else:
13992 * shape = view.shape[dim]
13993*/
13994 __pyx_v_stride = __pyx_v_itemsize;
13995
13996 /* "View.MemoryView":899
13997 * cdef char *resultp
13998 *
13999 * if view.ndim == 0: # <<<<<<<<<<<<<<
14000 * shape = view.len // itemsize
14001 * stride = itemsize
14002*/
14003 goto __pyx_L3;
14004 }
14005
14006 /* "View.MemoryView":903
14007 * stride = itemsize
14008 * else:
14009 * shape = view.shape[dim] # <<<<<<<<<<<<<<
14010 * stride = view.strides[dim]
14011 * if view.suboffsets != NULL:
14012*/
14013 /*else*/ {
14014 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
14015
14016 /* "View.MemoryView":904
14017 * else:
14018 * shape = view.shape[dim]
14019 * stride = view.strides[dim] # <<<<<<<<<<<<<<
14020 * if view.suboffsets != NULL:
14021 * suboffset = view.suboffsets[dim]
14022*/
14023 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
14024
14025 /* "View.MemoryView":905
14026 * shape = view.shape[dim]
14027 * stride = view.strides[dim]
14028 * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
14029 * suboffset = view.suboffsets[dim]
14030 *
14031*/
14032 __pyx_t_2 = (__pyx_v_view->suboffsets != NULL);
14033
14034 if (__pyx_t_2) {
14035
14036
14037 /* "View.MemoryView":906
14038 * stride = view.strides[dim]
14039 * if view.suboffsets != NULL:
14040 * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
14041 *
14042 * if index < 0:
14043*/
14044 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
14045
14046 /* "View.MemoryView":905
14047 * shape = view.shape[dim]
14048 * stride = view.strides[dim]
14049 * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
14050 * suboffset = view.suboffsets[dim]
14051 *
14052*/
14053 }
14054 }
14055 __pyx_L3:;
14056
14057 /* "View.MemoryView":908
14058 * suboffset = view.suboffsets[dim]
14059 *
14060 * if index < 0: # <<<<<<<<<<<<<<
14061 * index += view.shape[dim]
14062 * if cython.unlikely(index < 0):
14063*/
14064 __pyx_t_2 = (__pyx_v_index < 0);
14065
14066 if (__pyx_t_2) {
14067
14068
14069 /* "View.MemoryView":909
14070 *
14071 * if index < 0:
14072 * index += view.shape[dim] # <<<<<<<<<<<<<<
14073 * if cython.unlikely(index < 0):
14074 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14075*/
14076 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
14077
14078 /* "View.MemoryView":910
14079 * if index < 0:
14080 * index += view.shape[dim]
14081 * if cython.unlikely(index < 0): # <<<<<<<<<<<<<<
14082 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14083 *
14084*/
14085 __pyx_t_2 = (__pyx_v_index < 0);
14086
14087 if (unlikely(__pyx_t_2)) {
14088
14089
14090 /* "View.MemoryView":911
14091 * index += view.shape[dim]
14092 * if cython.unlikely(index < 0):
14093 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim) # <<<<<<<<<<<<<<
14094 *
14095 * if cython.unlikely(index >= shape):
14096*/
14097 __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)
14098
14099
14100 /* "View.MemoryView":910
14101 * if index < 0:
14102 * index += view.shape[dim]
14103 * if cython.unlikely(index < 0): # <<<<<<<<<<<<<<
14104 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14105 *
14106*/
14107 }
14108
14109 /* "View.MemoryView":908
14110 * suboffset = view.suboffsets[dim]
14111 *
14112 * if index < 0: # <<<<<<<<<<<<<<
14113 * index += view.shape[dim]
14114 * if cython.unlikely(index < 0):
14115*/
14116 }
14117
14118 /* "View.MemoryView":913
14119 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14120 *
14121 * if cython.unlikely(index >= shape): # <<<<<<<<<<<<<<
14122 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14123 *
14124*/
14125 __pyx_t_2 = (__pyx_v_index >= __pyx_v_shape);
14126
14127 if (unlikely(__pyx_t_2)) {
14128
14129
14130 /* "View.MemoryView":914
14131 *
14132 * if cython.unlikely(index >= shape):
14133 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim) # <<<<<<<<<<<<<<
14134 *
14135 * resultp = bufp + index * stride
14136*/
14137 __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)
14138
14139
14140 /* "View.MemoryView":913
14141 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14142 *
14143 * if cython.unlikely(index >= shape): # <<<<<<<<<<<<<<
14144 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14145 *
14146*/
14147 }
14148
14149 /* "View.MemoryView":916
14150 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14151 *
14152 * resultp = bufp + index * stride # <<<<<<<<<<<<<<
14153 * if suboffset >= 0:
14154 * resultp = (<char **> resultp)[0] + suboffset
14155*/
14156 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
14157
14158 /* "View.MemoryView":917
14159 *
14160 * resultp = bufp + index * stride
14161 * if suboffset >= 0: # <<<<<<<<<<<<<<
14162 * resultp = (<char **> resultp)[0] + suboffset
14163 *
14164*/
14165 __pyx_t_2 = (__pyx_v_suboffset >= 0);
14166
14167 if (__pyx_t_2) {
14168
14169
14170 /* "View.MemoryView":918
14171 * resultp = bufp + index * stride
14172 * if suboffset >= 0:
14173 * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
14174 *
14175 * return resultp
14176*/
14177 __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
14178
14179 /* "View.MemoryView":917
14180 *
14181 * resultp = bufp + index * stride
14182 * if suboffset >= 0: # <<<<<<<<<<<<<<
14183 * resultp = (<char **> resultp)[0] + suboffset
14184 *
14185*/
14186 }
14187
14188 /* "View.MemoryView":920
14189 * resultp = (<char **> resultp)[0] + suboffset
14190 *
14191 * return resultp # <<<<<<<<<<<<<<
14192 *
14193 *
14194*/
14195 {
14196
14197 __pyx_r = __pyx_v_resultp;
14198 }
14199 goto __pyx_L0;
14200
14201 /* "View.MemoryView":892
14202 *
14203 *
14204 * @cname('__pyx_pybuffer_index') # <<<<<<<<<<<<<<
14205 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
14206 * Py_ssize_t dim) except NULL:
14207*/
14208
14209 /* function exit code */
14210 __pyx_L1_error:;
14211 __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
14212 __pyx_r = NULL;
14213 __pyx_L0:;
14214
14215
14216
14217
14218
14219
14220
14221 return __pyx_r;
14222}
14223
14224/* "View.MemoryView":925
14225 *
14226 *
14227 * @cname('__pyx_memslice_transpose') # <<<<<<<<<<<<<<
14228 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
14229 * cdef int ndim = memslice.memview.view.ndim
14230*/
14231
14232static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
14233 int __pyx_v_ndim;
14234 Py_ssize_t *__pyx_v_shape;
14235 Py_ssize_t *__pyx_v_strides;
14236 int __pyx_v_i;
14237 int __pyx_v_j;
14238 int __pyx_r;
14239 int __pyx_t_1;
14240 Py_ssize_t *__pyx_t_2;
14241 long __pyx_t_3;
14242 long __pyx_t_4;
14243 Py_ssize_t __pyx_t_5;
14244 Py_ssize_t __pyx_t_6;
14245 int __pyx_t_7;
14246 int __pyx_t_8;
14247 int __pyx_t_9;
14248 int __pyx_lineno = 0;
14249 const char *__pyx_filename = NULL;
14250 int __pyx_clineno = 0;
14251 PyGILState_STATE __pyx_gilstate_save;
14252
14253 /* "View.MemoryView":927
14254 * @cname('__pyx_memslice_transpose')
14255 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
14256 * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
14257 *
14258 * cdef Py_ssize_t *shape = memslice.shape
14259*/
14260 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
14261
14262 __pyx_v_ndim = __pyx_t_1;
14263
14264 /* "View.MemoryView":929
14265 * cdef int ndim = memslice.memview.view.ndim
14266 *
14267 * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
14268 * cdef Py_ssize_t *strides = memslice.strides
14269 *
14270*/
14271 __pyx_t_2 = __pyx_v_memslice->shape;
14272
14273 __pyx_v_shape = __pyx_t_2;
14274
14275 /* "View.MemoryView":930
14276 *
14277 * cdef Py_ssize_t *shape = memslice.shape
14278 * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
14279 *
14280 *
14281*/
14282 __pyx_t_2 = __pyx_v_memslice->strides;
14283
14284 __pyx_v_strides = __pyx_t_2;
14285
14286 /* "View.MemoryView":934
14287 *
14288 * cdef int i, j
14289 * for i in range(ndim // 2): # <<<<<<<<<<<<<<
14290 * j = ndim - 1 - i
14291 * strides[i], strides[j] = strides[j], strides[i]
14292*/
14293
14294 __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2, 1);
14295 __pyx_t_4 = __pyx_t_3;
14296
14297 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
14298 __pyx_v_i = __pyx_t_1;
14299
14300 /* "View.MemoryView":935
14301 * cdef int i, j
14302 * for i in range(ndim // 2):
14303 * j = ndim - 1 - i # <<<<<<<<<<<<<<
14304 * strides[i], strides[j] = strides[j], strides[i]
14305 * shape[i], shape[j] = shape[j], shape[i]
14306*/
14307 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
14308
14309 /* "View.MemoryView":936
14310 * for i in range(ndim // 2):
14311 * j = ndim - 1 - i
14312 * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
14313 * shape[i], shape[j] = shape[j], shape[i]
14314 *
14315*/
14316 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
14317
14318 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
14319
14320 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
14321
14322 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
14323
14324
14325 /* "View.MemoryView":937
14326 * j = ndim - 1 - i
14327 * strides[i], strides[j] = strides[j], strides[i]
14328 * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
14329 *
14330 * if cython.unlikely(memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0):
14331*/
14332 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
14333
14334 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
14335
14336 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
14337
14338 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
14339
14340
14341 /* "View.MemoryView":939
14342 * shape[i], shape[j] = shape[j], shape[i]
14343 *
14344 * if cython.unlikely(memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0): # <<<<<<<<<<<<<<
14345 * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14346 *
14347*/
14348 __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0);
14349
14350 if (!__pyx_t_8) {
14351
14352 } else {
14353
14354 __pyx_t_7 = __pyx_t_8;
14355
14356 goto __pyx_L6_bool_binop_done;
14357 }
14358 __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0);
14359
14360
14361 __pyx_t_7 = __pyx_t_8;
14362
14363 __pyx_L6_bool_binop_done:;
14364 if (unlikely(__pyx_t_7)) {
14365
14366
14367 /* "View.MemoryView":940
14368 *
14369 * if cython.unlikely(memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0):
14370 * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
14371 *
14372 * return 0
14373*/
14374 __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)
14375
14376
14377 /* "View.MemoryView":939
14378 * shape[i], shape[j] = shape[j], shape[i]
14379 *
14380 * if cython.unlikely(memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0): # <<<<<<<<<<<<<<
14381 * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14382 *
14383*/
14384 }
14385 }
14386
14387
14388 /* "View.MemoryView":942
14389 * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14390 *
14391 * return 0 # <<<<<<<<<<<<<<
14392 *
14393 *
14394*/
14395 {
14396
14397 __pyx_r = 0;
14398 }
14399 goto __pyx_L0;
14400
14401 /* "View.MemoryView":925
14402 *
14403 *
14404 * @cname('__pyx_memslice_transpose') # <<<<<<<<<<<<<<
14405 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
14406 * cdef int ndim = memslice.memview.view.ndim
14407*/
14408
14409 /* function exit code */
14410 __pyx_L1_error:;
14411 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
14412 __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14413 __pyx_r = -1;
14414 __Pyx_PyGILState_Release(__pyx_gilstate_save);
14415 __pyx_L0:;
14416
14417
14418
14419
14420
14421 return __pyx_r;
14422}
14423
14424/* "View.MemoryView":960
14425 * cdef to_dtype_func_type to_dtype_func
14426 *
14427 * def __dealloc__(self): # <<<<<<<<<<<<<<
14428 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14429 *
14430*/
14431
14432/* Python wrapper */
14433static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
14434static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
14435 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
14436 __Pyx_RefNannyDeclarations
14437 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
14438 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
14439 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14440
14441 /* function exit code */
14442 __Pyx_RefNannyFinishContext();
14443}
14444
14445static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14446
14447 /* "View.MemoryView":961
14448 *
14449 * def __dealloc__(self):
14450 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
14451 *
14452 * cdef convert_item_to_object(self, char *itemp):
14453*/
14454 __PYX_XCLEAR_MEMVIEW((&__pyx_v_self->from_slice), 1);
14455
14456 /* "View.MemoryView":960
14457 * cdef to_dtype_func_type to_dtype_func
14458 *
14459 * def __dealloc__(self): # <<<<<<<<<<<<<<
14460 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14461 *
14462*/
14463
14464 /* function exit code */
14465
14466}
14467
14468/* "View.MemoryView":963
14469 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14470 *
14471 * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
14472 * if self.to_object_func != NULL:
14473 * return self.to_object_func(itemp)
14474*/
14475
14476static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
14477 PyObject *__pyx_r = NULL;
14478 __Pyx_RefNannyDeclarations
14479 int __pyx_t_1;
14480 PyObject *__pyx_t_2 = NULL;
14481 int __pyx_lineno = 0;
14482 const char *__pyx_filename = NULL;
14483 int __pyx_clineno = 0;
14484 __Pyx_RefNannySetupContext("convert_item_to_object", 0);
14485
14486 /* "View.MemoryView":964
14487 *
14488 * cdef convert_item_to_object(self, char *itemp):
14489 * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
14490 * return self.to_object_func(itemp)
14491 * else:
14492*/
14493 __pyx_t_1 = (__pyx_v_self->to_object_func != NULL);
14494
14495 if (__pyx_t_1) {
14496
14497
14498 /* "View.MemoryView":965
14499 * cdef convert_item_to_object(self, char *itemp):
14500 * if self.to_object_func != NULL:
14501 * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
14502 * else:
14503 * return memoryview.convert_item_to_object(self, itemp)
14504*/
14505 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 965, __pyx_L1_error)
14506 __Pyx_GOTREF(__pyx_t_2);
14507 {
14508 PyObject *__pyx_temp;
14509 {
14510 __pyx_temp = __pyx_r;
14511 __pyx_r = __pyx_t_2;
14512 }
14513 __Pyx_XDECREF(__pyx_temp);
14514 }
14515 __pyx_t_2 = 0;
14516 goto __pyx_L0;
14517
14518 /* "View.MemoryView":964
14519 *
14520 * cdef convert_item_to_object(self, char *itemp):
14521 * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
14522 * return self.to_object_func(itemp)
14523 * else:
14524*/
14525 }
14526
14527 /* "View.MemoryView":967
14528 * return self.to_object_func(itemp)
14529 * else:
14530 * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
14531 *
14532 * cdef assign_item_from_object(self, char *itemp, object value):
14533*/
14534 /*else*/ {
14535 __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)
14536 __Pyx_GOTREF(__pyx_t_2);
14537 {
14538 PyObject *__pyx_temp;
14539 {
14540 __pyx_temp = __pyx_r;
14541 __pyx_r = __pyx_t_2;
14542 }
14543 __Pyx_XDECREF(__pyx_temp);
14544 }
14545 __pyx_t_2 = 0;
14546 goto __pyx_L0;
14547 }
14548
14549 /* "View.MemoryView":963
14550 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14551 *
14552 * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
14553 * if self.to_object_func != NULL:
14554 * return self.to_object_func(itemp)
14555*/
14556
14557 /* function exit code */
14558 __pyx_L1_error:;
14559 __Pyx_XDECREF(__pyx_t_2);
14560 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14561 __pyx_r = 0;
14562 __pyx_L0:;
14563 __Pyx_XGIVEREF(__pyx_r);
14564 __Pyx_RefNannyFinishContext();
14565 return __pyx_r;
14566}
14567
14568/* "View.MemoryView":969
14569 * return memoryview.convert_item_to_object(self, itemp)
14570 *
14571 * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
14572 * if self.to_dtype_func != NULL:
14573 * self.to_dtype_func(itemp, value)
14574*/
14575
14576static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
14577 PyObject *__pyx_r = NULL;
14578 __Pyx_RefNannyDeclarations
14579 int __pyx_t_1;
14580 int __pyx_t_2;
14581 PyObject *__pyx_t_3 = NULL;
14582 int __pyx_lineno = 0;
14583 const char *__pyx_filename = NULL;
14584 int __pyx_clineno = 0;
14585 __Pyx_RefNannySetupContext("assign_item_from_object", 0);
14586
14587 /* "View.MemoryView":970
14588 *
14589 * cdef assign_item_from_object(self, char *itemp, object value):
14590 * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
14591 * self.to_dtype_func(itemp, value)
14592 * else:
14593*/
14594 __pyx_t_1 = (__pyx_v_self->to_dtype_func != NULL);
14595
14596 if (__pyx_t_1) {
14597
14598
14599 /* "View.MemoryView":971
14600 * cdef assign_item_from_object(self, char *itemp, object value):
14601 * if self.to_dtype_func != NULL:
14602 * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
14603 * else:
14604 * memoryview.assign_item_from_object(self, itemp, value)
14605*/
14606 __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)
14607
14608
14609 /* "View.MemoryView":970
14610 *
14611 * cdef assign_item_from_object(self, char *itemp, object value):
14612 * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
14613 * self.to_dtype_func(itemp, value)
14614 * else:
14615*/
14616 goto __pyx_L3;
14617 }
14618
14619 /* "View.MemoryView":973
14620 * self.to_dtype_func(itemp, value)
14621 * else:
14622 * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
14623 *
14624 * cdef _get_base(self):
14625*/
14626 /*else*/ {
14627 __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)
14628 __Pyx_GOTREF(__pyx_t_3);
14629 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14630 }
14631 __pyx_L3:;
14632
14633 /* "View.MemoryView":969
14634 * return memoryview.convert_item_to_object(self, itemp)
14635 *
14636 * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
14637 * if self.to_dtype_func != NULL:
14638 * self.to_dtype_func(itemp, value)
14639*/
14640
14641 /* function exit code */
14642 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14643 goto __pyx_L0;
14644 __pyx_L1_error:;
14645 __Pyx_XDECREF(__pyx_t_3);
14646 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14647 __pyx_r = 0;
14648 __pyx_L0:;
14649 __Pyx_XGIVEREF(__pyx_r);
14650 __Pyx_RefNannyFinishContext();
14651 return __pyx_r;
14652}
14653
14654/* "View.MemoryView":975
14655 * memoryview.assign_item_from_object(self, itemp, value)
14656 *
14657 * cdef _get_base(self): # <<<<<<<<<<<<<<
14658 * return self.from_object
14659 *
14660*/
14661
14662static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14663 PyObject *__pyx_r = NULL;
14664 __Pyx_RefNannyDeclarations
14665 __Pyx_RefNannySetupContext("_get_base", 0);
14666
14667 /* "View.MemoryView":976
14668 *
14669 * cdef _get_base(self):
14670 * return self.from_object # <<<<<<<<<<<<<<
14671 *
14672 *
14673*/
14674 {
14675 PyObject *__pyx_temp;
14676 {
14677 __pyx_temp = __pyx_r;
14678 __Pyx_INCREF(__pyx_v_self->from_object);
14679 __pyx_r = __pyx_v_self->from_object;
14680 }
14681 __Pyx_XDECREF(__pyx_temp);
14682 }
14683 goto __pyx_L0;
14684
14685 /* "View.MemoryView":975
14686 * memoryview.assign_item_from_object(self, itemp, value)
14687 *
14688 * cdef _get_base(self): # <<<<<<<<<<<<<<
14689 * return self.from_object
14690 *
14691*/
14692
14693 /* function exit code */
14694 __pyx_L0:;
14695 __Pyx_XGIVEREF(__pyx_r);
14696 __Pyx_RefNannyFinishContext();
14697 return __pyx_r;
14698}
14699
14700/* "(tree fragment)":1
14701 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14702 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14703 * def __setstate_cython__(self, __pyx_state):
14704*/
14705
14706/* Python wrapper */
14707static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
14708#if CYTHON_VECTORCALL
14709PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14710#else
14711PyObject *__pyx_args, PyObject *__pyx_kwds
14712#endif
14713); /*proto*/
14714static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
14715#if CYTHON_VECTORCALL
14716PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14717#else
14718PyObject *__pyx_args, PyObject *__pyx_kwds
14719#endif
14720) {
14721 #if !CYTHON_VECTORCALL
14722 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
14723 #endif
14724 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
14725 PyObject *__pyx_r = 0;
14726 __Pyx_RefNannyDeclarations
14727 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
14728 #if !CYTHON_VECTORCALL
14729 #if CYTHON_ASSUME_SAFE_SIZE
14730 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
14731 #else
14732 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
14733 #endif
14734 #endif
14735 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
14736 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
14737 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
14738 if (unlikely(__pyx_kwds_len < 0)) return NULL;
14739 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
14740 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14741
14742 /* function exit code */
14743 __Pyx_RefNannyFinishContext();
14744 return __pyx_r;
14745}
14746
14747static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14748 PyObject *__pyx_r = NULL;
14749 __Pyx_RefNannyDeclarations
14750 int __pyx_lineno = 0;
14751 const char *__pyx_filename = NULL;
14752 int __pyx_clineno = 0;
14753 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
14754
14755 /* "(tree fragment)":2
14756 * def __reduce_cython__(self):
14757 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
14758 * def __setstate_cython__(self, __pyx_state):
14759 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14760*/
14761 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
14762 __PYX_ERR(1, 2, __pyx_L1_error)
14763
14764 /* "(tree fragment)":1
14765 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14766 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14767 * def __setstate_cython__(self, __pyx_state):
14768*/
14769
14770 /* function exit code */
14771 __pyx_L1_error:;
14772 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14773 __pyx_r = NULL;
14774 __Pyx_XGIVEREF(__pyx_r);
14775 __Pyx_RefNannyFinishContext();
14776 return __pyx_r;
14777}
14778
14779/* "(tree fragment)":3
14780 * def __reduce_cython__(self):
14781 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14782 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14783 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14784*/
14785
14786/* Python wrapper */
14787static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
14788#if CYTHON_VECTORCALL
14789PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14790#else
14791PyObject *__pyx_args, PyObject *__pyx_kwds
14792#endif
14793); /*proto*/
14794static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
14795#if CYTHON_VECTORCALL
14796PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14797#else
14798PyObject *__pyx_args, PyObject *__pyx_kwds
14799#endif
14800) {
14801 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
14802 #if !CYTHON_VECTORCALL
14803 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
14804 #endif
14805 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
14806 PyObject* values[1] = {0};
14807 int __pyx_lineno = 0;
14808 const char *__pyx_filename = NULL;
14809 int __pyx_clineno = 0;
14810 PyObject *__pyx_r = 0;
14811 __Pyx_RefNannyDeclarations
14812 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
14813 #if !CYTHON_VECTORCALL
14814 #if CYTHON_ASSUME_SAFE_SIZE
14815 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
14816 #else
14817 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
14818 #endif
14819 #endif
14820 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
14821 {
14822 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
14823 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
14824 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
14825 if (__pyx_kwds_len > 0) {
14826 switch (__pyx_nargs) {
14827 case 1:
14828 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
14829 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
14830 CYTHON_FALLTHROUGH;
14831 case 0: break;
14832 default: goto __pyx_L5_argtuple_error;
14833 }
14834 const Py_ssize_t kwd_pos_args = __pyx_nargs;
14835 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)
14836 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
14837 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
14838 }
14839 } else if (unlikely(__pyx_nargs != 1)) {
14840 goto __pyx_L5_argtuple_error;
14841 } else {
14842 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
14843 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
14844 }
14845 __pyx_v___pyx_state = values[0];
14846 }
14847 goto __pyx_L6_skip;
14848 __pyx_L5_argtuple_error:;
14849 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
14850 __pyx_L6_skip:;
14851 goto __pyx_L4_argument_unpacking_done;
14852 __pyx_L3_error:;
14853 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
14854 Py_XDECREF(values[__pyx_temp]);
14855 }
14856 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14857 __Pyx_RefNannyFinishContext();
14858 return NULL;
14859 __pyx_L4_argument_unpacking_done:;
14860 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), __pyx_v___pyx_state);
14861
14862 /* function exit code */
14863 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
14864 Py_XDECREF(values[__pyx_temp]);
14865 }
14866 __Pyx_RefNannyFinishContext();
14867 return __pyx_r;
14868}
14869
14870static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
14871 PyObject *__pyx_r = NULL;
14872 __Pyx_RefNannyDeclarations
14873 int __pyx_lineno = 0;
14874 const char *__pyx_filename = NULL;
14875 int __pyx_clineno = 0;
14876 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
14877
14878 /* "(tree fragment)":4
14879 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14880 * def __setstate_cython__(self, __pyx_state):
14881 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
14882*/
14883 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
14884 __PYX_ERR(1, 4, __pyx_L1_error)
14885
14886 /* "(tree fragment)":3
14887 * def __reduce_cython__(self):
14888 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14889 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14890 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14891*/
14892
14893 /* function exit code */
14894 __pyx_L1_error:;
14895 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14896 __pyx_r = NULL;
14897 __Pyx_XGIVEREF(__pyx_r);
14898 __Pyx_RefNannyFinishContext();
14899 return __pyx_r;
14900}
14901
14902/* "View.MemoryView":995
14903 * pass # ignore failure, it's a minor issue
14904 *
14905 * @cname('__pyx_memoryview_fromslice') # <<<<<<<<<<<<<<
14906 * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,
14907 * int ndim,
14908*/
14909
14910static 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) {
14911 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
14912 Py_ssize_t __pyx_v_suboffset;
14913 Py_ssize_t __pyx_v_length;
14914 PyObject *__pyx_r = NULL;
14915 __Pyx_RefNannyDeclarations
14916 int __pyx_t_1;
14917 PyObject *__pyx_t_2 = NULL;
14918 PyObject *__pyx_t_3 = NULL;
14919 __Pyx_TypeInfo const *__pyx_t_4;
14920 Py_buffer __pyx_t_5;
14921 Py_ssize_t *__pyx_t_6;
14922 Py_ssize_t *__pyx_t_7;
14923 Py_ssize_t *__pyx_t_8;
14924 Py_ssize_t __pyx_t_9;
14925 int __pyx_lineno = 0;
14926 const char *__pyx_filename = NULL;
14927 int __pyx_clineno = 0;
14928 __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
14929
14930 /* "View.MemoryView":1004
14931 * cdef _memoryviewslice result
14932 *
14933 * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
14934 * return None
14935 *
14936*/
14937 __pyx_t_1 = (((PyObject *)__pyx_v_memviewslice.memview) == Py_None);
14938
14939 if (__pyx_t_1) {
14940
14941
14942 /* "View.MemoryView":1005
14943 *
14944 * if <PyObject *> memviewslice.memview == Py_None:
14945 * return None # <<<<<<<<<<<<<<
14946 *
14947 *
14948*/
14949 {
14950 PyObject *__pyx_temp;
14951 {
14952 __pyx_temp = __pyx_r;
14953 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14954 }
14955 __Pyx_XDECREF(__pyx_temp);
14956 }
14957 goto __pyx_L0;
14958
14959 /* "View.MemoryView":1004
14960 * cdef _memoryviewslice result
14961 *
14962 * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
14963 * return None
14964 *
14965*/
14966 }
14967
14968 /* "View.MemoryView":1010
14969 *
14970 *
14971 * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object) # <<<<<<<<<<<<<<
14972 *
14973 * result.from_slice = memviewslice
14974*/
14975 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1010, __pyx_L1_error)
14976 __Pyx_GOTREF(__pyx_t_2);
14977 __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1010, __pyx_L1_error)
14978 __Pyx_GOTREF(__pyx_t_3);
14979 __Pyx_INCREF(Py_None);
14980 __Pyx_GIVEREF(Py_None);
14981 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None) != (0)) __PYX_ERR(1, 1010, __pyx_L1_error);
14982 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
14983 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
14984 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(1, 1010, __pyx_L1_error);
14985 __Pyx_GIVEREF(__pyx_t_2);
14986 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2) != (0)) __PYX_ERR(1, 1010, __pyx_L1_error);
14987 __pyx_t_2 = 0;
14988 __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)
14989 __Pyx_GOTREF(__pyx_t_2);
14990 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14991 __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
14992 __pyx_t_2 = 0;
14993
14994 /* "View.MemoryView":1012
14995 * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object)
14996 *
14997 * result.from_slice = memviewslice # <<<<<<<<<<<<<<
14998 * __PYX_INC_MEMVIEW(&memviewslice, 1)
14999 *
15000*/
15001 __pyx_v_result->from_slice = __pyx_v_memviewslice;
15002
15003 /* "View.MemoryView":1013
15004 *
15005 * result.from_slice = memviewslice
15006 * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
15007 *
15008 * result.from_object = (<memoryview> memviewslice.memview)._get_base()
15009*/
15010 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
15011
15012 /* "View.MemoryView":1015
15013 * __PYX_INC_MEMVIEW(&memviewslice, 1)
15014 *
15015 * result.from_object = (<memoryview> memviewslice.memview)._get_base() # <<<<<<<<<<<<<<
15016 * result.typeinfo = memviewslice.memview.typeinfo
15017 *
15018*/
15019 __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)
15020 __Pyx_GOTREF(__pyx_t_2);
15021 __Pyx_GIVEREF(__pyx_t_2);
15022 __Pyx_GOTREF(__pyx_v_result->from_object);
15023 __Pyx_DECREF(__pyx_v_result->from_object);
15024 __pyx_v_result->from_object = __pyx_t_2;
15025 __pyx_t_2 = 0;
15026
15027 /* "View.MemoryView":1016
15028 *
15029 * result.from_object = (<memoryview> memviewslice.memview)._get_base()
15030 * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
15031 *
15032 * result.view = memviewslice.memview.view
15033*/
15034 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
15035
15036 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
15037
15038 /* "View.MemoryView":1018
15039 * result.typeinfo = memviewslice.memview.typeinfo
15040 *
15041 * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
15042 * result.view.buf = <void *> memviewslice.data
15043 * result.view.ndim = ndim
15044*/
15045 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
15046
15047 __pyx_v_result->__pyx_base.view = __pyx_t_5;
15048
15049 /* "View.MemoryView":1019
15050 *
15051 * result.view = memviewslice.memview.view
15052 * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
15053 * result.view.ndim = ndim
15054 * (<__pyx_buffer *> &result.view).obj = Py_None
15055*/
15056 __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
15057
15058 /* "View.MemoryView":1020
15059 * result.view = memviewslice.memview.view
15060 * result.view.buf = <void *> memviewslice.data
15061 * result.view.ndim = ndim # <<<<<<<<<<<<<<
15062 * (<__pyx_buffer *> &result.view).obj = Py_None
15063 * Py_INCREF(Py_None)
15064*/
15065 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
15066
15067 /* "View.MemoryView":1021
15068 * result.view.buf = <void *> memviewslice.data
15069 * result.view.ndim = ndim
15070 * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
15071 * Py_INCREF(Py_None)
15072 *
15073*/
15074 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
15075
15076 /* "View.MemoryView":1022
15077 * result.view.ndim = ndim
15078 * (<__pyx_buffer *> &result.view).obj = Py_None
15079 * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
15080 *
15081 * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
15082*/
15083 Py_INCREF(Py_None);
15084
15085 /* "View.MemoryView":1024
15086 * Py_INCREF(Py_None)
15087 *
15088 * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
15089 * result.flags = PyBUF_RECORDS
15090 * else:
15091*/
15092 __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
15093
15094 if (__pyx_t_1) {
15095
15096
15097 /* "View.MemoryView":1025
15098 *
15099 * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
15100 * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
15101 * else:
15102 * result.flags = PyBUF_RECORDS_RO
15103*/
15104 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
15105
15106 /* "View.MemoryView":1024
15107 * Py_INCREF(Py_None)
15108 *
15109 * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
15110 * result.flags = PyBUF_RECORDS
15111 * else:
15112*/
15113 goto __pyx_L4;
15114 }
15115
15116 /* "View.MemoryView":1027
15117 * result.flags = PyBUF_RECORDS
15118 * else:
15119 * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
15120 *
15121 * result.view.shape = <Py_ssize_t *> result.from_slice.shape
15122*/
15123 /*else*/ {
15124 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
15125 }
15126 __pyx_L4:;
15127
15128 /* "View.MemoryView":1029
15129 * result.flags = PyBUF_RECORDS_RO
15130 *
15131 * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
15132 * result.view.strides = <Py_ssize_t *> result.from_slice.strides
15133 *
15134*/
15135 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
15136
15137 /* "View.MemoryView":1030
15138 *
15139 * result.view.shape = <Py_ssize_t *> result.from_slice.shape
15140 * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
15141 *
15142 *
15143*/
15144 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
15145
15146 /* "View.MemoryView":1033
15147 *
15148 *
15149 * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
15150 * for suboffset in result.from_slice.suboffsets[:ndim]:
15151 * if suboffset >= 0:
15152*/
15153 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
15154
15155 /* "View.MemoryView":1034
15156 *
15157 * result.view.suboffsets = NULL
15158 * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
15159 * if suboffset >= 0:
15160 * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15161*/
15162 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
15163
15164 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15165 __pyx_t_6 = __pyx_t_8;
15166 __pyx_v_suboffset = (__pyx_t_6[0]);
15167
15168 /* "View.MemoryView":1035
15169 * result.view.suboffsets = NULL
15170 * for suboffset in result.from_slice.suboffsets[:ndim]:
15171 * if suboffset >= 0: # <<<<<<<<<<<<<<
15172 * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15173 * break
15174*/
15175 __pyx_t_1 = (__pyx_v_suboffset >= 0);
15176
15177 if (__pyx_t_1) {
15178
15179
15180 /* "View.MemoryView":1036
15181 * for suboffset in result.from_slice.suboffsets[:ndim]:
15182 * if suboffset >= 0:
15183 * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
15184 * break
15185 *
15186*/
15187 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
15188
15189 /* "View.MemoryView":1037
15190 * if suboffset >= 0:
15191 * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15192 * break # <<<<<<<<<<<<<<
15193 *
15194 * cdef Py_ssize_t length
15195*/
15196 goto __pyx_L6_break;
15197
15198 /* "View.MemoryView":1035
15199 * result.view.suboffsets = NULL
15200 * for suboffset in result.from_slice.suboffsets[:ndim]:
15201 * if suboffset >= 0: # <<<<<<<<<<<<<<
15202 * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15203 * break
15204*/
15205 }
15206 }
15207 __pyx_L6_break:;
15208
15209
15210 /* "View.MemoryView":1040
15211 *
15212 * cdef Py_ssize_t length
15213 * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
15214 * for length in result.view.shape[:ndim]:
15215 * result.view.len *= length
15216*/
15217 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
15218
15219 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
15220
15221 /* "View.MemoryView":1041
15222 * cdef Py_ssize_t length
15223 * result.view.len = result.view.itemsize
15224 * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
15225 * result.view.len *= length
15226 *
15227*/
15228 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
15229
15230 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15231 __pyx_t_6 = __pyx_t_8;
15232 __pyx_v_length = (__pyx_t_6[0]);
15233
15234 /* "View.MemoryView":1042
15235 * result.view.len = result.view.itemsize
15236 * for length in result.view.shape[:ndim]:
15237 * result.view.len *= length # <<<<<<<<<<<<<<
15238 *
15239 * result.to_object_func = to_object_func
15240*/
15241 __pyx_v_result->__pyx_base.view.len = (__pyx_v_result->__pyx_base.view.len * __pyx_v_length);
15242 }
15243
15244
15245 /* "View.MemoryView":1044
15246 * result.view.len *= length
15247 *
15248 * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
15249 * result.to_dtype_func = to_dtype_func
15250 *
15251*/
15252 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
15253
15254 /* "View.MemoryView":1045
15255 *
15256 * result.to_object_func = to_object_func
15257 * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
15258 *
15259 * return result
15260*/
15261 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
15262
15263 /* "View.MemoryView":1047
15264 * result.to_dtype_func = to_dtype_func
15265 *
15266 * return result # <<<<<<<<<<<<<<
15267 *
15268 * @cname('__pyx_memoryview_get_slice_from_memoryview')
15269*/
15270 {
15271 PyObject *__pyx_temp;
15272 {
15273 __pyx_temp = __pyx_r;
15274 __Pyx_INCREF((PyObject *)__pyx_v_result);
15275 __pyx_r = ((PyObject *)__pyx_v_result);
15276 }
15277 __Pyx_XDECREF(__pyx_temp);
15278 }
15279 goto __pyx_L0;
15280
15281 /* "View.MemoryView":995
15282 * pass # ignore failure, it's a minor issue
15283 *
15284 * @cname('__pyx_memoryview_fromslice') # <<<<<<<<<<<<<<
15285 * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,
15286 * int ndim,
15287*/
15288
15289 /* function exit code */
15290 __pyx_L1_error:;
15291 __Pyx_XDECREF(__pyx_t_2);
15292 __Pyx_XDECREF(__pyx_t_3);
15293 __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15294 __pyx_r = 0;
15295 __pyx_L0:;
15296 __Pyx_XDECREF((PyObject *)__pyx_v_result);
15297
15298
15299 __Pyx_XGIVEREF(__pyx_r);
15300 __Pyx_RefNannyFinishContext();
15301 return __pyx_r;
15302}
15303
15304/* "View.MemoryView":1049
15305 * return result
15306 *
15307 * @cname('__pyx_memoryview_get_slice_from_memoryview') # <<<<<<<<<<<<<<
15308 * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,
15309 * __Pyx_memviewslice *mslice) except NULL:
15310*/
15311
15312static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
15313 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
15314 __Pyx_memviewslice *__pyx_r;
15315 __Pyx_RefNannyDeclarations
15316 int __pyx_t_1;
15317 PyObject *__pyx_t_2 = NULL;
15318 int __pyx_lineno = 0;
15319 const char *__pyx_filename = NULL;
15320 int __pyx_clineno = 0;
15321 __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
15322
15323 /* "View.MemoryView":1053
15324 * __Pyx_memviewslice *mslice) except NULL:
15325 * cdef _memoryviewslice obj
15326 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15327 * obj = memview
15328 * return &obj.from_slice
15329*/
15330 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
15331 if (__pyx_t_1) {
15332
15333
15334 /* "View.MemoryView":1054
15335 * cdef _memoryviewslice obj
15336 * if isinstance(memview, _memoryviewslice):
15337 * obj = memview # <<<<<<<<<<<<<<
15338 * return &obj.from_slice
15339 * else:
15340*/
15341 __pyx_t_2 = ((PyObject *)__pyx_v_memview);
15342 __Pyx_INCREF(__pyx_t_2);
15343 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)
15344 __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
15345 __pyx_t_2 = 0;
15346
15347 /* "View.MemoryView":1055
15348 * if isinstance(memview, _memoryviewslice):
15349 * obj = memview
15350 * return &obj.from_slice # <<<<<<<<<<<<<<
15351 * else:
15352 * slice_copy(memview, mslice)
15353*/
15354 {
15355
15356 __pyx_r = (&__pyx_v_obj->from_slice);
15357 }
15358 goto __pyx_L0;
15359
15360 /* "View.MemoryView":1053
15361 * __Pyx_memviewslice *mslice) except NULL:
15362 * cdef _memoryviewslice obj
15363 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15364 * obj = memview
15365 * return &obj.from_slice
15366*/
15367 }
15368
15369 /* "View.MemoryView":1057
15370 * return &obj.from_slice
15371 * else:
15372 * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
15373 * return mslice
15374 *
15375*/
15376 /*else*/ {
15377 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
15378
15379 /* "View.MemoryView":1058
15380 * else:
15381 * slice_copy(memview, mslice)
15382 * return mslice # <<<<<<<<<<<<<<
15383 *
15384 * @cname('__pyx_memoryview_slice_copy')
15385*/
15386 {
15387
15388 __pyx_r = __pyx_v_mslice;
15389 }
15390 goto __pyx_L0;
15391 }
15392
15393 /* "View.MemoryView":1049
15394 * return result
15395 *
15396 * @cname('__pyx_memoryview_get_slice_from_memoryview') # <<<<<<<<<<<<<<
15397 * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,
15398 * __Pyx_memviewslice *mslice) except NULL:
15399*/
15400
15401 /* function exit code */
15402 __pyx_L1_error:;
15403 __Pyx_XDECREF(__pyx_t_2);
15404 __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
15405 __pyx_r = NULL;
15406 __pyx_L0:;
15407 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
15408
15409 __Pyx_RefNannyFinishContext();
15410 return __pyx_r;
15411}
15412
15413/* "View.MemoryView":1060
15414 * return mslice
15415 *
15416 * @cname('__pyx_memoryview_slice_copy') # <<<<<<<<<<<<<<
15417 * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept:
15418 * cdef int dim
15419*/
15420
15421static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
15422 int __pyx_v_dim;
15423 Py_ssize_t *__pyx_v_shape;
15424 Py_ssize_t *__pyx_v_strides;
15425 Py_ssize_t *__pyx_v_suboffsets;
15426 Py_ssize_t *__pyx_t_1;
15427 int __pyx_t_2;
15428 int __pyx_t_3;
15429 int __pyx_t_4;
15430 Py_ssize_t __pyx_t_5;
15431 int __pyx_t_6;
15432
15433 /* "View.MemoryView":1065
15434 * cdef (Py_ssize_t*) shape, strides, suboffsets
15435 *
15436 * shape = memview.view.shape # <<<<<<<<<<<<<<
15437 * strides = memview.view.strides
15438 * suboffsets = memview.view.suboffsets
15439*/
15440 __pyx_t_1 = __pyx_v_memview->view.shape;
15441
15442 __pyx_v_shape = __pyx_t_1;
15443
15444 /* "View.MemoryView":1066
15445 *
15446 * shape = memview.view.shape
15447 * strides = memview.view.strides # <<<<<<<<<<<<<<
15448 * suboffsets = memview.view.suboffsets
15449 *
15450*/
15451 __pyx_t_1 = __pyx_v_memview->view.strides;
15452
15453 __pyx_v_strides = __pyx_t_1;
15454
15455 /* "View.MemoryView":1067
15456 * shape = memview.view.shape
15457 * strides = memview.view.strides
15458 * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
15459 *
15460 * dst.memview = <__pyx_memoryview *> memview
15461*/
15462 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
15463
15464 __pyx_v_suboffsets = __pyx_t_1;
15465
15466 /* "View.MemoryView":1069
15467 * suboffsets = memview.view.suboffsets
15468 *
15469 * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
15470 * dst.data = <char *> memview.view.buf
15471 *
15472*/
15473 __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
15474
15475 /* "View.MemoryView":1070
15476 *
15477 * dst.memview = <__pyx_memoryview *> memview
15478 * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
15479 *
15480 * for dim in range(memview.view.ndim):
15481*/
15482 __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
15483
15484 /* "View.MemoryView":1072
15485 * dst.data = <char *> memview.view.buf
15486 *
15487 * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
15488 * dst.shape[dim] = shape[dim]
15489 * dst.strides[dim] = strides[dim]
15490*/
15491
15492 __pyx_t_2 = __pyx_v_memview->view.ndim;
15493 __pyx_t_3 = __pyx_t_2;
15494
15495 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15496 __pyx_v_dim = __pyx_t_4;
15497
15498 /* "View.MemoryView":1073
15499 *
15500 * for dim in range(memview.view.ndim):
15501 * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
15502 * dst.strides[dim] = strides[dim]
15503 * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
15504*/
15505 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
15506
15507 /* "View.MemoryView":1074
15508 * for dim in range(memview.view.ndim):
15509 * dst.shape[dim] = shape[dim]
15510 * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
15511 * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
15512 *
15513*/
15514 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
15515
15516 /* "View.MemoryView":1075
15517 * dst.shape[dim] = shape[dim]
15518 * dst.strides[dim] = strides[dim]
15519 * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
15520 *
15521 * @cname('__pyx_memoryview_copy_object')
15522*/
15523 __pyx_t_6 = (__pyx_v_suboffsets != 0);
15524
15525 if (__pyx_t_6) {
15526
15527 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
15528 } else {
15529
15530 __pyx_t_5 = -1L;
15531 }
15532
15533 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
15534
15535 }
15536
15537
15538 /* "View.MemoryView":1060
15539 * return mslice
15540 *
15541 * @cname('__pyx_memoryview_slice_copy') # <<<<<<<<<<<<<<
15542 * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept:
15543 * cdef int dim
15544*/
15545
15546 /* function exit code */
15547
15548
15549
15550
15551
15552}
15553
15554/* "View.MemoryView":1077
15555 * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
15556 *
15557 * @cname('__pyx_memoryview_copy_object') # <<<<<<<<<<<<<<
15558 * cdef memoryview_copy(memoryview memview):
15559 * "Create a new memoryview object"
15560*/
15561
15562static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
15563 __Pyx_memviewslice __pyx_v_memviewslice;
15564 PyObject *__pyx_r = NULL;
15565 __Pyx_RefNannyDeclarations
15566 PyObject *__pyx_t_1 = NULL;
15567 int __pyx_lineno = 0;
15568 const char *__pyx_filename = NULL;
15569 int __pyx_clineno = 0;
15570 __Pyx_RefNannySetupContext("memoryview_copy", 0);
15571
15572 /* "View.MemoryView":1081
15573 * "Create a new memoryview object"
15574 * cdef __Pyx_memviewslice memviewslice
15575 * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
15576 * return memoryview_copy_from_slice(memview, &memviewslice)
15577 *
15578*/
15579 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
15580
15581 /* "View.MemoryView":1082
15582 * cdef __Pyx_memviewslice memviewslice
15583 * slice_copy(memview, &memviewslice)
15584 * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
15585 *
15586 * @cname('__pyx_memoryview_copy_object_from_slice')
15587*/
15588 __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)
15589 __Pyx_GOTREF(__pyx_t_1);
15590 {
15591 PyObject *__pyx_temp;
15592 {
15593 __pyx_temp = __pyx_r;
15594 __pyx_r = __pyx_t_1;
15595 }
15596 __Pyx_XDECREF(__pyx_temp);
15597 }
15598 __pyx_t_1 = 0;
15599 goto __pyx_L0;
15600
15601 /* "View.MemoryView":1077
15602 * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
15603 *
15604 * @cname('__pyx_memoryview_copy_object') # <<<<<<<<<<<<<<
15605 * cdef memoryview_copy(memoryview memview):
15606 * "Create a new memoryview object"
15607*/
15608
15609 /* function exit code */
15610 __pyx_L1_error:;
15611 __Pyx_XDECREF(__pyx_t_1);
15612 __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
15613 __pyx_r = 0;
15614 __pyx_L0:;
15615
15616 __Pyx_XGIVEREF(__pyx_r);
15617 __Pyx_RefNannyFinishContext();
15618 return __pyx_r;
15619}
15620
15621/* "View.MemoryView":1084
15622 * return memoryview_copy_from_slice(memview, &memviewslice)
15623 *
15624 * @cname('__pyx_memoryview_copy_object_from_slice') # <<<<<<<<<<<<<<
15625 * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):
15626 * """
15627*/
15628
15629static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
15630 PyObject *(*__pyx_v_to_object_func)(char *);
15631 __pyx_memoryview_to_dtype_func_type __pyx_v_to_dtype_func;
15632 PyObject *__pyx_r = NULL;
15633 __Pyx_RefNannyDeclarations
15634 int __pyx_t_1;
15635 PyObject *(*__pyx_t_2)(char *);
15636 __pyx_memoryview_to_dtype_func_type __pyx_t_3;
15637 PyObject *__pyx_t_4 = NULL;
15638 int __pyx_lineno = 0;
15639 const char *__pyx_filename = NULL;
15640 int __pyx_clineno = 0;
15641 __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
15642
15643 /* "View.MemoryView":1092
15644 * cdef to_dtype_func_type to_dtype_func
15645 *
15646 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15647 * to_object_func = (<_memoryviewslice> memview).to_object_func
15648 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15649*/
15650 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
15651 if (__pyx_t_1) {
15652
15653
15654 /* "View.MemoryView":1093
15655 *
15656 * if isinstance(memview, _memoryviewslice):
15657 * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
15658 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15659 * else:
15660*/
15661 __pyx_t_2 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
15662
15663 __pyx_v_to_object_func = __pyx_t_2;
15664
15665 /* "View.MemoryView":1094
15666 * if isinstance(memview, _memoryviewslice):
15667 * to_object_func = (<_memoryviewslice> memview).to_object_func
15668 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
15669 * else:
15670 * to_object_func = NULL
15671*/
15672 __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
15673
15674 __pyx_v_to_dtype_func = __pyx_t_3;
15675
15676 /* "View.MemoryView":1092
15677 * cdef to_dtype_func_type to_dtype_func
15678 *
15679 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15680 * to_object_func = (<_memoryviewslice> memview).to_object_func
15681 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15682*/
15683 goto __pyx_L3;
15684 }
15685
15686 /* "View.MemoryView":1096
15687 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15688 * else:
15689 * to_object_func = NULL # <<<<<<<<<<<<<<
15690 * to_dtype_func = NULL
15691 *
15692*/
15693 /*else*/ {
15694 __pyx_v_to_object_func = NULL;
15695
15696 /* "View.MemoryView":1097
15697 * else:
15698 * to_object_func = NULL
15699 * to_dtype_func = NULL # <<<<<<<<<<<<<<
15700 *
15701 * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
15702*/
15703 __pyx_v_to_dtype_func = NULL;
15704 }
15705 __pyx_L3:;
15706
15707 /* "View.MemoryView":1099
15708 * to_dtype_func = NULL
15709 *
15710 * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
15711 * to_object_func, to_dtype_func,
15712 * memview.dtype_is_object)
15713*/
15714 __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)
15715 __Pyx_GOTREF(__pyx_t_4);
15716 {
15717 PyObject *__pyx_temp;
15718 {
15719 __pyx_temp = __pyx_r;
15720 __pyx_r = __pyx_t_4;
15721 }
15722 __Pyx_XDECREF(__pyx_temp);
15723 }
15724 __pyx_t_4 = 0;
15725 goto __pyx_L0;
15726
15727 /* "View.MemoryView":1084
15728 * return memoryview_copy_from_slice(memview, &memviewslice)
15729 *
15730 * @cname('__pyx_memoryview_copy_object_from_slice') # <<<<<<<<<<<<<<
15731 * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):
15732 * """
15733*/
15734
15735 /* function exit code */
15736 __pyx_L1_error:;
15737 __Pyx_XDECREF(__pyx_t_4);
15738 __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15739 __pyx_r = 0;
15740 __pyx_L0:;
15741
15742
15743 __Pyx_XGIVEREF(__pyx_r);
15744 __Pyx_RefNannyFinishContext();
15745 return __pyx_r;
15746}
15747
15748/* "View.MemoryView":1107
15749 *
15750 *
15751 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<<
15752 * return -arg if arg < 0 else arg
15753 *
15754*/
15755
15756static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
15757 Py_ssize_t __pyx_r;
15758 Py_ssize_t __pyx_t_1;
15759 int __pyx_t_2;
15760
15761 /* "View.MemoryView":1108
15762 *
15763 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil:
15764 * return -arg if arg < 0 else arg # <<<<<<<<<<<<<<
15765 *
15766 * @cname('__pyx_get_best_slice_order')
15767*/
15768 __pyx_t_2 = (__pyx_v_arg < 0);
15769
15770 if (__pyx_t_2) {
15771
15772 __pyx_t_1 = (-__pyx_v_arg);
15773 } else {
15774
15775 __pyx_t_1 = __pyx_v_arg;
15776 }
15777
15778 {
15779 __pyx_r = __pyx_t_1;
15780 }
15781 goto __pyx_L0;
15782
15783 /* "View.MemoryView":1107
15784 *
15785 *
15786 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<<
15787 * return -arg if arg < 0 else arg
15788 *
15789*/
15790
15791 /* function exit code */
15792 __pyx_L0:;
15793 return __pyx_r;
15794}
15795
15796/* "View.MemoryView":1110
15797 * return -arg if arg < 0 else arg
15798 *
15799 * @cname('__pyx_get_best_slice_order') # <<<<<<<<<<<<<<
15800 * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil:
15801 * """
15802*/
15803
15804static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
15805 int __pyx_v_i;
15806 Py_ssize_t __pyx_v_c_stride;
15807 Py_ssize_t __pyx_v_f_stride;
15808 char __pyx_r;
15809 int __pyx_t_1;
15810 int __pyx_t_2;
15811 int __pyx_t_3;
15812 int __pyx_t_4;
15813
15814 /* "View.MemoryView":1116
15815 * """
15816 * cdef int i
15817 * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
15818 * cdef Py_ssize_t f_stride = 0
15819 *
15820*/
15821 __pyx_v_c_stride = 0;
15822
15823 /* "View.MemoryView":1117
15824 * cdef int i
15825 * cdef Py_ssize_t c_stride = 0
15826 * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
15827 *
15828 * for i in range(ndim - 1, -1, -1):
15829*/
15830 __pyx_v_f_stride = 0;
15831
15832 /* "View.MemoryView":1119
15833 * cdef Py_ssize_t f_stride = 0
15834 *
15835 * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
15836 * if mslice.shape[i] > 1:
15837 * c_stride = mslice.strides[i]
15838*/
15839 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
15840 __pyx_v_i = __pyx_t_1;
15841
15842 /* "View.MemoryView":1120
15843 *
15844 * for i in range(ndim - 1, -1, -1):
15845 * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15846 * c_stride = mslice.strides[i]
15847 * break
15848*/
15849 __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
15850
15851 if (__pyx_t_2) {
15852
15853
15854 /* "View.MemoryView":1121
15855 * for i in range(ndim - 1, -1, -1):
15856 * if mslice.shape[i] > 1:
15857 * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
15858 * break
15859 *
15860*/
15861 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
15862
15863 /* "View.MemoryView":1122
15864 * if mslice.shape[i] > 1:
15865 * c_stride = mslice.strides[i]
15866 * break # <<<<<<<<<<<<<<
15867 *
15868 * for i in range(ndim):
15869*/
15870 goto __pyx_L4_break;
15871
15872 /* "View.MemoryView":1120
15873 *
15874 * for i in range(ndim - 1, -1, -1):
15875 * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15876 * c_stride = mslice.strides[i]
15877 * break
15878*/
15879 }
15880 }
15881 __pyx_L4_break:;
15882
15883 /* "View.MemoryView":1124
15884 * break
15885 *
15886 * for i in range(ndim): # <<<<<<<<<<<<<<
15887 * if mslice.shape[i] > 1:
15888 * f_stride = mslice.strides[i]
15889*/
15890
15891 __pyx_t_1 = __pyx_v_ndim;
15892 __pyx_t_3 = __pyx_t_1;
15893
15894 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15895 __pyx_v_i = __pyx_t_4;
15896
15897 /* "View.MemoryView":1125
15898 *
15899 * for i in range(ndim):
15900 * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15901 * f_stride = mslice.strides[i]
15902 * break
15903*/
15904 __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
15905
15906 if (__pyx_t_2) {
15907
15908
15909 /* "View.MemoryView":1126
15910 * for i in range(ndim):
15911 * if mslice.shape[i] > 1:
15912 * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
15913 * break
15914 *
15915*/
15916 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
15917
15918 /* "View.MemoryView":1127
15919 * if mslice.shape[i] > 1:
15920 * f_stride = mslice.strides[i]
15921 * break # <<<<<<<<<<<<<<
15922 *
15923 * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
15924*/
15925 goto __pyx_L7_break;
15926
15927 /* "View.MemoryView":1125
15928 *
15929 * for i in range(ndim):
15930 * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15931 * f_stride = mslice.strides[i]
15932 * break
15933*/
15934 }
15935 }
15936 __pyx_L7_break:;
15937
15938
15939 /* "View.MemoryView":1129
15940 * break
15941 *
15942 * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
15943 * return 'C'
15944 * else:
15945*/
15946 __pyx_t_2 = (abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride));
15947
15948 if (__pyx_t_2) {
15949
15950
15951 /* "View.MemoryView":1130
15952 *
15953 * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
15954 * return 'C' # <<<<<<<<<<<<<<
15955 * else:
15956 * return 'F'
15957*/
15958 {
15959
15960 __pyx_r = 'C';
15961 }
15962 goto __pyx_L0;
15963
15964 /* "View.MemoryView":1129
15965 * break
15966 *
15967 * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
15968 * return 'C'
15969 * else:
15970*/
15971 }
15972
15973 /* "View.MemoryView":1132
15974 * return 'C'
15975 * else:
15976 * return 'F' # <<<<<<<<<<<<<<
15977 *
15978 * @cython.cdivision(True)
15979*/
15980 /*else*/ {
15981 {
15982
15983 __pyx_r = 'F';
15984 }
15985 goto __pyx_L0;
15986 }
15987
15988 /* "View.MemoryView":1110
15989 * return -arg if arg < 0 else arg
15990 *
15991 * @cname('__pyx_get_best_slice_order') # <<<<<<<<<<<<<<
15992 * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil:
15993 * """
15994*/
15995
15996 /* function exit code */
15997 __pyx_L0:;
15998
15999
16000
16001 return __pyx_r;
16002}
16003
16004/* "View.MemoryView":1134
16005 * return 'F'
16006 *
16007 * @cython.cdivision(True) # <<<<<<<<<<<<<<
16008 * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,
16009 * char *dst_data, Py_ssize_t *dst_strides,
16010*/
16011
16012static 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) {
16013 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
16014 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
16015 Py_ssize_t __pyx_v_dst_extent;
16016 Py_ssize_t __pyx_v_src_stride;
16017 Py_ssize_t __pyx_v_dst_stride;
16018 int __pyx_t_1;
16019 int __pyx_t_2;
16020 Py_ssize_t __pyx_t_3;
16021 Py_ssize_t __pyx_t_4;
16022 Py_ssize_t __pyx_t_5;
16023
16024
16025
16026 /* "View.MemoryView":1142
16027 *
16028 * cdef Py_ssize_t i
16029 * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
16030 * cdef Py_ssize_t dst_extent = dst_shape[0]
16031 * cdef Py_ssize_t src_stride = src_strides[0]
16032*/
16033 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
16034
16035 /* "View.MemoryView":1143
16036 * cdef Py_ssize_t i
16037 * cdef Py_ssize_t src_extent = src_shape[0]
16038 * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
16039 * cdef Py_ssize_t src_stride = src_strides[0]
16040 * cdef Py_ssize_t dst_stride = dst_strides[0]
16041*/
16042 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
16043
16044 /* "View.MemoryView":1144
16045 * cdef Py_ssize_t src_extent = src_shape[0]
16046 * cdef Py_ssize_t dst_extent = dst_shape[0]
16047 * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
16048 * cdef Py_ssize_t dst_stride = dst_strides[0]
16049 *
16050*/
16051 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
16052
16053 /* "View.MemoryView":1145
16054 * cdef Py_ssize_t dst_extent = dst_shape[0]
16055 * cdef Py_ssize_t src_stride = src_strides[0]
16056 * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
16057 *
16058 * if ndim == 1:
16059*/
16060 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
16061
16062 /* "View.MemoryView":1147
16063 * cdef Py_ssize_t dst_stride = dst_strides[0]
16064 *
16065 * if ndim == 1: # <<<<<<<<<<<<<<
16066 * if (src_stride > 0 and dst_stride > 0 and
16067 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16068*/
16069 __pyx_t_1 = (__pyx_v_ndim == 1);
16070
16071 if (__pyx_t_1) {
16072
16073
16074 /* "View.MemoryView":1148
16075 *
16076 * if ndim == 1:
16077 * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16078 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16079 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent)
16080*/
16081 __pyx_t_2 = (__pyx_v_src_stride > 0);
16082
16083 if (__pyx_t_2) {
16084
16085 } else {
16086
16087 __pyx_t_1 = __pyx_t_2;
16088
16089 goto __pyx_L5_bool_binop_done;
16090 }
16091 __pyx_t_2 = (__pyx_v_dst_stride > 0);
16092
16093 if (__pyx_t_2) {
16094
16095 } else {
16096
16097 __pyx_t_1 = __pyx_t_2;
16098
16099 goto __pyx_L5_bool_binop_done;
16100 }
16101
16102 /* "View.MemoryView":1149
16103 * if ndim == 1:
16104 * if (src_stride > 0 and dst_stride > 0 and
16105 * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
16106 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent)
16107 * else:
16108*/
16109 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
16110 if (__pyx_t_2) {
16111 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
16112 }
16113
16114 __pyx_t_1 = __pyx_t_2;
16115
16116 __pyx_L5_bool_binop_done:;
16117
16118 /* "View.MemoryView":1148
16119 *
16120 * if ndim == 1:
16121 * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16122 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16123 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent)
16124*/
16125 if (__pyx_t_1) {
16126
16127
16128 /* "View.MemoryView":1150
16129 * if (src_stride > 0 and dst_stride > 0 and
16130 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16131 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent) # <<<<<<<<<<<<<<
16132 * else:
16133 * for i in range(dst_extent):
16134*/
16135 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * ((size_t)__pyx_v_dst_extent))));
16136
16137 /* "View.MemoryView":1148
16138 *
16139 * if ndim == 1:
16140 * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16141 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16142 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent)
16143*/
16144 goto __pyx_L4;
16145 }
16146
16147 /* "View.MemoryView":1152
16148 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent)
16149 * else:
16150 * for i in range(dst_extent): # <<<<<<<<<<<<<<
16151 * memcpy(dst_data, src_data, itemsize)
16152 * src_data += src_stride
16153*/
16154 /*else*/ {
16155
16156 __pyx_t_3 = __pyx_v_dst_extent;
16157 __pyx_t_4 = __pyx_t_3;
16158
16159 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16160 __pyx_v_i = __pyx_t_5;
16161
16162 /* "View.MemoryView":1153
16163 * else:
16164 * for i in range(dst_extent):
16165 * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
16166 * src_data += src_stride
16167 * dst_data += dst_stride
16168*/
16169 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
16170
16171 /* "View.MemoryView":1154
16172 * for i in range(dst_extent):
16173 * memcpy(dst_data, src_data, itemsize)
16174 * src_data += src_stride # <<<<<<<<<<<<<<
16175 * dst_data += dst_stride
16176 * else:
16177*/
16178 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16179
16180 /* "View.MemoryView":1155
16181 * memcpy(dst_data, src_data, itemsize)
16182 * src_data += src_stride
16183 * dst_data += dst_stride # <<<<<<<<<<<<<<
16184 * else:
16185 * for i in range(dst_extent):
16186*/
16187 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16188 }
16189
16190 }
16191 __pyx_L4:;
16192
16193 /* "View.MemoryView":1147
16194 * cdef Py_ssize_t dst_stride = dst_strides[0]
16195 *
16196 * if ndim == 1: # <<<<<<<<<<<<<<
16197 * if (src_stride > 0 and dst_stride > 0 and
16198 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16199*/
16200 goto __pyx_L3;
16201 }
16202
16203 /* "View.MemoryView":1157
16204 * dst_data += dst_stride
16205 * else:
16206 * for i in range(dst_extent): # <<<<<<<<<<<<<<
16207 * _copy_strided_to_strided(src_data, src_strides + 1,
16208 * dst_data, dst_strides + 1,
16209*/
16210 /*else*/ {
16211
16212 __pyx_t_3 = __pyx_v_dst_extent;
16213 __pyx_t_4 = __pyx_t_3;
16214
16215 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16216 __pyx_v_i = __pyx_t_5;
16217
16218 /* "View.MemoryView":1158
16219 * else:
16220 * for i in range(dst_extent):
16221 * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
16222 * dst_data, dst_strides + 1,
16223 * src_shape + 1, dst_shape + 1,
16224*/
16225 _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);
16226
16227 /* "View.MemoryView":1162
16228 * src_shape + 1, dst_shape + 1,
16229 * ndim - 1, itemsize)
16230 * src_data += src_stride # <<<<<<<<<<<<<<
16231 * dst_data += dst_stride
16232 *
16233*/
16234 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16235
16236 /* "View.MemoryView":1163
16237 * ndim - 1, itemsize)
16238 * src_data += src_stride
16239 * dst_data += dst_stride # <<<<<<<<<<<<<<
16240 *
16241 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
16242*/
16243 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16244 }
16245
16246 }
16247 __pyx_L3:;
16248
16249 /* "View.MemoryView":1134
16250 * return 'F'
16251 *
16252 * @cython.cdivision(True) # <<<<<<<<<<<<<<
16253 * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,
16254 * char *dst_data, Py_ssize_t *dst_strides,
16255*/
16256
16257 /* function exit code */
16258
16259
16260
16261
16262
16263
16264
16265}
16266
16267/* "View.MemoryView":1165
16268 * dst_data += dst_stride
16269 *
16270 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16271 * __Pyx_memviewslice *dst,
16272 * int ndim, size_t itemsize) noexcept nogil:
16273*/
16274
16275static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
16276
16277 /* "View.MemoryView":1168
16278 * __Pyx_memviewslice *dst,
16279 * int ndim, size_t itemsize) noexcept nogil:
16280 * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
16281 * src.shape, dst.shape, ndim, itemsize)
16282 *
16283*/
16284 _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);
16285
16286 /* "View.MemoryView":1165
16287 * dst_data += dst_stride
16288 *
16289 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16290 * __Pyx_memviewslice *dst,
16291 * int ndim, size_t itemsize) noexcept nogil:
16292*/
16293
16294 /* function exit code */
16295}
16296
16297/* "View.MemoryView":1171
16298 * src.shape, dst.shape, ndim, itemsize)
16299 *
16300 * @cname('__pyx_memoryview_slice_get_size') # <<<<<<<<<<<<<<
16301 * cdef size_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
16302 * "Return the size of the memory occupied by the slice in number of bytes"
16303*/
16304
16305static size_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
16306 Py_ssize_t __pyx_v_shape;
16307 size_t __pyx_v_size;
16308 size_t __pyx_r;
16309 Py_ssize_t *__pyx_t_1;
16310 Py_ssize_t *__pyx_t_2;
16311 Py_ssize_t *__pyx_t_3;
16312
16313 /* "View.MemoryView":1175
16314 * "Return the size of the memory occupied by the slice in number of bytes"
16315 * cdef Py_ssize_t shape
16316 * cdef size_t size = <size_t> src.memview.view.itemsize # <<<<<<<<<<<<<<
16317 *
16318 * for shape in src.shape[:ndim]:
16319*/
16320 __pyx_v_size = ((size_t)__pyx_v_src->memview->view.itemsize);
16321
16322 /* "View.MemoryView":1177
16323 * cdef size_t size = <size_t> src.memview.view.itemsize
16324 *
16325 * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
16326 * size *= <size_t> shape
16327 *
16328*/
16329 __pyx_t_2 = (__pyx_v_src->shape + __pyx_v_ndim);
16330
16331 for (__pyx_t_3 = __pyx_v_src->shape; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
16332 __pyx_t_1 = __pyx_t_3;
16333 __pyx_v_shape = (__pyx_t_1[0]);
16334
16335 /* "View.MemoryView":1178
16336 *
16337 * for shape in src.shape[:ndim]:
16338 * size *= <size_t> shape # <<<<<<<<<<<<<<
16339 *
16340 * return size
16341*/
16342 __pyx_v_size = (__pyx_v_size * ((size_t)__pyx_v_shape));
16343 }
16344
16345
16346 /* "View.MemoryView":1180
16347 * size *= <size_t> shape
16348 *
16349 * return size # <<<<<<<<<<<<<<
16350 *
16351 * @cname('__pyx_fill_contig_strides_array')
16352*/
16353 {
16354
16355 __pyx_r = __pyx_v_size;
16356 }
16357 goto __pyx_L0;
16358
16359 /* "View.MemoryView":1171
16360 * src.shape, dst.shape, ndim, itemsize)
16361 *
16362 * @cname('__pyx_memoryview_slice_get_size') # <<<<<<<<<<<<<<
16363 * cdef size_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
16364 * "Return the size of the memory occupied by the slice in number of bytes"
16365*/
16366
16367 /* function exit code */
16368 __pyx_L0:;
16369
16370
16371 return __pyx_r;
16372}
16373
16374/* "View.MemoryView":1182
16375 * return size
16376 *
16377 * @cname('__pyx_fill_contig_strides_array') # <<<<<<<<<<<<<<
16378 * cdef Py_ssize_t fill_contig_strides_array(
16379 * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
16380*/
16381
16382static 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) {
16383 int __pyx_v_idx;
16384 Py_ssize_t __pyx_r;
16385 int __pyx_t_1;
16386 int __pyx_t_2;
16387 int __pyx_t_3;
16388 int __pyx_t_4;
16389
16390
16391 /* "View.MemoryView":1192
16392 * cdef int idx
16393 *
16394 * if order == 'F': # <<<<<<<<<<<<<<
16395 * for idx in range(ndim):
16396 * strides[idx] = stride
16397*/
16398 __pyx_t_1 = (__pyx_v_order == 'F');
16399
16400 if (__pyx_t_1) {
16401
16402
16403 /* "View.MemoryView":1193
16404 *
16405 * if order == 'F':
16406 * for idx in range(ndim): # <<<<<<<<<<<<<<
16407 * strides[idx] = stride
16408 * stride *= shape[idx]
16409*/
16410
16411 __pyx_t_2 = __pyx_v_ndim;
16412 __pyx_t_3 = __pyx_t_2;
16413
16414 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16415 __pyx_v_idx = __pyx_t_4;
16416
16417 /* "View.MemoryView":1194
16418 * if order == 'F':
16419 * for idx in range(ndim):
16420 * strides[idx] = stride # <<<<<<<<<<<<<<
16421 * stride *= shape[idx]
16422 * else:
16423*/
16424 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16425
16426 /* "View.MemoryView":1195
16427 * for idx in range(ndim):
16428 * strides[idx] = stride
16429 * stride *= shape[idx] # <<<<<<<<<<<<<<
16430 * else:
16431 * for idx in range(ndim - 1, -1, -1):
16432*/
16433 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16434 }
16435
16436
16437 /* "View.MemoryView":1192
16438 * cdef int idx
16439 *
16440 * if order == 'F': # <<<<<<<<<<<<<<
16441 * for idx in range(ndim):
16442 * strides[idx] = stride
16443*/
16444 goto __pyx_L3;
16445 }
16446
16447 /* "View.MemoryView":1197
16448 * stride *= shape[idx]
16449 * else:
16450 * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
16451 * strides[idx] = stride
16452 * stride *= shape[idx]
16453*/
16454 /*else*/ {
16455 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
16456 __pyx_v_idx = __pyx_t_2;
16457
16458 /* "View.MemoryView":1198
16459 * else:
16460 * for idx in range(ndim - 1, -1, -1):
16461 * strides[idx] = stride # <<<<<<<<<<<<<<
16462 * stride *= shape[idx]
16463 *
16464*/
16465 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16466
16467 /* "View.MemoryView":1199
16468 * for idx in range(ndim - 1, -1, -1):
16469 * strides[idx] = stride
16470 * stride *= shape[idx] # <<<<<<<<<<<<<<
16471 *
16472 * return stride
16473*/
16474 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16475 }
16476 }
16477 __pyx_L3:;
16478
16479 /* "View.MemoryView":1201
16480 * stride *= shape[idx]
16481 *
16482 * return stride # <<<<<<<<<<<<<<
16483 *
16484 * @cname('__pyx_memoryview_copy_data_to_temp')
16485*/
16486 {
16487
16488 __pyx_r = __pyx_v_stride;
16489 }
16490 goto __pyx_L0;
16491
16492 /* "View.MemoryView":1182
16493 * return size
16494 *
16495 * @cname('__pyx_fill_contig_strides_array') # <<<<<<<<<<<<<<
16496 * cdef Py_ssize_t fill_contig_strides_array(
16497 * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
16498*/
16499
16500 /* function exit code */
16501 __pyx_L0:;
16502
16503
16504 return __pyx_r;
16505}
16506
16507/* "View.MemoryView":1203
16508 * return stride
16509 *
16510 * @cname('__pyx_memoryview_copy_data_to_temp') # <<<<<<<<<<<<<<
16511 * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,
16512 * __Pyx_memviewslice *tmpslice,
16513*/
16514
16515static 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) {
16516 int __pyx_v_i;
16517 void *__pyx_v_result;
16518 size_t __pyx_v_itemsize;
16519 size_t __pyx_v_size;
16520 void *__pyx_r;
16521 int __pyx_t_1;
16522 int __pyx_t_2;
16523 struct __pyx_memoryview_obj *__pyx_t_3;
16524 int __pyx_t_4;
16525 int __pyx_t_5;
16526 int __pyx_lineno = 0;
16527 const char *__pyx_filename = NULL;
16528 int __pyx_clineno = 0;
16529 PyGILState_STATE __pyx_gilstate_save;
16530
16531 /* "View.MemoryView":1215
16532 * cdef void *result
16533 *
16534 * cdef size_t itemsize = <size_t> src.memview.view.itemsize # <<<<<<<<<<<<<<
16535 * cdef size_t size = slice_get_size(src, ndim)
16536 *
16537*/
16538 __pyx_v_itemsize = ((size_t)__pyx_v_src->memview->view.itemsize);
16539
16540 /* "View.MemoryView":1216
16541 *
16542 * cdef size_t itemsize = <size_t> src.memview.view.itemsize
16543 * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
16544 *
16545 * result = malloc(size)
16546*/
16547 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
16548
16549 /* "View.MemoryView":1218
16550 * cdef size_t size = slice_get_size(src, ndim)
16551 *
16552 * result = malloc(size) # <<<<<<<<<<<<<<
16553 * if cython.unlikely(not result):
16554 * _err_no_memory()
16555*/
16556 __pyx_v_result = malloc(__pyx_v_size);
16557
16558 /* "View.MemoryView":1219
16559 *
16560 * result = malloc(size)
16561 * if cython.unlikely(not result): # <<<<<<<<<<<<<<
16562 * _err_no_memory()
16563 *
16564*/
16565 __pyx_t_1 = (!(__pyx_v_result != 0));
16566
16567 if (unlikely(__pyx_t_1)) {
16568
16569
16570 /* "View.MemoryView":1220
16571 * result = malloc(size)
16572 * if cython.unlikely(not result):
16573 * _err_no_memory() # <<<<<<<<<<<<<<
16574 *
16575 *
16576*/
16577 __pyx_t_2 = __pyx_memoryview_err_no_memory(); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 1220, __pyx_L1_error)
16578
16579
16580 /* "View.MemoryView":1219
16581 *
16582 * result = malloc(size)
16583 * if cython.unlikely(not result): # <<<<<<<<<<<<<<
16584 * _err_no_memory()
16585 *
16586*/
16587 }
16588
16589 /* "View.MemoryView":1223
16590 *
16591 *
16592 * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
16593 * tmpslice.memview = src.memview
16594 * for i in range(ndim):
16595*/
16596 __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
16597
16598 /* "View.MemoryView":1224
16599 *
16600 * tmpslice.data = <char *> result
16601 * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
16602 * for i in range(ndim):
16603 * tmpslice.shape[i] = src.shape[i]
16604*/
16605 __pyx_t_3 = __pyx_v_src->memview;
16606
16607 __pyx_v_tmpslice->memview = __pyx_t_3;
16608
16609 /* "View.MemoryView":1225
16610 * tmpslice.data = <char *> result
16611 * tmpslice.memview = src.memview
16612 * for i in range(ndim): # <<<<<<<<<<<<<<
16613 * tmpslice.shape[i] = src.shape[i]
16614 * tmpslice.suboffsets[i] = -1
16615*/
16616
16617 __pyx_t_2 = __pyx_v_ndim;
16618 __pyx_t_4 = __pyx_t_2;
16619
16620 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16621 __pyx_v_i = __pyx_t_5;
16622
16623 /* "View.MemoryView":1226
16624 * tmpslice.memview = src.memview
16625 * for i in range(ndim):
16626 * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
16627 * tmpslice.suboffsets[i] = -1
16628 *
16629*/
16630 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
16631
16632 /* "View.MemoryView":1227
16633 * for i in range(ndim):
16634 * tmpslice.shape[i] = src.shape[i]
16635 * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
16636 *
16637 * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], <Py_ssize_t> itemsize, ndim, order)
16638*/
16639 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
16640 }
16641
16642
16643 /* "View.MemoryView":1229
16644 * tmpslice.suboffsets[i] = -1
16645 *
16646 * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], <Py_ssize_t> itemsize, ndim, order) # <<<<<<<<<<<<<<
16647 *
16648 *
16649*/
16650 (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));
16651
16652 /* "View.MemoryView":1232
16653 *
16654 *
16655 * for i in range(ndim): # <<<<<<<<<<<<<<
16656 * if tmpslice.shape[i] == 1:
16657 * tmpslice.strides[i] = 0
16658*/
16659
16660 __pyx_t_2 = __pyx_v_ndim;
16661 __pyx_t_4 = __pyx_t_2;
16662
16663 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16664 __pyx_v_i = __pyx_t_5;
16665
16666 /* "View.MemoryView":1233
16667 *
16668 * for i in range(ndim):
16669 * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
16670 * tmpslice.strides[i] = 0
16671 *
16672*/
16673 __pyx_t_1 = ((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1);
16674
16675 if (__pyx_t_1) {
16676
16677
16678 /* "View.MemoryView":1234
16679 * for i in range(ndim):
16680 * if tmpslice.shape[i] == 1:
16681 * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
16682 *
16683 * if slice_is_contig(src[0], order, ndim):
16684*/
16685 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
16686
16687 /* "View.MemoryView":1233
16688 *
16689 * for i in range(ndim):
16690 * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
16691 * tmpslice.strides[i] = 0
16692 *
16693*/
16694 }
16695 }
16696
16697
16698 /* "View.MemoryView":1236
16699 * tmpslice.strides[i] = 0
16700 *
16701 * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
16702 * memcpy(result, src.data, size)
16703 * else:
16704*/
16705 __pyx_t_1 = __pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim);
16706
16707 if (__pyx_t_1) {
16708
16709
16710 /* "View.MemoryView":1237
16711 *
16712 * if slice_is_contig(src[0], order, ndim):
16713 * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
16714 * else:
16715 * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
16716*/
16717 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
16718
16719 /* "View.MemoryView":1236
16720 * tmpslice.strides[i] = 0
16721 *
16722 * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
16723 * memcpy(result, src.data, size)
16724 * else:
16725*/
16726 goto __pyx_L9;
16727 }
16728
16729 /* "View.MemoryView":1239
16730 * memcpy(result, src.data, size)
16731 * else:
16732 * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
16733 *
16734 * return result
16735*/
16736 /*else*/ {
16737 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
16738 }
16739 __pyx_L9:;
16740
16741 /* "View.MemoryView":1241
16742 * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
16743 *
16744 * return result # <<<<<<<<<<<<<<
16745 *
16746 *
16747*/
16748 {
16749
16750 __pyx_r = __pyx_v_result;
16751 }
16752 goto __pyx_L0;
16753
16754 /* "View.MemoryView":1203
16755 * return stride
16756 *
16757 * @cname('__pyx_memoryview_copy_data_to_temp') # <<<<<<<<<<<<<<
16758 * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,
16759 * __Pyx_memviewslice *tmpslice,
16760*/
16761
16762 /* function exit code */
16763 __pyx_L1_error:;
16764 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16765 __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
16766 __pyx_r = NULL;
16767 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16768 __pyx_L0:;
16769
16770
16771
16772
16773 return __pyx_r;
16774}
16775
16776/* "View.MemoryView":1246
16777 *
16778 *
16779 * @cname('__pyx_memoryview_err_extents') # <<<<<<<<<<<<<<
16780 * cdef int _err_extents(int i, Py_ssize_t extent1,
16781 * Py_ssize_t extent2) except -1 with gil:
16782*/
16783
16784static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
16785 int __pyx_r;
16786 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16787
16788
16789
16790
16791 /* "View.MemoryView":1249
16792 * cdef int _err_extents(int i, Py_ssize_t extent1,
16793 * Py_ssize_t extent2) except -1 with gil:
16794 * PyErr_Format( # <<<<<<<<<<<<<<
16795 * PyExc_ValueError,
16796 * "got differing extents in dimension %d (got %zd and %zd)",
16797*/
16798 (void)(PyErr_Format(PyExc_ValueError, __pyx_k_got_differing_extents_in_dimensi, __pyx_v_i, __pyx_v_extent1, __pyx_v_extent2));
16799
16800 /* "View.MemoryView":1253
16801 * "got differing extents in dimension %d (got %zd and %zd)",
16802 * i, extent1, extent2)
16803 * return -1 # <<<<<<<<<<<<<<
16804 *
16805 * @cname('__pyx_memoryview_err_dim')
16806*/
16807 {
16808
16809 __pyx_r = -1;
16810 }
16811 goto __pyx_L0;
16812
16813 /* "View.MemoryView":1246
16814 *
16815 *
16816 * @cname('__pyx_memoryview_err_extents') # <<<<<<<<<<<<<<
16817 * cdef int _err_extents(int i, Py_ssize_t extent1,
16818 * Py_ssize_t extent2) except -1 with gil:
16819*/
16820
16821 /* function exit code */
16822 __pyx_L0:;
16823
16824
16825
16826
16827 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16828 return __pyx_r;
16829}
16830
16831/* "View.MemoryView":1255
16832 * return -1
16833 *
16834 * @cname('__pyx_memoryview_err_dim') # <<<<<<<<<<<<<<
16835 * cdef int _err_dim(PyObject *error, const char* msg, int dim) except -1 with gil:
16836 * PyErr_Format(error, msg, dim)
16837*/
16838
16839static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char const *__pyx_v_msg, int __pyx_v_dim) {
16840 int __pyx_r;
16841 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16842
16843
16844
16845
16846 /* "View.MemoryView":1257
16847 * @cname('__pyx_memoryview_err_dim')
16848 * cdef int _err_dim(PyObject *error, const char* msg, int dim) except -1 with gil:
16849 * PyErr_Format(error, msg, dim) # <<<<<<<<<<<<<<
16850 * return -1
16851 *
16852*/
16853 (void)(PyErr_Format(__pyx_v_error, __pyx_v_msg, __pyx_v_dim));
16854
16855 /* "View.MemoryView":1258
16856 * cdef int _err_dim(PyObject *error, const char* msg, int dim) except -1 with gil:
16857 * PyErr_Format(error, msg, dim)
16858 * return -1 # <<<<<<<<<<<<<<
16859 *
16860 * @cname('__pyx_memoryview_err')
16861*/
16862 {
16863
16864 __pyx_r = -1;
16865 }
16866 goto __pyx_L0;
16867
16868 /* "View.MemoryView":1255
16869 * return -1
16870 *
16871 * @cname('__pyx_memoryview_err_dim') # <<<<<<<<<<<<<<
16872 * cdef int _err_dim(PyObject *error, const char* msg, int dim) except -1 with gil:
16873 * PyErr_Format(error, msg, dim)
16874*/
16875
16876 /* function exit code */
16877 __pyx_L0:;
16878
16879
16880
16881
16882 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16883 return __pyx_r;
16884}
16885
16886/* "View.MemoryView":1260
16887 * return -1
16888 *
16889 * @cname('__pyx_memoryview_err') # <<<<<<<<<<<<<<
16890 * cdef int _err(PyObject *error, const char* msg) except -1 with gil:
16891 * PyErr_SetString(error, msg)
16892*/
16893
16894static int __pyx_memoryview_err(PyObject *__pyx_v_error, char const *__pyx_v_msg) {
16895 int __pyx_r;
16896 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16897
16898
16899
16900 /* "View.MemoryView":1262
16901 * @cname('__pyx_memoryview_err')
16902 * cdef int _err(PyObject *error, const char* msg) except -1 with gil:
16903 * PyErr_SetString(error, msg) # <<<<<<<<<<<<<<
16904 * return -1
16905 *
16906*/
16907 (void)(PyErr_SetString(__pyx_v_error, __pyx_v_msg));
16908
16909 /* "View.MemoryView":1263
16910 * cdef int _err(PyObject *error, const char* msg) except -1 with gil:
16911 * PyErr_SetString(error, msg)
16912 * return -1 # <<<<<<<<<<<<<<
16913 *
16914 * @cname('__pyx_memoryview_err_no_memory')
16915*/
16916 {
16917
16918 __pyx_r = -1;
16919 }
16920 goto __pyx_L0;
16921
16922 /* "View.MemoryView":1260
16923 * return -1
16924 *
16925 * @cname('__pyx_memoryview_err') # <<<<<<<<<<<<<<
16926 * cdef int _err(PyObject *error, const char* msg) except -1 with gil:
16927 * PyErr_SetString(error, msg)
16928*/
16929
16930 /* function exit code */
16931 __pyx_L0:;
16932
16933
16934
16935 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16936 return __pyx_r;
16937}
16938
16939/* "View.MemoryView":1265
16940 * return -1
16941 *
16942 * @cname('__pyx_memoryview_err_no_memory') # <<<<<<<<<<<<<<
16943 * cdef int _err_no_memory() except -1 with gil:
16944 * raise MemoryError
16945*/
16946
16947static int __pyx_memoryview_err_no_memory(void) {
16948 int __pyx_r;
16949 int __pyx_lineno = 0;
16950 const char *__pyx_filename = NULL;
16951 int __pyx_clineno = 0;
16952 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16953
16954 /* "View.MemoryView":1267
16955 * @cname('__pyx_memoryview_err_no_memory')
16956 * cdef int _err_no_memory() except -1 with gil:
16957 * raise MemoryError # <<<<<<<<<<<<<<
16958 *
16959 *
16960*/
16961 PyErr_NoMemory(); __PYX_ERR(1, 1267, __pyx_L1_error)
16962
16963 /* "View.MemoryView":1265
16964 * return -1
16965 *
16966 * @cname('__pyx_memoryview_err_no_memory') # <<<<<<<<<<<<<<
16967 * cdef int _err_no_memory() except -1 with gil:
16968 * raise MemoryError
16969*/
16970
16971 /* function exit code */
16972 __pyx_L1_error:;
16973 __Pyx_AddTraceback("View.MemoryView._err_no_memory", __pyx_clineno, __pyx_lineno, __pyx_filename);
16974 __pyx_r = -1;
16975
16976 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16977 return __pyx_r;
16978}
16979
16980/* "View.MemoryView":1271
16981 *
16982 *
16983 * @cname('__pyx_memoryview_err_ValueError') # <<<<<<<<<<<<<<
16984 * cdef int _err_ValueError(const char* msg) except -1:
16985 * PyErr_SetString(PyExc_ValueError, msg)
16986*/
16987
16988static int __pyx_memoryview_err_ValueError(char const *__pyx_v_msg) {
16989 int __pyx_r;
16990
16991 /* "View.MemoryView":1273
16992 * @cname('__pyx_memoryview_err_ValueError')
16993 * cdef int _err_ValueError(const char* msg) except -1:
16994 * PyErr_SetString(PyExc_ValueError, msg) # <<<<<<<<<<<<<<
16995 * return -1
16996 *
16997*/
16998 (void)(PyErr_SetString(PyExc_ValueError, __pyx_v_msg));
16999
17000 /* "View.MemoryView":1274
17001 * cdef int _err_ValueError(const char* msg) except -1:
17002 * PyErr_SetString(PyExc_ValueError, msg)
17003 * return -1 # <<<<<<<<<<<<<<
17004 *
17005 * @cname('__pyx_memoryview_err_IndexError')
17006*/
17007 {
17008
17009 __pyx_r = -1;
17010 }
17011 goto __pyx_L0;
17012
17013 /* "View.MemoryView":1271
17014 *
17015 *
17016 * @cname('__pyx_memoryview_err_ValueError') # <<<<<<<<<<<<<<
17017 * cdef int _err_ValueError(const char* msg) except -1:
17018 * PyErr_SetString(PyExc_ValueError, msg)
17019*/
17020
17021 /* function exit code */
17022 __pyx_L0:;
17023
17024 return __pyx_r;
17025}
17026
17027/* "View.MemoryView":1276
17028 * return -1
17029 *
17030 * @cname('__pyx_memoryview_err_IndexError') # <<<<<<<<<<<<<<
17031 * cdef int _err_IndexError(const char* msg, Py_ssize_t index) except -1:
17032 * PyErr_Format(PyExc_IndexError, msg, index)
17033*/
17034
17035static int __pyx_memoryview_err_IndexError(char const *__pyx_v_msg, Py_ssize_t __pyx_v_index) {
17036 int __pyx_r;
17037
17038 /* "View.MemoryView":1278
17039 * @cname('__pyx_memoryview_err_IndexError')
17040 * cdef int _err_IndexError(const char* msg, Py_ssize_t index) except -1:
17041 * PyErr_Format(PyExc_IndexError, msg, index) # <<<<<<<<<<<<<<
17042 * return -1
17043 *
17044*/
17045 (void)(PyErr_Format(PyExc_IndexError, __pyx_v_msg, __pyx_v_index));
17046
17047 /* "View.MemoryView":1279
17048 * cdef int _err_IndexError(const char* msg, Py_ssize_t index) except -1:
17049 * PyErr_Format(PyExc_IndexError, msg, index)
17050 * return -1 # <<<<<<<<<<<<<<
17051 *
17052 *
17053*/
17054 {
17055
17056 __pyx_r = -1;
17057 }
17058 goto __pyx_L0;
17059
17060 /* "View.MemoryView":1276
17061 * return -1
17062 *
17063 * @cname('__pyx_memoryview_err_IndexError') # <<<<<<<<<<<<<<
17064 * cdef int _err_IndexError(const char* msg, Py_ssize_t index) except -1:
17065 * PyErr_Format(PyExc_IndexError, msg, index)
17066*/
17067
17068 /* function exit code */
17069 __pyx_L0:;
17070
17071 return __pyx_r;
17072}
17073
17074/* "View.MemoryView":1282
17075 *
17076 *
17077 * @cname('__pyx_memoryview_copy_contents') # <<<<<<<<<<<<<<
17078 * cdef int memoryview_copy_contents(__Pyx_memviewslice src,
17079 * __Pyx_memviewslice dst,
17080*/
17081
17082static 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) {
17083 void *__pyx_v_tmpdata;
17084 size_t __pyx_v_itemsize;
17085 int __pyx_v_i;
17086 char __pyx_v_order;
17087 int __pyx_v_broadcasting;
17088 int __pyx_v_direct_copy;
17089 __Pyx_memviewslice __pyx_v_tmp;
17090 int __pyx_v_ndim;
17091 int __pyx_r;
17092 int __pyx_t_1;
17093 int __pyx_t_2;
17094 int __pyx_t_3;
17095 int __pyx_t_4;
17096 int __pyx_t_5;
17097 void *__pyx_t_6;
17098 int __pyx_lineno = 0;
17099 const char *__pyx_filename = NULL;
17100 int __pyx_clineno = 0;
17101 PyGILState_STATE __pyx_gilstate_save;
17102
17103
17104 /* "View.MemoryView":1291
17105 * Check for overlapping memory and verify the shapes.
17106 * """
17107 * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
17108 * cdef size_t itemsize = <size_t> src.memview.view.itemsize
17109 * cdef int i
17110*/
17111 __pyx_v_tmpdata = NULL;
17112
17113 /* "View.MemoryView":1292
17114 * """
17115 * cdef void *tmpdata = NULL
17116 * cdef size_t itemsize = <size_t> src.memview.view.itemsize # <<<<<<<<<<<<<<
17117 * cdef int i
17118 * cdef char order = get_best_order(&src, src_ndim)
17119*/
17120 __pyx_v_itemsize = ((size_t)__pyx_v_src.memview->view.itemsize);
17121
17122 /* "View.MemoryView":1294
17123 * cdef size_t itemsize = <size_t> src.memview.view.itemsize
17124 * cdef int i
17125 * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
17126 * cdef bint broadcasting = False
17127 * cdef bint direct_copy = False
17128*/
17129 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
17130
17131 /* "View.MemoryView":1295
17132 * cdef int i
17133 * cdef char order = get_best_order(&src, src_ndim)
17134 * cdef bint broadcasting = False # <<<<<<<<<<<<<<
17135 * cdef bint direct_copy = False
17136 * cdef __Pyx_memviewslice tmp
17137*/
17138 __pyx_v_broadcasting = 0;
17139
17140 /* "View.MemoryView":1296
17141 * cdef char order = get_best_order(&src, src_ndim)
17142 * cdef bint broadcasting = False
17143 * cdef bint direct_copy = False # <<<<<<<<<<<<<<
17144 * cdef __Pyx_memviewslice tmp
17145 *
17146*/
17147 __pyx_v_direct_copy = 0;
17148
17149 /* "View.MemoryView":1299
17150 * cdef __Pyx_memviewslice tmp
17151 *
17152 * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
17153 * broadcast_leading(&src, src_ndim, dst_ndim)
17154 * elif dst_ndim < src_ndim:
17155*/
17156 __pyx_t_1 = (__pyx_v_src_ndim < __pyx_v_dst_ndim);
17157
17158 if (__pyx_t_1) {
17159
17160
17161 /* "View.MemoryView":1300
17162 *
17163 * if src_ndim < dst_ndim:
17164 * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
17165 * elif dst_ndim < src_ndim:
17166 * broadcast_leading(&dst, dst_ndim, src_ndim)
17167*/
17168 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
17169
17170 /* "View.MemoryView":1299
17171 * cdef __Pyx_memviewslice tmp
17172 *
17173 * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
17174 * broadcast_leading(&src, src_ndim, dst_ndim)
17175 * elif dst_ndim < src_ndim:
17176*/
17177 goto __pyx_L3;
17178 }
17179
17180 /* "View.MemoryView":1301
17181 * if src_ndim < dst_ndim:
17182 * broadcast_leading(&src, src_ndim, dst_ndim)
17183 * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
17184 * broadcast_leading(&dst, dst_ndim, src_ndim)
17185 *
17186*/
17187 __pyx_t_1 = (__pyx_v_dst_ndim < __pyx_v_src_ndim);
17188
17189 if (__pyx_t_1) {
17190
17191
17192 /* "View.MemoryView":1302
17193 * broadcast_leading(&src, src_ndim, dst_ndim)
17194 * elif dst_ndim < src_ndim:
17195 * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
17196 *
17197 * cdef int ndim = max(src_ndim, dst_ndim)
17198*/
17199 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
17200
17201 /* "View.MemoryView":1301
17202 * if src_ndim < dst_ndim:
17203 * broadcast_leading(&src, src_ndim, dst_ndim)
17204 * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
17205 * broadcast_leading(&dst, dst_ndim, src_ndim)
17206 *
17207*/
17208 }
17209 __pyx_L3:;
17210
17211 /* "View.MemoryView":1304
17212 * broadcast_leading(&dst, dst_ndim, src_ndim)
17213 *
17214 * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
17215 *
17216 * for i in range(ndim):
17217*/
17218
17219 __pyx_t_2 = __pyx_v_dst_ndim;
17220
17221 __pyx_t_3 = __pyx_v_src_ndim;
17222 __pyx_t_1 = (__pyx_t_2 > __pyx_t_3);
17223
17224 if (__pyx_t_1) {
17225
17226 __pyx_t_4 = __pyx_t_2;
17227 } else {
17228
17229 __pyx_t_4 = __pyx_t_3;
17230 }
17231
17232 __pyx_v_ndim = __pyx_t_4;
17233
17234
17235 /* "View.MemoryView":1306
17236 * cdef int ndim = max(src_ndim, dst_ndim)
17237 *
17238 * for i in range(ndim): # <<<<<<<<<<<<<<
17239 * if src.shape[i] != dst.shape[i]:
17240 * if cython.likely(src.shape[i] == 1):
17241*/
17242
17243 __pyx_t_4 = __pyx_v_ndim;
17244 __pyx_t_2 = __pyx_t_4;
17245
17246 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17247 __pyx_v_i = __pyx_t_3;
17248
17249 /* "View.MemoryView":1307
17250 *
17251 * for i in range(ndim):
17252 * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
17253 * if cython.likely(src.shape[i] == 1):
17254 * broadcasting = True
17255*/
17256 __pyx_t_1 = ((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i]));
17257
17258 if (__pyx_t_1) {
17259
17260
17261 /* "View.MemoryView":1308
17262 * for i in range(ndim):
17263 * if src.shape[i] != dst.shape[i]:
17264 * if cython.likely(src.shape[i] == 1): # <<<<<<<<<<<<<<
17265 * broadcasting = True
17266 * src.strides[i] = 0
17267*/
17268 __pyx_t_1 = ((__pyx_v_src.shape[__pyx_v_i]) == 1);
17269
17270 if (likely(__pyx_t_1)) {
17271
17272
17273 /* "View.MemoryView":1309
17274 * if src.shape[i] != dst.shape[i]:
17275 * if cython.likely(src.shape[i] == 1):
17276 * broadcasting = True # <<<<<<<<<<<<<<
17277 * src.strides[i] = 0
17278 * else:
17279*/
17280 __pyx_v_broadcasting = 1;
17281
17282 /* "View.MemoryView":1310
17283 * if cython.likely(src.shape[i] == 1):
17284 * broadcasting = True
17285 * src.strides[i] = 0 # <<<<<<<<<<<<<<
17286 * else:
17287 * _err_extents(i, dst.shape[i], src.shape[i])
17288*/
17289 (__pyx_v_src.strides[__pyx_v_i]) = 0;
17290
17291 /* "View.MemoryView":1308
17292 * for i in range(ndim):
17293 * if src.shape[i] != dst.shape[i]:
17294 * if cython.likely(src.shape[i] == 1): # <<<<<<<<<<<<<<
17295 * broadcasting = True
17296 * src.strides[i] = 0
17297*/
17298 goto __pyx_L7;
17299 }
17300
17301 /* "View.MemoryView":1312
17302 * src.strides[i] = 0
17303 * else:
17304 * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
17305 *
17306 * if cython.unlikely(src.suboffsets[i] >= 0):
17307*/
17308 /*else*/ {
17309 __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)
17310
17311 }
17312 __pyx_L7:;
17313
17314 /* "View.MemoryView":1307
17315 *
17316 * for i in range(ndim):
17317 * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
17318 * if cython.likely(src.shape[i] == 1):
17319 * broadcasting = True
17320*/
17321 }
17322
17323 /* "View.MemoryView":1314
17324 * _err_extents(i, dst.shape[i], src.shape[i])
17325 *
17326 * if cython.unlikely(src.suboffsets[i] >= 0): # <<<<<<<<<<<<<<
17327 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17328 *
17329*/
17330 __pyx_t_1 = ((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0);
17331
17332 if (unlikely(__pyx_t_1)) {
17333
17334
17335 /* "View.MemoryView":1315
17336 *
17337 * if cython.unlikely(src.suboffsets[i] >= 0):
17338 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
17339 *
17340 * if slices_overlap(&src, &dst, ndim, itemsize):
17341*/
17342 __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)
17343
17344
17345 /* "View.MemoryView":1314
17346 * _err_extents(i, dst.shape[i], src.shape[i])
17347 *
17348 * if cython.unlikely(src.suboffsets[i] >= 0): # <<<<<<<<<<<<<<
17349 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17350 *
17351*/
17352 }
17353 }
17354
17355
17356 /* "View.MemoryView":1317
17357 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17358 *
17359 * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
17360 *
17361 * if not slice_is_contig(src, order, ndim):
17362*/
17363 __pyx_t_1 = __pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17364
17365 if (__pyx_t_1) {
17366
17367
17368 /* "View.MemoryView":1319
17369 * if slices_overlap(&src, &dst, ndim, itemsize):
17370 *
17371 * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
17372 * order = get_best_order(&dst, ndim)
17373 *
17374*/
17375 __pyx_t_1 = (!__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim));
17376
17377 if (__pyx_t_1) {
17378
17379
17380 /* "View.MemoryView":1320
17381 *
17382 * if not slice_is_contig(src, order, ndim):
17383 * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
17384 *
17385 * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
17386*/
17387 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
17388
17389 /* "View.MemoryView":1319
17390 * if slices_overlap(&src, &dst, ndim, itemsize):
17391 *
17392 * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
17393 * order = get_best_order(&dst, ndim)
17394 *
17395*/
17396 }
17397
17398 /* "View.MemoryView":1322
17399 * order = get_best_order(&dst, ndim)
17400 *
17401 * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
17402 * src = tmp
17403 *
17404*/
17405 __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)
17406 __pyx_v_tmpdata = __pyx_t_6;
17407
17408 /* "View.MemoryView":1323
17409 *
17410 * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
17411 * src = tmp # <<<<<<<<<<<<<<
17412 *
17413 * if not broadcasting:
17414*/
17415 __pyx_v_src = __pyx_v_tmp;
17416
17417 /* "View.MemoryView":1317
17418 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17419 *
17420 * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
17421 *
17422 * if not slice_is_contig(src, order, ndim):
17423*/
17424 }
17425
17426 /* "View.MemoryView":1325
17427 * src = tmp
17428 *
17429 * if not broadcasting: # <<<<<<<<<<<<<<
17430 *
17431 *
17432*/
17433 __pyx_t_1 = (!__pyx_v_broadcasting);
17434
17435 if (__pyx_t_1) {
17436
17437
17438 /* "View.MemoryView":1328
17439 *
17440 *
17441 * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
17442 * direct_copy = slice_is_contig(dst, 'C', ndim)
17443 * elif slice_is_contig(src, 'F', ndim):
17444*/
17445 __pyx_t_1 = __pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim);
17446
17447 if (__pyx_t_1) {
17448
17449
17450 /* "View.MemoryView":1329
17451 *
17452 * if slice_is_contig(src, 'C', ndim):
17453 * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
17454 * elif slice_is_contig(src, 'F', ndim):
17455 * direct_copy = slice_is_contig(dst, 'F', ndim)
17456*/
17457 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
17458
17459 /* "View.MemoryView":1328
17460 *
17461 *
17462 * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
17463 * direct_copy = slice_is_contig(dst, 'C', ndim)
17464 * elif slice_is_contig(src, 'F', ndim):
17465*/
17466 goto __pyx_L12;
17467 }
17468
17469 /* "View.MemoryView":1330
17470 * if slice_is_contig(src, 'C', ndim):
17471 * direct_copy = slice_is_contig(dst, 'C', ndim)
17472 * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
17473 * direct_copy = slice_is_contig(dst, 'F', ndim)
17474 *
17475*/
17476 __pyx_t_1 = __pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim);
17477
17478 if (__pyx_t_1) {
17479
17480
17481 /* "View.MemoryView":1331
17482 * direct_copy = slice_is_contig(dst, 'C', ndim)
17483 * elif slice_is_contig(src, 'F', ndim):
17484 * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
17485 *
17486 * if direct_copy:
17487*/
17488 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
17489
17490 /* "View.MemoryView":1330
17491 * if slice_is_contig(src, 'C', ndim):
17492 * direct_copy = slice_is_contig(dst, 'C', ndim)
17493 * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
17494 * direct_copy = slice_is_contig(dst, 'F', ndim)
17495 *
17496*/
17497 }
17498 __pyx_L12:;
17499
17500 /* "View.MemoryView":1333
17501 * direct_copy = slice_is_contig(dst, 'F', ndim)
17502 *
17503 * if direct_copy: # <<<<<<<<<<<<<<
17504 *
17505 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17506*/
17507 if (__pyx_v_direct_copy) {
17508
17509 /* "View.MemoryView":1335
17510 * if direct_copy:
17511 *
17512 * refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
17513 * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17514 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17515*/
17516 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17517
17518 /* "View.MemoryView":1336
17519 *
17520 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17521 * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
17522 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17523 * free(tmpdata)
17524*/
17525 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
17526
17527 /* "View.MemoryView":1337
17528 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17529 * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17530 * refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
17531 * free(tmpdata)
17532 * return 0
17533*/
17534 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17535
17536 /* "View.MemoryView":1338
17537 * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17538 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17539 * free(tmpdata) # <<<<<<<<<<<<<<
17540 * return 0
17541 *
17542*/
17543 free(__pyx_v_tmpdata);
17544
17545 /* "View.MemoryView":1339
17546 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17547 * free(tmpdata)
17548 * return 0 # <<<<<<<<<<<<<<
17549 *
17550 * if order == 'F' == get_best_order(&dst, ndim):
17551*/
17552 {
17553
17554 __pyx_r = 0;
17555 }
17556 goto __pyx_L0;
17557
17558 /* "View.MemoryView":1333
17559 * direct_copy = slice_is_contig(dst, 'F', ndim)
17560 *
17561 * if direct_copy: # <<<<<<<<<<<<<<
17562 *
17563 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17564*/
17565 }
17566
17567 /* "View.MemoryView":1325
17568 * src = tmp
17569 *
17570 * if not broadcasting: # <<<<<<<<<<<<<<
17571 *
17572 *
17573*/
17574 }
17575
17576 /* "View.MemoryView":1341
17577 * return 0
17578 *
17579 * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
17580 *
17581 *
17582*/
17583 __pyx_t_1 = (__pyx_v_order == 'F');
17584 if (__pyx_t_1) {
17585 __pyx_t_1 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
17586 }
17587 if (__pyx_t_1) {
17588
17589
17590 /* "View.MemoryView":1344
17591 *
17592 *
17593 * transpose_memslice(&src) # <<<<<<<<<<<<<<
17594 * transpose_memslice(&dst)
17595 *
17596*/
17597 __pyx_t_4 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1344, __pyx_L1_error)
17598
17599
17600 /* "View.MemoryView":1345
17601 *
17602 * transpose_memslice(&src)
17603 * transpose_memslice(&dst) # <<<<<<<<<<<<<<
17604 *
17605 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17606*/
17607 __pyx_t_4 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1345, __pyx_L1_error)
17608
17609
17610 /* "View.MemoryView":1341
17611 * return 0
17612 *
17613 * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
17614 *
17615 *
17616*/
17617 }
17618
17619 /* "View.MemoryView":1347
17620 * transpose_memslice(&dst)
17621 *
17622 * refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
17623 * copy_strided_to_strided(&src, &dst, ndim, itemsize)
17624 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17625*/
17626 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17627
17628 /* "View.MemoryView":1348
17629 *
17630 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17631 * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
17632 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17633 *
17634*/
17635 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17636
17637 /* "View.MemoryView":1349
17638 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17639 * copy_strided_to_strided(&src, &dst, ndim, itemsize)
17640 * refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
17641 *
17642 * free(tmpdata)
17643*/
17644 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17645
17646 /* "View.MemoryView":1351
17647 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17648 *
17649 * free(tmpdata) # <<<<<<<<<<<<<<
17650 * return 0
17651 *
17652*/
17653 free(__pyx_v_tmpdata);
17654
17655 /* "View.MemoryView":1352
17656 *
17657 * free(tmpdata)
17658 * return 0 # <<<<<<<<<<<<<<
17659 *
17660 * @cname('__pyx_memoryview_broadcast_leading')
17661*/
17662 {
17663
17664 __pyx_r = 0;
17665 }
17666 goto __pyx_L0;
17667
17668 /* "View.MemoryView":1282
17669 *
17670 *
17671 * @cname('__pyx_memoryview_copy_contents') # <<<<<<<<<<<<<<
17672 * cdef int memoryview_copy_contents(__Pyx_memviewslice src,
17673 * __Pyx_memviewslice dst,
17674*/
17675
17676 /* function exit code */
17677 __pyx_L1_error:;
17678 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17679 __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
17680 __pyx_r = -1;
17681 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17682 __pyx_L0:;
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692 return __pyx_r;
17693}
17694
17695/* "View.MemoryView":1354
17696 * return 0
17697 *
17698 * @cname('__pyx_memoryview_broadcast_leading') # <<<<<<<<<<<<<<
17699 * cdef void broadcast_leading(__Pyx_memviewslice *mslice,
17700 * int ndim,
17701*/
17702
17703static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
17704 int __pyx_v_i;
17705 int __pyx_v_offset;
17706 int __pyx_t_1;
17707 int __pyx_t_2;
17708 int __pyx_t_3;
17709
17710 /* "View.MemoryView":1359
17711 * int ndim_other) noexcept nogil:
17712 * cdef int i
17713 * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
17714 *
17715 * for i in range(ndim - 1, -1, -1):
17716*/
17717 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
17718
17719 /* "View.MemoryView":1361
17720 * cdef int offset = ndim_other - ndim
17721 *
17722 * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
17723 * mslice.shape[i + offset] = mslice.shape[i]
17724 * mslice.strides[i + offset] = mslice.strides[i]
17725*/
17726 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
17727 __pyx_v_i = __pyx_t_1;
17728
17729 /* "View.MemoryView":1362
17730 *
17731 * for i in range(ndim - 1, -1, -1):
17732 * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
17733 * mslice.strides[i + offset] = mslice.strides[i]
17734 * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17735*/
17736 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
17737
17738 /* "View.MemoryView":1363
17739 * for i in range(ndim - 1, -1, -1):
17740 * mslice.shape[i + offset] = mslice.shape[i]
17741 * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
17742 * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17743 *
17744*/
17745 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
17746
17747 /* "View.MemoryView":1364
17748 * mslice.shape[i + offset] = mslice.shape[i]
17749 * mslice.strides[i + offset] = mslice.strides[i]
17750 * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
17751 *
17752 * for i in range(offset):
17753*/
17754 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
17755 }
17756
17757 /* "View.MemoryView":1366
17758 * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17759 *
17760 * for i in range(offset): # <<<<<<<<<<<<<<
17761 * mslice.shape[i] = 1
17762 * mslice.strides[i] = mslice.strides[0]
17763*/
17764
17765 __pyx_t_1 = __pyx_v_offset;
17766 __pyx_t_2 = __pyx_t_1;
17767
17768 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17769 __pyx_v_i = __pyx_t_3;
17770
17771 /* "View.MemoryView":1367
17772 *
17773 * for i in range(offset):
17774 * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
17775 * mslice.strides[i] = mslice.strides[0]
17776 * mslice.suboffsets[i] = -1
17777*/
17778 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
17779
17780 /* "View.MemoryView":1368
17781 * for i in range(offset):
17782 * mslice.shape[i] = 1
17783 * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
17784 * mslice.suboffsets[i] = -1
17785 *
17786*/
17787 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
17788
17789 /* "View.MemoryView":1369
17790 * mslice.shape[i] = 1
17791 * mslice.strides[i] = mslice.strides[0]
17792 * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
17793 *
17794 *
17795*/
17796 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
17797 }
17798
17799
17800 /* "View.MemoryView":1354
17801 * return 0
17802 *
17803 * @cname('__pyx_memoryview_broadcast_leading') # <<<<<<<<<<<<<<
17804 * cdef void broadcast_leading(__Pyx_memviewslice *mslice,
17805 * int ndim,
17806*/
17807
17808 /* function exit code */
17809
17810
17811}
17812
17813/* "View.MemoryView":1376
17814 *
17815 *
17816 * @cname('__pyx_memoryview_refcount_copying') # <<<<<<<<<<<<<<
17817 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
17818 *
17819*/
17820
17821static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
17822
17823 /* "View.MemoryView":1379
17824 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
17825 *
17826 * if dtype_is_object: # <<<<<<<<<<<<<<
17827 * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
17828 *
17829*/
17830 if (__pyx_v_dtype_is_object) {
17831
17832 /* "View.MemoryView":1380
17833 *
17834 * if dtype_is_object:
17835 * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc) # <<<<<<<<<<<<<<
17836 *
17837 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
17838*/
17839 __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);
17840
17841 /* "View.MemoryView":1379
17842 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
17843 *
17844 * if dtype_is_object: # <<<<<<<<<<<<<<
17845 * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
17846 *
17847*/
17848 }
17849
17850 /* "View.MemoryView":1376
17851 *
17852 *
17853 * @cname('__pyx_memoryview_refcount_copying') # <<<<<<<<<<<<<<
17854 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
17855 *
17856*/
17857
17858 /* function exit code */
17859}
17860
17861/* "View.MemoryView":1382
17862 * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
17863 *
17864 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') # <<<<<<<<<<<<<<
17865 * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,
17866 * Py_ssize_t *strides, int ndim,
17867*/
17868
17869static 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) {
17870 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17871
17872
17873
17874
17875
17876
17877 /* "View.MemoryView":1386
17878 * Py_ssize_t *strides, int ndim,
17879 * bint inc) noexcept with gil:
17880 * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
17881 *
17882 * @cname('__pyx_memoryview_refcount_objects_in_slice')
17883*/
17884 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
17885
17886 /* "View.MemoryView":1382
17887 * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
17888 *
17889 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') # <<<<<<<<<<<<<<
17890 * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,
17891 * Py_ssize_t *strides, int ndim,
17892*/
17893
17894 /* function exit code */
17895
17896
17897
17898
17899
17900
17901 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17902}
17903
17904/* "View.MemoryView":1388
17905 * refcount_objects_in_slice(data, shape, strides, ndim, inc)
17906 *
17907 * @cname('__pyx_memoryview_refcount_objects_in_slice') # <<<<<<<<<<<<<<
17908 * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,
17909 * Py_ssize_t *strides, int ndim, bint inc) noexcept:
17910*/
17911
17912static 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) {
17913 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
17914 Py_ssize_t __pyx_v_stride;
17915 Py_ssize_t __pyx_t_1;
17916 Py_ssize_t __pyx_t_2;
17917 Py_ssize_t __pyx_t_3;
17918 int __pyx_t_4;
17919
17920
17921 /* "View.MemoryView":1392
17922 * Py_ssize_t *strides, int ndim, bint inc) noexcept:
17923 * cdef Py_ssize_t i
17924 * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
17925 *
17926 * for i in range(shape[0]):
17927*/
17928 __pyx_v_stride = (__pyx_v_strides[0]);
17929
17930 /* "View.MemoryView":1394
17931 * cdef Py_ssize_t stride = strides[0]
17932 *
17933 * for i in range(shape[0]): # <<<<<<<<<<<<<<
17934 * if ndim == 1:
17935 * if inc:
17936*/
17937
17938 __pyx_t_1 = (__pyx_v_shape[0]);
17939 __pyx_t_2 = __pyx_t_1;
17940
17941 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17942 __pyx_v_i = __pyx_t_3;
17943
17944 /* "View.MemoryView":1395
17945 *
17946 * for i in range(shape[0]):
17947 * if ndim == 1: # <<<<<<<<<<<<<<
17948 * if inc:
17949 * Py_INCREF((<PyObject **> data)[0])
17950*/
17951 __pyx_t_4 = (__pyx_v_ndim == 1);
17952
17953 if (__pyx_t_4) {
17954
17955
17956 /* "View.MemoryView":1396
17957 * for i in range(shape[0]):
17958 * if ndim == 1:
17959 * if inc: # <<<<<<<<<<<<<<
17960 * Py_INCREF((<PyObject **> data)[0])
17961 * else:
17962*/
17963 if (__pyx_v_inc) {
17964
17965 /* "View.MemoryView":1397
17966 * if ndim == 1:
17967 * if inc:
17968 * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
17969 * else:
17970 * Py_DECREF((<PyObject **> data)[0])
17971*/
17972 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
17973
17974 /* "View.MemoryView":1396
17975 * for i in range(shape[0]):
17976 * if ndim == 1:
17977 * if inc: # <<<<<<<<<<<<<<
17978 * Py_INCREF((<PyObject **> data)[0])
17979 * else:
17980*/
17981 goto __pyx_L6;
17982 }
17983
17984 /* "View.MemoryView":1399
17985 * Py_INCREF((<PyObject **> data)[0])
17986 * else:
17987 * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
17988 * else:
17989 * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
17990*/
17991 /*else*/ {
17992 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
17993 }
17994 __pyx_L6:;
17995
17996 /* "View.MemoryView":1395
17997 *
17998 * for i in range(shape[0]):
17999 * if ndim == 1: # <<<<<<<<<<<<<<
18000 * if inc:
18001 * Py_INCREF((<PyObject **> data)[0])
18002*/
18003 goto __pyx_L5;
18004 }
18005
18006 /* "View.MemoryView":1401
18007 * Py_DECREF((<PyObject **> data)[0])
18008 * else:
18009 * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc) # <<<<<<<<<<<<<<
18010 *
18011 * data += stride
18012*/
18013 /*else*/ {
18014 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
18015 }
18016 __pyx_L5:;
18017
18018 /* "View.MemoryView":1403
18019 * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
18020 *
18021 * data += stride # <<<<<<<<<<<<<<
18022 *
18023 *
18024*/
18025 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18026 }
18027
18028
18029 /* "View.MemoryView":1388
18030 * refcount_objects_in_slice(data, shape, strides, ndim, inc)
18031 *
18032 * @cname('__pyx_memoryview_refcount_objects_in_slice') # <<<<<<<<<<<<<<
18033 * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,
18034 * Py_ssize_t *strides, int ndim, bint inc) noexcept:
18035*/
18036
18037 /* function exit code */
18038
18039
18040
18041
18042}
18043
18044/* "View.MemoryView":1408
18045 *
18046 *
18047 * @cname('__pyx_memoryview_slice_assign_scalar') # <<<<<<<<<<<<<<
18048 * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,
18049 * size_t itemsize, void *item,
18050*/
18051
18052static 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) {
18053
18054 /* "View.MemoryView":1412
18055 * size_t itemsize, void *item,
18056 * bint dtype_is_object) noexcept nogil:
18057 * refcount_copying(dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
18058 * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
18059 * refcount_copying(dst, dtype_is_object, ndim, inc=True)
18060*/
18061 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18062
18063 /* "View.MemoryView":1413
18064 * bint dtype_is_object) noexcept nogil:
18065 * refcount_copying(dst, dtype_is_object, ndim, inc=False)
18066 * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item) # <<<<<<<<<<<<<<
18067 * refcount_copying(dst, dtype_is_object, ndim, inc=True)
18068 *
18069*/
18070 __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);
18071
18072 /* "View.MemoryView":1414
18073 * refcount_copying(dst, dtype_is_object, ndim, inc=False)
18074 * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
18075 * refcount_copying(dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
18076 *
18077 *
18078*/
18079 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18080
18081 /* "View.MemoryView":1408
18082 *
18083 *
18084 * @cname('__pyx_memoryview_slice_assign_scalar') # <<<<<<<<<<<<<<
18085 * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,
18086 * size_t itemsize, void *item,
18087*/
18088
18089 /* function exit code */
18090}
18091
18092/* "View.MemoryView":1417
18093 *
18094 *
18095 * @cname('__pyx_memoryview__slice_assign_scalar') # <<<<<<<<<<<<<<
18096 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,
18097 * Py_ssize_t *strides, int ndim,
18098*/
18099
18100static 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) {
18101 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18102 Py_ssize_t __pyx_v_stride;
18103 Py_ssize_t __pyx_v_extent;
18104 int __pyx_t_1;
18105 Py_ssize_t __pyx_t_2;
18106 Py_ssize_t __pyx_t_3;
18107 Py_ssize_t __pyx_t_4;
18108
18109
18110 /* "View.MemoryView":1422
18111 * size_t itemsize, void *item) noexcept nogil:
18112 * cdef Py_ssize_t i
18113 * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
18114 * cdef Py_ssize_t extent = shape[0]
18115 *
18116*/
18117 __pyx_v_stride = (__pyx_v_strides[0]);
18118
18119 /* "View.MemoryView":1423
18120 * cdef Py_ssize_t i
18121 * cdef Py_ssize_t stride = strides[0]
18122 * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
18123 *
18124 * if ndim == 1:
18125*/
18126 __pyx_v_extent = (__pyx_v_shape[0]);
18127
18128 /* "View.MemoryView":1425
18129 * cdef Py_ssize_t extent = shape[0]
18130 *
18131 * if ndim == 1: # <<<<<<<<<<<<<<
18132 * for i in range(extent):
18133 * memcpy(data, item, itemsize)
18134*/
18135 __pyx_t_1 = (__pyx_v_ndim == 1);
18136
18137 if (__pyx_t_1) {
18138
18139
18140 /* "View.MemoryView":1426
18141 *
18142 * if ndim == 1:
18143 * for i in range(extent): # <<<<<<<<<<<<<<
18144 * memcpy(data, item, itemsize)
18145 * data += stride
18146*/
18147
18148 __pyx_t_2 = __pyx_v_extent;
18149 __pyx_t_3 = __pyx_t_2;
18150
18151 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18152 __pyx_v_i = __pyx_t_4;
18153
18154 /* "View.MemoryView":1427
18155 * if ndim == 1:
18156 * for i in range(extent):
18157 * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
18158 * data += stride
18159 * else:
18160*/
18161 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
18162
18163 /* "View.MemoryView":1428
18164 * for i in range(extent):
18165 * memcpy(data, item, itemsize)
18166 * data += stride # <<<<<<<<<<<<<<
18167 * else:
18168 * for i in range(extent):
18169*/
18170 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18171 }
18172
18173
18174 /* "View.MemoryView":1425
18175 * cdef Py_ssize_t extent = shape[0]
18176 *
18177 * if ndim == 1: # <<<<<<<<<<<<<<
18178 * for i in range(extent):
18179 * memcpy(data, item, itemsize)
18180*/
18181 goto __pyx_L3;
18182 }
18183
18184 /* "View.MemoryView":1430
18185 * data += stride
18186 * else:
18187 * for i in range(extent): # <<<<<<<<<<<<<<
18188 * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
18189 * data += stride
18190*/
18191 /*else*/ {
18192
18193 __pyx_t_2 = __pyx_v_extent;
18194 __pyx_t_3 = __pyx_t_2;
18195
18196 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18197 __pyx_v_i = __pyx_t_4;
18198
18199 /* "View.MemoryView":1431
18200 * else:
18201 * for i in range(extent):
18202 * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item) # <<<<<<<<<<<<<<
18203 * data += stride
18204 *
18205*/
18206 __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);
18207
18208 /* "View.MemoryView":1432
18209 * for i in range(extent):
18210 * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
18211 * data += stride # <<<<<<<<<<<<<<
18212 *
18213*/
18214 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18215 }
18216
18217 }
18218 __pyx_L3:;
18219
18220 /* "View.MemoryView":1417
18221 *
18222 *
18223 * @cname('__pyx_memoryview__slice_assign_scalar') # <<<<<<<<<<<<<<
18224 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,
18225 * Py_ssize_t *strides, int ndim,
18226*/
18227
18228 /* function exit code */
18229
18230
18231
18232
18233}
18234
18235/* "(tree fragment)":4
18236 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
18237 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
18238 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<<
18239 * cdef object __pyx_result
18240 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
18241*/
18242
18243/* Python wrapper */
18244static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
18245#if CYTHON_VECTORCALL
18246PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
18247#else
18248PyObject *__pyx_args, PyObject *__pyx_kwds
18249#endif
18250); /*proto*/
18251static 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};
18252static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
18253#if CYTHON_VECTORCALL
18254PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
18255#else
18256PyObject *__pyx_args, PyObject *__pyx_kwds
18257#endif
18258) {
18259 PyObject *__pyx_v___pyx_type = 0;
18260 long __pyx_v___pyx_checksum;
18261 PyObject *__pyx_v___pyx_state = 0;
18262 #if !CYTHON_VECTORCALL
18263 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
18264 #endif
18265 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
18266 PyObject* values[3] = {0,0,0};
18267 int __pyx_lineno = 0;
18268 const char *__pyx_filename = NULL;
18269 int __pyx_clineno = 0;
18270 PyObject *__pyx_r = 0;
18271 __Pyx_RefNannyDeclarations
18272 __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
18273 #if !CYTHON_VECTORCALL
18274 #if CYTHON_ASSUME_SAFE_SIZE
18275 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
18276 #else
18277 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
18278 #endif
18279 #endif
18280 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
18281 {
18282 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};
18283 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
18284 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 4, __pyx_L3_error)
18285 if (__pyx_kwds_len > 0) {
18286 switch (__pyx_nargs) {
18287 case 3:
18288 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
18289 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
18290 CYTHON_FALLTHROUGH;
18291 case 2:
18292 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
18293 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
18294 CYTHON_FALLTHROUGH;
18295 case 1:
18296 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
18297 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 4, __pyx_L3_error)
18298 CYTHON_FALLTHROUGH;
18299 case 0: break;
18300 default: goto __pyx_L5_argtuple_error;
18301 }
18302 const Py_ssize_t kwd_pos_args = __pyx_nargs;
18303 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)
18304 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
18305 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
18306 }
18307 } else if (unlikely(__pyx_nargs != 3)) {
18308 goto __pyx_L5_argtuple_error;
18309 } else {
18310 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
18311 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 4, __pyx_L3_error)
18312 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
18313 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
18314 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
18315 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
18316 }
18317 __pyx_v___pyx_type = values[0];
18318 __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)
18319 __pyx_v___pyx_state = ((PyObject*)values[2]);
18320 }
18321 goto __pyx_L6_skip;
18322 __pyx_L5_argtuple_error:;
18323 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __pyx_L3_error)
18324 __pyx_L6_skip:;
18325 goto __pyx_L4_argument_unpacking_done;
18326 __pyx_L3_error:;
18327 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18328 Py_XDECREF(values[__pyx_temp]);
18329 }
18330 __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18331 __Pyx_RefNannyFinishContext();
18332 return NULL;
18333 __pyx_L4_argument_unpacking_done:;
18334 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
18335 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
18336
18337 /* function exit code */
18338 goto __pyx_L0;
18339 __pyx_L1_error:;
18340 __pyx_r = NULL;
18341 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18342 Py_XDECREF(values[__pyx_temp]);
18343 }
18344 goto __pyx_L7_cleaned_up;
18345 __pyx_L0:;
18346 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18347 Py_XDECREF(values[__pyx_temp]);
18348 }
18349 __pyx_L7_cleaned_up:;
18350
18351 __Pyx_RefNannyFinishContext();
18352 return __pyx_r;
18353}
18354
18355static 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) {
18356 PyObject *__pyx_v___pyx_result = 0;
18357 PyObject *__pyx_r = NULL;
18358 __Pyx_RefNannyDeclarations
18359 int __pyx_t_1;
18360 PyObject *__pyx_t_2 = NULL;
18361 PyObject *__pyx_t_3 = NULL;
18362 size_t __pyx_t_4;
18363 int __pyx_t_5;
18364 int __pyx_lineno = 0;
18365 const char *__pyx_filename = NULL;
18366 int __pyx_clineno = 0;
18367 __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
18368
18369 /* "(tree fragment)":6
18370 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state):
18371 * cdef object __pyx_result
18372 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name') # <<<<<<<<<<<<<<
18373 * __pyx_result = Enum.__new__(__pyx_type)
18374 * if __pyx_state is not None:
18375*/
18376 __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)
18377
18378
18379 /* "(tree fragment)":7
18380 * cdef object __pyx_result
18381 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
18382 * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
18383 * if __pyx_state is not None:
18384 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18385*/
18386 __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_MemviewEnum_type);
18387 __Pyx_INCREF(__pyx_t_3);
18388 __pyx_t_4 = 0;
18389 {
18390 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
18391 __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));
18392 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18393 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
18394 __Pyx_GOTREF(__pyx_t_2);
18395 }
18396 __pyx_v___pyx_result = __pyx_t_2;
18397 __pyx_t_2 = 0;
18398
18399 /* "(tree fragment)":8
18400 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
18401 * __pyx_result = Enum.__new__(__pyx_type)
18402 * if __pyx_state is not None: # <<<<<<<<<<<<<<
18403 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18404 * return __pyx_result
18405*/
18406 __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
18407 if (__pyx_t_5) {
18408
18409
18410 /* "(tree fragment)":9
18411 * __pyx_result = Enum.__new__(__pyx_type)
18412 * if __pyx_state is not None:
18413 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
18414 * return __pyx_result
18415 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
18416*/
18417 if (unlikely(__pyx_v___pyx_state == Py_None)) {
18418 PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
18419 __PYX_ERR(1, 9, __pyx_L1_error)
18420 }
18421 __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)
18422 __Pyx_GOTREF(__pyx_t_2);
18423 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18424
18425 /* "(tree fragment)":8
18426 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
18427 * __pyx_result = Enum.__new__(__pyx_type)
18428 * if __pyx_state is not None: # <<<<<<<<<<<<<<
18429 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18430 * return __pyx_result
18431*/
18432 }
18433
18434 /* "(tree fragment)":10
18435 * if __pyx_state is not None:
18436 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18437 * return __pyx_result # <<<<<<<<<<<<<<
18438 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
18439 * __pyx_result.name = __pyx_state[0]
18440*/
18441 {
18442 PyObject *__pyx_temp;
18443 {
18444 __pyx_temp = __pyx_r;
18445 __Pyx_INCREF(__pyx_v___pyx_result);
18446 __pyx_r = __pyx_v___pyx_result;
18447 }
18448 __Pyx_XDECREF(__pyx_temp);
18449 }
18450 goto __pyx_L0;
18451
18452 /* "(tree fragment)":4
18453 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
18454 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
18455 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<<
18456 * cdef object __pyx_result
18457 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
18458*/
18459
18460 /* function exit code */
18461 __pyx_L1_error:;
18462 __Pyx_XDECREF(__pyx_t_2);
18463 __Pyx_XDECREF(__pyx_t_3);
18464 __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18465 __pyx_r = NULL;
18466 __pyx_L0:;
18467 __Pyx_XDECREF(__pyx_v___pyx_result);
18468 __Pyx_XGIVEREF(__pyx_r);
18469 __Pyx_RefNannyFinishContext();
18470 return __pyx_r;
18471}
18472
18473/* "(tree fragment)":11
18474 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18475 * return __pyx_result
18476 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple): # <<<<<<<<<<<<<<
18477 * __pyx_result.name = __pyx_state[0]
18478 * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
18479*/
18480
18481static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
18482 PyObject *__pyx_r = NULL;
18483 __Pyx_RefNannyDeclarations
18484 PyObject *__pyx_t_1 = NULL;
18485 int __pyx_t_2;
18486 int __pyx_lineno = 0;
18487 const char *__pyx_filename = NULL;
18488 int __pyx_clineno = 0;
18489 __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
18490
18491 /* "(tree fragment)":12
18492 * return __pyx_result
18493 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
18494 * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
18495 * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
18496*/
18497 __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)
18498 __Pyx_GOTREF(__pyx_t_1);
18499 __Pyx_GIVEREF(__pyx_t_1);
18500 __Pyx_GOTREF(__pyx_v___pyx_result->name);
18501 __Pyx_DECREF(__pyx_v___pyx_result->name);
18502 __pyx_v___pyx_result->name = __pyx_t_1;
18503 __pyx_t_1 = 0;
18504
18505 /* "(tree fragment)":13
18506 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
18507 * __pyx_result.name = __pyx_state[0]
18508 * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1) # <<<<<<<<<<<<<<
18509*/
18510 __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)
18511
18512
18513 /* "(tree fragment)":11
18514 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18515 * return __pyx_result
18516 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple): # <<<<<<<<<<<<<<
18517 * __pyx_result.name = __pyx_state[0]
18518 * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
18519*/
18520
18521 /* function exit code */
18522 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18523 goto __pyx_L0;
18524 __pyx_L1_error:;
18525 __Pyx_XDECREF(__pyx_t_1);
18526 __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
18527 __pyx_r = 0;
18528 __pyx_L0:;
18529 __Pyx_XGIVEREF(__pyx_r);
18530 __Pyx_RefNannyFinishContext();
18531 return __pyx_r;
18532}
18533
18534/* "BufferFormatFromTypeInfo":1467
18535 *
18536 *
18537 * @cname('__pyx_format_from_typeinfo') # <<<<<<<<<<<<<<
18538 * cdef bytes format_from_typeinfo(const __Pyx_TypeInfo *type):
18539 * cdef const __Pyx_StructField *field
18540*/
18541
18542static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo const *__pyx_v_type) {
18543 __Pyx_StructField const *__pyx_v_field;
18544 struct __pyx_typeinfo_string __pyx_v_fmt;
18545 PyObject *__pyx_v_part = 0;
18546 PyObject *__pyx_v_result = 0;
18547 PyObject *__pyx_v_alignment = NULL;
18548 PyObject *__pyx_v_parts = NULL;
18549 PyObject *__pyx_v_extents = NULL;
18550 Py_ssize_t __pyx_7genexpr__pyx_v_i;
18551 PyObject *__pyx_r = NULL;
18552 __Pyx_RefNannyDeclarations
18553 int __pyx_t_1;
18554 PyObject *__pyx_t_2 = NULL;
18555 __Pyx_StructField const *__pyx_t_3;
18556 PyObject *__pyx_t_4 = NULL;
18557 PyObject *__pyx_t_5 = NULL;
18558 int __pyx_t_6;
18559 int __pyx_t_7;
18560 int __pyx_t_8;
18561 Py_ssize_t __pyx_t_9;
18562 PyObject *__pyx_t_10[3];
18563 int __pyx_lineno = 0;
18564 const char *__pyx_filename = NULL;
18565 int __pyx_clineno = 0;
18566 __Pyx_RefNannySetupContext("format_from_typeinfo", 0);
18567
18568 /* "BufferFormatFromTypeInfo":1474
18569 * cdef Py_ssize_t i
18570 *
18571 * if type.typegroup == 'S': # <<<<<<<<<<<<<<
18572 * assert type.fields != NULL
18573 * assert type.fields.type != NULL
18574*/
18575 __pyx_t_1 = (__pyx_v_type->typegroup == 'S');
18576
18577 if (__pyx_t_1) {
18578
18579
18580 /* "BufferFormatFromTypeInfo":1475
18581 *
18582 * if type.typegroup == 'S':
18583 * assert type.fields != NULL # <<<<<<<<<<<<<<
18584 * assert type.fields.type != NULL
18585 *
18586*/
18587 #ifndef CYTHON_WITHOUT_ASSERTIONS
18588 if (unlikely(__pyx_assertions_enabled())) {
18589 __pyx_t_1 = (__pyx_v_type->fields != NULL);
18590
18591 if (unlikely(!__pyx_t_1)) {
18592 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
18593 __PYX_ERR(1, 1475, __pyx_L1_error)
18594 }
18595
18596 }
18597 #else
18598 if ((1)); else __PYX_ERR(1, 1475, __pyx_L1_error)
18599 #endif
18600
18601 /* "BufferFormatFromTypeInfo":1476
18602 * if type.typegroup == 'S':
18603 * assert type.fields != NULL
18604 * assert type.fields.type != NULL # <<<<<<<<<<<<<<
18605 *
18606 * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
18607*/
18608 #ifndef CYTHON_WITHOUT_ASSERTIONS
18609 if (unlikely(__pyx_assertions_enabled())) {
18610 __pyx_t_1 = (__pyx_v_type->fields->type != NULL);
18611
18612 if (unlikely(!__pyx_t_1)) {
18613 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
18614 __PYX_ERR(1, 1476, __pyx_L1_error)
18615 }
18616
18617 }
18618 #else
18619 if ((1)); else __PYX_ERR(1, 1476, __pyx_L1_error)
18620 #endif
18621
18622 /* "BufferFormatFromTypeInfo":1478
18623 * assert type.fields.type != NULL
18624 *
18625 * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<<
18626 * alignment = b'^'
18627 * else:
18628*/
18629 __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0);
18630
18631 if (__pyx_t_1) {
18632
18633
18634 /* "BufferFormatFromTypeInfo":1479
18635 *
18636 * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
18637 * alignment = b'^' # <<<<<<<<<<<<<<
18638 * else:
18639 * alignment = b''
18640*/
18641 __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__5);
18642 __pyx_v_alignment = __pyx_mstate_global->__pyx_kp_b__5;
18643
18644 /* "BufferFormatFromTypeInfo":1478
18645 * assert type.fields.type != NULL
18646 *
18647 * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<<
18648 * alignment = b'^'
18649 * else:
18650*/
18651 goto __pyx_L4;
18652 }
18653
18654 /* "BufferFormatFromTypeInfo":1481
18655 * alignment = b'^'
18656 * else:
18657 * alignment = b'' # <<<<<<<<<<<<<<
18658 *
18659 * parts = [b"T{"]
18660*/
18661 /*else*/ {
18662 __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__6);
18663 __pyx_v_alignment = __pyx_mstate_global->__pyx_kp_b__6;
18664 }
18665 __pyx_L4:;
18666
18667 /* "BufferFormatFromTypeInfo":1483
18668 * alignment = b''
18669 *
18670 * parts = [b"T{"] # <<<<<<<<<<<<<<
18671 * field = type.fields
18672 *
18673*/
18674 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1483, __pyx_L1_error)
18675 __Pyx_GOTREF(__pyx_t_2);
18676 __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b_T);
18677 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_b_T);
18678 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_mstate_global->__pyx_kp_b_T) != (0)) __PYX_ERR(1, 1483, __pyx_L1_error);
18679 __pyx_v_parts = ((PyObject*)__pyx_t_2);
18680 __pyx_t_2 = 0;
18681
18682 /* "BufferFormatFromTypeInfo":1484
18683 *
18684 * parts = [b"T{"]
18685 * field = type.fields # <<<<<<<<<<<<<<
18686 *
18687 * while field.type:
18688*/
18689 __pyx_t_3 = __pyx_v_type->fields;
18690
18691 __pyx_v_field = __pyx_t_3;
18692
18693 /* "BufferFormatFromTypeInfo":1486
18694 * field = type.fields
18695 *
18696 * while field.type: # <<<<<<<<<<<<<<
18697 * part = format_from_typeinfo(field.type)
18698 * parts.append(part + b':' + field.name + b':')
18699*/
18700 while (1) {
18701 __pyx_t_1 = (__pyx_v_field->type != 0);
18702
18703
18704 if (!__pyx_t_1) break;
18705
18706 /* "BufferFormatFromTypeInfo":1487
18707 *
18708 * while field.type:
18709 * part = format_from_typeinfo(field.type) # <<<<<<<<<<<<<<
18710 * parts.append(part + b':' + field.name + b':')
18711 * field += 1
18712*/
18713 __pyx_t_2 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1487, __pyx_L1_error)
18714 __Pyx_GOTREF(__pyx_t_2);
18715 __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_2));
18716 __pyx_t_2 = 0;
18717
18718 /* "BufferFormatFromTypeInfo":1488
18719 * while field.type:
18720 * part = format_from_typeinfo(field.type)
18721 * parts.append(part + b':' + field.name + b':') # <<<<<<<<<<<<<<
18722 * field += 1
18723 *
18724*/
18725 __pyx_t_2 = PyNumber_Add(__pyx_v_part, __pyx_mstate_global->__pyx_kp_b__7); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1488, __pyx_L1_error)
18726 __Pyx_GOTREF(__pyx_t_2);
18727 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1488, __pyx_L1_error)
18728 __Pyx_GOTREF(__pyx_t_4);
18729 __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1488, __pyx_L1_error)
18730 __Pyx_GOTREF(__pyx_t_5);
18731 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18732 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18733 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_mstate_global->__pyx_kp_b__7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1488, __pyx_L1_error)
18734 __Pyx_GOTREF(__pyx_t_4);
18735 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18736 __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_4); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1488, __pyx_L1_error)
18737 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18738
18739
18740 /* "BufferFormatFromTypeInfo":1489
18741 * part = format_from_typeinfo(field.type)
18742 * parts.append(part + b':' + field.name + b':')
18743 * field += 1 # <<<<<<<<<<<<<<
18744 *
18745 * result = alignment.join(parts) + b'}'
18746*/
18747 __pyx_v_field = (__pyx_v_field + 1);
18748 }
18749
18750 /* "BufferFormatFromTypeInfo":1491
18751 * field += 1
18752 *
18753 * result = alignment.join(parts) + b'}' # <<<<<<<<<<<<<<
18754 * else:
18755 * fmt = __Pyx_TypeInfoToFormat(type)
18756*/
18757 __pyx_t_4 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1491, __pyx_L1_error)
18758 __Pyx_GOTREF(__pyx_t_4);
18759 __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_mstate_global->__pyx_kp_b__8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1491, __pyx_L1_error)
18760 __Pyx_GOTREF(__pyx_t_5);
18761 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18762 __pyx_v_result = ((PyObject*)__pyx_t_5);
18763 __pyx_t_5 = 0;
18764
18765 /* "BufferFormatFromTypeInfo":1474
18766 * cdef Py_ssize_t i
18767 *
18768 * if type.typegroup == 'S': # <<<<<<<<<<<<<<
18769 * assert type.fields != NULL
18770 * assert type.fields.type != NULL
18771*/
18772 goto __pyx_L3;
18773 }
18774
18775 /* "BufferFormatFromTypeInfo":1493
18776 * result = alignment.join(parts) + b'}'
18777 * else:
18778 * fmt = __Pyx_TypeInfoToFormat(type) # <<<<<<<<<<<<<<
18779 * result = fmt.string
18780 * if type.arraysize[0]:
18781*/
18782 /*else*/ {
18783 __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type);
18784
18785 /* "BufferFormatFromTypeInfo":1494
18786 * else:
18787 * fmt = __Pyx_TypeInfoToFormat(type)
18788 * result = fmt.string # <<<<<<<<<<<<<<
18789 * if type.arraysize[0]:
18790 * extents = [f"{type.arraysize[i]}" for i in range(type.ndim)]
18791*/
18792 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1494, __pyx_L1_error)
18793 __Pyx_GOTREF(__pyx_t_5);
18794 __pyx_v_result = ((PyObject*)__pyx_t_5);
18795 __pyx_t_5 = 0;
18796
18797 /* "BufferFormatFromTypeInfo":1495
18798 * fmt = __Pyx_TypeInfoToFormat(type)
18799 * result = fmt.string
18800 * if type.arraysize[0]: # <<<<<<<<<<<<<<
18801 * extents = [f"{type.arraysize[i]}" for i in range(type.ndim)]
18802 * result = f"({u','.join(extents)})".encode('ascii') + result
18803*/
18804 __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0);
18805
18806 if (__pyx_t_1) {
18807
18808
18809 /* "BufferFormatFromTypeInfo":1496
18810 * result = fmt.string
18811 * if type.arraysize[0]:
18812 * extents = [f"{type.arraysize[i]}" for i in range(type.ndim)] # <<<<<<<<<<<<<<
18813 * result = f"({u','.join(extents)})".encode('ascii') + result
18814 *
18815*/
18816 { /* enter inner scope */
18817 __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1496, __pyx_L1_error)
18818 __Pyx_GOTREF(__pyx_t_5);
18819
18820 __pyx_t_7 = __pyx_v_type->ndim;
18821 __pyx_t_8 = __pyx_t_7;
18822
18823 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
18824 __pyx_7genexpr__pyx_v_i = __pyx_t_9;
18825 __pyx_t_4 = __Pyx_PyUnicode_From_size_t((__pyx_v_type->arraysize[__pyx_7genexpr__pyx_v_i]), 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1496, __pyx_L1_error)
18826 __Pyx_GOTREF(__pyx_t_4);
18827 __Pyx_GIVEREF(__pyx_t_4);
18828 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_5, __pyx_t_4))) __PYX_ERR(1, 1496, __pyx_L1_error)
18829 __pyx_t_4 = 0;
18830 }
18831
18832 } /* exit inner scope */
18833 __pyx_v_extents = ((PyObject*)__pyx_t_5);
18834 __pyx_t_5 = 0;
18835
18836 /* "BufferFormatFromTypeInfo":1497
18837 * if type.arraysize[0]:
18838 * extents = [f"{type.arraysize[i]}" for i in range(type.ndim)]
18839 * result = f"({u','.join(extents)})".encode('ascii') + result # <<<<<<<<<<<<<<
18840 *
18841 * return result
18842*/
18843 __pyx_t_5 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__10, __pyx_v_extents); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1497, __pyx_L1_error)
18844 __Pyx_GOTREF(__pyx_t_5);
18845 __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u__9;
18846 __pyx_t_10[1] = __pyx_t_5;
18847 __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u__11;
18848 __pyx_t_9 = 2;
18849 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
18850 __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10[1]);
18851 #endif
18852 __pyx_t_7 = 0;
18853 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
18854 __pyx_t_7 |= __Pyx_PyUnicode_KIND_04(__pyx_t_10[1]);
18855 #endif
18856 __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_10, 3, __pyx_t_9, __pyx_t_7);
18857 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1497, __pyx_L1_error)
18858 __Pyx_GOTREF(__pyx_t_4);
18859 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18860 __pyx_t_5 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1497, __pyx_L1_error)
18861 __Pyx_GOTREF(__pyx_t_5);
18862 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18863 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1497, __pyx_L1_error)
18864 __Pyx_GOTREF(__pyx_t_4);
18865 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18866 __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4));
18867 __pyx_t_4 = 0;
18868
18869 /* "BufferFormatFromTypeInfo":1495
18870 * fmt = __Pyx_TypeInfoToFormat(type)
18871 * result = fmt.string
18872 * if type.arraysize[0]: # <<<<<<<<<<<<<<
18873 * extents = [f"{type.arraysize[i]}" for i in range(type.ndim)]
18874 * result = f"({u','.join(extents)})".encode('ascii') + result
18875*/
18876 }
18877 }
18878 __pyx_L3:;
18879
18880 /* "BufferFormatFromTypeInfo":1499
18881 * result = f"({u','.join(extents)})".encode('ascii') + result
18882 *
18883 * return result # <<<<<<<<<<<<<<
18884*/
18885 {
18886 PyObject *__pyx_temp;
18887 {
18888 __pyx_temp = __pyx_r;
18889 __Pyx_INCREF(__pyx_v_result);
18890 __pyx_r = __pyx_v_result;
18891 }
18892 __Pyx_XDECREF(__pyx_temp);
18893 }
18894 goto __pyx_L0;
18895
18896 /* "BufferFormatFromTypeInfo":1467
18897 *
18898 *
18899 * @cname('__pyx_format_from_typeinfo') # <<<<<<<<<<<<<<
18900 * cdef bytes format_from_typeinfo(const __Pyx_TypeInfo *type):
18901 * cdef const __Pyx_StructField *field
18902*/
18903
18904 /* function exit code */
18905 __pyx_L1_error:;
18906 __Pyx_XDECREF(__pyx_t_2);
18907 __Pyx_XDECREF(__pyx_t_4);
18908 __Pyx_XDECREF(__pyx_t_5);
18909 __Pyx_AddTraceback("BufferFormatFromTypeInfo.format_from_typeinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
18910 __pyx_r = 0;
18911 __pyx_L0:;
18912
18913
18914 __Pyx_XDECREF(__pyx_v_part);
18915 __Pyx_XDECREF(__pyx_v_result);
18916 __Pyx_XDECREF(__pyx_v_alignment);
18917 __Pyx_XDECREF(__pyx_v_parts);
18918 __Pyx_XDECREF(__pyx_v_extents);
18919
18920 __Pyx_XGIVEREF(__pyx_r);
18921 __Pyx_RefNannyFinishContext();
18922 return __pyx_r;
18923}
18924
18925/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":230
18926 *
18927 * ctypedef class numpy.dtype [object PyArray_Descr, check_size ignore]:
18928 * @property # <<<<<<<<<<<<<<
18929 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
18930 * return PyDataType_TYPEOBJ(self)
18931*/
18932
18933static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self) {
18934 PyTypeObject *__pyx_r;
18935
18936 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":232
18937 * @property
18938 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
18939 * return PyDataType_TYPEOBJ(self) # <<<<<<<<<<<<<<
18940 *
18941 * @property
18942*/
18943 {
18944
18945 __pyx_r = PyDataType_TYPEOBJ(__pyx_v_self);
18946 }
18947 goto __pyx_L0;
18948
18949 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":230
18950 *
18951 * ctypedef class numpy.dtype [object PyArray_Descr, check_size ignore]:
18952 * @property # <<<<<<<<<<<<<<
18953 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
18954 * return PyDataType_TYPEOBJ(self)
18955*/
18956
18957 /* function exit code */
18958 __pyx_L0:;
18959 return __pyx_r;
18960}
18961
18962/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":234
18963 * return PyDataType_TYPEOBJ(self)
18964 *
18965 * @property # <<<<<<<<<<<<<<
18966 * cdef inline char kind(self) noexcept nogil:
18967 * return PyDataType_KIND(self)
18968*/
18969
18970static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self) {
18971 char __pyx_r;
18972
18973 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":236
18974 * @property
18975 * cdef inline char kind(self) noexcept nogil:
18976 * return PyDataType_KIND(self) # <<<<<<<<<<<<<<
18977 *
18978 * @property
18979*/
18980 {
18981
18982 __pyx_r = PyDataType_KIND(__pyx_v_self);
18983 }
18984 goto __pyx_L0;
18985
18986 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":234
18987 * return PyDataType_TYPEOBJ(self)
18988 *
18989 * @property # <<<<<<<<<<<<<<
18990 * cdef inline char kind(self) noexcept nogil:
18991 * return PyDataType_KIND(self)
18992*/
18993
18994 /* function exit code */
18995 __pyx_L0:;
18996 return __pyx_r;
18997}
18998
18999/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":238
19000 * return PyDataType_KIND(self)
19001 *
19002 * @property # <<<<<<<<<<<<<<
19003 * cdef inline char type(self) noexcept nogil:
19004 * return PyDataType_TYPE(self)
19005*/
19006
19007static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self) {
19008 char __pyx_r;
19009
19010 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":240
19011 * @property
19012 * cdef inline char type(self) noexcept nogil:
19013 * return PyDataType_TYPE(self) # <<<<<<<<<<<<<<
19014 *
19015 * # Numpy sometimes mutates this without warning (e.g. it'll
19016*/
19017 {
19018
19019 __pyx_r = PyDataType_TYPE(__pyx_v_self);
19020 }
19021 goto __pyx_L0;
19022
19023 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":238
19024 * return PyDataType_KIND(self)
19025 *
19026 * @property # <<<<<<<<<<<<<<
19027 * cdef inline char type(self) noexcept nogil:
19028 * return PyDataType_TYPE(self)
19029*/
19030
19031 /* function exit code */
19032 __pyx_L0:;
19033 return __pyx_r;
19034}
19035
19036/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":247
19037 * # PyArray_IsNativeByteOrder(dtype.byteorder) instead of
19038 * # directly accessing this field.
19039 * @property # <<<<<<<<<<<<<<
19040 * cdef inline char byteorder(self) noexcept nogil:
19041 * return PyDataType_BYTEORDER(self)
19042*/
19043
19044static CYTHON_INLINE char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self) {
19045 char __pyx_r;
19046
19047 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":249
19048 * @property
19049 * cdef inline char byteorder(self) noexcept nogil:
19050 * return PyDataType_BYTEORDER(self) # <<<<<<<<<<<<<<
19051 *
19052 * @property
19053*/
19054 {
19055
19056 __pyx_r = PyDataType_BYTEORDER(__pyx_v_self);
19057 }
19058 goto __pyx_L0;
19059
19060 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":247
19061 * # PyArray_IsNativeByteOrder(dtype.byteorder) instead of
19062 * # directly accessing this field.
19063 * @property # <<<<<<<<<<<<<<
19064 * cdef inline char byteorder(self) noexcept nogil:
19065 * return PyDataType_BYTEORDER(self)
19066*/
19067
19068 /* function exit code */
19069 __pyx_L0:;
19070 return __pyx_r;
19071}
19072
19073/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":251
19074 * return PyDataType_BYTEORDER(self)
19075 *
19076 * @property # <<<<<<<<<<<<<<
19077 * cdef inline int type_num(self) noexcept nogil:
19078 * return PyDataType_TYPENUM(self)
19079*/
19080
19081static CYTHON_INLINE int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self) {
19082 int __pyx_r;
19083
19084 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":253
19085 * @property
19086 * cdef inline int type_num(self) noexcept nogil:
19087 * return PyDataType_TYPENUM(self) # <<<<<<<<<<<<<<
19088 *
19089 * @property
19090*/
19091 {
19092
19093 __pyx_r = PyDataType_TYPENUM(__pyx_v_self);
19094 }
19095 goto __pyx_L0;
19096
19097 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":251
19098 * return PyDataType_BYTEORDER(self)
19099 *
19100 * @property # <<<<<<<<<<<<<<
19101 * cdef inline int type_num(self) noexcept nogil:
19102 * return PyDataType_TYPENUM(self)
19103*/
19104
19105 /* function exit code */
19106 __pyx_L0:;
19107 return __pyx_r;
19108}
19109
19110/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":255
19111 * return PyDataType_TYPENUM(self)
19112 *
19113 * @property # <<<<<<<<<<<<<<
19114 * cdef inline npy_intp itemsize(self) noexcept nogil:
19115 * return PyDataType_ELSIZE(self)
19116*/
19117
19118static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self) {
19119 npy_intp __pyx_r;
19120
19121 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":257
19122 * @property
19123 * cdef inline npy_intp itemsize(self) noexcept nogil:
19124 * return PyDataType_ELSIZE(self) # <<<<<<<<<<<<<<
19125 *
19126 * @property
19127*/
19128 {
19129
19130 __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
19131 }
19132 goto __pyx_L0;
19133
19134 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":255
19135 * return PyDataType_TYPENUM(self)
19136 *
19137 * @property # <<<<<<<<<<<<<<
19138 * cdef inline npy_intp itemsize(self) noexcept nogil:
19139 * return PyDataType_ELSIZE(self)
19140*/
19141
19142 /* function exit code */
19143 __pyx_L0:;
19144 return __pyx_r;
19145}
19146
19147/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":259
19148 * return PyDataType_ELSIZE(self)
19149 *
19150 * @property # <<<<<<<<<<<<<<
19151 * cdef inline npy_intp alignment(self) noexcept nogil:
19152 * return PyDataType_ALIGNMENT(self)
19153*/
19154
19155static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self) {
19156 npy_intp __pyx_r;
19157
19158 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":261
19159 * @property
19160 * cdef inline npy_intp alignment(self) noexcept nogil:
19161 * return PyDataType_ALIGNMENT(self) # <<<<<<<<<<<<<<
19162 *
19163 * # Use fields/names with care as they may be NULL. You must check
19164*/
19165 {
19166
19167 __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
19168 }
19169 goto __pyx_L0;
19170
19171 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":259
19172 * return PyDataType_ELSIZE(self)
19173 *
19174 * @property # <<<<<<<<<<<<<<
19175 * cdef inline npy_intp alignment(self) noexcept nogil:
19176 * return PyDataType_ALIGNMENT(self)
19177*/
19178
19179 /* function exit code */
19180 __pyx_L0:;
19181 return __pyx_r;
19182}
19183
19184/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":265
19185 * # Use fields/names with care as they may be NULL. You must check
19186 * # for this using PyDataType_HASFIELDS.
19187 * @property # <<<<<<<<<<<<<<
19188 * cdef inline object fields(self):
19189 * return <object>PyDataType_FIELDS(self)
19190*/
19191
19192static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self) {
19193 PyObject *__pyx_r = NULL;
19194 __Pyx_RefNannyDeclarations
19195 PyObject *__pyx_t_1;
19196 __Pyx_RefNannySetupContext("__get__", 0);
19197
19198 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":267
19199 * @property
19200 * cdef inline object fields(self):
19201 * return <object>PyDataType_FIELDS(self) # <<<<<<<<<<<<<<
19202 *
19203 * @property
19204*/
19205 __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
19206
19207 {
19208 PyObject *__pyx_temp;
19209 {
19210 __pyx_temp = __pyx_r;
19211 __Pyx_INCREF(((PyObject *)__pyx_t_1));
19212 __pyx_r = ((PyObject *)__pyx_t_1);
19213 }
19214 __Pyx_XDECREF(__pyx_temp);
19215 }
19216
19217 goto __pyx_L0;
19218
19219 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":265
19220 * # Use fields/names with care as they may be NULL. You must check
19221 * # for this using PyDataType_HASFIELDS.
19222 * @property # <<<<<<<<<<<<<<
19223 * cdef inline object fields(self):
19224 * return <object>PyDataType_FIELDS(self)
19225*/
19226
19227 /* function exit code */
19228 __pyx_L0:;
19229 __Pyx_XGIVEREF(__pyx_r);
19230 __Pyx_RefNannyFinishContext();
19231 return __pyx_r;
19232}
19233
19234/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":269
19235 * return <object>PyDataType_FIELDS(self)
19236 *
19237 * @property # <<<<<<<<<<<<<<
19238 * cdef inline tuple names(self):
19239 * return <tuple>PyDataType_NAMES(self)
19240*/
19241
19242static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self) {
19243 PyObject *__pyx_r = NULL;
19244 __Pyx_RefNannyDeclarations
19245 PyObject *__pyx_t_1;
19246 __Pyx_RefNannySetupContext("__get__", 0);
19247
19248 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":271
19249 * @property
19250 * cdef inline tuple names(self):
19251 * return <tuple>PyDataType_NAMES(self) # <<<<<<<<<<<<<<
19252 *
19253 * # Use PyDataType_HASSUBARRAY to test whether this field is
19254*/
19255 __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
19256
19257 {
19258 PyObject *__pyx_temp;
19259 {
19260 __pyx_temp = __pyx_r;
19261 __Pyx_INCREF(((PyObject*)__pyx_t_1));
19262 __pyx_r = ((PyObject*)__pyx_t_1);
19263 }
19264 __Pyx_XDECREF(__pyx_temp);
19265 }
19266
19267 goto __pyx_L0;
19268
19269 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":269
19270 * return <object>PyDataType_FIELDS(self)
19271 *
19272 * @property # <<<<<<<<<<<<<<
19273 * cdef inline tuple names(self):
19274 * return <tuple>PyDataType_NAMES(self)
19275*/
19276
19277 /* function exit code */
19278 __pyx_L0:;
19279 __Pyx_XGIVEREF(__pyx_r);
19280 __Pyx_RefNannyFinishContext();
19281 return __pyx_r;
19282}
19283
19284/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":276
19285 * # valid (the pointer can be NULL). Most users should access
19286 * # this field via the inline helper method PyDataType_SHAPE.
19287 * @property # <<<<<<<<<<<<<<
19288 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
19289 * return PyDataType_SUBARRAY(self)
19290*/
19291
19292static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self) {
19293 PyArray_ArrayDescr *__pyx_r;
19294
19295 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":278
19296 * @property
19297 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
19298 * return PyDataType_SUBARRAY(self) # <<<<<<<<<<<<<<
19299 *
19300 * @property
19301*/
19302 {
19303
19304 __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
19305 }
19306 goto __pyx_L0;
19307
19308 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":276
19309 * # valid (the pointer can be NULL). Most users should access
19310 * # this field via the inline helper method PyDataType_SHAPE.
19311 * @property # <<<<<<<<<<<<<<
19312 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
19313 * return PyDataType_SUBARRAY(self)
19314*/
19315
19316 /* function exit code */
19317 __pyx_L0:;
19318 return __pyx_r;
19319}
19320
19321/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":280
19322 * return PyDataType_SUBARRAY(self)
19323 *
19324 * @property # <<<<<<<<<<<<<<
19325 * cdef inline npy_uint64 flags(self) noexcept nogil:
19326 * """The data types flags."""
19327*/
19328
19329static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self) {
19330 npy_uint64 __pyx_r;
19331
19332 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":283
19333 * cdef inline npy_uint64 flags(self) noexcept nogil:
19334 * """The data types flags."""
19335 * return PyDataType_FLAGS(self) # <<<<<<<<<<<<<<
19336 *
19337 *
19338*/
19339 {
19340
19341 __pyx_r = PyDataType_FLAGS(__pyx_v_self);
19342 }
19343 goto __pyx_L0;
19344
19345 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":280
19346 * return PyDataType_SUBARRAY(self)
19347 *
19348 * @property # <<<<<<<<<<<<<<
19349 * cdef inline npy_uint64 flags(self) noexcept nogil:
19350 * """The data types flags."""
19351*/
19352
19353 /* function exit code */
19354 __pyx_L0:;
19355 return __pyx_r;
19356}
19357
19358/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":292
19359 * ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]:
19360 *
19361 * @property # <<<<<<<<<<<<<<
19362 * cdef inline int numiter(self) noexcept nogil:
19363 * """The number of arrays that need to be broadcast to the same shape."""
19364*/
19365
19366static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self) {
19367 int __pyx_r;
19368
19369 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":295
19370 * cdef inline int numiter(self) noexcept nogil:
19371 * """The number of arrays that need to be broadcast to the same shape."""
19372 * return PyArray_MultiIter_NUMITER(self) # <<<<<<<<<<<<<<
19373 *
19374 * @property
19375*/
19376 {
19377
19378 __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
19379 }
19380 goto __pyx_L0;
19381
19382 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":292
19383 * ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]:
19384 *
19385 * @property # <<<<<<<<<<<<<<
19386 * cdef inline int numiter(self) noexcept nogil:
19387 * """The number of arrays that need to be broadcast to the same shape."""
19388*/
19389
19390 /* function exit code */
19391 __pyx_L0:;
19392 return __pyx_r;
19393}
19394
19395/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":297
19396 * return PyArray_MultiIter_NUMITER(self)
19397 *
19398 * @property # <<<<<<<<<<<<<<
19399 * cdef inline npy_intp size(self) noexcept nogil:
19400 * """The total broadcasted size."""
19401*/
19402
19403static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self) {
19404 npy_intp __pyx_r;
19405
19406 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":300
19407 * cdef inline npy_intp size(self) noexcept nogil:
19408 * """The total broadcasted size."""
19409 * return PyArray_MultiIter_SIZE(self) # <<<<<<<<<<<<<<
19410 *
19411 * @property
19412*/
19413 {
19414
19415 __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
19416 }
19417 goto __pyx_L0;
19418
19419 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":297
19420 * return PyArray_MultiIter_NUMITER(self)
19421 *
19422 * @property # <<<<<<<<<<<<<<
19423 * cdef inline npy_intp size(self) noexcept nogil:
19424 * """The total broadcasted size."""
19425*/
19426
19427 /* function exit code */
19428 __pyx_L0:;
19429 return __pyx_r;
19430}
19431
19432/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":302
19433 * return PyArray_MultiIter_SIZE(self)
19434 *
19435 * @property # <<<<<<<<<<<<<<
19436 * cdef inline npy_intp index(self) noexcept nogil:
19437 * """The current (1-d) index into the broadcasted result."""
19438*/
19439
19440static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self) {
19441 npy_intp __pyx_r;
19442
19443 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":305
19444 * cdef inline npy_intp index(self) noexcept nogil:
19445 * """The current (1-d) index into the broadcasted result."""
19446 * return PyArray_MultiIter_INDEX(self) # <<<<<<<<<<<<<<
19447 *
19448 * @property
19449*/
19450 {
19451
19452 __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
19453 }
19454 goto __pyx_L0;
19455
19456 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":302
19457 * return PyArray_MultiIter_SIZE(self)
19458 *
19459 * @property # <<<<<<<<<<<<<<
19460 * cdef inline npy_intp index(self) noexcept nogil:
19461 * """The current (1-d) index into the broadcasted result."""
19462*/
19463
19464 /* function exit code */
19465 __pyx_L0:;
19466 return __pyx_r;
19467}
19468
19469/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":307
19470 * return PyArray_MultiIter_INDEX(self)
19471 *
19472 * @property # <<<<<<<<<<<<<<
19473 * cdef inline int nd(self) noexcept nogil:
19474 * """The number of dimensions in the broadcasted result."""
19475*/
19476
19477static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self) {
19478 int __pyx_r;
19479
19480 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":310
19481 * cdef inline int nd(self) noexcept nogil:
19482 * """The number of dimensions in the broadcasted result."""
19483 * return PyArray_MultiIter_NDIM(self) # <<<<<<<<<<<<<<
19484 *
19485 * @property
19486*/
19487 {
19488
19489 __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
19490 }
19491 goto __pyx_L0;
19492
19493 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":307
19494 * return PyArray_MultiIter_INDEX(self)
19495 *
19496 * @property # <<<<<<<<<<<<<<
19497 * cdef inline int nd(self) noexcept nogil:
19498 * """The number of dimensions in the broadcasted result."""
19499*/
19500
19501 /* function exit code */
19502 __pyx_L0:;
19503 return __pyx_r;
19504}
19505
19506/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":312
19507 * return PyArray_MultiIter_NDIM(self)
19508 *
19509 * @property # <<<<<<<<<<<<<<
19510 * cdef inline npy_intp* dimensions(self) noexcept nogil:
19511 * """The shape of the broadcasted result."""
19512*/
19513
19514static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self) {
19515 npy_intp *__pyx_r;
19516
19517 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":315
19518 * cdef inline npy_intp* dimensions(self) noexcept nogil:
19519 * """The shape of the broadcasted result."""
19520 * return PyArray_MultiIter_DIMS(self) # <<<<<<<<<<<<<<
19521 *
19522 * @property
19523*/
19524 {
19525
19526 __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
19527 }
19528 goto __pyx_L0;
19529
19530 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":312
19531 * return PyArray_MultiIter_NDIM(self)
19532 *
19533 * @property # <<<<<<<<<<<<<<
19534 * cdef inline npy_intp* dimensions(self) noexcept nogil:
19535 * """The shape of the broadcasted result."""
19536*/
19537
19538 /* function exit code */
19539 __pyx_L0:;
19540 return __pyx_r;
19541}
19542
19543/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":317
19544 * return PyArray_MultiIter_DIMS(self)
19545 *
19546 * @property # <<<<<<<<<<<<<<
19547 * cdef inline void** iters(self) noexcept nogil:
19548 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
19549*/
19550
19551static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self) {
19552 void **__pyx_r;
19553
19554 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":321
19555 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
19556 * On return, the iterators are adjusted for broadcasting."""
19557 * return PyArray_MultiIter_ITERS(self) # <<<<<<<<<<<<<<
19558 *
19559 *
19560*/
19561 {
19562
19563 __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
19564 }
19565 goto __pyx_L0;
19566
19567 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":317
19568 * return PyArray_MultiIter_DIMS(self)
19569 *
19570 * @property # <<<<<<<<<<<<<<
19571 * cdef inline void** iters(self) noexcept nogil:
19572 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
19573*/
19574
19575 /* function exit code */
19576 __pyx_L0:;
19577 return __pyx_r;
19578}
19579
19580/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":335
19581 * # Instead, we use properties that map to the corresponding C-API functions.
19582 *
19583 * @property # <<<<<<<<<<<<<<
19584 * cdef inline PyObject* base(self) noexcept nogil:
19585 * """Returns a borrowed reference to the object owning the data/memory.
19586*/
19587
19588static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self) {
19589 PyObject *__pyx_r;
19590
19591 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":339
19592 * """Returns a borrowed reference to the object owning the data/memory.
19593 * """
19594 * return PyArray_BASE(self) # <<<<<<<<<<<<<<
19595 *
19596 * @property
19597*/
19598 {
19599
19600 __pyx_r = PyArray_BASE(__pyx_v_self);
19601 }
19602 goto __pyx_L0;
19603
19604 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":335
19605 * # Instead, we use properties that map to the corresponding C-API functions.
19606 *
19607 * @property # <<<<<<<<<<<<<<
19608 * cdef inline PyObject* base(self) noexcept nogil:
19609 * """Returns a borrowed reference to the object owning the data/memory.
19610*/
19611
19612 /* function exit code */
19613 __pyx_L0:;
19614 return __pyx_r;
19615}
19616
19617/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":341
19618 * return PyArray_BASE(self)
19619 *
19620 * @property # <<<<<<<<<<<<<<
19621 * cdef inline dtype descr(self):
19622 * """Returns an owned reference to the dtype of the array.
19623*/
19624
19625static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self) {
19626 PyArray_Descr *__pyx_r = NULL;
19627 __Pyx_RefNannyDeclarations
19628 PyArray_Descr *__pyx_t_1;
19629 __Pyx_RefNannySetupContext("__get__", 0);
19630
19631 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":345
19632 * """Returns an owned reference to the dtype of the array.
19633 * """
19634 * return <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
19635 *
19636 * @property
19637*/
19638 __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
19639
19640 {
19641 PyArray_Descr *__pyx_temp;
19642 {
19643 __pyx_temp = __pyx_r;
19644 __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
19645 __pyx_r = ((PyArray_Descr *)__pyx_t_1);
19646 }
19647 __Pyx_XDECREF((PyObject *)__pyx_temp);
19648 }
19649
19650 goto __pyx_L0;
19651
19652 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":341
19653 * return PyArray_BASE(self)
19654 *
19655 * @property # <<<<<<<<<<<<<<
19656 * cdef inline dtype descr(self):
19657 * """Returns an owned reference to the dtype of the array.
19658*/
19659
19660 /* function exit code */
19661 __pyx_L0:;
19662 __Pyx_XGIVEREF((PyObject *)__pyx_r);
19663 __Pyx_RefNannyFinishContext();
19664 return __pyx_r;
19665}
19666
19667/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":347
19668 * return <dtype>PyArray_DESCR(self)
19669 *
19670 * @property # <<<<<<<<<<<<<<
19671 * cdef inline int ndim(self) noexcept nogil:
19672 * """Returns the number of dimensions in the array.
19673*/
19674
19675static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self) {
19676 int __pyx_r;
19677
19678 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":351
19679 * """Returns the number of dimensions in the array.
19680 * """
19681 * return PyArray_NDIM(self) # <<<<<<<<<<<<<<
19682 *
19683 * @property
19684*/
19685 {
19686
19687 __pyx_r = PyArray_NDIM(__pyx_v_self);
19688 }
19689 goto __pyx_L0;
19690
19691 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":347
19692 * return <dtype>PyArray_DESCR(self)
19693 *
19694 * @property # <<<<<<<<<<<<<<
19695 * cdef inline int ndim(self) noexcept nogil:
19696 * """Returns the number of dimensions in the array.
19697*/
19698
19699 /* function exit code */
19700 __pyx_L0:;
19701 return __pyx_r;
19702}
19703
19704/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":353
19705 * return PyArray_NDIM(self)
19706 *
19707 * @property # <<<<<<<<<<<<<<
19708 * cdef inline npy_intp *shape(self) noexcept nogil:
19709 * """Returns a pointer to the dimensions/shape of the array.
19710*/
19711
19712static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self) {
19713 npy_intp *__pyx_r;
19714
19715 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":359
19716 * Can return NULL for 0-dimensional arrays.
19717 * """
19718 * return PyArray_DIMS(self) # <<<<<<<<<<<<<<
19719 *
19720 * @property
19721*/
19722 {
19723
19724 __pyx_r = PyArray_DIMS(__pyx_v_self);
19725 }
19726 goto __pyx_L0;
19727
19728 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":353
19729 * return PyArray_NDIM(self)
19730 *
19731 * @property # <<<<<<<<<<<<<<
19732 * cdef inline npy_intp *shape(self) noexcept nogil:
19733 * """Returns a pointer to the dimensions/shape of the array.
19734*/
19735
19736 /* function exit code */
19737 __pyx_L0:;
19738 return __pyx_r;
19739}
19740
19741/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":361
19742 * return PyArray_DIMS(self)
19743 *
19744 * @property # <<<<<<<<<<<<<<
19745 * cdef inline npy_intp *strides(self) noexcept nogil:
19746 * """Returns a pointer to the strides of the array.
19747*/
19748
19749static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self) {
19750 npy_intp *__pyx_r;
19751
19752 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":366
19753 * The number of elements matches the number of dimensions of the array (ndim).
19754 * """
19755 * return PyArray_STRIDES(self) # <<<<<<<<<<<<<<
19756 *
19757 * @property
19758*/
19759 {
19760
19761 __pyx_r = PyArray_STRIDES(__pyx_v_self);
19762 }
19763 goto __pyx_L0;
19764
19765 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":361
19766 * return PyArray_DIMS(self)
19767 *
19768 * @property # <<<<<<<<<<<<<<
19769 * cdef inline npy_intp *strides(self) noexcept nogil:
19770 * """Returns a pointer to the strides of the array.
19771*/
19772
19773 /* function exit code */
19774 __pyx_L0:;
19775 return __pyx_r;
19776}
19777
19778/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":368
19779 * return PyArray_STRIDES(self)
19780 *
19781 * @property # <<<<<<<<<<<<<<
19782 * cdef inline npy_intp size(self) noexcept nogil:
19783 * """Returns the total size (in number of elements) of the array.
19784*/
19785
19786static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self) {
19787 npy_intp __pyx_r;
19788
19789 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":372
19790 * """Returns the total size (in number of elements) of the array.
19791 * """
19792 * return PyArray_SIZE(self) # <<<<<<<<<<<<<<
19793 *
19794 * @property
19795*/
19796 {
19797
19798 __pyx_r = PyArray_SIZE(__pyx_v_self);
19799 }
19800 goto __pyx_L0;
19801
19802 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":368
19803 * return PyArray_STRIDES(self)
19804 *
19805 * @property # <<<<<<<<<<<<<<
19806 * cdef inline npy_intp size(self) noexcept nogil:
19807 * """Returns the total size (in number of elements) of the array.
19808*/
19809
19810 /* function exit code */
19811 __pyx_L0:;
19812 return __pyx_r;
19813}
19814
19815/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":374
19816 * return PyArray_SIZE(self)
19817 *
19818 * @property # <<<<<<<<<<<<<<
19819 * cdef inline char* data(self) noexcept nogil:
19820 * """The pointer to the data buffer as a char*.
19821*/
19822
19823static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self) {
19824 char *__pyx_r;
19825
19826 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":381
19827 * of `PyArray_DATA()` instead, which returns a 'void*'.
19828 * """
19829 * return PyArray_BYTES(self) # <<<<<<<<<<<<<<
19830 *
19831 *
19832*/
19833 {
19834
19835 __pyx_r = PyArray_BYTES(__pyx_v_self);
19836 }
19837 goto __pyx_L0;
19838
19839 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":374
19840 * return PyArray_SIZE(self)
19841 *
19842 * @property # <<<<<<<<<<<<<<
19843 * cdef inline char* data(self) noexcept nogil:
19844 * """The pointer to the data buffer as a char*.
19845*/
19846
19847 /* function exit code */
19848 __pyx_L0:;
19849 return __pyx_r;
19850}
19851
19852/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":794
19853 * ctypedef long double complex clongdouble_t
19854 *
19855 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
19856 * return PyArray_MultiIterNew(1, <void*>a)
19857 *
19858*/
19859
19860static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
19861 PyObject *__pyx_r = NULL;
19862 __Pyx_RefNannyDeclarations
19863 PyObject *__pyx_t_1 = NULL;
19864 int __pyx_lineno = 0;
19865 const char *__pyx_filename = NULL;
19866 int __pyx_clineno = 0;
19867 __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
19868
19869 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":795
19870 *
19871 * cdef inline object PyArray_MultiIterNew1(a):
19872 * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
19873 *
19874 * cdef inline object PyArray_MultiIterNew2(a, b):
19875*/
19876 __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 795, __pyx_L1_error)
19877 __Pyx_GOTREF(__pyx_t_1);
19878 {
19879 PyObject *__pyx_temp;
19880 {
19881 __pyx_temp = __pyx_r;
19882 __pyx_r = __pyx_t_1;
19883 }
19884 __Pyx_XDECREF(__pyx_temp);
19885 }
19886 __pyx_t_1 = 0;
19887 goto __pyx_L0;
19888
19889 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":794
19890 * ctypedef long double complex clongdouble_t
19891 *
19892 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
19893 * return PyArray_MultiIterNew(1, <void*>a)
19894 *
19895*/
19896
19897 /* function exit code */
19898 __pyx_L1_error:;
19899 __Pyx_XDECREF(__pyx_t_1);
19900 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
19901 __pyx_r = 0;
19902 __pyx_L0:;
19903 __Pyx_XGIVEREF(__pyx_r);
19904 __Pyx_RefNannyFinishContext();
19905 return __pyx_r;
19906}
19907
19908/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":797
19909 * return PyArray_MultiIterNew(1, <void*>a)
19910 *
19911 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
19912 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19913 *
19914*/
19915
19916static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
19917 PyObject *__pyx_r = NULL;
19918 __Pyx_RefNannyDeclarations
19919 PyObject *__pyx_t_1 = NULL;
19920 int __pyx_lineno = 0;
19921 const char *__pyx_filename = NULL;
19922 int __pyx_clineno = 0;
19923 __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
19924
19925 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":798
19926 *
19927 * cdef inline object PyArray_MultiIterNew2(a, b):
19928 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
19929 *
19930 * cdef inline object PyArray_MultiIterNew3(a, b, c):
19931*/
19932 __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)
19933 __Pyx_GOTREF(__pyx_t_1);
19934 {
19935 PyObject *__pyx_temp;
19936 {
19937 __pyx_temp = __pyx_r;
19938 __pyx_r = __pyx_t_1;
19939 }
19940 __Pyx_XDECREF(__pyx_temp);
19941 }
19942 __pyx_t_1 = 0;
19943 goto __pyx_L0;
19944
19945 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":797
19946 * return PyArray_MultiIterNew(1, <void*>a)
19947 *
19948 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
19949 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19950 *
19951*/
19952
19953 /* function exit code */
19954 __pyx_L1_error:;
19955 __Pyx_XDECREF(__pyx_t_1);
19956 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
19957 __pyx_r = 0;
19958 __pyx_L0:;
19959 __Pyx_XGIVEREF(__pyx_r);
19960 __Pyx_RefNannyFinishContext();
19961 return __pyx_r;
19962}
19963
19964/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":800
19965 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19966 *
19967 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
19968 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19969 *
19970*/
19971
19972static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
19973 PyObject *__pyx_r = NULL;
19974 __Pyx_RefNannyDeclarations
19975 PyObject *__pyx_t_1 = NULL;
19976 int __pyx_lineno = 0;
19977 const char *__pyx_filename = NULL;
19978 int __pyx_clineno = 0;
19979 __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
19980
19981 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":801
19982 *
19983 * cdef inline object PyArray_MultiIterNew3(a, b, c):
19984 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
19985 *
19986 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
19987*/
19988 __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)
19989 __Pyx_GOTREF(__pyx_t_1);
19990 {
19991 PyObject *__pyx_temp;
19992 {
19993 __pyx_temp = __pyx_r;
19994 __pyx_r = __pyx_t_1;
19995 }
19996 __Pyx_XDECREF(__pyx_temp);
19997 }
19998 __pyx_t_1 = 0;
19999 goto __pyx_L0;
20000
20001 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":800
20002 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
20003 *
20004 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
20005 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
20006 *
20007*/
20008
20009 /* function exit code */
20010 __pyx_L1_error:;
20011 __Pyx_XDECREF(__pyx_t_1);
20012 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
20013 __pyx_r = 0;
20014 __pyx_L0:;
20015 __Pyx_XGIVEREF(__pyx_r);
20016 __Pyx_RefNannyFinishContext();
20017 return __pyx_r;
20018}
20019
20020/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":803
20021 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
20022 *
20023 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
20024 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
20025 *
20026*/
20027
20028static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
20029 PyObject *__pyx_r = NULL;
20030 __Pyx_RefNannyDeclarations
20031 PyObject *__pyx_t_1 = NULL;
20032 int __pyx_lineno = 0;
20033 const char *__pyx_filename = NULL;
20034 int __pyx_clineno = 0;
20035 __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
20036
20037 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":804
20038 *
20039 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
20040 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
20041 *
20042 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
20043*/
20044 __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)
20045 __Pyx_GOTREF(__pyx_t_1);
20046 {
20047 PyObject *__pyx_temp;
20048 {
20049 __pyx_temp = __pyx_r;
20050 __pyx_r = __pyx_t_1;
20051 }
20052 __Pyx_XDECREF(__pyx_temp);
20053 }
20054 __pyx_t_1 = 0;
20055 goto __pyx_L0;
20056
20057 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":803
20058 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
20059 *
20060 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
20061 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
20062 *
20063*/
20064
20065 /* function exit code */
20066 __pyx_L1_error:;
20067 __Pyx_XDECREF(__pyx_t_1);
20068 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
20069 __pyx_r = 0;
20070 __pyx_L0:;
20071 __Pyx_XGIVEREF(__pyx_r);
20072 __Pyx_RefNannyFinishContext();
20073 return __pyx_r;
20074}
20075
20076/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":806
20077 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
20078 *
20079 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
20080 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20081 *
20082*/
20083
20084static 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) {
20085 PyObject *__pyx_r = NULL;
20086 __Pyx_RefNannyDeclarations
20087 PyObject *__pyx_t_1 = NULL;
20088 int __pyx_lineno = 0;
20089 const char *__pyx_filename = NULL;
20090 int __pyx_clineno = 0;
20091 __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
20092
20093 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":807
20094 *
20095 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
20096 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
20097 *
20098 * cdef inline tuple PyDataType_SHAPE(dtype d):
20099*/
20100 __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)
20101 __Pyx_GOTREF(__pyx_t_1);
20102 {
20103 PyObject *__pyx_temp;
20104 {
20105 __pyx_temp = __pyx_r;
20106 __pyx_r = __pyx_t_1;
20107 }
20108 __Pyx_XDECREF(__pyx_temp);
20109 }
20110 __pyx_t_1 = 0;
20111 goto __pyx_L0;
20112
20113 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":806
20114 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
20115 *
20116 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
20117 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20118 *
20119*/
20120
20121 /* function exit code */
20122 __pyx_L1_error:;
20123 __Pyx_XDECREF(__pyx_t_1);
20124 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
20125 __pyx_r = 0;
20126 __pyx_L0:;
20127 __Pyx_XGIVEREF(__pyx_r);
20128 __Pyx_RefNannyFinishContext();
20129 return __pyx_r;
20130}
20131
20132/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":809
20133 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20134 *
20135 * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
20136 * if PyDataType_HASSUBARRAY(d):
20137 * return <tuple>d.subarray.shape
20138*/
20139
20140static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
20141 PyObject *__pyx_r = NULL;
20142 __Pyx_RefNannyDeclarations
20143 int __pyx_t_1;
20144 PyObject *__pyx_t_2;
20145 __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
20146
20147 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":810
20148 *
20149 * cdef inline tuple PyDataType_SHAPE(dtype d):
20150 * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
20151 * return <tuple>d.subarray.shape
20152 * else:
20153*/
20154 __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
20155
20156 if (__pyx_t_1) {
20157
20158
20159 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":811
20160 * cdef inline tuple PyDataType_SHAPE(dtype d):
20161 * if PyDataType_HASSUBARRAY(d):
20162 * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
20163 * else:
20164 * return ()
20165*/
20166 __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray___get__(__pyx_v_d)->shape;
20167
20168 {
20169 PyObject *__pyx_temp;
20170 {
20171 __pyx_temp = __pyx_r;
20172 __Pyx_INCREF(((PyObject*)__pyx_t_2));
20173 __pyx_r = ((PyObject*)__pyx_t_2);
20174 }
20175 __Pyx_XDECREF(__pyx_temp);
20176 }
20177
20178 goto __pyx_L0;
20179
20180 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":810
20181 *
20182 * cdef inline tuple PyDataType_SHAPE(dtype d):
20183 * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
20184 * return <tuple>d.subarray.shape
20185 * else:
20186*/
20187 }
20188
20189 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":813
20190 * return <tuple>d.subarray.shape
20191 * else:
20192 * return () # <<<<<<<<<<<<<<
20193 *
20194 *
20195*/
20196 /*else*/ {
20197 {
20198 PyObject *__pyx_temp;
20199 {
20200 __pyx_temp = __pyx_r;
20201 __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
20202 __pyx_r = __pyx_mstate_global->__pyx_empty_tuple;
20203 }
20204 __Pyx_XDECREF(__pyx_temp);
20205 }
20206 goto __pyx_L0;
20207 }
20208
20209 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":809
20210 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20211 *
20212 * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
20213 * if PyDataType_HASSUBARRAY(d):
20214 * return <tuple>d.subarray.shape
20215*/
20216
20217 /* function exit code */
20218 __pyx_L0:;
20219 __Pyx_XGIVEREF(__pyx_r);
20220 __Pyx_RefNannyFinishContext();
20221 return __pyx_r;
20222}
20223
20224/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":947
20225 *
20226 * ctypedef class numpy.ufunc [object PyUFuncObject, check_size ignore]:
20227 * @property # <<<<<<<<<<<<<<
20228 * cdef inline int nin(self) noexcept nogil:
20229 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
20230*/
20231
20232static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self) {
20233 int __pyx_r;
20234
20235 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":949
20236 * @property
20237 * cdef inline int nin(self) noexcept nogil:
20238 * return _PyUFuncObject_GET_ITEM_DATA(self).nin # <<<<<<<<<<<<<<
20239 *
20240 * @property
20241*/
20242 {
20243
20244 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nin;
20245 }
20246 goto __pyx_L0;
20247
20248 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":947
20249 *
20250 * ctypedef class numpy.ufunc [object PyUFuncObject, check_size ignore]:
20251 * @property # <<<<<<<<<<<<<<
20252 * cdef inline int nin(self) noexcept nogil:
20253 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
20254*/
20255
20256 /* function exit code */
20257 __pyx_L0:;
20258 return __pyx_r;
20259}
20260
20261/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":951
20262 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
20263 *
20264 * @property # <<<<<<<<<<<<<<
20265 * cdef inline int nout(self) noexcept nogil:
20266 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
20267*/
20268
20269static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self) {
20270 int __pyx_r;
20271
20272 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":953
20273 * @property
20274 * cdef inline int nout(self) noexcept nogil:
20275 * return _PyUFuncObject_GET_ITEM_DATA(self).nout # <<<<<<<<<<<<<<
20276 *
20277 * @property
20278*/
20279 {
20280
20281 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nout;
20282 }
20283 goto __pyx_L0;
20284
20285 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":951
20286 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
20287 *
20288 * @property # <<<<<<<<<<<<<<
20289 * cdef inline int nout(self) noexcept nogil:
20290 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
20291*/
20292
20293 /* function exit code */
20294 __pyx_L0:;
20295 return __pyx_r;
20296}
20297
20298/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":955
20299 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
20300 *
20301 * @property # <<<<<<<<<<<<<<
20302 * cdef inline int nargs(self) noexcept nogil:
20303 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
20304*/
20305
20306static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self) {
20307 int __pyx_r;
20308
20309 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":957
20310 * @property
20311 * cdef inline int nargs(self) noexcept nogil:
20312 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs # <<<<<<<<<<<<<<
20313 *
20314 * @property
20315*/
20316 {
20317
20318 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nargs;
20319 }
20320 goto __pyx_L0;
20321
20322 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":955
20323 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
20324 *
20325 * @property # <<<<<<<<<<<<<<
20326 * cdef inline int nargs(self) noexcept nogil:
20327 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
20328*/
20329
20330 /* function exit code */
20331 __pyx_L0:;
20332 return __pyx_r;
20333}
20334
20335/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":959
20336 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
20337 *
20338 * @property # <<<<<<<<<<<<<<
20339 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
20340 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
20341*/
20342
20343static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self) {
20344 PyUFuncGenericFunction *__pyx_r;
20345
20346 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":961
20347 * @property
20348 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
20349 * return _PyUFuncObject_GET_ITEM_DATA(self).functions # <<<<<<<<<<<<<<
20350 *
20351 * @property
20352*/
20353 {
20354
20355 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->functions;
20356 }
20357 goto __pyx_L0;
20358
20359 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":959
20360 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
20361 *
20362 * @property # <<<<<<<<<<<<<<
20363 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
20364 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
20365*/
20366
20367 /* function exit code */
20368 __pyx_L0:;
20369 return __pyx_r;
20370}
20371
20372/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":963
20373 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
20374 *
20375 * @property # <<<<<<<<<<<<<<
20376 * cdef inline void ** data(self) noexcept nogil:
20377 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
20378*/
20379
20380static CYTHON_INLINE void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self) {
20381 void **__pyx_r;
20382
20383 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":965
20384 * @property
20385 * cdef inline void ** data(self) noexcept nogil:
20386 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data # <<<<<<<<<<<<<<
20387 *
20388 * @property
20389*/
20390 {
20391
20392 __pyx_r = ((void **)_PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->data);
20393 }
20394 goto __pyx_L0;
20395
20396 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":963
20397 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
20398 *
20399 * @property # <<<<<<<<<<<<<<
20400 * cdef inline void ** data(self) noexcept nogil:
20401 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
20402*/
20403
20404 /* function exit code */
20405 __pyx_L0:;
20406 return __pyx_r;
20407}
20408
20409/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":967
20410 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
20411 *
20412 * @property # <<<<<<<<<<<<<<
20413 * cdef inline int ntypes(self) noexcept nogil:
20414 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
20415*/
20416
20417static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self) {
20418 int __pyx_r;
20419
20420 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":969
20421 * @property
20422 * cdef inline int ntypes(self) noexcept nogil:
20423 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes # <<<<<<<<<<<<<<
20424 *
20425 * @property
20426*/
20427 {
20428
20429 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ntypes;
20430 }
20431 goto __pyx_L0;
20432
20433 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":967
20434 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
20435 *
20436 * @property # <<<<<<<<<<<<<<
20437 * cdef inline int ntypes(self) noexcept nogil:
20438 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
20439*/
20440
20441 /* function exit code */
20442 __pyx_L0:;
20443 return __pyx_r;
20444}
20445
20446/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":971
20447 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
20448 *
20449 * @property # <<<<<<<<<<<<<<
20450 * cdef inline const char* name(self) noexcept nogil:
20451 * return _PyUFuncObject_GET_ITEM_DATA(self).name
20452*/
20453
20454static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self) {
20455 char const *__pyx_r;
20456
20457 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":973
20458 * @property
20459 * cdef inline const char* name(self) noexcept nogil:
20460 * return _PyUFuncObject_GET_ITEM_DATA(self).name # <<<<<<<<<<<<<<
20461 *
20462 * @property
20463*/
20464 {
20465
20466 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->name;
20467 }
20468 goto __pyx_L0;
20469
20470 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":971
20471 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
20472 *
20473 * @property # <<<<<<<<<<<<<<
20474 * cdef inline const char* name(self) noexcept nogil:
20475 * return _PyUFuncObject_GET_ITEM_DATA(self).name
20476*/
20477
20478 /* function exit code */
20479 __pyx_L0:;
20480 return __pyx_r;
20481}
20482
20483/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":975
20484 * return _PyUFuncObject_GET_ITEM_DATA(self).name
20485 *
20486 * @property # <<<<<<<<<<<<<<
20487 * cdef inline const char* doc(self) noexcept nogil:
20488 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
20489*/
20490
20491static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self) {
20492 char const *__pyx_r;
20493
20494 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":977
20495 * @property
20496 * cdef inline const char* doc(self) noexcept nogil:
20497 * return _PyUFuncObject_GET_ITEM_DATA(self).doc # <<<<<<<<<<<<<<
20498 *
20499 * @property
20500*/
20501 {
20502
20503 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->doc;
20504 }
20505 goto __pyx_L0;
20506
20507 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":975
20508 * return _PyUFuncObject_GET_ITEM_DATA(self).name
20509 *
20510 * @property # <<<<<<<<<<<<<<
20511 * cdef inline const char* doc(self) noexcept nogil:
20512 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
20513*/
20514
20515 /* function exit code */
20516 __pyx_L0:;
20517 return __pyx_r;
20518}
20519
20520/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":979
20521 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
20522 *
20523 * @property # <<<<<<<<<<<<<<
20524 * cdef inline void* ptr(self) noexcept nogil:
20525 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
20526*/
20527
20528static CYTHON_INLINE void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self) {
20529 void *__pyx_r;
20530
20531 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":981
20532 * @property
20533 * cdef inline void* ptr(self) noexcept nogil:
20534 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr # <<<<<<<<<<<<<<
20535 *
20536 * @property
20537*/
20538 {
20539
20540 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ptr;
20541 }
20542 goto __pyx_L0;
20543
20544 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":979
20545 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
20546 *
20547 * @property # <<<<<<<<<<<<<<
20548 * cdef inline void* ptr(self) noexcept nogil:
20549 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
20550*/
20551
20552 /* function exit code */
20553 __pyx_L0:;
20554 return __pyx_r;
20555}
20556
20557/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":983
20558 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
20559 *
20560 * @property # <<<<<<<<<<<<<<
20561 * cdef inline PyObject* obj(self) noexcept nogil:
20562 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
20563*/
20564
20565static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self) {
20566 PyObject *__pyx_r;
20567
20568 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":985
20569 * @property
20570 * cdef inline PyObject* obj(self) noexcept nogil:
20571 * return _PyUFuncObject_GET_ITEM_DATA(self).obj # <<<<<<<<<<<<<<
20572 *
20573 * @property
20574*/
20575 {
20576
20577 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->obj;
20578 }
20579 goto __pyx_L0;
20580
20581 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":983
20582 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
20583 *
20584 * @property # <<<<<<<<<<<<<<
20585 * cdef inline PyObject* obj(self) noexcept nogil:
20586 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
20587*/
20588
20589 /* function exit code */
20590 __pyx_L0:;
20591 return __pyx_r;
20592}
20593
20594/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":987
20595 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
20596 *
20597 * @property # <<<<<<<<<<<<<<
20598 * cdef inline PyObject* userloops(self) noexcept nogil:
20599 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops
20600*/
20601
20602static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self) {
20603 PyObject *__pyx_r;
20604
20605 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":989
20606 * @property
20607 * cdef inline PyObject* userloops(self) noexcept nogil:
20608 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops # <<<<<<<<<<<<<<
20609 *
20610 * PyUFuncObject_fields *_PyUFuncObject_GET_ITEM_DATA(ufunc) nogil
20611*/
20612 {
20613
20614 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->userloops;
20615 }
20616 goto __pyx_L0;
20617
20618 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":987
20619 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
20620 *
20621 * @property # <<<<<<<<<<<<<<
20622 * cdef inline PyObject* userloops(self) noexcept nogil:
20623 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops
20624*/
20625
20626 /* function exit code */
20627 __pyx_L0:;
20628 return __pyx_r;
20629}
20630
20631/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1065
20632 * int _import_umath() except -1
20633 *
20634 * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
20635 * Py_INCREF(base) # important to do this before stealing the reference below!
20636 * PyArray_SetBaseObject(arr, base)
20637*/
20638
20639static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
20640 int __pyx_t_1;
20641 int __pyx_lineno = 0;
20642 const char *__pyx_filename = NULL;
20643 int __pyx_clineno = 0;
20644
20645 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1066
20646 *
20647 * cdef inline void set_array_base(ndarray arr, object base) except *:
20648 * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
20649 * PyArray_SetBaseObject(arr, base)
20650 *
20651*/
20652 Py_INCREF(__pyx_v_base);
20653
20654 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1067
20655 * cdef inline void set_array_base(ndarray arr, object base) except *:
20656 * Py_INCREF(base) # important to do this before stealing the reference below!
20657 * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
20658 *
20659 * cdef inline object get_array_base(ndarray arr):
20660*/
20661 __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)
20662
20663
20664 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1065
20665 * int _import_umath() except -1
20666 *
20667 * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
20668 * Py_INCREF(base) # important to do this before stealing the reference below!
20669 * PyArray_SetBaseObject(arr, base)
20670*/
20671
20672 /* function exit code */
20673 goto __pyx_L0;
20674 __pyx_L1_error:;
20675 __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
20676 __pyx_L0:;
20677
20678}
20679
20680/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1069
20681 * PyArray_SetBaseObject(arr, base)
20682 *
20683 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
20684 * base = PyArray_BASE(arr)
20685 * if base is NULL:
20686*/
20687
20688static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
20689 PyObject *__pyx_v_base;
20690 PyObject *__pyx_r = NULL;
20691 __Pyx_RefNannyDeclarations
20692 int __pyx_t_1;
20693 __Pyx_RefNannySetupContext("get_array_base", 0);
20694
20695 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1070
20696 *
20697 * cdef inline object get_array_base(ndarray arr):
20698 * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
20699 * if base is NULL:
20700 * return None
20701*/
20702 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
20703
20704 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1071
20705 * cdef inline object get_array_base(ndarray arr):
20706 * base = PyArray_BASE(arr)
20707 * if base is NULL: # <<<<<<<<<<<<<<
20708 * return None
20709 * return <object>base
20710*/
20711 __pyx_t_1 = (__pyx_v_base == NULL);
20712
20713 if (__pyx_t_1) {
20714
20715
20716 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1072
20717 * base = PyArray_BASE(arr)
20718 * if base is NULL:
20719 * return None # <<<<<<<<<<<<<<
20720 * return <object>base
20721 *
20722*/
20723 {
20724 PyObject *__pyx_temp;
20725 {
20726 __pyx_temp = __pyx_r;
20727 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20728 }
20729 __Pyx_XDECREF(__pyx_temp);
20730 }
20731 goto __pyx_L0;
20732
20733 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1071
20734 * cdef inline object get_array_base(ndarray arr):
20735 * base = PyArray_BASE(arr)
20736 * if base is NULL: # <<<<<<<<<<<<<<
20737 * return None
20738 * return <object>base
20739*/
20740 }
20741
20742 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1073
20743 * if base is NULL:
20744 * return None
20745 * return <object>base # <<<<<<<<<<<<<<
20746 *
20747 * # Versions of the import_* functions which are more suitable for
20748*/
20749 {
20750 PyObject *__pyx_temp;
20751 {
20752 __pyx_temp = __pyx_r;
20753 __Pyx_INCREF(((PyObject *)__pyx_v_base));
20754 __pyx_r = ((PyObject *)__pyx_v_base);
20755 }
20756 __Pyx_XDECREF(__pyx_temp);
20757 }
20758 goto __pyx_L0;
20759
20760 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1069
20761 * PyArray_SetBaseObject(arr, base)
20762 *
20763 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
20764 * base = PyArray_BASE(arr)
20765 * if base is NULL:
20766*/
20767
20768 /* function exit code */
20769 __pyx_L0:;
20770
20771 __Pyx_XGIVEREF(__pyx_r);
20772 __Pyx_RefNannyFinishContext();
20773 return __pyx_r;
20774}
20775
20776/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1077
20777 * # Versions of the import_* functions which are more suitable for
20778 * # Cython code.
20779 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
20780 * try:
20781 * __pyx_import_array()
20782*/
20783
20784static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20785 int __pyx_r;
20786 __Pyx_RefNannyDeclarations
20787 PyObject *__pyx_t_1 = NULL;
20788 PyObject *__pyx_t_2 = NULL;
20789 PyObject *__pyx_t_3 = NULL;
20790 int __pyx_t_4;
20791 PyObject *__pyx_t_5 = NULL;
20792 PyObject *__pyx_t_6 = NULL;
20793 PyObject *__pyx_t_7 = NULL;
20794 PyObject *__pyx_t_8 = NULL;
20795 PyObject *__pyx_t_9 = NULL;
20796 size_t __pyx_t_10;
20797 int __pyx_lineno = 0;
20798 const char *__pyx_filename = NULL;
20799 int __pyx_clineno = 0;
20800 __Pyx_RefNannySetupContext("import_array", 0);
20801
20802 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
20803 * # Cython code.
20804 * cdef inline int import_array() except -1:
20805 * try: # <<<<<<<<<<<<<<
20806 * __pyx_import_array()
20807 * except Exception:
20808*/
20809 {
20810 __Pyx_PyThreadState_declare
20811 __Pyx_PyThreadState_assign
20812 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20813 __Pyx_XGOTREF(__pyx_t_1);
20814 __Pyx_XGOTREF(__pyx_t_2);
20815 __Pyx_XGOTREF(__pyx_t_3);
20816 /*try:*/ {
20817
20818 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1079
20819 * cdef inline int import_array() except -1:
20820 * try:
20821 * __pyx_import_array() # <<<<<<<<<<<<<<
20822 * except Exception:
20823 * raise ImportError("numpy._core.multiarray failed to import")
20824*/
20825 __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1079, __pyx_L3_error)
20826
20827
20828 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
20829 * # Cython code.
20830 * cdef inline int import_array() except -1:
20831 * try: # <<<<<<<<<<<<<<
20832 * __pyx_import_array()
20833 * except Exception:
20834*/
20835 }
20836 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20837 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20838 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20839 goto __pyx_L8_try_end;
20840 __pyx_L3_error:;
20841
20842 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1080
20843 * try:
20844 * __pyx_import_array()
20845 * except Exception: # <<<<<<<<<<<<<<
20846 * raise ImportError("numpy._core.multiarray failed to import")
20847 *
20848*/
20849 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
20850 if (__pyx_t_4) {
20851 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
20852 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1080, __pyx_L5_except_error)
20853 __Pyx_XGOTREF(__pyx_t_5);
20854 __Pyx_XGOTREF(__pyx_t_6);
20855 __Pyx_XGOTREF(__pyx_t_7);
20856
20857 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1081
20858 * __pyx_import_array()
20859 * except Exception:
20860 * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<<
20861 *
20862 * cdef inline int import_umath() except -1:
20863*/
20864 __pyx_t_9 = NULL;
20865 __pyx_t_10 = 1;
20866 {
20867 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to};
20868 __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));
20869 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
20870 if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1081, __pyx_L5_except_error)
20871 __Pyx_GOTREF(__pyx_t_8);
20872 }
20873 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20874 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20875 __PYX_ERR(2, 1081, __pyx_L5_except_error)
20876 }
20877 goto __pyx_L5_except_error;
20878
20879 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
20880 * # Cython code.
20881 * cdef inline int import_array() except -1:
20882 * try: # <<<<<<<<<<<<<<
20883 * __pyx_import_array()
20884 * except Exception:
20885*/
20886 __pyx_L5_except_error:;
20887 __Pyx_XGIVEREF(__pyx_t_1);
20888 __Pyx_XGIVEREF(__pyx_t_2);
20889 __Pyx_XGIVEREF(__pyx_t_3);
20890 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
20891 goto __pyx_L1_error;
20892 __pyx_L8_try_end:;
20893 }
20894
20895 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1077
20896 * # Versions of the import_* functions which are more suitable for
20897 * # Cython code.
20898 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
20899 * try:
20900 * __pyx_import_array()
20901*/
20902
20903 /* function exit code */
20904 __pyx_r = 0;
20905 goto __pyx_L0;
20906 __pyx_L1_error:;
20907 __Pyx_XDECREF(__pyx_t_5);
20908 __Pyx_XDECREF(__pyx_t_6);
20909 __Pyx_XDECREF(__pyx_t_7);
20910 __Pyx_XDECREF(__pyx_t_8);
20911 __Pyx_XDECREF(__pyx_t_9);
20912 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
20913 __pyx_r = -1;
20914 __pyx_L0:;
20915
20916 __Pyx_RefNannyFinishContext();
20917 return __pyx_r;
20918}
20919
20920/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1083
20921 * raise ImportError("numpy._core.multiarray failed to import")
20922 *
20923 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
20924 * try:
20925 * _import_umath()
20926*/
20927
20928static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20929 int __pyx_r;
20930 __Pyx_RefNannyDeclarations
20931 PyObject *__pyx_t_1 = NULL;
20932 PyObject *__pyx_t_2 = NULL;
20933 PyObject *__pyx_t_3 = NULL;
20934 int __pyx_t_4;
20935 PyObject *__pyx_t_5 = NULL;
20936 PyObject *__pyx_t_6 = NULL;
20937 PyObject *__pyx_t_7 = NULL;
20938 PyObject *__pyx_t_8 = NULL;
20939 PyObject *__pyx_t_9 = NULL;
20940 size_t __pyx_t_10;
20941 int __pyx_lineno = 0;
20942 const char *__pyx_filename = NULL;
20943 int __pyx_clineno = 0;
20944 __Pyx_RefNannySetupContext("import_umath", 0);
20945
20946 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
20947 *
20948 * cdef inline int import_umath() except -1:
20949 * try: # <<<<<<<<<<<<<<
20950 * _import_umath()
20951 * except Exception:
20952*/
20953 {
20954 __Pyx_PyThreadState_declare
20955 __Pyx_PyThreadState_assign
20956 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20957 __Pyx_XGOTREF(__pyx_t_1);
20958 __Pyx_XGOTREF(__pyx_t_2);
20959 __Pyx_XGOTREF(__pyx_t_3);
20960 /*try:*/ {
20961
20962 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1085
20963 * cdef inline int import_umath() except -1:
20964 * try:
20965 * _import_umath() # <<<<<<<<<<<<<<
20966 * except Exception:
20967 * raise ImportError("numpy._core.umath failed to import")
20968*/
20969 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1085, __pyx_L3_error)
20970
20971
20972 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
20973 *
20974 * cdef inline int import_umath() except -1:
20975 * try: # <<<<<<<<<<<<<<
20976 * _import_umath()
20977 * except Exception:
20978*/
20979 }
20980 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20981 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20982 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20983 goto __pyx_L8_try_end;
20984 __pyx_L3_error:;
20985
20986 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1086
20987 * try:
20988 * _import_umath()
20989 * except Exception: # <<<<<<<<<<<<<<
20990 * raise ImportError("numpy._core.umath failed to import")
20991 *
20992*/
20993 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
20994 if (__pyx_t_4) {
20995 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
20996 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1086, __pyx_L5_except_error)
20997 __Pyx_XGOTREF(__pyx_t_5);
20998 __Pyx_XGOTREF(__pyx_t_6);
20999 __Pyx_XGOTREF(__pyx_t_7);
21000
21001 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1087
21002 * _import_umath()
21003 * except Exception:
21004 * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
21005 *
21006 * cdef inline int import_ufunc() except -1:
21007*/
21008 __pyx_t_9 = NULL;
21009 __pyx_t_10 = 1;
21010 {
21011 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
21012 __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));
21013 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
21014 if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1087, __pyx_L5_except_error)
21015 __Pyx_GOTREF(__pyx_t_8);
21016 }
21017 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
21018 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21019 __PYX_ERR(2, 1087, __pyx_L5_except_error)
21020 }
21021 goto __pyx_L5_except_error;
21022
21023 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
21024 *
21025 * cdef inline int import_umath() except -1:
21026 * try: # <<<<<<<<<<<<<<
21027 * _import_umath()
21028 * except Exception:
21029*/
21030 __pyx_L5_except_error:;
21031 __Pyx_XGIVEREF(__pyx_t_1);
21032 __Pyx_XGIVEREF(__pyx_t_2);
21033 __Pyx_XGIVEREF(__pyx_t_3);
21034 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
21035 goto __pyx_L1_error;
21036 __pyx_L8_try_end:;
21037 }
21038
21039 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1083
21040 * raise ImportError("numpy._core.multiarray failed to import")
21041 *
21042 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
21043 * try:
21044 * _import_umath()
21045*/
21046
21047 /* function exit code */
21048 __pyx_r = 0;
21049 goto __pyx_L0;
21050 __pyx_L1_error:;
21051 __Pyx_XDECREF(__pyx_t_5);
21052 __Pyx_XDECREF(__pyx_t_6);
21053 __Pyx_XDECREF(__pyx_t_7);
21054 __Pyx_XDECREF(__pyx_t_8);
21055 __Pyx_XDECREF(__pyx_t_9);
21056 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
21057 __pyx_r = -1;
21058 __pyx_L0:;
21059
21060 __Pyx_RefNannyFinishContext();
21061 return __pyx_r;
21062}
21063
21064/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1089
21065 * raise ImportError("numpy._core.umath failed to import")
21066 *
21067 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
21068 * try:
21069 * _import_umath()
21070*/
21071
21072static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
21073 int __pyx_r;
21074 __Pyx_RefNannyDeclarations
21075 PyObject *__pyx_t_1 = NULL;
21076 PyObject *__pyx_t_2 = NULL;
21077 PyObject *__pyx_t_3 = NULL;
21078 int __pyx_t_4;
21079 PyObject *__pyx_t_5 = NULL;
21080 PyObject *__pyx_t_6 = NULL;
21081 PyObject *__pyx_t_7 = NULL;
21082 PyObject *__pyx_t_8 = NULL;
21083 PyObject *__pyx_t_9 = NULL;
21084 size_t __pyx_t_10;
21085 int __pyx_lineno = 0;
21086 const char *__pyx_filename = NULL;
21087 int __pyx_clineno = 0;
21088 __Pyx_RefNannySetupContext("import_ufunc", 0);
21089
21090 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
21091 *
21092 * cdef inline int import_ufunc() except -1:
21093 * try: # <<<<<<<<<<<<<<
21094 * _import_umath()
21095 * except Exception:
21096*/
21097 {
21098 __Pyx_PyThreadState_declare
21099 __Pyx_PyThreadState_assign
21100 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
21101 __Pyx_XGOTREF(__pyx_t_1);
21102 __Pyx_XGOTREF(__pyx_t_2);
21103 __Pyx_XGOTREF(__pyx_t_3);
21104 /*try:*/ {
21105
21106 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1091
21107 * cdef inline int import_ufunc() except -1:
21108 * try:
21109 * _import_umath() # <<<<<<<<<<<<<<
21110 * except Exception:
21111 * raise ImportError("numpy._core.umath failed to import")
21112*/
21113 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1091, __pyx_L3_error)
21114
21115
21116 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
21117 *
21118 * cdef inline int import_ufunc() except -1:
21119 * try: # <<<<<<<<<<<<<<
21120 * _import_umath()
21121 * except Exception:
21122*/
21123 }
21124 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21125 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21126 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21127 goto __pyx_L8_try_end;
21128 __pyx_L3_error:;
21129
21130 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1092
21131 * try:
21132 * _import_umath()
21133 * except Exception: # <<<<<<<<<<<<<<
21134 * raise ImportError("numpy._core.umath failed to import")
21135 *
21136*/
21137 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
21138 if (__pyx_t_4) {
21139 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
21140 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1092, __pyx_L5_except_error)
21141 __Pyx_XGOTREF(__pyx_t_5);
21142 __Pyx_XGOTREF(__pyx_t_6);
21143 __Pyx_XGOTREF(__pyx_t_7);
21144
21145 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1093
21146 * _import_umath()
21147 * except Exception:
21148 * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
21149 *
21150 *
21151*/
21152 __pyx_t_9 = NULL;
21153 __pyx_t_10 = 1;
21154 {
21155 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
21156 __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));
21157 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
21158 if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1093, __pyx_L5_except_error)
21159 __Pyx_GOTREF(__pyx_t_8);
21160 }
21161 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
21162 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21163 __PYX_ERR(2, 1093, __pyx_L5_except_error)
21164 }
21165 goto __pyx_L5_except_error;
21166
21167 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
21168 *
21169 * cdef inline int import_ufunc() except -1:
21170 * try: # <<<<<<<<<<<<<<
21171 * _import_umath()
21172 * except Exception:
21173*/
21174 __pyx_L5_except_error:;
21175 __Pyx_XGIVEREF(__pyx_t_1);
21176 __Pyx_XGIVEREF(__pyx_t_2);
21177 __Pyx_XGIVEREF(__pyx_t_3);
21178 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
21179 goto __pyx_L1_error;
21180 __pyx_L8_try_end:;
21181 }
21182
21183 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1089
21184 * raise ImportError("numpy._core.umath failed to import")
21185 *
21186 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
21187 * try:
21188 * _import_umath()
21189*/
21190
21191 /* function exit code */
21192 __pyx_r = 0;
21193 goto __pyx_L0;
21194 __pyx_L1_error:;
21195 __Pyx_XDECREF(__pyx_t_5);
21196 __Pyx_XDECREF(__pyx_t_6);
21197 __Pyx_XDECREF(__pyx_t_7);
21198 __Pyx_XDECREF(__pyx_t_8);
21199 __Pyx_XDECREF(__pyx_t_9);
21200 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
21201 __pyx_r = -1;
21202 __pyx_L0:;
21203
21204 __Pyx_RefNannyFinishContext();
21205 return __pyx_r;
21206}
21207
21208/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1096
21209 *
21210 *
21211 * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
21212 * """
21213 * Cython equivalent of `isinstance(obj, np.timedelta64)`
21214*/
21215
21216static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
21217 int __pyx_r;
21218
21219 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1108
21220 * bool
21221 * """
21222 * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
21223 *
21224 *
21225*/
21226 {
21227
21228 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
21229 }
21230 goto __pyx_L0;
21231
21232 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1096
21233 *
21234 *
21235 * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
21236 * """
21237 * Cython equivalent of `isinstance(obj, np.timedelta64)`
21238*/
21239
21240 /* function exit code */
21241 __pyx_L0:;
21242
21243 return __pyx_r;
21244}
21245
21246/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1111
21247 *
21248 *
21249 * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
21250 * """
21251 * Cython equivalent of `isinstance(obj, np.datetime64)`
21252*/
21253
21254static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
21255 int __pyx_r;
21256
21257 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1123
21258 * bool
21259 * """
21260 * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
21261 *
21262 *
21263*/
21264 {
21265
21266 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
21267 }
21268 goto __pyx_L0;
21269
21270 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1111
21271 *
21272 *
21273 * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
21274 * """
21275 * Cython equivalent of `isinstance(obj, np.datetime64)`
21276*/
21277
21278 /* function exit code */
21279 __pyx_L0:;
21280
21281 return __pyx_r;
21282}
21283
21284/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1126
21285 *
21286 *
21287 * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21288 * """
21289 * returns the int64 value underlying scalar numpy datetime64 object
21290*/
21291
21292static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
21293 npy_datetime __pyx_r;
21294
21295 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1133
21296 * also needed. That can be found using `get_datetime64_unit`.
21297 * """
21298 * return _PyDatetimeScalarObject_GetValue(obj) # <<<<<<<<<<<<<<
21299 *
21300 *
21301*/
21302 {
21303
21304 __pyx_r = _PyDatetimeScalarObject_GetValue(__pyx_v_obj);
21305 }
21306 goto __pyx_L0;
21307
21308 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1126
21309 *
21310 *
21311 * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21312 * """
21313 * returns the int64 value underlying scalar numpy datetime64 object
21314*/
21315
21316 /* function exit code */
21317 __pyx_L0:;
21318 return __pyx_r;
21319}
21320
21321/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1136
21322 *
21323 *
21324 * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21325 * """
21326 * returns the int64 value underlying scalar numpy timedelta64 object
21327*/
21328
21329static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
21330 npy_timedelta __pyx_r;
21331
21332 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1140
21333 * returns the int64 value underlying scalar numpy timedelta64 object
21334 * """
21335 * return _PyTimedeltaScalarObject_GetValue(obj) # <<<<<<<<<<<<<<
21336 *
21337 *
21338*/
21339 {
21340
21341 __pyx_r = _PyTimedeltaScalarObject_GetValue(__pyx_v_obj);
21342 }
21343 goto __pyx_L0;
21344
21345 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1136
21346 *
21347 *
21348 * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21349 * """
21350 * returns the int64 value underlying scalar numpy timedelta64 object
21351*/
21352
21353 /* function exit code */
21354 __pyx_L0:;
21355 return __pyx_r;
21356}
21357
21358/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1143
21359 *
21360 *
21361 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21362 * """
21363 * returns the unit part of the dtype for a numpy datetime64 object.
21364*/
21365
21366static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
21367 NPY_DATETIMEUNIT __pyx_r;
21368
21369 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1147
21370 * returns the unit part of the dtype for a numpy datetime64 object.
21371 * """
21372 * return _PyDatetimeScalarObject_GetMetadata(obj).base # <<<<<<<<<<<<<<
21373 *
21374 *
21375*/
21376 {
21377
21378 __pyx_r = _PyDatetimeScalarObject_GetMetadata(__pyx_v_obj).base;
21379 }
21380 goto __pyx_L0;
21381
21382 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1143
21383 *
21384 *
21385 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21386 * """
21387 * returns the unit part of the dtype for a numpy datetime64 object.
21388*/
21389
21390 /* function exit code */
21391 __pyx_L0:;
21392 return __pyx_r;
21393}
21394
21395/* "equivalent_polynomials.pyx":53
21396 * cdef eqp.cSimplex[nSpace3T,nDOF3T,nP2T,nQT,nEBQT] s32
21397 * cdef eqp.cSimplex[nSpace3T,nDOF3T,nP3T,nQT,nEBQT] s33
21398 * def __cinit__(self, nSpace, nP, nQ): # <<<<<<<<<<<<<<
21399 * self.xiBuffer=np.zeros((50,3),'d')
21400 * self.nSpace = nSpace
21401*/
21402
21403/* Python wrapper */
21404static int __pyx_pw_22equivalent_polynomials_7Simplex_1__cinit__(PyObject *__pyx_v_self,
21405#if CYTHON_VECTORCALL_TPNEW
21406PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21407#else
21408PyObject *__pyx_args, PyObject *__pyx_kwds
21409#endif
21410); /*proto*/
21411static int __pyx_pw_22equivalent_polynomials_7Simplex_1__cinit__(PyObject *__pyx_v_self,
21412#if CYTHON_VECTORCALL_TPNEW
21413PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21414#else
21415PyObject *__pyx_args, PyObject *__pyx_kwds
21416#endif
21417) {
21418 PyObject *__pyx_v_nSpace = 0;
21419 PyObject *__pyx_v_nP = 0;
21420 PyObject *__pyx_v_nQ = 0;
21421 #if !CYTHON_VECTORCALL_TPNEW
21422 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21423 #endif
21424 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
21425 PyObject* values[3] = {0,0,0};
21426 int __pyx_lineno = 0;
21427 const char *__pyx_filename = NULL;
21428 int __pyx_clineno = 0;
21429 int __pyx_r;
21430 __Pyx_RefNannyDeclarations
21431 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
21432 #if !CYTHON_VECTORCALL_TPNEW
21433 #if CYTHON_ASSUME_SAFE_SIZE
21434 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21435 #else
21436 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
21437 #endif
21438 #endif
21439 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
21440 {
21441 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nSpace,&__pyx_mstate_global->__pyx_n_u_nP,&__pyx_mstate_global->__pyx_n_u_nQ,0};
21442 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
21443 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 53, __pyx_L3_error)
21444 if (__pyx_kwds_len > 0) {
21445 switch (__pyx_nargs) {
21446 case 3:
21447 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
21448 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 53, __pyx_L3_error)
21449 CYTHON_FALLTHROUGH;
21450 case 2:
21451 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
21452 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 53, __pyx_L3_error)
21453 CYTHON_FALLTHROUGH;
21454 case 1:
21455 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
21456 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 53, __pyx_L3_error)
21457 CYTHON_FALLTHROUGH;
21458 case 0: break;
21459 default: goto __pyx_L5_argtuple_error;
21460 }
21461 const Py_ssize_t kwd_pos_args = __pyx_nargs;
21462 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)
21463 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
21464 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, i); __PYX_ERR(0, 53, __pyx_L3_error) }
21465 }
21466 } else if (unlikely(__pyx_nargs != 3)) {
21467 goto __pyx_L5_argtuple_error;
21468 } else {
21469 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
21470 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 53, __pyx_L3_error)
21471 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
21472 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 53, __pyx_L3_error)
21473 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
21474 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 53, __pyx_L3_error)
21475 }
21476 __pyx_v_nSpace = values[0];
21477 __pyx_v_nP = values[1];
21478 __pyx_v_nQ = values[2];
21479 }
21480 goto __pyx_L6_skip;
21481 __pyx_L5_argtuple_error:;
21482 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 53, __pyx_L3_error)
21483 __pyx_L6_skip:;
21484 goto __pyx_L4_argument_unpacking_done;
21485 __pyx_L3_error:;
21486 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21487 Py_XDECREF(values[__pyx_temp]);
21488 }
21489 __Pyx_AddTraceback("equivalent_polynomials.Simplex.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21490 __Pyx_RefNannyFinishContext();
21491 return -1;
21492 __pyx_L4_argument_unpacking_done:;
21493 __pyx_r = __pyx_pf_22equivalent_polynomials_7Simplex___cinit__(((struct __pyx_obj_22equivalent_polynomials_Simplex *)__pyx_v_self), __pyx_v_nSpace, __pyx_v_nP, __pyx_v_nQ);
21494
21495 /* function exit code */
21496 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21497 Py_XDECREF(values[__pyx_temp]);
21498 }
21499 __Pyx_RefNannyFinishContext();
21500 return __pyx_r;
21501}
21502
21503static int __pyx_pf_22equivalent_polynomials_7Simplex___cinit__(struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self, PyObject *__pyx_v_nSpace, PyObject *__pyx_v_nP, PyObject *__pyx_v_nQ) {
21504 int __pyx_r;
21505 __Pyx_RefNannyDeclarations
21506 PyObject *__pyx_t_1 = NULL;
21507 PyObject *__pyx_t_2 = NULL;
21508 int __pyx_t_3;
21509 int __pyx_lineno = 0;
21510 const char *__pyx_filename = NULL;
21511 int __pyx_clineno = 0;
21512 __Pyx_RefNannySetupContext("__cinit__", 0);
21513
21514 /* "equivalent_polynomials.pyx":54
21515 * cdef eqp.cSimplex[nSpace3T,nDOF3T,nP3T,nQT,nEBQT] s33
21516 * def __cinit__(self, nSpace, nP, nQ):
21517 * self.xiBuffer=np.zeros((50,3),'d') # <<<<<<<<<<<<<<
21518 * self.nSpace = nSpace
21519 * self.nP = nP
21520*/
21521 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error)
21522 __Pyx_GOTREF(__pyx_t_1);
21523 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error)
21524 __Pyx_GOTREF(__pyx_t_2);
21525 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21526 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[3], NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error)
21527 __Pyx_GOTREF(__pyx_t_1);
21528 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21529 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 54, __pyx_L1_error)
21530 __Pyx_GIVEREF(__pyx_t_1);
21531 __Pyx_GOTREF((PyObject *)__pyx_v_self->xiBuffer);
21532 __Pyx_DECREF((PyObject *)__pyx_v_self->xiBuffer);
21533 __pyx_v_self->xiBuffer = ((PyArrayObject *)__pyx_t_1);
21534 __pyx_t_1 = 0;
21535
21536 /* "equivalent_polynomials.pyx":55
21537 * def __cinit__(self, nSpace, nP, nQ):
21538 * self.xiBuffer=np.zeros((50,3),'d')
21539 * self.nSpace = nSpace # <<<<<<<<<<<<<<
21540 * self.nP = nP
21541 * self.nQ=nQ
21542*/
21543 __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_v_nSpace); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L1_error)
21544 __pyx_v_self->nSpace = __pyx_t_3;
21545
21546 /* "equivalent_polynomials.pyx":56
21547 * self.xiBuffer=np.zeros((50,3),'d')
21548 * self.nSpace = nSpace
21549 * self.nP = nP # <<<<<<<<<<<<<<
21550 * self.nQ=nQ
21551 * self.nEBQ=nQ#cek hack
21552*/
21553 __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_v_nP); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L1_error)
21554 __pyx_v_self->nP = __pyx_t_3;
21555
21556 /* "equivalent_polynomials.pyx":57
21557 * self.nSpace = nSpace
21558 * self.nP = nP
21559 * self.nQ=nQ # <<<<<<<<<<<<<<
21560 * self.nEBQ=nQ#cek hack
21561 * self.q=0
21562*/
21563 __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_v_nQ); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error)
21564 __pyx_v_self->nQ = __pyx_t_3;
21565
21566 /* "equivalent_polynomials.pyx":58
21567 * self.nP = nP
21568 * self.nQ=nQ
21569 * self.nEBQ=nQ#cek hack # <<<<<<<<<<<<<<
21570 * self.q=0
21571 * def calculate(self, np.ndarray phi_dof, np.ndarray phi_nodes, np.ndarray xi):
21572*/
21573 __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_v_nQ); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error)
21574 __pyx_v_self->nEBQ = __pyx_t_3;
21575
21576 /* "equivalent_polynomials.pyx":59
21577 * self.nQ=nQ
21578 * self.nEBQ=nQ#cek hack
21579 * self.q=0 # <<<<<<<<<<<<<<
21580 * def calculate(self, np.ndarray phi_dof, np.ndarray phi_nodes, np.ndarray xi):
21581 * self.xiBuffer[:xi.shape[0]]=xi
21582*/
21583 __pyx_v_self->q = 0;
21584
21585 /* "equivalent_polynomials.pyx":53
21586 * cdef eqp.cSimplex[nSpace3T,nDOF3T,nP2T,nQT,nEBQT] s32
21587 * cdef eqp.cSimplex[nSpace3T,nDOF3T,nP3T,nQT,nEBQT] s33
21588 * def __cinit__(self, nSpace, nP, nQ): # <<<<<<<<<<<<<<
21589 * self.xiBuffer=np.zeros((50,3),'d')
21590 * self.nSpace = nSpace
21591*/
21592
21593 /* function exit code */
21594 __pyx_r = 0;
21595 goto __pyx_L0;
21596 __pyx_L1_error:;
21597 __Pyx_XDECREF(__pyx_t_1);
21598 __Pyx_XDECREF(__pyx_t_2);
21599 __Pyx_AddTraceback("equivalent_polynomials.Simplex.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21600 __pyx_r = -1;
21601 __pyx_L0:;
21602
21603 __Pyx_RefNannyFinishContext();
21604 return __pyx_r;
21605}
21606
21607/* "equivalent_polynomials.pyx":60
21608 * self.nEBQ=nQ#cek hack
21609 * self.q=0
21610 * def calculate(self, np.ndarray phi_dof, np.ndarray phi_nodes, np.ndarray xi): # <<<<<<<<<<<<<<
21611 * self.xiBuffer[:xi.shape[0]]=xi
21612 * if (self.nSpace,self.nP) == (1,1):
21613*/
21614
21615/* Python wrapper */
21616static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_3calculate(PyObject *__pyx_v_self,
21617#if CYTHON_VECTORCALL
21618PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21619#else
21620PyObject *__pyx_args, PyObject *__pyx_kwds
21621#endif
21622); /*proto*/
21623static PyMethodDef __pyx_mdef_22equivalent_polynomials_7Simplex_3calculate = {"calculate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_22equivalent_polynomials_7Simplex_3calculate, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
21624static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_3calculate(PyObject *__pyx_v_self,
21625#if CYTHON_VECTORCALL
21626PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21627#else
21628PyObject *__pyx_args, PyObject *__pyx_kwds
21629#endif
21630) {
21631 PyArrayObject *__pyx_v_phi_dof = 0;
21632 PyArrayObject *__pyx_v_phi_nodes = 0;
21633 PyArrayObject *__pyx_v_xi = 0;
21634 #if !CYTHON_VECTORCALL
21635 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21636 #endif
21637 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
21638 PyObject* values[3] = {0,0,0};
21639 int __pyx_lineno = 0;
21640 const char *__pyx_filename = NULL;
21641 int __pyx_clineno = 0;
21642 PyObject *__pyx_r = 0;
21643 __Pyx_RefNannyDeclarations
21644 __Pyx_RefNannySetupContext("calculate (wrapper)", 0);
21645 #if !CYTHON_VECTORCALL
21646 #if CYTHON_ASSUME_SAFE_SIZE
21647 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21648 #else
21649 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
21650 #endif
21651 #endif
21652 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21653 {
21654 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_phi_dof,&__pyx_mstate_global->__pyx_n_u_phi_nodes,&__pyx_mstate_global->__pyx_n_u_xi,0};
21655 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
21656 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 60, __pyx_L3_error)
21657 if (__pyx_kwds_len > 0) {
21658 switch (__pyx_nargs) {
21659 case 3:
21660 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21661 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 60, __pyx_L3_error)
21662 CYTHON_FALLTHROUGH;
21663 case 2:
21664 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21665 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 60, __pyx_L3_error)
21666 CYTHON_FALLTHROUGH;
21667 case 1:
21668 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21669 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 60, __pyx_L3_error)
21670 CYTHON_FALLTHROUGH;
21671 case 0: break;
21672 default: goto __pyx_L5_argtuple_error;
21673 }
21674 const Py_ssize_t kwd_pos_args = __pyx_nargs;
21675 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "calculate", 0) < (0)) __PYX_ERR(0, 60, __pyx_L3_error)
21676 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
21677 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, i); __PYX_ERR(0, 60, __pyx_L3_error) }
21678 }
21679 } else if (unlikely(__pyx_nargs != 3)) {
21680 goto __pyx_L5_argtuple_error;
21681 } else {
21682 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21683 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 60, __pyx_L3_error)
21684 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21685 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 60, __pyx_L3_error)
21686 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21687 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 60, __pyx_L3_error)
21688 }
21689 __pyx_v_phi_dof = ((PyArrayObject *)values[0]);
21690 __pyx_v_phi_nodes = ((PyArrayObject *)values[1]);
21691 __pyx_v_xi = ((PyArrayObject *)values[2]);
21692 }
21693 goto __pyx_L6_skip;
21694 __pyx_L5_argtuple_error:;
21695 __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 60, __pyx_L3_error)
21696 __pyx_L6_skip:;
21697 goto __pyx_L4_argument_unpacking_done;
21698 __pyx_L3_error:;
21699 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21700 Py_XDECREF(values[__pyx_temp]);
21701 }
21702 __Pyx_AddTraceback("equivalent_polynomials.Simplex.calculate", __pyx_clineno, __pyx_lineno, __pyx_filename);
21703 __Pyx_RefNannyFinishContext();
21704 return NULL;
21705 __pyx_L4_argument_unpacking_done:;
21706 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phi_dof), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "phi_dof", 0))) __PYX_ERR(0, 60, __pyx_L1_error)
21707 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phi_nodes), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "phi_nodes", 0))) __PYX_ERR(0, 60, __pyx_L1_error)
21708 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xi), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "xi", 0))) __PYX_ERR(0, 60, __pyx_L1_error)
21709 __pyx_r = __pyx_pf_22equivalent_polynomials_7Simplex_2calculate(((struct __pyx_obj_22equivalent_polynomials_Simplex *)__pyx_v_self), __pyx_v_phi_dof, __pyx_v_phi_nodes, __pyx_v_xi);
21710
21711 /* function exit code */
21712 goto __pyx_L0;
21713 __pyx_L1_error:;
21714 __pyx_r = NULL;
21715 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21716 Py_XDECREF(values[__pyx_temp]);
21717 }
21718 goto __pyx_L7_cleaned_up;
21719 __pyx_L0:;
21720 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21721 Py_XDECREF(values[__pyx_temp]);
21722 }
21723 __pyx_L7_cleaned_up:;
21724 __Pyx_RefNannyFinishContext();
21725 return __pyx_r;
21726}
21727
21728static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_2calculate(struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self, PyArrayObject *__pyx_v_phi_dof, PyArrayObject *__pyx_v_phi_nodes, PyArrayObject *__pyx_v_xi) {
21729 CYTHON_UNUSED int __pyx_v_icase;
21730 PyObject *__pyx_r = NULL;
21731 __Pyx_RefNannyDeclarations
21732 PyObject *__pyx_t_1 = NULL;
21733 PyObject *__pyx_t_2 = NULL;
21734 PyObject *__pyx_t_3 = NULL;
21735 int __pyx_t_4;
21736 PyObject *__pyx_t_5 = NULL;
21737 double *__pyx_t_6;
21738 struct __pyx_array_obj *__pyx_t_7 = NULL;
21739 PyObject *__pyx_t_8 = NULL;
21740 char *__pyx_t_9;
21741 size_t __pyx_t_10;
21742 bool __pyx_t_11;
21743 int __pyx_t_12;
21744 int __pyx_lineno = 0;
21745 const char *__pyx_filename = NULL;
21746 int __pyx_clineno = 0;
21747 __Pyx_RefNannySetupContext("calculate", 0);
21748
21749 /* "equivalent_polynomials.pyx":61
21750 * self.q=0
21751 * def calculate(self, np.ndarray phi_dof, np.ndarray phi_nodes, np.ndarray xi):
21752 * self.xiBuffer[:xi.shape[0]]=xi # <<<<<<<<<<<<<<
21753 * if (self.nSpace,self.nP) == (1,1):
21754 * icase = self.s11.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
21755*/
21756 if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_self->xiBuffer), ((PyObject *)__pyx_v_xi), 0, (__pyx_f_5numpy_7ndarray_5shape___get__(__pyx_v_xi)[0]), NULL, NULL, NULL, 0, 1, 1) < (0)) __PYX_ERR(0, 61, __pyx_L1_error)
21757
21758 /* "equivalent_polynomials.pyx":62
21759 * def calculate(self, np.ndarray phi_dof, np.ndarray phi_nodes, np.ndarray xi):
21760 * self.xiBuffer[:xi.shape[0]]=xi
21761 * if (self.nSpace,self.nP) == (1,1): # <<<<<<<<<<<<<<
21762 * icase = self.s11.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
21763 * self._H = np.asarray(<double[:self.nQ]>self.s11.get_H())
21764*/
21765 __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->nSpace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
21766 __Pyx_GOTREF(__pyx_t_1);
21767 __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_self->nP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
21768 __Pyx_GOTREF(__pyx_t_2);
21769 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
21770 __Pyx_GOTREF(__pyx_t_3);
21771 __Pyx_GIVEREF(__pyx_t_1);
21772 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 62, __pyx_L1_error);
21773 __Pyx_GIVEREF(__pyx_t_2);
21774 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 62, __pyx_L1_error);
21775 __pyx_t_1 = 0;
21776 __pyx_t_2 = 0;
21777 __pyx_t_4 = __Pyx_PyObject_RichCompareBool(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[4], Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 62, __pyx_L1_error)
21778 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21779 if (__pyx_t_4) {
21780
21781
21782 /* "equivalent_polynomials.pyx":63
21783 * self.xiBuffer[:xi.shape[0]]=xi
21784 * if (self.nSpace,self.nP) == (1,1):
21785 * icase = self.s11.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False) # <<<<<<<<<<<<<<
21786 * self._H = np.asarray(<double[:self.nQ]>self.s11.get_H())
21787 * self._ImH = np.asarray(<double[:self.nQ]>self.s11.get_ImH())
21788*/
21789 __pyx_t_3 = ((PyObject *)__pyx_v_self->xiBuffer);
21790 __Pyx_INCREF(__pyx_t_3);
21791 __pyx_v_icase = __pyx_v_self->s11.calculate(((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_phi_dof)), ((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_phi_nodes)), ((double *)__pyx_f_5numpy_7ndarray_4data___get__(((PyArrayObject *)__pyx_t_3))), 0);
21792 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21793
21794 /* "equivalent_polynomials.pyx":64
21795 * if (self.nSpace,self.nP) == (1,1):
21796 * icase = self.s11.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
21797 * self._H = np.asarray(<double[:self.nQ]>self.s11.get_H()) # <<<<<<<<<<<<<<
21798 * self._ImH = np.asarray(<double[:self.nQ]>self.s11.get_ImH())
21799 * self._D = np.asarray(<double[:self.nQ]>self.s11.get_D())
21800*/
21801 __pyx_t_2 = NULL;
21802 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
21803 __Pyx_GOTREF(__pyx_t_1);
21804 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 64, __pyx_L1_error)
21805 __Pyx_GOTREF(__pyx_t_5);
21806 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21807 __pyx_t_6 = __pyx_v_self->s11.get_H();
21808
21809 if (!__pyx_t_6) {
21810 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
21811 __PYX_ERR(0, 64, __pyx_L1_error)
21812 }
21813 __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 64, __pyx_L1_error)
21814 __Pyx_GOTREF(__pyx_t_8);
21815 __pyx_t_1 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
21816 __Pyx_GOTREF(__pyx_t_1);
21817 #if CYTHON_COMPILING_IN_LIMITED_API
21818 __pyx_t_9 = PyBytes_AsString(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 64, __pyx_L1_error)
21819 #else
21820 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_8);
21821 #endif
21822 __pyx_t_7 = __pyx_array_new(__pyx_t_1, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 64, __pyx_L1_error)
21823 __Pyx_GOTREF((PyObject *)__pyx_t_7);
21824 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21825 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21826
21827 __pyx_t_10 = 1;
21828 #if CYTHON_UNPACK_METHODS
21829 if (unlikely(PyMethod_Check(__pyx_t_5))) {
21830 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
21831 assert(__pyx_t_2);
21832 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
21833 __Pyx_INCREF(__pyx_t_2);
21834 __Pyx_INCREF(__pyx__function);
21835 __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
21836 __pyx_t_10 = 0;
21837 }
21838 #endif
21839 {
21840 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_7)};
21841 __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
21842 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21843 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
21844 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21845 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error)
21846 __Pyx_GOTREF(__pyx_t_3);
21847 }
21848 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 64, __pyx_L1_error)
21849 __Pyx_GIVEREF(__pyx_t_3);
21850 __Pyx_GOTREF((PyObject *)__pyx_v_self->_H);
21851 __Pyx_DECREF((PyObject *)__pyx_v_self->_H);
21852 __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_3);
21853 __pyx_t_3 = 0;
21854
21855 /* "equivalent_polynomials.pyx":65
21856 * icase = self.s11.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
21857 * self._H = np.asarray(<double[:self.nQ]>self.s11.get_H())
21858 * self._ImH = np.asarray(<double[:self.nQ]>self.s11.get_ImH()) # <<<<<<<<<<<<<<
21859 * self._D = np.asarray(<double[:self.nQ]>self.s11.get_D())
21860 * self.inside_out = self.s11.inside_out
21861*/
21862 __pyx_t_5 = NULL;
21863 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error)
21864 __Pyx_GOTREF(__pyx_t_2);
21865 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 65, __pyx_L1_error)
21866 __Pyx_GOTREF(__pyx_t_8);
21867 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21868 __pyx_t_6 = __pyx_v_self->s11.get_ImH();
21869
21870 if (!__pyx_t_6) {
21871 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
21872 __PYX_ERR(0, 65, __pyx_L1_error)
21873 }
21874 __pyx_t_1 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
21875 __Pyx_GOTREF(__pyx_t_1);
21876 __pyx_t_2 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error)
21877 __Pyx_GOTREF(__pyx_t_2);
21878 #if CYTHON_COMPILING_IN_LIMITED_API
21879 __pyx_t_9 = PyBytes_AsString(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 65, __pyx_L1_error)
21880 #else
21881 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_1);
21882 #endif
21883 __pyx_t_7 = __pyx_array_new(__pyx_t_2, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 65, __pyx_L1_error)
21884 __Pyx_GOTREF((PyObject *)__pyx_t_7);
21885 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21886 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21887
21888 __pyx_t_10 = 1;
21889 #if CYTHON_UNPACK_METHODS
21890 if (unlikely(PyMethod_Check(__pyx_t_8))) {
21891 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
21892 assert(__pyx_t_5);
21893 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
21894 __Pyx_INCREF(__pyx_t_5);
21895 __Pyx_INCREF(__pyx__function);
21896 __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
21897 __pyx_t_10 = 0;
21898 }
21899 #endif
21900 {
21901 PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_t_7)};
21902 __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
21903 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21904 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
21905 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21906 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error)
21907 __Pyx_GOTREF(__pyx_t_3);
21908 }
21909 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 65, __pyx_L1_error)
21910 __Pyx_GIVEREF(__pyx_t_3);
21911 __Pyx_GOTREF((PyObject *)__pyx_v_self->_ImH);
21912 __Pyx_DECREF((PyObject *)__pyx_v_self->_ImH);
21913 __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_3);
21914 __pyx_t_3 = 0;
21915
21916 /* "equivalent_polynomials.pyx":66
21917 * self._H = np.asarray(<double[:self.nQ]>self.s11.get_H())
21918 * self._ImH = np.asarray(<double[:self.nQ]>self.s11.get_ImH())
21919 * self._D = np.asarray(<double[:self.nQ]>self.s11.get_D()) # <<<<<<<<<<<<<<
21920 * self.inside_out = self.s11.inside_out
21921 * self.edge = self.s11.edge
21922*/
21923 __pyx_t_8 = NULL;
21924 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 66, __pyx_L1_error)
21925 __Pyx_GOTREF(__pyx_t_5);
21926 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
21927 __Pyx_GOTREF(__pyx_t_1);
21928 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21929 __pyx_t_6 = __pyx_v_self->s11.get_D();
21930
21931 if (!__pyx_t_6) {
21932 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
21933 __PYX_ERR(0, 66, __pyx_L1_error)
21934 }
21935 __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error)
21936 __Pyx_GOTREF(__pyx_t_2);
21937 __pyx_t_5 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 66, __pyx_L1_error)
21938 __Pyx_GOTREF(__pyx_t_5);
21939 #if CYTHON_COMPILING_IN_LIMITED_API
21940 __pyx_t_9 = PyBytes_AsString(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __pyx_L1_error)
21941 #else
21942 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_2);
21943 #endif
21944 __pyx_t_7 = __pyx_array_new(__pyx_t_5, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 66, __pyx_L1_error)
21945 __Pyx_GOTREF((PyObject *)__pyx_t_7);
21946 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21947 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21948
21949 __pyx_t_10 = 1;
21950 #if CYTHON_UNPACK_METHODS
21951 if (unlikely(PyMethod_Check(__pyx_t_1))) {
21952 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
21953 assert(__pyx_t_8);
21954 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
21955 __Pyx_INCREF(__pyx_t_8);
21956 __Pyx_INCREF(__pyx__function);
21957 __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
21958 __pyx_t_10 = 0;
21959 }
21960 #endif
21961 {
21962 PyObject *__pyx_callargs[2] = {__pyx_t_8, ((PyObject *)__pyx_t_7)};
21963 __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
21964 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21965 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
21966 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21967 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error)
21968 __Pyx_GOTREF(__pyx_t_3);
21969 }
21970 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 66, __pyx_L1_error)
21971 __Pyx_GIVEREF(__pyx_t_3);
21972 __Pyx_GOTREF((PyObject *)__pyx_v_self->_D);
21973 __Pyx_DECREF((PyObject *)__pyx_v_self->_D);
21974 __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_3);
21975 __pyx_t_3 = 0;
21976
21977 /* "equivalent_polynomials.pyx":67
21978 * self._ImH = np.asarray(<double[:self.nQ]>self.s11.get_ImH())
21979 * self._D = np.asarray(<double[:self.nQ]>self.s11.get_D())
21980 * self.inside_out = self.s11.inside_out # <<<<<<<<<<<<<<
21981 * self.edge = self.s11.edge
21982 * self.corner = self.s11.corner
21983*/
21984 __pyx_t_11 = __pyx_v_self->s11.inside_out;
21985
21986 __pyx_v_self->inside_out = __pyx_t_11;
21987
21988 /* "equivalent_polynomials.pyx":68
21989 * self._D = np.asarray(<double[:self.nQ]>self.s11.get_D())
21990 * self.inside_out = self.s11.inside_out
21991 * self.edge = self.s11.edge # <<<<<<<<<<<<<<
21992 * self.corner = self.s11.corner
21993 * elif (self.nSpace,self.nP) == (1,2):
21994*/
21995 __pyx_t_12 = __pyx_v_self->s11.edge;
21996
21997 __pyx_v_self->edge = __pyx_t_12;
21998
21999 /* "equivalent_polynomials.pyx":69
22000 * self.inside_out = self.s11.inside_out
22001 * self.edge = self.s11.edge
22002 * self.corner = self.s11.corner # <<<<<<<<<<<<<<
22003 * elif (self.nSpace,self.nP) == (1,2):
22004 * icase = self.s12.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
22005*/
22006 __pyx_t_12 = __pyx_v_self->s11.corner;
22007
22008 __pyx_v_self->corner = __pyx_t_12;
22009
22010 /* "equivalent_polynomials.pyx":62
22011 * def calculate(self, np.ndarray phi_dof, np.ndarray phi_nodes, np.ndarray xi):
22012 * self.xiBuffer[:xi.shape[0]]=xi
22013 * if (self.nSpace,self.nP) == (1,1): # <<<<<<<<<<<<<<
22014 * icase = self.s11.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
22015 * self._H = np.asarray(<double[:self.nQ]>self.s11.get_H())
22016*/
22017 goto __pyx_L3;
22018 }
22019
22020 /* "equivalent_polynomials.pyx":70
22021 * self.edge = self.s11.edge
22022 * self.corner = self.s11.corner
22023 * elif (self.nSpace,self.nP) == (1,2): # <<<<<<<<<<<<<<
22024 * icase = self.s12.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
22025 * self._H = np.asarray(<double[:self.nQ]>self.s12.get_H())
22026*/
22027 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_self->nSpace); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error)
22028 __Pyx_GOTREF(__pyx_t_3);
22029 __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->nP); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
22030 __Pyx_GOTREF(__pyx_t_1);
22031 __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 70, __pyx_L1_error)
22032 __Pyx_GOTREF(__pyx_t_8);
22033 __Pyx_GIVEREF(__pyx_t_3);
22034 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 70, __pyx_L1_error);
22035 __Pyx_GIVEREF(__pyx_t_1);
22036 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 70, __pyx_L1_error);
22037 __pyx_t_3 = 0;
22038 __pyx_t_1 = 0;
22039 __pyx_t_4 = __Pyx_PyObject_RichCompareBool(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[5], Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 70, __pyx_L1_error)
22040 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22041 if (__pyx_t_4) {
22042
22043
22044 /* "equivalent_polynomials.pyx":71
22045 * self.corner = self.s11.corner
22046 * elif (self.nSpace,self.nP) == (1,2):
22047 * icase = self.s12.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False) # <<<<<<<<<<<<<<
22048 * self._H = np.asarray(<double[:self.nQ]>self.s12.get_H())
22049 * self._ImH = np.asarray(<double[:self.nQ]>self.s12.get_ImH())
22050*/
22051 __pyx_t_8 = ((PyObject *)__pyx_v_self->xiBuffer);
22052 __Pyx_INCREF(__pyx_t_8);
22053 __pyx_v_icase = __pyx_v_self->s12.calculate(((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_phi_dof)), ((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_phi_nodes)), ((double *)__pyx_f_5numpy_7ndarray_4data___get__(((PyArrayObject *)__pyx_t_8))), 0);
22054 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22055
22056 /* "equivalent_polynomials.pyx":72
22057 * elif (self.nSpace,self.nP) == (1,2):
22058 * icase = self.s12.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
22059 * self._H = np.asarray(<double[:self.nQ]>self.s12.get_H()) # <<<<<<<<<<<<<<
22060 * self._ImH = np.asarray(<double[:self.nQ]>self.s12.get_ImH())
22061 * self._D = np.asarray(<double[:self.nQ]>self.s12.get_D())
22062*/
22063 __pyx_t_1 = NULL;
22064 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error)
22065 __Pyx_GOTREF(__pyx_t_3);
22066 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error)
22067 __Pyx_GOTREF(__pyx_t_2);
22068 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22069 __pyx_t_6 = __pyx_v_self->s12.get_H();
22070
22071 if (!__pyx_t_6) {
22072 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
22073 __PYX_ERR(0, 72, __pyx_L1_error)
22074 }
22075 __pyx_t_5 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error)
22076 __Pyx_GOTREF(__pyx_t_5);
22077 __pyx_t_3 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error)
22078 __Pyx_GOTREF(__pyx_t_3);
22079 #if CYTHON_COMPILING_IN_LIMITED_API
22080 __pyx_t_9 = PyBytes_AsString(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 72, __pyx_L1_error)
22081 #else
22082 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_5);
22083 #endif
22084 __pyx_t_7 = __pyx_array_new(__pyx_t_3, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 72, __pyx_L1_error)
22085 __Pyx_GOTREF((PyObject *)__pyx_t_7);
22086 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22087 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22088
22089 __pyx_t_10 = 1;
22090 #if CYTHON_UNPACK_METHODS
22091 if (unlikely(PyMethod_Check(__pyx_t_2))) {
22092 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
22093 assert(__pyx_t_1);
22094 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
22095 __Pyx_INCREF(__pyx_t_1);
22096 __Pyx_INCREF(__pyx__function);
22097 __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
22098 __pyx_t_10 = 0;
22099 }
22100 #endif
22101 {
22102 PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_t_7)};
22103 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22104 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22105 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
22106 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22107 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 72, __pyx_L1_error)
22108 __Pyx_GOTREF(__pyx_t_8);
22109 }
22110 if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 72, __pyx_L1_error)
22111 __Pyx_GIVEREF(__pyx_t_8);
22112 __Pyx_GOTREF((PyObject *)__pyx_v_self->_H);
22113 __Pyx_DECREF((PyObject *)__pyx_v_self->_H);
22114 __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_8);
22115 __pyx_t_8 = 0;
22116
22117 /* "equivalent_polynomials.pyx":73
22118 * icase = self.s12.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
22119 * self._H = np.asarray(<double[:self.nQ]>self.s12.get_H())
22120 * self._ImH = np.asarray(<double[:self.nQ]>self.s12.get_ImH()) # <<<<<<<<<<<<<<
22121 * self._D = np.asarray(<double[:self.nQ]>self.s12.get_D())
22122 * self.inside_out = self.s12.inside_out
22123*/
22124 __pyx_t_2 = NULL;
22125 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
22126 __Pyx_GOTREF(__pyx_t_1);
22127 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 73, __pyx_L1_error)
22128 __Pyx_GOTREF(__pyx_t_5);
22129 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22130 __pyx_t_6 = __pyx_v_self->s12.get_ImH();
22131
22132 if (!__pyx_t_6) {
22133 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
22134 __PYX_ERR(0, 73, __pyx_L1_error)
22135 }
22136 __pyx_t_3 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error)
22137 __Pyx_GOTREF(__pyx_t_3);
22138 __pyx_t_1 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
22139 __Pyx_GOTREF(__pyx_t_1);
22140 #if CYTHON_COMPILING_IN_LIMITED_API
22141 __pyx_t_9 = PyBytes_AsString(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 73, __pyx_L1_error)
22142 #else
22143 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_3);
22144 #endif
22145 __pyx_t_7 = __pyx_array_new(__pyx_t_1, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 73, __pyx_L1_error)
22146 __Pyx_GOTREF((PyObject *)__pyx_t_7);
22147 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22148 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22149
22150 __pyx_t_10 = 1;
22151 #if CYTHON_UNPACK_METHODS
22152 if (unlikely(PyMethod_Check(__pyx_t_5))) {
22153 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
22154 assert(__pyx_t_2);
22155 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
22156 __Pyx_INCREF(__pyx_t_2);
22157 __Pyx_INCREF(__pyx__function);
22158 __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
22159 __pyx_t_10 = 0;
22160 }
22161 #endif
22162 {
22163 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_7)};
22164 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22165 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22166 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
22167 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22168 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 73, __pyx_L1_error)
22169 __Pyx_GOTREF(__pyx_t_8);
22170 }
22171 if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 73, __pyx_L1_error)
22172 __Pyx_GIVEREF(__pyx_t_8);
22173 __Pyx_GOTREF((PyObject *)__pyx_v_self->_ImH);
22174 __Pyx_DECREF((PyObject *)__pyx_v_self->_ImH);
22175 __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_8);
22176 __pyx_t_8 = 0;
22177
22178 /* "equivalent_polynomials.pyx":74
22179 * self._H = np.asarray(<double[:self.nQ]>self.s12.get_H())
22180 * self._ImH = np.asarray(<double[:self.nQ]>self.s12.get_ImH())
22181 * self._D = np.asarray(<double[:self.nQ]>self.s12.get_D()) # <<<<<<<<<<<<<<
22182 * self.inside_out = self.s12.inside_out
22183 * self.edge = self.s12.edge
22184*/
22185 __pyx_t_5 = NULL;
22186 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error)
22187 __Pyx_GOTREF(__pyx_t_2);
22188 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error)
22189 __Pyx_GOTREF(__pyx_t_3);
22190 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22191 __pyx_t_6 = __pyx_v_self->s12.get_D();
22192
22193 if (!__pyx_t_6) {
22194 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
22195 __PYX_ERR(0, 74, __pyx_L1_error)
22196 }
22197 __pyx_t_1 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
22198 __Pyx_GOTREF(__pyx_t_1);
22199 __pyx_t_2 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error)
22200 __Pyx_GOTREF(__pyx_t_2);
22201 #if CYTHON_COMPILING_IN_LIMITED_API
22202 __pyx_t_9 = PyBytes_AsString(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 74, __pyx_L1_error)
22203 #else
22204 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_1);
22205 #endif
22206 __pyx_t_7 = __pyx_array_new(__pyx_t_2, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 74, __pyx_L1_error)
22207 __Pyx_GOTREF((PyObject *)__pyx_t_7);
22208 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22209 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22210
22211 __pyx_t_10 = 1;
22212 #if CYTHON_UNPACK_METHODS
22213 if (unlikely(PyMethod_Check(__pyx_t_3))) {
22214 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
22215 assert(__pyx_t_5);
22216 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
22217 __Pyx_INCREF(__pyx_t_5);
22218 __Pyx_INCREF(__pyx__function);
22219 __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
22220 __pyx_t_10 = 0;
22221 }
22222 #endif
22223 {
22224 PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_t_7)};
22225 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22226 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
22227 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
22228 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22229 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 74, __pyx_L1_error)
22230 __Pyx_GOTREF(__pyx_t_8);
22231 }
22232 if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 74, __pyx_L1_error)
22233 __Pyx_GIVEREF(__pyx_t_8);
22234 __Pyx_GOTREF((PyObject *)__pyx_v_self->_D);
22235 __Pyx_DECREF((PyObject *)__pyx_v_self->_D);
22236 __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_8);
22237 __pyx_t_8 = 0;
22238
22239 /* "equivalent_polynomials.pyx":75
22240 * self._ImH = np.asarray(<double[:self.nQ]>self.s12.get_ImH())
22241 * self._D = np.asarray(<double[:self.nQ]>self.s12.get_D())
22242 * self.inside_out = self.s12.inside_out # <<<<<<<<<<<<<<
22243 * self.edge = self.s12.edge
22244 * self.corner = self.s12.corner
22245*/
22246 __pyx_t_11 = __pyx_v_self->s12.inside_out;
22247
22248 __pyx_v_self->inside_out = __pyx_t_11;
22249
22250 /* "equivalent_polynomials.pyx":76
22251 * self._D = np.asarray(<double[:self.nQ]>self.s12.get_D())
22252 * self.inside_out = self.s12.inside_out
22253 * self.edge = self.s12.edge # <<<<<<<<<<<<<<
22254 * self.corner = self.s12.corner
22255 * elif (self.nSpace,self.nP) == (1,3):
22256*/
22257 __pyx_t_12 = __pyx_v_self->s12.edge;
22258
22259 __pyx_v_self->edge = __pyx_t_12;
22260
22261 /* "equivalent_polynomials.pyx":77
22262 * self.inside_out = self.s12.inside_out
22263 * self.edge = self.s12.edge
22264 * self.corner = self.s12.corner # <<<<<<<<<<<<<<
22265 * elif (self.nSpace,self.nP) == (1,3):
22266 * icase = self.s13.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
22267*/
22268 __pyx_t_12 = __pyx_v_self->s12.corner;
22269
22270 __pyx_v_self->corner = __pyx_t_12;
22271
22272 /* "equivalent_polynomials.pyx":70
22273 * self.edge = self.s11.edge
22274 * self.corner = self.s11.corner
22275 * elif (self.nSpace,self.nP) == (1,2): # <<<<<<<<<<<<<<
22276 * icase = self.s12.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
22277 * self._H = np.asarray(<double[:self.nQ]>self.s12.get_H())
22278*/
22279 goto __pyx_L3;
22280 }
22281
22282 /* "equivalent_polynomials.pyx":78
22283 * self.edge = self.s12.edge
22284 * self.corner = self.s12.corner
22285 * elif (self.nSpace,self.nP) == (1,3): # <<<<<<<<<<<<<<
22286 * icase = self.s13.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
22287 * self._H = np.asarray(<double[:self.nQ]>self.s13.get_H())
22288*/
22289 __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_self->nSpace); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 78, __pyx_L1_error)
22290 __Pyx_GOTREF(__pyx_t_8);
22291 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_self->nP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error)
22292 __Pyx_GOTREF(__pyx_t_3);
22293 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
22294 __Pyx_GOTREF(__pyx_t_5);
22295 __Pyx_GIVEREF(__pyx_t_8);
22296 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 78, __pyx_L1_error);
22297 __Pyx_GIVEREF(__pyx_t_3);
22298 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 78, __pyx_L1_error);
22299 __pyx_t_8 = 0;
22300 __pyx_t_3 = 0;
22301 __pyx_t_4 = __Pyx_PyObject_RichCompareBool(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[6], Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 78, __pyx_L1_error)
22302 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22303 if (__pyx_t_4) {
22304
22305
22306 /* "equivalent_polynomials.pyx":79
22307 * self.corner = self.s12.corner
22308 * elif (self.nSpace,self.nP) == (1,3):
22309 * icase = self.s13.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False) # <<<<<<<<<<<<<<
22310 * self._H = np.asarray(<double[:self.nQ]>self.s13.get_H())
22311 * self._ImH = np.asarray(<double[:self.nQ]>self.s13.get_ImH())
22312*/
22313 __pyx_t_5 = ((PyObject *)__pyx_v_self->xiBuffer);
22314 __Pyx_INCREF(__pyx_t_5);
22315 __pyx_v_icase = __pyx_v_self->s13.calculate(((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_phi_dof)), ((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_phi_nodes)), ((double *)__pyx_f_5numpy_7ndarray_4data___get__(((PyArrayObject *)__pyx_t_5))), 0);
22316 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22317
22318 /* "equivalent_polynomials.pyx":80
22319 * elif (self.nSpace,self.nP) == (1,3):
22320 * icase = self.s13.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
22321 * self._H = np.asarray(<double[:self.nQ]>self.s13.get_H()) # <<<<<<<<<<<<<<
22322 * self._ImH = np.asarray(<double[:self.nQ]>self.s13.get_ImH())
22323 * self._D = np.asarray(<double[:self.nQ]>self.s13.get_D())
22324*/
22325 __pyx_t_3 = NULL;
22326 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 80, __pyx_L1_error)
22327 __Pyx_GOTREF(__pyx_t_8);
22328 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
22329 __Pyx_GOTREF(__pyx_t_1);
22330 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22331 __pyx_t_6 = __pyx_v_self->s13.get_H();
22332
22333 if (!__pyx_t_6) {
22334 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
22335 __PYX_ERR(0, 80, __pyx_L1_error)
22336 }
22337 __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error)
22338 __Pyx_GOTREF(__pyx_t_2);
22339 __pyx_t_8 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 80, __pyx_L1_error)
22340 __Pyx_GOTREF(__pyx_t_8);
22341 #if CYTHON_COMPILING_IN_LIMITED_API
22342 __pyx_t_9 = PyBytes_AsString(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 80, __pyx_L1_error)
22343 #else
22344 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_2);
22345 #endif
22346 __pyx_t_7 = __pyx_array_new(__pyx_t_8, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 80, __pyx_L1_error)
22347 __Pyx_GOTREF((PyObject *)__pyx_t_7);
22348 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22349 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22350
22351 __pyx_t_10 = 1;
22352 #if CYTHON_UNPACK_METHODS
22353 if (unlikely(PyMethod_Check(__pyx_t_1))) {
22354 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
22355 assert(__pyx_t_3);
22356 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
22357 __Pyx_INCREF(__pyx_t_3);
22358 __Pyx_INCREF(__pyx__function);
22359 __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
22360 __pyx_t_10 = 0;
22361 }
22362 #endif
22363 {
22364 PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_t_7)};
22365 __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22366 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
22367 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
22368 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22369 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 80, __pyx_L1_error)
22370 __Pyx_GOTREF(__pyx_t_5);
22371 }
22372 if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 80, __pyx_L1_error)
22373 __Pyx_GIVEREF(__pyx_t_5);
22374 __Pyx_GOTREF((PyObject *)__pyx_v_self->_H);
22375 __Pyx_DECREF((PyObject *)__pyx_v_self->_H);
22376 __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_5);
22377 __pyx_t_5 = 0;
22378
22379 /* "equivalent_polynomials.pyx":81
22380 * icase = self.s13.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
22381 * self._H = np.asarray(<double[:self.nQ]>self.s13.get_H())
22382 * self._ImH = np.asarray(<double[:self.nQ]>self.s13.get_ImH()) # <<<<<<<<<<<<<<
22383 * self._D = np.asarray(<double[:self.nQ]>self.s13.get_D())
22384 * self.inside_out = self.s13.inside_out
22385*/
22386 __pyx_t_1 = NULL;
22387 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error)
22388 __Pyx_GOTREF(__pyx_t_3);
22389 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
22390 __Pyx_GOTREF(__pyx_t_2);
22391 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22392 __pyx_t_6 = __pyx_v_self->s13.get_ImH();
22393
22394 if (!__pyx_t_6) {
22395 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
22396 __PYX_ERR(0, 81, __pyx_L1_error)
22397 }
22398 __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 81, __pyx_L1_error)
22399 __Pyx_GOTREF(__pyx_t_8);
22400 __pyx_t_3 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error)
22401 __Pyx_GOTREF(__pyx_t_3);
22402 #if CYTHON_COMPILING_IN_LIMITED_API
22403 __pyx_t_9 = PyBytes_AsString(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 81, __pyx_L1_error)
22404 #else
22405 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_8);
22406 #endif
22407 __pyx_t_7 = __pyx_array_new(__pyx_t_3, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 81, __pyx_L1_error)
22408 __Pyx_GOTREF((PyObject *)__pyx_t_7);
22409 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22410 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22411
22412 __pyx_t_10 = 1;
22413 #if CYTHON_UNPACK_METHODS
22414 if (unlikely(PyMethod_Check(__pyx_t_2))) {
22415 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
22416 assert(__pyx_t_1);
22417 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
22418 __Pyx_INCREF(__pyx_t_1);
22419 __Pyx_INCREF(__pyx__function);
22420 __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
22421 __pyx_t_10 = 0;
22422 }
22423 #endif
22424 {
22425 PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_t_7)};
22426 __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22427 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22428 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
22429 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22430 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 81, __pyx_L1_error)
22431 __Pyx_GOTREF(__pyx_t_5);
22432 }
22433 if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 81, __pyx_L1_error)
22434 __Pyx_GIVEREF(__pyx_t_5);
22435 __Pyx_GOTREF((PyObject *)__pyx_v_self->_ImH);
22436 __Pyx_DECREF((PyObject *)__pyx_v_self->_ImH);
22437 __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_5);
22438 __pyx_t_5 = 0;
22439
22440 /* "equivalent_polynomials.pyx":82
22441 * self._H = np.asarray(<double[:self.nQ]>self.s13.get_H())
22442 * self._ImH = np.asarray(<double[:self.nQ]>self.s13.get_ImH())
22443 * self._D = np.asarray(<double[:self.nQ]>self.s13.get_D()) # <<<<<<<<<<<<<<
22444 * self.inside_out = self.s13.inside_out
22445 * self.edge = self.s13.edge
22446*/
22447 __pyx_t_2 = NULL;
22448 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
22449 __Pyx_GOTREF(__pyx_t_1);
22450 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 82, __pyx_L1_error)
22451 __Pyx_GOTREF(__pyx_t_8);
22452 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22453 __pyx_t_6 = __pyx_v_self->s13.get_D();
22454
22455 if (!__pyx_t_6) {
22456 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
22457 __PYX_ERR(0, 82, __pyx_L1_error)
22458 }
22459 __pyx_t_3 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error)
22460 __Pyx_GOTREF(__pyx_t_3);
22461 __pyx_t_1 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
22462 __Pyx_GOTREF(__pyx_t_1);
22463 #if CYTHON_COMPILING_IN_LIMITED_API
22464 __pyx_t_9 = PyBytes_AsString(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 82, __pyx_L1_error)
22465 #else
22466 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_3);
22467 #endif
22468 __pyx_t_7 = __pyx_array_new(__pyx_t_1, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 82, __pyx_L1_error)
22469 __Pyx_GOTREF((PyObject *)__pyx_t_7);
22470 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22471 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22472
22473 __pyx_t_10 = 1;
22474 #if CYTHON_UNPACK_METHODS
22475 if (unlikely(PyMethod_Check(__pyx_t_8))) {
22476 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
22477 assert(__pyx_t_2);
22478 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
22479 __Pyx_INCREF(__pyx_t_2);
22480 __Pyx_INCREF(__pyx__function);
22481 __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
22482 __pyx_t_10 = 0;
22483 }
22484 #endif
22485 {
22486 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_7)};
22487 __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22488 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22489 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
22490 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22491 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 82, __pyx_L1_error)
22492 __Pyx_GOTREF(__pyx_t_5);
22493 }
22494 if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 82, __pyx_L1_error)
22495 __Pyx_GIVEREF(__pyx_t_5);
22496 __Pyx_GOTREF((PyObject *)__pyx_v_self->_D);
22497 __Pyx_DECREF((PyObject *)__pyx_v_self->_D);
22498 __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_5);
22499 __pyx_t_5 = 0;
22500
22501 /* "equivalent_polynomials.pyx":83
22502 * self._ImH = np.asarray(<double[:self.nQ]>self.s13.get_ImH())
22503 * self._D = np.asarray(<double[:self.nQ]>self.s13.get_D())
22504 * self.inside_out = self.s13.inside_out # <<<<<<<<<<<<<<
22505 * self.edge = self.s13.edge
22506 * self.corner = self.s13.corner
22507*/
22508 __pyx_t_11 = __pyx_v_self->s13.inside_out;
22509
22510 __pyx_v_self->inside_out = __pyx_t_11;
22511
22512 /* "equivalent_polynomials.pyx":84
22513 * self._D = np.asarray(<double[:self.nQ]>self.s13.get_D())
22514 * self.inside_out = self.s13.inside_out
22515 * self.edge = self.s13.edge # <<<<<<<<<<<<<<
22516 * self.corner = self.s13.corner
22517 * elif (self.nSpace,self.nP) == (2,1):
22518*/
22519 __pyx_t_12 = __pyx_v_self->s13.edge;
22520
22521 __pyx_v_self->edge = __pyx_t_12;
22522
22523 /* "equivalent_polynomials.pyx":85
22524 * self.inside_out = self.s13.inside_out
22525 * self.edge = self.s13.edge
22526 * self.corner = self.s13.corner # <<<<<<<<<<<<<<
22527 * elif (self.nSpace,self.nP) == (2,1):
22528 * icase = self.s21.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
22529*/
22530 __pyx_t_12 = __pyx_v_self->s13.corner;
22531
22532 __pyx_v_self->corner = __pyx_t_12;
22533
22534 /* "equivalent_polynomials.pyx":78
22535 * self.edge = self.s12.edge
22536 * self.corner = self.s12.corner
22537 * elif (self.nSpace,self.nP) == (1,3): # <<<<<<<<<<<<<<
22538 * icase = self.s13.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
22539 * self._H = np.asarray(<double[:self.nQ]>self.s13.get_H())
22540*/
22541 goto __pyx_L3;
22542 }
22543
22544 /* "equivalent_polynomials.pyx":86
22545 * self.edge = self.s13.edge
22546 * self.corner = self.s13.corner
22547 * elif (self.nSpace,self.nP) == (2,1): # <<<<<<<<<<<<<<
22548 * icase = self.s21.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
22549 * self._H = np.asarray(<double[:self.nQ]>self.s21.get_H())
22550*/
22551 __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_self->nSpace); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error)
22552 __Pyx_GOTREF(__pyx_t_5);
22553 __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_self->nP); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 86, __pyx_L1_error)
22554 __Pyx_GOTREF(__pyx_t_8);
22555 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
22556 __Pyx_GOTREF(__pyx_t_2);
22557 __Pyx_GIVEREF(__pyx_t_5);
22558 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 86, __pyx_L1_error);
22559 __Pyx_GIVEREF(__pyx_t_8);
22560 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 86, __pyx_L1_error);
22561 __pyx_t_5 = 0;
22562 __pyx_t_8 = 0;
22563 __pyx_t_4 = __Pyx_PyObject_RichCompareBool(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[7], Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 86, __pyx_L1_error)
22564 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22565 if (__pyx_t_4) {
22566
22567
22568 /* "equivalent_polynomials.pyx":87
22569 * self.corner = self.s13.corner
22570 * elif (self.nSpace,self.nP) == (2,1):
22571 * icase = self.s21.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False) # <<<<<<<<<<<<<<
22572 * self._H = np.asarray(<double[:self.nQ]>self.s21.get_H())
22573 * self._ImH = np.asarray(<double[:self.nQ]>self.s21.get_ImH())
22574*/
22575 __pyx_t_2 = ((PyObject *)__pyx_v_self->xiBuffer);
22576 __Pyx_INCREF(__pyx_t_2);
22577 __pyx_v_icase = __pyx_v_self->s21.calculate(((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_phi_dof)), ((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_phi_nodes)), ((double *)__pyx_f_5numpy_7ndarray_4data___get__(((PyArrayObject *)__pyx_t_2))), 0);
22578 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22579
22580 /* "equivalent_polynomials.pyx":88
22581 * elif (self.nSpace,self.nP) == (2,1):
22582 * icase = self.s21.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
22583 * self._H = np.asarray(<double[:self.nQ]>self.s21.get_H()) # <<<<<<<<<<<<<<
22584 * self._ImH = np.asarray(<double[:self.nQ]>self.s21.get_ImH())
22585 * self._D = np.asarray(<double[:self.nQ]>self.s21.get_D())
22586*/
22587 __pyx_t_8 = NULL;
22588 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error)
22589 __Pyx_GOTREF(__pyx_t_5);
22590 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error)
22591 __Pyx_GOTREF(__pyx_t_3);
22592 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22593 __pyx_t_6 = __pyx_v_self->s21.get_H();
22594
22595 if (!__pyx_t_6) {
22596 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
22597 __PYX_ERR(0, 88, __pyx_L1_error)
22598 }
22599 __pyx_t_1 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
22600 __Pyx_GOTREF(__pyx_t_1);
22601 __pyx_t_5 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error)
22602 __Pyx_GOTREF(__pyx_t_5);
22603 #if CYTHON_COMPILING_IN_LIMITED_API
22604 __pyx_t_9 = PyBytes_AsString(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 88, __pyx_L1_error)
22605 #else
22606 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_1);
22607 #endif
22608 __pyx_t_7 = __pyx_array_new(__pyx_t_5, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 88, __pyx_L1_error)
22609 __Pyx_GOTREF((PyObject *)__pyx_t_7);
22610 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22611 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22612
22613 __pyx_t_10 = 1;
22614 #if CYTHON_UNPACK_METHODS
22615 if (unlikely(PyMethod_Check(__pyx_t_3))) {
22616 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
22617 assert(__pyx_t_8);
22618 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
22619 __Pyx_INCREF(__pyx_t_8);
22620 __Pyx_INCREF(__pyx__function);
22621 __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
22622 __pyx_t_10 = 0;
22623 }
22624 #endif
22625 {
22626 PyObject *__pyx_callargs[2] = {__pyx_t_8, ((PyObject *)__pyx_t_7)};
22627 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22628 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
22629 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
22630 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22631 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
22632 __Pyx_GOTREF(__pyx_t_2);
22633 }
22634 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 88, __pyx_L1_error)
22635 __Pyx_GIVEREF(__pyx_t_2);
22636 __Pyx_GOTREF((PyObject *)__pyx_v_self->_H);
22637 __Pyx_DECREF((PyObject *)__pyx_v_self->_H);
22638 __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_2);
22639 __pyx_t_2 = 0;
22640
22641 /* "equivalent_polynomials.pyx":89
22642 * icase = self.s21.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
22643 * self._H = np.asarray(<double[:self.nQ]>self.s21.get_H())
22644 * self._ImH = np.asarray(<double[:self.nQ]>self.s21.get_ImH()) # <<<<<<<<<<<<<<
22645 * self._D = np.asarray(<double[:self.nQ]>self.s21.get_D())
22646 * self.inside_out = self.s21.inside_out
22647*/
22648 __pyx_t_3 = NULL;
22649 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 89, __pyx_L1_error)
22650 __Pyx_GOTREF(__pyx_t_8);
22651 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
22652 __Pyx_GOTREF(__pyx_t_1);
22653 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22654 __pyx_t_6 = __pyx_v_self->s21.get_ImH();
22655
22656 if (!__pyx_t_6) {
22657 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
22658 __PYX_ERR(0, 89, __pyx_L1_error)
22659 }
22660 __pyx_t_5 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error)
22661 __Pyx_GOTREF(__pyx_t_5);
22662 __pyx_t_8 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 89, __pyx_L1_error)
22663 __Pyx_GOTREF(__pyx_t_8);
22664 #if CYTHON_COMPILING_IN_LIMITED_API
22665 __pyx_t_9 = PyBytes_AsString(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 89, __pyx_L1_error)
22666 #else
22667 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_5);
22668 #endif
22669 __pyx_t_7 = __pyx_array_new(__pyx_t_8, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 89, __pyx_L1_error)
22670 __Pyx_GOTREF((PyObject *)__pyx_t_7);
22671 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22672 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22673
22674 __pyx_t_10 = 1;
22675 #if CYTHON_UNPACK_METHODS
22676 if (unlikely(PyMethod_Check(__pyx_t_1))) {
22677 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
22678 assert(__pyx_t_3);
22679 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
22680 __Pyx_INCREF(__pyx_t_3);
22681 __Pyx_INCREF(__pyx__function);
22682 __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
22683 __pyx_t_10 = 0;
22684 }
22685 #endif
22686 {
22687 PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_t_7)};
22688 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22689 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
22690 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
22691 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22692 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error)
22693 __Pyx_GOTREF(__pyx_t_2);
22694 }
22695 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 89, __pyx_L1_error)
22696 __Pyx_GIVEREF(__pyx_t_2);
22697 __Pyx_GOTREF((PyObject *)__pyx_v_self->_ImH);
22698 __Pyx_DECREF((PyObject *)__pyx_v_self->_ImH);
22699 __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_2);
22700 __pyx_t_2 = 0;
22701
22702 /* "equivalent_polynomials.pyx":90
22703 * self._H = np.asarray(<double[:self.nQ]>self.s21.get_H())
22704 * self._ImH = np.asarray(<double[:self.nQ]>self.s21.get_ImH())
22705 * self._D = np.asarray(<double[:self.nQ]>self.s21.get_D()) # <<<<<<<<<<<<<<
22706 * self.inside_out = self.s21.inside_out
22707 * self.edge = self.s21.edge
22708*/
22709 __pyx_t_1 = NULL;
22710 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error)
22711 __Pyx_GOTREF(__pyx_t_3);
22712 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 90, __pyx_L1_error)
22713 __Pyx_GOTREF(__pyx_t_5);
22714 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22715 __pyx_t_6 = __pyx_v_self->s21.get_D();
22716
22717 if (!__pyx_t_6) {
22718 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
22719 __PYX_ERR(0, 90, __pyx_L1_error)
22720 }
22721 __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 90, __pyx_L1_error)
22722 __Pyx_GOTREF(__pyx_t_8);
22723 __pyx_t_3 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error)
22724 __Pyx_GOTREF(__pyx_t_3);
22725 #if CYTHON_COMPILING_IN_LIMITED_API
22726 __pyx_t_9 = PyBytes_AsString(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 90, __pyx_L1_error)
22727 #else
22728 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_8);
22729 #endif
22730 __pyx_t_7 = __pyx_array_new(__pyx_t_3, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 90, __pyx_L1_error)
22731 __Pyx_GOTREF((PyObject *)__pyx_t_7);
22732 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22733 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22734
22735 __pyx_t_10 = 1;
22736 #if CYTHON_UNPACK_METHODS
22737 if (unlikely(PyMethod_Check(__pyx_t_5))) {
22738 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
22739 assert(__pyx_t_1);
22740 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
22741 __Pyx_INCREF(__pyx_t_1);
22742 __Pyx_INCREF(__pyx__function);
22743 __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
22744 __pyx_t_10 = 0;
22745 }
22746 #endif
22747 {
22748 PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_t_7)};
22749 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22750 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22751 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
22752 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22753 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error)
22754 __Pyx_GOTREF(__pyx_t_2);
22755 }
22756 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 90, __pyx_L1_error)
22757 __Pyx_GIVEREF(__pyx_t_2);
22758 __Pyx_GOTREF((PyObject *)__pyx_v_self->_D);
22759 __Pyx_DECREF((PyObject *)__pyx_v_self->_D);
22760 __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_2);
22761 __pyx_t_2 = 0;
22762
22763 /* "equivalent_polynomials.pyx":91
22764 * self._ImH = np.asarray(<double[:self.nQ]>self.s21.get_ImH())
22765 * self._D = np.asarray(<double[:self.nQ]>self.s21.get_D())
22766 * self.inside_out = self.s21.inside_out # <<<<<<<<<<<<<<
22767 * self.edge = self.s21.edge
22768 * self.corner = self.s21.corner
22769*/
22770 __pyx_t_11 = __pyx_v_self->s21.inside_out;
22771
22772 __pyx_v_self->inside_out = __pyx_t_11;
22773
22774 /* "equivalent_polynomials.pyx":92
22775 * self._D = np.asarray(<double[:self.nQ]>self.s21.get_D())
22776 * self.inside_out = self.s21.inside_out
22777 * self.edge = self.s21.edge # <<<<<<<<<<<<<<
22778 * self.corner = self.s21.corner
22779 * elif (self.nSpace,self.nP) == (2,2):
22780*/
22781 __pyx_t_12 = __pyx_v_self->s21.edge;
22782
22783 __pyx_v_self->edge = __pyx_t_12;
22784
22785 /* "equivalent_polynomials.pyx":93
22786 * self.inside_out = self.s21.inside_out
22787 * self.edge = self.s21.edge
22788 * self.corner = self.s21.corner # <<<<<<<<<<<<<<
22789 * elif (self.nSpace,self.nP) == (2,2):
22790 * icase = self.s22.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
22791*/
22792 __pyx_t_12 = __pyx_v_self->s21.corner;
22793
22794 __pyx_v_self->corner = __pyx_t_12;
22795
22796 /* "equivalent_polynomials.pyx":86
22797 * self.edge = self.s13.edge
22798 * self.corner = self.s13.corner
22799 * elif (self.nSpace,self.nP) == (2,1): # <<<<<<<<<<<<<<
22800 * icase = self.s21.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
22801 * self._H = np.asarray(<double[:self.nQ]>self.s21.get_H())
22802*/
22803 goto __pyx_L3;
22804 }
22805
22806 /* "equivalent_polynomials.pyx":94
22807 * self.edge = self.s21.edge
22808 * self.corner = self.s21.corner
22809 * elif (self.nSpace,self.nP) == (2,2): # <<<<<<<<<<<<<<
22810 * icase = self.s22.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
22811 * self._H = np.asarray(<double[:self.nQ]>self.s22.get_H())
22812*/
22813 __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_self->nSpace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error)
22814 __Pyx_GOTREF(__pyx_t_2);
22815 __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_self->nP); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 94, __pyx_L1_error)
22816 __Pyx_GOTREF(__pyx_t_5);
22817 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
22818 __Pyx_GOTREF(__pyx_t_1);
22819 __Pyx_GIVEREF(__pyx_t_2);
22820 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 94, __pyx_L1_error);
22821 __Pyx_GIVEREF(__pyx_t_5);
22822 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5) != (0)) __PYX_ERR(0, 94, __pyx_L1_error);
22823 __pyx_t_2 = 0;
22824 __pyx_t_5 = 0;
22825 __pyx_t_4 = __Pyx_PyObject_RichCompareBool(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[8], Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 94, __pyx_L1_error)
22826 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22827 if (__pyx_t_4) {
22828
22829
22830 /* "equivalent_polynomials.pyx":95
22831 * self.corner = self.s21.corner
22832 * elif (self.nSpace,self.nP) == (2,2):
22833 * icase = self.s22.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False) # <<<<<<<<<<<<<<
22834 * self._H = np.asarray(<double[:self.nQ]>self.s22.get_H())
22835 * self._ImH = np.asarray(<double[:self.nQ]>self.s22.get_ImH())
22836*/
22837 __pyx_t_1 = ((PyObject *)__pyx_v_self->xiBuffer);
22838 __Pyx_INCREF(__pyx_t_1);
22839 __pyx_v_icase = __pyx_v_self->s22.calculate(((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_phi_dof)), ((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_phi_nodes)), ((double *)__pyx_f_5numpy_7ndarray_4data___get__(((PyArrayObject *)__pyx_t_1))), 0);
22840 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22841
22842 /* "equivalent_polynomials.pyx":96
22843 * elif (self.nSpace,self.nP) == (2,2):
22844 * icase = self.s22.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
22845 * self._H = np.asarray(<double[:self.nQ]>self.s22.get_H()) # <<<<<<<<<<<<<<
22846 * self._ImH = np.asarray(<double[:self.nQ]>self.s22.get_ImH())
22847 * self._D = np.asarray(<double[:self.nQ]>self.s22.get_D())
22848*/
22849 __pyx_t_5 = NULL;
22850 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error)
22851 __Pyx_GOTREF(__pyx_t_2);
22852 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 96, __pyx_L1_error)
22853 __Pyx_GOTREF(__pyx_t_8);
22854 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22855 __pyx_t_6 = __pyx_v_self->s22.get_H();
22856
22857 if (!__pyx_t_6) {
22858 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
22859 __PYX_ERR(0, 96, __pyx_L1_error)
22860 }
22861 __pyx_t_3 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
22862 __Pyx_GOTREF(__pyx_t_3);
22863 __pyx_t_2 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error)
22864 __Pyx_GOTREF(__pyx_t_2);
22865 #if CYTHON_COMPILING_IN_LIMITED_API
22866 __pyx_t_9 = PyBytes_AsString(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 96, __pyx_L1_error)
22867 #else
22868 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_3);
22869 #endif
22870 __pyx_t_7 = __pyx_array_new(__pyx_t_2, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 96, __pyx_L1_error)
22871 __Pyx_GOTREF((PyObject *)__pyx_t_7);
22872 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22873 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22874
22875 __pyx_t_10 = 1;
22876 #if CYTHON_UNPACK_METHODS
22877 if (unlikely(PyMethod_Check(__pyx_t_8))) {
22878 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
22879 assert(__pyx_t_5);
22880 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
22881 __Pyx_INCREF(__pyx_t_5);
22882 __Pyx_INCREF(__pyx__function);
22883 __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
22884 __pyx_t_10 = 0;
22885 }
22886 #endif
22887 {
22888 PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_t_7)};
22889 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22890 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
22891 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
22892 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22893 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
22894 __Pyx_GOTREF(__pyx_t_1);
22895 }
22896 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 96, __pyx_L1_error)
22897 __Pyx_GIVEREF(__pyx_t_1);
22898 __Pyx_GOTREF((PyObject *)__pyx_v_self->_H);
22899 __Pyx_DECREF((PyObject *)__pyx_v_self->_H);
22900 __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_1);
22901 __pyx_t_1 = 0;
22902
22903 /* "equivalent_polynomials.pyx":97
22904 * icase = self.s22.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
22905 * self._H = np.asarray(<double[:self.nQ]>self.s22.get_H())
22906 * self._ImH = np.asarray(<double[:self.nQ]>self.s22.get_ImH()) # <<<<<<<<<<<<<<
22907 * self._D = np.asarray(<double[:self.nQ]>self.s22.get_D())
22908 * self.inside_out = self.s22.inside_out
22909*/
22910 __pyx_t_8 = NULL;
22911 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error)
22912 __Pyx_GOTREF(__pyx_t_5);
22913 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error)
22914 __Pyx_GOTREF(__pyx_t_3);
22915 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22916 __pyx_t_6 = __pyx_v_self->s22.get_ImH();
22917
22918 if (!__pyx_t_6) {
22919 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
22920 __PYX_ERR(0, 97, __pyx_L1_error)
22921 }
22922 __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
22923 __Pyx_GOTREF(__pyx_t_2);
22924 __pyx_t_5 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error)
22925 __Pyx_GOTREF(__pyx_t_5);
22926 #if CYTHON_COMPILING_IN_LIMITED_API
22927 __pyx_t_9 = PyBytes_AsString(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 97, __pyx_L1_error)
22928 #else
22929 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_2);
22930 #endif
22931 __pyx_t_7 = __pyx_array_new(__pyx_t_5, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 97, __pyx_L1_error)
22932 __Pyx_GOTREF((PyObject *)__pyx_t_7);
22933 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22934 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22935
22936 __pyx_t_10 = 1;
22937 #if CYTHON_UNPACK_METHODS
22938 if (unlikely(PyMethod_Check(__pyx_t_3))) {
22939 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
22940 assert(__pyx_t_8);
22941 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
22942 __Pyx_INCREF(__pyx_t_8);
22943 __Pyx_INCREF(__pyx__function);
22944 __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
22945 __pyx_t_10 = 0;
22946 }
22947 #endif
22948 {
22949 PyObject *__pyx_callargs[2] = {__pyx_t_8, ((PyObject *)__pyx_t_7)};
22950 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22951 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
22952 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
22953 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22954 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
22955 __Pyx_GOTREF(__pyx_t_1);
22956 }
22957 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 97, __pyx_L1_error)
22958 __Pyx_GIVEREF(__pyx_t_1);
22959 __Pyx_GOTREF((PyObject *)__pyx_v_self->_ImH);
22960 __Pyx_DECREF((PyObject *)__pyx_v_self->_ImH);
22961 __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_1);
22962 __pyx_t_1 = 0;
22963
22964 /* "equivalent_polynomials.pyx":98
22965 * self._H = np.asarray(<double[:self.nQ]>self.s22.get_H())
22966 * self._ImH = np.asarray(<double[:self.nQ]>self.s22.get_ImH())
22967 * self._D = np.asarray(<double[:self.nQ]>self.s22.get_D()) # <<<<<<<<<<<<<<
22968 * self.inside_out = self.s22.inside_out
22969 * self.edge = self.s22.edge
22970*/
22971 __pyx_t_3 = NULL;
22972 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 98, __pyx_L1_error)
22973 __Pyx_GOTREF(__pyx_t_8);
22974 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error)
22975 __Pyx_GOTREF(__pyx_t_2);
22976 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22977 __pyx_t_6 = __pyx_v_self->s22.get_D();
22978
22979 if (!__pyx_t_6) {
22980 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
22981 __PYX_ERR(0, 98, __pyx_L1_error)
22982 }
22983 __pyx_t_5 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 98, __pyx_L1_error)
22984 __Pyx_GOTREF(__pyx_t_5);
22985 __pyx_t_8 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 98, __pyx_L1_error)
22986 __Pyx_GOTREF(__pyx_t_8);
22987 #if CYTHON_COMPILING_IN_LIMITED_API
22988 __pyx_t_9 = PyBytes_AsString(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 98, __pyx_L1_error)
22989 #else
22990 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_5);
22991 #endif
22992 __pyx_t_7 = __pyx_array_new(__pyx_t_8, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 98, __pyx_L1_error)
22993 __Pyx_GOTREF((PyObject *)__pyx_t_7);
22994 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22995 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22996
22997 __pyx_t_10 = 1;
22998 #if CYTHON_UNPACK_METHODS
22999 if (unlikely(PyMethod_Check(__pyx_t_2))) {
23000 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
23001 assert(__pyx_t_3);
23002 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
23003 __Pyx_INCREF(__pyx_t_3);
23004 __Pyx_INCREF(__pyx__function);
23005 __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
23006 __pyx_t_10 = 0;
23007 }
23008 #endif
23009 {
23010 PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_t_7)};
23011 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
23012 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
23013 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
23014 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23015 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
23016 __Pyx_GOTREF(__pyx_t_1);
23017 }
23018 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 98, __pyx_L1_error)
23019 __Pyx_GIVEREF(__pyx_t_1);
23020 __Pyx_GOTREF((PyObject *)__pyx_v_self->_D);
23021 __Pyx_DECREF((PyObject *)__pyx_v_self->_D);
23022 __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_1);
23023 __pyx_t_1 = 0;
23024
23025 /* "equivalent_polynomials.pyx":99
23026 * self._ImH = np.asarray(<double[:self.nQ]>self.s22.get_ImH())
23027 * self._D = np.asarray(<double[:self.nQ]>self.s22.get_D())
23028 * self.inside_out = self.s22.inside_out # <<<<<<<<<<<<<<
23029 * self.edge = self.s22.edge
23030 * self.corner = self.s22.corner
23031*/
23032 __pyx_t_11 = __pyx_v_self->s22.inside_out;
23033
23034 __pyx_v_self->inside_out = __pyx_t_11;
23035
23036 /* "equivalent_polynomials.pyx":100
23037 * self._D = np.asarray(<double[:self.nQ]>self.s22.get_D())
23038 * self.inside_out = self.s22.inside_out
23039 * self.edge = self.s22.edge # <<<<<<<<<<<<<<
23040 * self.corner = self.s22.corner
23041 * elif (self.nSpace,self.nP) == (2,3):
23042*/
23043 __pyx_t_12 = __pyx_v_self->s22.edge;
23044
23045 __pyx_v_self->edge = __pyx_t_12;
23046
23047 /* "equivalent_polynomials.pyx":101
23048 * self.inside_out = self.s22.inside_out
23049 * self.edge = self.s22.edge
23050 * self.corner = self.s22.corner # <<<<<<<<<<<<<<
23051 * elif (self.nSpace,self.nP) == (2,3):
23052 * icase = self.s23.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
23053*/
23054 __pyx_t_12 = __pyx_v_self->s22.corner;
23055
23056 __pyx_v_self->corner = __pyx_t_12;
23057
23058 /* "equivalent_polynomials.pyx":94
23059 * self.edge = self.s21.edge
23060 * self.corner = self.s21.corner
23061 * elif (self.nSpace,self.nP) == (2,2): # <<<<<<<<<<<<<<
23062 * icase = self.s22.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
23063 * self._H = np.asarray(<double[:self.nQ]>self.s22.get_H())
23064*/
23065 goto __pyx_L3;
23066 }
23067
23068 /* "equivalent_polynomials.pyx":102
23069 * self.edge = self.s22.edge
23070 * self.corner = self.s22.corner
23071 * elif (self.nSpace,self.nP) == (2,3): # <<<<<<<<<<<<<<
23072 * icase = self.s23.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
23073 * self._H = np.asarray(<double[:self.nQ]>self.s23.get_H())
23074*/
23075 __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->nSpace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error)
23076 __Pyx_GOTREF(__pyx_t_1);
23077 __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_self->nP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error)
23078 __Pyx_GOTREF(__pyx_t_2);
23079 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error)
23080 __Pyx_GOTREF(__pyx_t_3);
23081 __Pyx_GIVEREF(__pyx_t_1);
23082 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 102, __pyx_L1_error);
23083 __Pyx_GIVEREF(__pyx_t_2);
23084 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 102, __pyx_L1_error);
23085 __pyx_t_1 = 0;
23086 __pyx_t_2 = 0;
23087 __pyx_t_4 = __Pyx_PyObject_RichCompareBool(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[9], Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 102, __pyx_L1_error)
23088 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23089 if (__pyx_t_4) {
23090
23091
23092 /* "equivalent_polynomials.pyx":103
23093 * self.corner = self.s22.corner
23094 * elif (self.nSpace,self.nP) == (2,3):
23095 * icase = self.s23.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False) # <<<<<<<<<<<<<<
23096 * self._H = np.asarray(<double[:self.nQ]>self.s23.get_H())
23097 * self._ImH = np.asarray(<double[:self.nQ]>self.s23.get_ImH())
23098*/
23099 __pyx_t_3 = ((PyObject *)__pyx_v_self->xiBuffer);
23100 __Pyx_INCREF(__pyx_t_3);
23101 __pyx_v_icase = __pyx_v_self->s23.calculate(((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_phi_dof)), ((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_phi_nodes)), ((double *)__pyx_f_5numpy_7ndarray_4data___get__(((PyArrayObject *)__pyx_t_3))), 0);
23102 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23103
23104 /* "equivalent_polynomials.pyx":104
23105 * elif (self.nSpace,self.nP) == (2,3):
23106 * icase = self.s23.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
23107 * self._H = np.asarray(<double[:self.nQ]>self.s23.get_H()) # <<<<<<<<<<<<<<
23108 * self._ImH = np.asarray(<double[:self.nQ]>self.s23.get_ImH())
23109 * self._D = np.asarray(<double[:self.nQ]>self.s23.get_D())
23110*/
23111 __pyx_t_2 = NULL;
23112 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
23113 __Pyx_GOTREF(__pyx_t_1);
23114 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 104, __pyx_L1_error)
23115 __Pyx_GOTREF(__pyx_t_5);
23116 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23117 __pyx_t_6 = __pyx_v_self->s23.get_H();
23118
23119 if (!__pyx_t_6) {
23120 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
23121 __PYX_ERR(0, 104, __pyx_L1_error)
23122 }
23123 __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 104, __pyx_L1_error)
23124 __Pyx_GOTREF(__pyx_t_8);
23125 __pyx_t_1 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
23126 __Pyx_GOTREF(__pyx_t_1);
23127 #if CYTHON_COMPILING_IN_LIMITED_API
23128 __pyx_t_9 = PyBytes_AsString(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 104, __pyx_L1_error)
23129 #else
23130 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_8);
23131 #endif
23132 __pyx_t_7 = __pyx_array_new(__pyx_t_1, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 104, __pyx_L1_error)
23133 __Pyx_GOTREF((PyObject *)__pyx_t_7);
23134 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23135 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23136
23137 __pyx_t_10 = 1;
23138 #if CYTHON_UNPACK_METHODS
23139 if (unlikely(PyMethod_Check(__pyx_t_5))) {
23140 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
23141 assert(__pyx_t_2);
23142 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
23143 __Pyx_INCREF(__pyx_t_2);
23144 __Pyx_INCREF(__pyx__function);
23145 __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
23146 __pyx_t_10 = 0;
23147 }
23148 #endif
23149 {
23150 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_7)};
23151 __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
23152 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23153 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
23154 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23155 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error)
23156 __Pyx_GOTREF(__pyx_t_3);
23157 }
23158 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 104, __pyx_L1_error)
23159 __Pyx_GIVEREF(__pyx_t_3);
23160 __Pyx_GOTREF((PyObject *)__pyx_v_self->_H);
23161 __Pyx_DECREF((PyObject *)__pyx_v_self->_H);
23162 __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_3);
23163 __pyx_t_3 = 0;
23164
23165 /* "equivalent_polynomials.pyx":105
23166 * icase = self.s23.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
23167 * self._H = np.asarray(<double[:self.nQ]>self.s23.get_H())
23168 * self._ImH = np.asarray(<double[:self.nQ]>self.s23.get_ImH()) # <<<<<<<<<<<<<<
23169 * self._D = np.asarray(<double[:self.nQ]>self.s23.get_D())
23170 * self.inside_out = self.s23.inside_out
23171*/
23172 __pyx_t_5 = NULL;
23173 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
23174 __Pyx_GOTREF(__pyx_t_2);
23175 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 105, __pyx_L1_error)
23176 __Pyx_GOTREF(__pyx_t_8);
23177 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23178 __pyx_t_6 = __pyx_v_self->s23.get_ImH();
23179
23180 if (!__pyx_t_6) {
23181 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
23182 __PYX_ERR(0, 105, __pyx_L1_error)
23183 }
23184 __pyx_t_1 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
23185 __Pyx_GOTREF(__pyx_t_1);
23186 __pyx_t_2 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
23187 __Pyx_GOTREF(__pyx_t_2);
23188 #if CYTHON_COMPILING_IN_LIMITED_API
23189 __pyx_t_9 = PyBytes_AsString(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 105, __pyx_L1_error)
23190 #else
23191 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_1);
23192 #endif
23193 __pyx_t_7 = __pyx_array_new(__pyx_t_2, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 105, __pyx_L1_error)
23194 __Pyx_GOTREF((PyObject *)__pyx_t_7);
23195 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23196 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23197
23198 __pyx_t_10 = 1;
23199 #if CYTHON_UNPACK_METHODS
23200 if (unlikely(PyMethod_Check(__pyx_t_8))) {
23201 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
23202 assert(__pyx_t_5);
23203 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
23204 __Pyx_INCREF(__pyx_t_5);
23205 __Pyx_INCREF(__pyx__function);
23206 __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
23207 __pyx_t_10 = 0;
23208 }
23209 #endif
23210 {
23211 PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_t_7)};
23212 __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
23213 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
23214 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
23215 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23216 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error)
23217 __Pyx_GOTREF(__pyx_t_3);
23218 }
23219 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 105, __pyx_L1_error)
23220 __Pyx_GIVEREF(__pyx_t_3);
23221 __Pyx_GOTREF((PyObject *)__pyx_v_self->_ImH);
23222 __Pyx_DECREF((PyObject *)__pyx_v_self->_ImH);
23223 __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_3);
23224 __pyx_t_3 = 0;
23225
23226 /* "equivalent_polynomials.pyx":106
23227 * self._H = np.asarray(<double[:self.nQ]>self.s23.get_H())
23228 * self._ImH = np.asarray(<double[:self.nQ]>self.s23.get_ImH())
23229 * self._D = np.asarray(<double[:self.nQ]>self.s23.get_D()) # <<<<<<<<<<<<<<
23230 * self.inside_out = self.s23.inside_out
23231 * self.edge = self.s23.edge
23232*/
23233 __pyx_t_8 = NULL;
23234 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 106, __pyx_L1_error)
23235 __Pyx_GOTREF(__pyx_t_5);
23236 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error)
23237 __Pyx_GOTREF(__pyx_t_1);
23238 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23239 __pyx_t_6 = __pyx_v_self->s23.get_D();
23240
23241 if (!__pyx_t_6) {
23242 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
23243 __PYX_ERR(0, 106, __pyx_L1_error)
23244 }
23245 __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error)
23246 __Pyx_GOTREF(__pyx_t_2);
23247 __pyx_t_5 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 106, __pyx_L1_error)
23248 __Pyx_GOTREF(__pyx_t_5);
23249 #if CYTHON_COMPILING_IN_LIMITED_API
23250 __pyx_t_9 = PyBytes_AsString(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 106, __pyx_L1_error)
23251 #else
23252 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_2);
23253 #endif
23254 __pyx_t_7 = __pyx_array_new(__pyx_t_5, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 106, __pyx_L1_error)
23255 __Pyx_GOTREF((PyObject *)__pyx_t_7);
23256 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23257 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23258
23259 __pyx_t_10 = 1;
23260 #if CYTHON_UNPACK_METHODS
23261 if (unlikely(PyMethod_Check(__pyx_t_1))) {
23262 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
23263 assert(__pyx_t_8);
23264 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
23265 __Pyx_INCREF(__pyx_t_8);
23266 __Pyx_INCREF(__pyx__function);
23267 __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
23268 __pyx_t_10 = 0;
23269 }
23270 #endif
23271 {
23272 PyObject *__pyx_callargs[2] = {__pyx_t_8, ((PyObject *)__pyx_t_7)};
23273 __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
23274 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
23275 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
23276 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23277 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error)
23278 __Pyx_GOTREF(__pyx_t_3);
23279 }
23280 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 106, __pyx_L1_error)
23281 __Pyx_GIVEREF(__pyx_t_3);
23282 __Pyx_GOTREF((PyObject *)__pyx_v_self->_D);
23283 __Pyx_DECREF((PyObject *)__pyx_v_self->_D);
23284 __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_3);
23285 __pyx_t_3 = 0;
23286
23287 /* "equivalent_polynomials.pyx":107
23288 * self._ImH = np.asarray(<double[:self.nQ]>self.s23.get_ImH())
23289 * self._D = np.asarray(<double[:self.nQ]>self.s23.get_D())
23290 * self.inside_out = self.s23.inside_out # <<<<<<<<<<<<<<
23291 * self.edge = self.s23.edge
23292 * self.corner = self.s23.corner
23293*/
23294 __pyx_t_11 = __pyx_v_self->s23.inside_out;
23295
23296 __pyx_v_self->inside_out = __pyx_t_11;
23297
23298 /* "equivalent_polynomials.pyx":108
23299 * self._D = np.asarray(<double[:self.nQ]>self.s23.get_D())
23300 * self.inside_out = self.s23.inside_out
23301 * self.edge = self.s23.edge # <<<<<<<<<<<<<<
23302 * self.corner = self.s23.corner
23303 * if (self.nSpace,self.nP) == (3,1):
23304*/
23305 __pyx_t_12 = __pyx_v_self->s23.edge;
23306
23307 __pyx_v_self->edge = __pyx_t_12;
23308
23309 /* "equivalent_polynomials.pyx":109
23310 * self.inside_out = self.s23.inside_out
23311 * self.edge = self.s23.edge
23312 * self.corner = self.s23.corner # <<<<<<<<<<<<<<
23313 * if (self.nSpace,self.nP) == (3,1):
23314 * icase = self.s31.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
23315*/
23316 __pyx_t_12 = __pyx_v_self->s23.corner;
23317
23318 __pyx_v_self->corner = __pyx_t_12;
23319
23320 /* "equivalent_polynomials.pyx":102
23321 * self.edge = self.s22.edge
23322 * self.corner = self.s22.corner
23323 * elif (self.nSpace,self.nP) == (2,3): # <<<<<<<<<<<<<<
23324 * icase = self.s23.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
23325 * self._H = np.asarray(<double[:self.nQ]>self.s23.get_H())
23326*/
23327 }
23328 __pyx_L3:;
23329
23330 /* "equivalent_polynomials.pyx":110
23331 * self.edge = self.s23.edge
23332 * self.corner = self.s23.corner
23333 * if (self.nSpace,self.nP) == (3,1): # <<<<<<<<<<<<<<
23334 * icase = self.s31.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
23335 * self._H = np.asarray(<double[:self.nQ]>self.s31.get_H())
23336*/
23337 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_self->nSpace); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 110, __pyx_L1_error)
23338 __Pyx_GOTREF(__pyx_t_3);
23339 __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->nP); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
23340 __Pyx_GOTREF(__pyx_t_1);
23341 __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 110, __pyx_L1_error)
23342 __Pyx_GOTREF(__pyx_t_8);
23343 __Pyx_GIVEREF(__pyx_t_3);
23344 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 110, __pyx_L1_error);
23345 __Pyx_GIVEREF(__pyx_t_1);
23346 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 110, __pyx_L1_error);
23347 __pyx_t_3 = 0;
23348 __pyx_t_1 = 0;
23349 __pyx_t_4 = __Pyx_PyObject_RichCompareBool(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[10], Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 110, __pyx_L1_error)
23350 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23351 if (__pyx_t_4) {
23352
23353
23354 /* "equivalent_polynomials.pyx":111
23355 * self.corner = self.s23.corner
23356 * if (self.nSpace,self.nP) == (3,1):
23357 * icase = self.s31.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False) # <<<<<<<<<<<<<<
23358 * self._H = np.asarray(<double[:self.nQ]>self.s31.get_H())
23359 * self._ImH = np.asarray(<double[:self.nQ]>self.s31.get_ImH())
23360*/
23361 __pyx_t_8 = ((PyObject *)__pyx_v_self->xiBuffer);
23362 __Pyx_INCREF(__pyx_t_8);
23363 __pyx_v_icase = __pyx_v_self->s31.calculate(((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_phi_dof)), ((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_phi_nodes)), ((double *)__pyx_f_5numpy_7ndarray_4data___get__(((PyArrayObject *)__pyx_t_8))), 0);
23364 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23365
23366 /* "equivalent_polynomials.pyx":112
23367 * if (self.nSpace,self.nP) == (3,1):
23368 * icase = self.s31.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
23369 * self._H = np.asarray(<double[:self.nQ]>self.s31.get_H()) # <<<<<<<<<<<<<<
23370 * self._ImH = np.asarray(<double[:self.nQ]>self.s31.get_ImH())
23371 * self._D = np.asarray(<double[:self.nQ]>self.s31.get_D())
23372*/
23373 __pyx_t_1 = NULL;
23374 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error)
23375 __Pyx_GOTREF(__pyx_t_3);
23376 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error)
23377 __Pyx_GOTREF(__pyx_t_2);
23378 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23379 __pyx_t_6 = __pyx_v_self->s31.get_H();
23380
23381 if (!__pyx_t_6) {
23382 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
23383 __PYX_ERR(0, 112, __pyx_L1_error)
23384 }
23385 __pyx_t_5 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error)
23386 __Pyx_GOTREF(__pyx_t_5);
23387 __pyx_t_3 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error)
23388 __Pyx_GOTREF(__pyx_t_3);
23389 #if CYTHON_COMPILING_IN_LIMITED_API
23390 __pyx_t_9 = PyBytes_AsString(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 112, __pyx_L1_error)
23391 #else
23392 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_5);
23393 #endif
23394 __pyx_t_7 = __pyx_array_new(__pyx_t_3, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 112, __pyx_L1_error)
23395 __Pyx_GOTREF((PyObject *)__pyx_t_7);
23396 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23397 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23398
23399 __pyx_t_10 = 1;
23400 #if CYTHON_UNPACK_METHODS
23401 if (unlikely(PyMethod_Check(__pyx_t_2))) {
23402 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
23403 assert(__pyx_t_1);
23404 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
23405 __Pyx_INCREF(__pyx_t_1);
23406 __Pyx_INCREF(__pyx__function);
23407 __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
23408 __pyx_t_10 = 0;
23409 }
23410 #endif
23411 {
23412 PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_t_7)};
23413 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
23414 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
23415 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
23416 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23417 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 112, __pyx_L1_error)
23418 __Pyx_GOTREF(__pyx_t_8);
23419 }
23420 if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 112, __pyx_L1_error)
23421 __Pyx_GIVEREF(__pyx_t_8);
23422 __Pyx_GOTREF((PyObject *)__pyx_v_self->_H);
23423 __Pyx_DECREF((PyObject *)__pyx_v_self->_H);
23424 __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_8);
23425 __pyx_t_8 = 0;
23426
23427 /* "equivalent_polynomials.pyx":113
23428 * icase = self.s31.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
23429 * self._H = np.asarray(<double[:self.nQ]>self.s31.get_H())
23430 * self._ImH = np.asarray(<double[:self.nQ]>self.s31.get_ImH()) # <<<<<<<<<<<<<<
23431 * self._D = np.asarray(<double[:self.nQ]>self.s31.get_D())
23432 * self.inside_out = self.s31.inside_out
23433*/
23434 __pyx_t_2 = NULL;
23435 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
23436 __Pyx_GOTREF(__pyx_t_1);
23437 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 113, __pyx_L1_error)
23438 __Pyx_GOTREF(__pyx_t_5);
23439 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23440 __pyx_t_6 = __pyx_v_self->s31.get_ImH();
23441
23442 if (!__pyx_t_6) {
23443 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
23444 __PYX_ERR(0, 113, __pyx_L1_error)
23445 }
23446 __pyx_t_3 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
23447 __Pyx_GOTREF(__pyx_t_3);
23448 __pyx_t_1 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
23449 __Pyx_GOTREF(__pyx_t_1);
23450 #if CYTHON_COMPILING_IN_LIMITED_API
23451 __pyx_t_9 = PyBytes_AsString(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 113, __pyx_L1_error)
23452 #else
23453 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_3);
23454 #endif
23455 __pyx_t_7 = __pyx_array_new(__pyx_t_1, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 113, __pyx_L1_error)
23456 __Pyx_GOTREF((PyObject *)__pyx_t_7);
23457 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23458 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23459
23460 __pyx_t_10 = 1;
23461 #if CYTHON_UNPACK_METHODS
23462 if (unlikely(PyMethod_Check(__pyx_t_5))) {
23463 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
23464 assert(__pyx_t_2);
23465 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
23466 __Pyx_INCREF(__pyx_t_2);
23467 __Pyx_INCREF(__pyx__function);
23468 __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
23469 __pyx_t_10 = 0;
23470 }
23471 #endif
23472 {
23473 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_7)};
23474 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
23475 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23476 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
23477 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23478 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 113, __pyx_L1_error)
23479 __Pyx_GOTREF(__pyx_t_8);
23480 }
23481 if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 113, __pyx_L1_error)
23482 __Pyx_GIVEREF(__pyx_t_8);
23483 __Pyx_GOTREF((PyObject *)__pyx_v_self->_ImH);
23484 __Pyx_DECREF((PyObject *)__pyx_v_self->_ImH);
23485 __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_8);
23486 __pyx_t_8 = 0;
23487
23488 /* "equivalent_polynomials.pyx":114
23489 * self._H = np.asarray(<double[:self.nQ]>self.s31.get_H())
23490 * self._ImH = np.asarray(<double[:self.nQ]>self.s31.get_ImH())
23491 * self._D = np.asarray(<double[:self.nQ]>self.s31.get_D()) # <<<<<<<<<<<<<<
23492 * self.inside_out = self.s31.inside_out
23493 * self.edge = self.s31.edge
23494*/
23495 __pyx_t_5 = NULL;
23496 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error)
23497 __Pyx_GOTREF(__pyx_t_2);
23498 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 114, __pyx_L1_error)
23499 __Pyx_GOTREF(__pyx_t_3);
23500 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23501 __pyx_t_6 = __pyx_v_self->s31.get_D();
23502
23503 if (!__pyx_t_6) {
23504 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
23505 __PYX_ERR(0, 114, __pyx_L1_error)
23506 }
23507 __pyx_t_1 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
23508 __Pyx_GOTREF(__pyx_t_1);
23509 __pyx_t_2 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error)
23510 __Pyx_GOTREF(__pyx_t_2);
23511 #if CYTHON_COMPILING_IN_LIMITED_API
23512 __pyx_t_9 = PyBytes_AsString(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 114, __pyx_L1_error)
23513 #else
23514 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_1);
23515 #endif
23516 __pyx_t_7 = __pyx_array_new(__pyx_t_2, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 114, __pyx_L1_error)
23517 __Pyx_GOTREF((PyObject *)__pyx_t_7);
23518 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23519 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23520
23521 __pyx_t_10 = 1;
23522 #if CYTHON_UNPACK_METHODS
23523 if (unlikely(PyMethod_Check(__pyx_t_3))) {
23524 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
23525 assert(__pyx_t_5);
23526 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
23527 __Pyx_INCREF(__pyx_t_5);
23528 __Pyx_INCREF(__pyx__function);
23529 __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
23530 __pyx_t_10 = 0;
23531 }
23532 #endif
23533 {
23534 PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_t_7)};
23535 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
23536 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
23537 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
23538 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23539 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 114, __pyx_L1_error)
23540 __Pyx_GOTREF(__pyx_t_8);
23541 }
23542 if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 114, __pyx_L1_error)
23543 __Pyx_GIVEREF(__pyx_t_8);
23544 __Pyx_GOTREF((PyObject *)__pyx_v_self->_D);
23545 __Pyx_DECREF((PyObject *)__pyx_v_self->_D);
23546 __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_8);
23547 __pyx_t_8 = 0;
23548
23549 /* "equivalent_polynomials.pyx":115
23550 * self._ImH = np.asarray(<double[:self.nQ]>self.s31.get_ImH())
23551 * self._D = np.asarray(<double[:self.nQ]>self.s31.get_D())
23552 * self.inside_out = self.s31.inside_out # <<<<<<<<<<<<<<
23553 * self.edge = self.s31.edge
23554 * self.corner = self.s31.corner
23555*/
23556 __pyx_t_11 = __pyx_v_self->s31.inside_out;
23557
23558 __pyx_v_self->inside_out = __pyx_t_11;
23559
23560 /* "equivalent_polynomials.pyx":116
23561 * self._D = np.asarray(<double[:self.nQ]>self.s31.get_D())
23562 * self.inside_out = self.s31.inside_out
23563 * self.edge = self.s31.edge # <<<<<<<<<<<<<<
23564 * self.corner = self.s31.corner
23565 * elif (self.nSpace,self.nP) == (3,2):
23566*/
23567 __pyx_t_12 = __pyx_v_self->s31.edge;
23568
23569 __pyx_v_self->edge = __pyx_t_12;
23570
23571 /* "equivalent_polynomials.pyx":117
23572 * self.inside_out = self.s31.inside_out
23573 * self.edge = self.s31.edge
23574 * self.corner = self.s31.corner # <<<<<<<<<<<<<<
23575 * elif (self.nSpace,self.nP) == (3,2):
23576 * icase = self.s32.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
23577*/
23578 __pyx_t_12 = __pyx_v_self->s31.corner;
23579
23580 __pyx_v_self->corner = __pyx_t_12;
23581
23582 /* "equivalent_polynomials.pyx":110
23583 * self.edge = self.s23.edge
23584 * self.corner = self.s23.corner
23585 * if (self.nSpace,self.nP) == (3,1): # <<<<<<<<<<<<<<
23586 * icase = self.s31.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
23587 * self._H = np.asarray(<double[:self.nQ]>self.s31.get_H())
23588*/
23589 goto __pyx_L4;
23590 }
23591
23592 /* "equivalent_polynomials.pyx":118
23593 * self.edge = self.s31.edge
23594 * self.corner = self.s31.corner
23595 * elif (self.nSpace,self.nP) == (3,2): # <<<<<<<<<<<<<<
23596 * icase = self.s32.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
23597 * self._H = np.asarray(<double[:self.nQ]>self.s32.get_H())
23598*/
23599 __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_self->nSpace); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 118, __pyx_L1_error)
23600 __Pyx_GOTREF(__pyx_t_8);
23601 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_self->nP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L1_error)
23602 __Pyx_GOTREF(__pyx_t_3);
23603 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 118, __pyx_L1_error)
23604 __Pyx_GOTREF(__pyx_t_5);
23605 __Pyx_GIVEREF(__pyx_t_8);
23606 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 118, __pyx_L1_error);
23607 __Pyx_GIVEREF(__pyx_t_3);
23608 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 118, __pyx_L1_error);
23609 __pyx_t_8 = 0;
23610 __pyx_t_3 = 0;
23611 __pyx_t_4 = __Pyx_PyObject_RichCompareBool(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[11], Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 118, __pyx_L1_error)
23612 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23613 if (__pyx_t_4) {
23614
23615
23616 /* "equivalent_polynomials.pyx":119
23617 * self.corner = self.s31.corner
23618 * elif (self.nSpace,self.nP) == (3,2):
23619 * icase = self.s32.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False) # <<<<<<<<<<<<<<
23620 * self._H = np.asarray(<double[:self.nQ]>self.s32.get_H())
23621 * self._ImH = np.asarray(<double[:self.nQ]>self.s32.get_ImH())
23622*/
23623 __pyx_t_5 = ((PyObject *)__pyx_v_self->xiBuffer);
23624 __Pyx_INCREF(__pyx_t_5);
23625 __pyx_v_icase = __pyx_v_self->s32.calculate(((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_phi_dof)), ((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_phi_nodes)), ((double *)__pyx_f_5numpy_7ndarray_4data___get__(((PyArrayObject *)__pyx_t_5))), 0);
23626 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23627
23628 /* "equivalent_polynomials.pyx":120
23629 * elif (self.nSpace,self.nP) == (3,2):
23630 * icase = self.s32.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
23631 * self._H = np.asarray(<double[:self.nQ]>self.s32.get_H()) # <<<<<<<<<<<<<<
23632 * self._ImH = np.asarray(<double[:self.nQ]>self.s32.get_ImH())
23633 * self._D = np.asarray(<double[:self.nQ]>self.s32.get_D())
23634*/
23635 __pyx_t_3 = NULL;
23636 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 120, __pyx_L1_error)
23637 __Pyx_GOTREF(__pyx_t_8);
23638 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
23639 __Pyx_GOTREF(__pyx_t_1);
23640 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23641 __pyx_t_6 = __pyx_v_self->s32.get_H();
23642
23643 if (!__pyx_t_6) {
23644 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
23645 __PYX_ERR(0, 120, __pyx_L1_error)
23646 }
23647 __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error)
23648 __Pyx_GOTREF(__pyx_t_2);
23649 __pyx_t_8 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 120, __pyx_L1_error)
23650 __Pyx_GOTREF(__pyx_t_8);
23651 #if CYTHON_COMPILING_IN_LIMITED_API
23652 __pyx_t_9 = PyBytes_AsString(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 120, __pyx_L1_error)
23653 #else
23654 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_2);
23655 #endif
23656 __pyx_t_7 = __pyx_array_new(__pyx_t_8, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 120, __pyx_L1_error)
23657 __Pyx_GOTREF((PyObject *)__pyx_t_7);
23658 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23659 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23660
23661 __pyx_t_10 = 1;
23662 #if CYTHON_UNPACK_METHODS
23663 if (unlikely(PyMethod_Check(__pyx_t_1))) {
23664 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
23665 assert(__pyx_t_3);
23666 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
23667 __Pyx_INCREF(__pyx_t_3);
23668 __Pyx_INCREF(__pyx__function);
23669 __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
23670 __pyx_t_10 = 0;
23671 }
23672 #endif
23673 {
23674 PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_t_7)};
23675 __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
23676 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
23677 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
23678 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23679 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 120, __pyx_L1_error)
23680 __Pyx_GOTREF(__pyx_t_5);
23681 }
23682 if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 120, __pyx_L1_error)
23683 __Pyx_GIVEREF(__pyx_t_5);
23684 __Pyx_GOTREF((PyObject *)__pyx_v_self->_H);
23685 __Pyx_DECREF((PyObject *)__pyx_v_self->_H);
23686 __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_5);
23687 __pyx_t_5 = 0;
23688
23689 /* "equivalent_polynomials.pyx":121
23690 * icase = self.s32.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
23691 * self._H = np.asarray(<double[:self.nQ]>self.s32.get_H())
23692 * self._ImH = np.asarray(<double[:self.nQ]>self.s32.get_ImH()) # <<<<<<<<<<<<<<
23693 * self._D = np.asarray(<double[:self.nQ]>self.s32.get_D())
23694 * self.inside_out = self.s32.inside_out
23695*/
23696 __pyx_t_1 = NULL;
23697 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error)
23698 __Pyx_GOTREF(__pyx_t_3);
23699 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
23700 __Pyx_GOTREF(__pyx_t_2);
23701 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23702 __pyx_t_6 = __pyx_v_self->s32.get_ImH();
23703
23704 if (!__pyx_t_6) {
23705 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
23706 __PYX_ERR(0, 121, __pyx_L1_error)
23707 }
23708 __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 121, __pyx_L1_error)
23709 __Pyx_GOTREF(__pyx_t_8);
23710 __pyx_t_3 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error)
23711 __Pyx_GOTREF(__pyx_t_3);
23712 #if CYTHON_COMPILING_IN_LIMITED_API
23713 __pyx_t_9 = PyBytes_AsString(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 121, __pyx_L1_error)
23714 #else
23715 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_8);
23716 #endif
23717 __pyx_t_7 = __pyx_array_new(__pyx_t_3, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 121, __pyx_L1_error)
23718 __Pyx_GOTREF((PyObject *)__pyx_t_7);
23719 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23720 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23721
23722 __pyx_t_10 = 1;
23723 #if CYTHON_UNPACK_METHODS
23724 if (unlikely(PyMethod_Check(__pyx_t_2))) {
23725 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
23726 assert(__pyx_t_1);
23727 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
23728 __Pyx_INCREF(__pyx_t_1);
23729 __Pyx_INCREF(__pyx__function);
23730 __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
23731 __pyx_t_10 = 0;
23732 }
23733 #endif
23734 {
23735 PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_t_7)};
23736 __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
23737 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
23738 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
23739 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23740 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 121, __pyx_L1_error)
23741 __Pyx_GOTREF(__pyx_t_5);
23742 }
23743 if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 121, __pyx_L1_error)
23744 __Pyx_GIVEREF(__pyx_t_5);
23745 __Pyx_GOTREF((PyObject *)__pyx_v_self->_ImH);
23746 __Pyx_DECREF((PyObject *)__pyx_v_self->_ImH);
23747 __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_5);
23748 __pyx_t_5 = 0;
23749
23750 /* "equivalent_polynomials.pyx":122
23751 * self._H = np.asarray(<double[:self.nQ]>self.s32.get_H())
23752 * self._ImH = np.asarray(<double[:self.nQ]>self.s32.get_ImH())
23753 * self._D = np.asarray(<double[:self.nQ]>self.s32.get_D()) # <<<<<<<<<<<<<<
23754 * self.inside_out = self.s32.inside_out
23755 * self.edge = self.s32.edge
23756*/
23757 __pyx_t_2 = NULL;
23758 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
23759 __Pyx_GOTREF(__pyx_t_1);
23760 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 122, __pyx_L1_error)
23761 __Pyx_GOTREF(__pyx_t_8);
23762 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23763 __pyx_t_6 = __pyx_v_self->s32.get_D();
23764
23765 if (!__pyx_t_6) {
23766 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
23767 __PYX_ERR(0, 122, __pyx_L1_error)
23768 }
23769 __pyx_t_3 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error)
23770 __Pyx_GOTREF(__pyx_t_3);
23771 __pyx_t_1 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
23772 __Pyx_GOTREF(__pyx_t_1);
23773 #if CYTHON_COMPILING_IN_LIMITED_API
23774 __pyx_t_9 = PyBytes_AsString(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 122, __pyx_L1_error)
23775 #else
23776 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_3);
23777 #endif
23778 __pyx_t_7 = __pyx_array_new(__pyx_t_1, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 122, __pyx_L1_error)
23779 __Pyx_GOTREF((PyObject *)__pyx_t_7);
23780 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23781 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23782
23783 __pyx_t_10 = 1;
23784 #if CYTHON_UNPACK_METHODS
23785 if (unlikely(PyMethod_Check(__pyx_t_8))) {
23786 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
23787 assert(__pyx_t_2);
23788 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
23789 __Pyx_INCREF(__pyx_t_2);
23790 __Pyx_INCREF(__pyx__function);
23791 __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
23792 __pyx_t_10 = 0;
23793 }
23794 #endif
23795 {
23796 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_7)};
23797 __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
23798 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23799 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
23800 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23801 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error)
23802 __Pyx_GOTREF(__pyx_t_5);
23803 }
23804 if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 122, __pyx_L1_error)
23805 __Pyx_GIVEREF(__pyx_t_5);
23806 __Pyx_GOTREF((PyObject *)__pyx_v_self->_D);
23807 __Pyx_DECREF((PyObject *)__pyx_v_self->_D);
23808 __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_5);
23809 __pyx_t_5 = 0;
23810
23811 /* "equivalent_polynomials.pyx":123
23812 * self._ImH = np.asarray(<double[:self.nQ]>self.s32.get_ImH())
23813 * self._D = np.asarray(<double[:self.nQ]>self.s32.get_D())
23814 * self.inside_out = self.s32.inside_out # <<<<<<<<<<<<<<
23815 * self.edge = self.s32.edge
23816 * self.corner = self.s32.corner
23817*/
23818 __pyx_t_11 = __pyx_v_self->s32.inside_out;
23819
23820 __pyx_v_self->inside_out = __pyx_t_11;
23821
23822 /* "equivalent_polynomials.pyx":124
23823 * self._D = np.asarray(<double[:self.nQ]>self.s32.get_D())
23824 * self.inside_out = self.s32.inside_out
23825 * self.edge = self.s32.edge # <<<<<<<<<<<<<<
23826 * self.corner = self.s32.corner
23827 * elif (self.nSpace,self.nP) == (3,3):
23828*/
23829 __pyx_t_12 = __pyx_v_self->s32.edge;
23830
23831 __pyx_v_self->edge = __pyx_t_12;
23832
23833 /* "equivalent_polynomials.pyx":125
23834 * self.inside_out = self.s32.inside_out
23835 * self.edge = self.s32.edge
23836 * self.corner = self.s32.corner # <<<<<<<<<<<<<<
23837 * elif (self.nSpace,self.nP) == (3,3):
23838 * icase = self.s33.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
23839*/
23840 __pyx_t_12 = __pyx_v_self->s32.corner;
23841
23842 __pyx_v_self->corner = __pyx_t_12;
23843
23844 /* "equivalent_polynomials.pyx":118
23845 * self.edge = self.s31.edge
23846 * self.corner = self.s31.corner
23847 * elif (self.nSpace,self.nP) == (3,2): # <<<<<<<<<<<<<<
23848 * icase = self.s32.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
23849 * self._H = np.asarray(<double[:self.nQ]>self.s32.get_H())
23850*/
23851 goto __pyx_L4;
23852 }
23853
23854 /* "equivalent_polynomials.pyx":126
23855 * self.edge = self.s32.edge
23856 * self.corner = self.s32.corner
23857 * elif (self.nSpace,self.nP) == (3,3): # <<<<<<<<<<<<<<
23858 * icase = self.s33.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
23859 * self._H = np.asarray(<double[:self.nQ]>self.s33.get_H())
23860*/
23861 __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_self->nSpace); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error)
23862 __Pyx_GOTREF(__pyx_t_5);
23863 __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_self->nP); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 126, __pyx_L1_error)
23864 __Pyx_GOTREF(__pyx_t_8);
23865 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
23866 __Pyx_GOTREF(__pyx_t_2);
23867 __Pyx_GIVEREF(__pyx_t_5);
23868 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 126, __pyx_L1_error);
23869 __Pyx_GIVEREF(__pyx_t_8);
23870 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 126, __pyx_L1_error);
23871 __pyx_t_5 = 0;
23872 __pyx_t_8 = 0;
23873 __pyx_t_4 = __Pyx_PyObject_RichCompareBool(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[12], Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 126, __pyx_L1_error)
23874 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23875 if (__pyx_t_4) {
23876
23877
23878 /* "equivalent_polynomials.pyx":127
23879 * self.corner = self.s32.corner
23880 * elif (self.nSpace,self.nP) == (3,3):
23881 * icase = self.s33.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False) # <<<<<<<<<<<<<<
23882 * self._H = np.asarray(<double[:self.nQ]>self.s33.get_H())
23883 * self._ImH = np.asarray(<double[:self.nQ]>self.s33.get_ImH())
23884*/
23885 __pyx_t_2 = ((PyObject *)__pyx_v_self->xiBuffer);
23886 __Pyx_INCREF(__pyx_t_2);
23887 __pyx_v_icase = __pyx_v_self->s33.calculate(((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_phi_dof)), ((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_phi_nodes)), ((double *)__pyx_f_5numpy_7ndarray_4data___get__(((PyArrayObject *)__pyx_t_2))), 0);
23888 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23889
23890 /* "equivalent_polynomials.pyx":128
23891 * elif (self.nSpace,self.nP) == (3,3):
23892 * icase = self.s33.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
23893 * self._H = np.asarray(<double[:self.nQ]>self.s33.get_H()) # <<<<<<<<<<<<<<
23894 * self._ImH = np.asarray(<double[:self.nQ]>self.s33.get_ImH())
23895 * self._D = np.asarray(<double[:self.nQ]>self.s33.get_D())
23896*/
23897 __pyx_t_8 = NULL;
23898 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 128, __pyx_L1_error)
23899 __Pyx_GOTREF(__pyx_t_5);
23900 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error)
23901 __Pyx_GOTREF(__pyx_t_3);
23902 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23903 __pyx_t_6 = __pyx_v_self->s33.get_H();
23904
23905 if (!__pyx_t_6) {
23906 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
23907 __PYX_ERR(0, 128, __pyx_L1_error)
23908 }
23909 __pyx_t_1 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error)
23910 __Pyx_GOTREF(__pyx_t_1);
23911 __pyx_t_5 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 128, __pyx_L1_error)
23912 __Pyx_GOTREF(__pyx_t_5);
23913 #if CYTHON_COMPILING_IN_LIMITED_API
23914 __pyx_t_9 = PyBytes_AsString(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 128, __pyx_L1_error)
23915 #else
23916 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_1);
23917 #endif
23918 __pyx_t_7 = __pyx_array_new(__pyx_t_5, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L1_error)
23919 __Pyx_GOTREF((PyObject *)__pyx_t_7);
23920 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23921 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23922
23923 __pyx_t_10 = 1;
23924 #if CYTHON_UNPACK_METHODS
23925 if (unlikely(PyMethod_Check(__pyx_t_3))) {
23926 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
23927 assert(__pyx_t_8);
23928 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
23929 __Pyx_INCREF(__pyx_t_8);
23930 __Pyx_INCREF(__pyx__function);
23931 __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
23932 __pyx_t_10 = 0;
23933 }
23934 #endif
23935 {
23936 PyObject *__pyx_callargs[2] = {__pyx_t_8, ((PyObject *)__pyx_t_7)};
23937 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
23938 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
23939 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
23940 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23941 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error)
23942 __Pyx_GOTREF(__pyx_t_2);
23943 }
23944 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 128, __pyx_L1_error)
23945 __Pyx_GIVEREF(__pyx_t_2);
23946 __Pyx_GOTREF((PyObject *)__pyx_v_self->_H);
23947 __Pyx_DECREF((PyObject *)__pyx_v_self->_H);
23948 __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_2);
23949 __pyx_t_2 = 0;
23950
23951 /* "equivalent_polynomials.pyx":129
23952 * icase = self.s33.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
23953 * self._H = np.asarray(<double[:self.nQ]>self.s33.get_H())
23954 * self._ImH = np.asarray(<double[:self.nQ]>self.s33.get_ImH()) # <<<<<<<<<<<<<<
23955 * self._D = np.asarray(<double[:self.nQ]>self.s33.get_D())
23956 * self.inside_out = self.s33.inside_out
23957*/
23958 __pyx_t_3 = NULL;
23959 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 129, __pyx_L1_error)
23960 __Pyx_GOTREF(__pyx_t_8);
23961 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
23962 __Pyx_GOTREF(__pyx_t_1);
23963 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23964 __pyx_t_6 = __pyx_v_self->s33.get_ImH();
23965
23966 if (!__pyx_t_6) {
23967 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
23968 __PYX_ERR(0, 129, __pyx_L1_error)
23969 }
23970 __pyx_t_5 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 129, __pyx_L1_error)
23971 __Pyx_GOTREF(__pyx_t_5);
23972 __pyx_t_8 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 129, __pyx_L1_error)
23973 __Pyx_GOTREF(__pyx_t_8);
23974 #if CYTHON_COMPILING_IN_LIMITED_API
23975 __pyx_t_9 = PyBytes_AsString(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 129, __pyx_L1_error)
23976 #else
23977 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_5);
23978 #endif
23979 __pyx_t_7 = __pyx_array_new(__pyx_t_8, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 129, __pyx_L1_error)
23980 __Pyx_GOTREF((PyObject *)__pyx_t_7);
23981 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23982 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23983
23984 __pyx_t_10 = 1;
23985 #if CYTHON_UNPACK_METHODS
23986 if (unlikely(PyMethod_Check(__pyx_t_1))) {
23987 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
23988 assert(__pyx_t_3);
23989 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
23990 __Pyx_INCREF(__pyx_t_3);
23991 __Pyx_INCREF(__pyx__function);
23992 __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
23993 __pyx_t_10 = 0;
23994 }
23995 #endif
23996 {
23997 PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_t_7)};
23998 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
23999 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
24000 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
24001 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24002 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error)
24003 __Pyx_GOTREF(__pyx_t_2);
24004 }
24005 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 129, __pyx_L1_error)
24006 __Pyx_GIVEREF(__pyx_t_2);
24007 __Pyx_GOTREF((PyObject *)__pyx_v_self->_ImH);
24008 __Pyx_DECREF((PyObject *)__pyx_v_self->_ImH);
24009 __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_2);
24010 __pyx_t_2 = 0;
24011
24012 /* "equivalent_polynomials.pyx":130
24013 * self._H = np.asarray(<double[:self.nQ]>self.s33.get_H())
24014 * self._ImH = np.asarray(<double[:self.nQ]>self.s33.get_ImH())
24015 * self._D = np.asarray(<double[:self.nQ]>self.s33.get_D()) # <<<<<<<<<<<<<<
24016 * self.inside_out = self.s33.inside_out
24017 * self.edge = self.s33.edge
24018*/
24019 __pyx_t_1 = NULL;
24020 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error)
24021 __Pyx_GOTREF(__pyx_t_3);
24022 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 130, __pyx_L1_error)
24023 __Pyx_GOTREF(__pyx_t_5);
24024 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24025 __pyx_t_6 = __pyx_v_self->s33.get_D();
24026
24027 if (!__pyx_t_6) {
24028 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
24029 __PYX_ERR(0, 130, __pyx_L1_error)
24030 }
24031 __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 130, __pyx_L1_error)
24032 __Pyx_GOTREF(__pyx_t_8);
24033 __pyx_t_3 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error)
24034 __Pyx_GOTREF(__pyx_t_3);
24035 #if CYTHON_COMPILING_IN_LIMITED_API
24036 __pyx_t_9 = PyBytes_AsString(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 130, __pyx_L1_error)
24037 #else
24038 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_8);
24039 #endif
24040 __pyx_t_7 = __pyx_array_new(__pyx_t_3, sizeof(double), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 130, __pyx_L1_error)
24041 __Pyx_GOTREF((PyObject *)__pyx_t_7);
24042 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24043 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
24044
24045 __pyx_t_10 = 1;
24046 #if CYTHON_UNPACK_METHODS
24047 if (unlikely(PyMethod_Check(__pyx_t_5))) {
24048 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
24049 assert(__pyx_t_1);
24050 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
24051 __Pyx_INCREF(__pyx_t_1);
24052 __Pyx_INCREF(__pyx__function);
24053 __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
24054 __pyx_t_10 = 0;
24055 }
24056 #endif
24057 {
24058 PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_t_7)};
24059 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
24060 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
24061 __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
24062 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24063 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error)
24064 __Pyx_GOTREF(__pyx_t_2);
24065 }
24066 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 130, __pyx_L1_error)
24067 __Pyx_GIVEREF(__pyx_t_2);
24068 __Pyx_GOTREF((PyObject *)__pyx_v_self->_D);
24069 __Pyx_DECREF((PyObject *)__pyx_v_self->_D);
24070 __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_2);
24071 __pyx_t_2 = 0;
24072
24073 /* "equivalent_polynomials.pyx":131
24074 * self._ImH = np.asarray(<double[:self.nQ]>self.s33.get_ImH())
24075 * self._D = np.asarray(<double[:self.nQ]>self.s33.get_D())
24076 * self.inside_out = self.s33.inside_out # <<<<<<<<<<<<<<
24077 * self.edge = self.s33.edge
24078 * self.corner = self.s33.corner
24079*/
24080 __pyx_t_11 = __pyx_v_self->s33.inside_out;
24081
24082 __pyx_v_self->inside_out = __pyx_t_11;
24083
24084 /* "equivalent_polynomials.pyx":132
24085 * self._D = np.asarray(<double[:self.nQ]>self.s33.get_D())
24086 * self.inside_out = self.s33.inside_out
24087 * self.edge = self.s33.edge # <<<<<<<<<<<<<<
24088 * self.corner = self.s33.corner
24089 * def set_quad(self, int q):
24090*/
24091 __pyx_t_12 = __pyx_v_self->s33.edge;
24092
24093 __pyx_v_self->edge = __pyx_t_12;
24094
24095 /* "equivalent_polynomials.pyx":133
24096 * self.inside_out = self.s33.inside_out
24097 * self.edge = self.s33.edge
24098 * self.corner = self.s33.corner # <<<<<<<<<<<<<<
24099 * def set_quad(self, int q):
24100 * self.q=q
24101*/
24102 __pyx_t_12 = __pyx_v_self->s33.corner;
24103
24104 __pyx_v_self->corner = __pyx_t_12;
24105
24106 /* "equivalent_polynomials.pyx":126
24107 * self.edge = self.s32.edge
24108 * self.corner = self.s32.corner
24109 * elif (self.nSpace,self.nP) == (3,3): # <<<<<<<<<<<<<<
24110 * icase = self.s33.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
24111 * self._H = np.asarray(<double[:self.nQ]>self.s33.get_H())
24112*/
24113 }
24114 __pyx_L4:;
24115
24116 /* "equivalent_polynomials.pyx":60
24117 * self.nEBQ=nQ#cek hack
24118 * self.q=0
24119 * def calculate(self, np.ndarray phi_dof, np.ndarray phi_nodes, np.ndarray xi): # <<<<<<<<<<<<<<
24120 * self.xiBuffer[:xi.shape[0]]=xi
24121 * if (self.nSpace,self.nP) == (1,1):
24122*/
24123
24124 /* function exit code */
24125 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24126 goto __pyx_L0;
24127 __pyx_L1_error:;
24128 __Pyx_XDECREF(__pyx_t_1);
24129 __Pyx_XDECREF(__pyx_t_2);
24130 __Pyx_XDECREF(__pyx_t_3);
24131 __Pyx_XDECREF(__pyx_t_5);
24132 __Pyx_XDECREF((PyObject *)__pyx_t_7);
24133 __Pyx_XDECREF(__pyx_t_8);
24134 __Pyx_AddTraceback("equivalent_polynomials.Simplex.calculate", __pyx_clineno, __pyx_lineno, __pyx_filename);
24135 __pyx_r = NULL;
24136 __pyx_L0:;
24137
24138 __Pyx_XGIVEREF(__pyx_r);
24139 __Pyx_RefNannyFinishContext();
24140 return __pyx_r;
24141}
24142
24143/* "equivalent_polynomials.pyx":134
24144 * self.edge = self.s33.edge
24145 * self.corner = self.s33.corner
24146 * def set_quad(self, int q): # <<<<<<<<<<<<<<
24147 * self.q=q
24148 * # Mirrors Simplex::set_quad() in equivalent_polynomials.h, including its precedence:
24149*/
24150
24151/* Python wrapper */
24152static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_5set_quad(PyObject *__pyx_v_self,
24153#if CYTHON_VECTORCALL
24154PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24155#else
24156PyObject *__pyx_args, PyObject *__pyx_kwds
24157#endif
24158); /*proto*/
24159static PyMethodDef __pyx_mdef_22equivalent_polynomials_7Simplex_5set_quad = {"set_quad", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_22equivalent_polynomials_7Simplex_5set_quad, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
24160static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_5set_quad(PyObject *__pyx_v_self,
24161#if CYTHON_VECTORCALL
24162PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24163#else
24164PyObject *__pyx_args, PyObject *__pyx_kwds
24165#endif
24166) {
24167 int __pyx_v_q;
24168 #if !CYTHON_VECTORCALL
24169 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
24170 #endif
24171 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
24172 PyObject* values[1] = {0};
24173 int __pyx_lineno = 0;
24174 const char *__pyx_filename = NULL;
24175 int __pyx_clineno = 0;
24176 PyObject *__pyx_r = 0;
24177 __Pyx_RefNannyDeclarations
24178 __Pyx_RefNannySetupContext("set_quad (wrapper)", 0);
24179 #if !CYTHON_VECTORCALL
24180 #if CYTHON_ASSUME_SAFE_SIZE
24181 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
24182 #else
24183 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
24184 #endif
24185 #endif
24186 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
24187 {
24188 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_q,0};
24189 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
24190 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 134, __pyx_L3_error)
24191 if (__pyx_kwds_len > 0) {
24192 switch (__pyx_nargs) {
24193 case 1:
24194 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24195 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 134, __pyx_L3_error)
24196 CYTHON_FALLTHROUGH;
24197 case 0: break;
24198 default: goto __pyx_L5_argtuple_error;
24199 }
24200 const Py_ssize_t kwd_pos_args = __pyx_nargs;
24201 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_quad", 0) < (0)) __PYX_ERR(0, 134, __pyx_L3_error)
24202 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
24203 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_quad", 1, 1, 1, i); __PYX_ERR(0, 134, __pyx_L3_error) }
24204 }
24205 } else if (unlikely(__pyx_nargs != 1)) {
24206 goto __pyx_L5_argtuple_error;
24207 } else {
24208 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24209 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 134, __pyx_L3_error)
24210 }
24211 __pyx_v_q = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_q == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error)
24212 }
24213 goto __pyx_L6_skip;
24214 __pyx_L5_argtuple_error:;
24215 __Pyx_RaiseArgtupleInvalid("set_quad", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 134, __pyx_L3_error)
24216 __pyx_L6_skip:;
24217 goto __pyx_L4_argument_unpacking_done;
24218 __pyx_L3_error:;
24219 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24220 Py_XDECREF(values[__pyx_temp]);
24221 }
24222 __Pyx_AddTraceback("equivalent_polynomials.Simplex.set_quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
24223 __Pyx_RefNannyFinishContext();
24224 return NULL;
24225 __pyx_L4_argument_unpacking_done:;
24226 __pyx_r = __pyx_pf_22equivalent_polynomials_7Simplex_4set_quad(((struct __pyx_obj_22equivalent_polynomials_Simplex *)__pyx_v_self), __pyx_v_q);
24227
24228 /* function exit code */
24229 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24230 Py_XDECREF(values[__pyx_temp]);
24231 }
24232
24233 __Pyx_RefNannyFinishContext();
24234 return __pyx_r;
24235}
24236
24237static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_4set_quad(struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self, int __pyx_v_q) {
24238 PyObject *__pyx_r = NULL;
24239 __Pyx_RefNannyDeclarations
24240 __Pyx_RefNannySetupContext("set_quad", 0);
24241
24242 /* "equivalent_polynomials.pyx":135
24243 * self.corner = self.s33.corner
24244 * def set_quad(self, int q):
24245 * self.q=q # <<<<<<<<<<<<<<
24246 * # Mirrors Simplex::set_quad() in equivalent_polynomials.h, including its precedence:
24247 * # the edge/corner degenerate cases are resolved BEFORE inside_out. Keying off inside_out
24248*/
24249 __pyx_v_self->q = __pyx_v_q;
24250
24251 /* "equivalent_polynomials.pyx":134
24252 * self.edge = self.s33.edge
24253 * self.corner = self.s33.corner
24254 * def set_quad(self, int q): # <<<<<<<<<<<<<<
24255 * self.q=q
24256 * # Mirrors Simplex::set_quad() in equivalent_polynomials.h, including its precedence:
24257*/
24258
24259 /* function exit code */
24260 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24261 __Pyx_XGIVEREF(__pyx_r);
24262 __Pyx_RefNannyFinishContext();
24263 return __pyx_r;
24264}
24265
24266/* "equivalent_polynomials.pyx":140
24267 * # alone (as this wrapper used to) reports H and ImH exchanged whenever a cell is flagged
24268 * # corner==1, which also sets inside_out for the P2 basis solve.
24269 * @property # <<<<<<<<<<<<<<
24270 * def H(self):
24271 * if self.edge == -1 or self.corner == -1:
24272*/
24273
24274/* Python wrapper */
24275static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_1H_1__get__(PyObject *__pyx_v_self); /*proto*/
24276static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_1H_1__get__(PyObject *__pyx_v_self) {
24277 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
24278 PyObject *__pyx_r = 0;
24279 __Pyx_RefNannyDeclarations
24280 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
24281 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
24282 __pyx_r = __pyx_pf_22equivalent_polynomials_7Simplex_1H___get__(((struct __pyx_obj_22equivalent_polynomials_Simplex *)__pyx_v_self));
24283
24284 /* function exit code */
24285 __Pyx_RefNannyFinishContext();
24286 return __pyx_r;
24287}
24288
24289static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_1H___get__(struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self) {
24290 PyObject *__pyx_r = NULL;
24291 __Pyx_RefNannyDeclarations
24292 int __pyx_t_1;
24293 int __pyx_t_2;
24294 PyObject *__pyx_t_3 = NULL;
24295 int __pyx_lineno = 0;
24296 const char *__pyx_filename = NULL;
24297 int __pyx_clineno = 0;
24298 __Pyx_RefNannySetupContext("__get__", 0);
24299
24300 /* "equivalent_polynomials.pyx":142
24301 * @property
24302 * def H(self):
24303 * if self.edge == -1 or self.corner == -1: # <<<<<<<<<<<<<<
24304 * return 0.0
24305 * elif self.edge == 1 or self.corner == 1:
24306*/
24307 __pyx_t_2 = (__pyx_v_self->edge == -1L);
24308
24309 if (!__pyx_t_2) {
24310
24311 } else {
24312
24313 __pyx_t_1 = __pyx_t_2;
24314
24315 goto __pyx_L4_bool_binop_done;
24316 }
24317 __pyx_t_2 = (__pyx_v_self->corner == -1L);
24318
24319
24320 __pyx_t_1 = __pyx_t_2;
24321
24322 __pyx_L4_bool_binop_done:;
24323 if (__pyx_t_1) {
24324
24325
24326 /* "equivalent_polynomials.pyx":143
24327 * def H(self):
24328 * if self.edge == -1 or self.corner == -1:
24329 * return 0.0 # <<<<<<<<<<<<<<
24330 * elif self.edge == 1 or self.corner == 1:
24331 * return 1.0
24332*/
24333 {
24334 PyObject *__pyx_temp;
24335 {
24336 __pyx_temp = __pyx_r;
24337 __Pyx_INCREF(__pyx_mstate_global->__pyx_float_0_0);
24338 __pyx_r = __pyx_mstate_global->__pyx_float_0_0;
24339 }
24340 __Pyx_XDECREF(__pyx_temp);
24341 }
24342 goto __pyx_L0;
24343
24344 /* "equivalent_polynomials.pyx":142
24345 * @property
24346 * def H(self):
24347 * if self.edge == -1 or self.corner == -1: # <<<<<<<<<<<<<<
24348 * return 0.0
24349 * elif self.edge == 1 or self.corner == 1:
24350*/
24351 }
24352
24353 /* "equivalent_polynomials.pyx":144
24354 * if self.edge == -1 or self.corner == -1:
24355 * return 0.0
24356 * elif self.edge == 1 or self.corner == 1: # <<<<<<<<<<<<<<
24357 * return 1.0
24358 * elif self.inside_out:
24359*/
24360 __pyx_t_2 = (__pyx_v_self->edge == 1);
24361
24362 if (!__pyx_t_2) {
24363
24364 } else {
24365
24366 __pyx_t_1 = __pyx_t_2;
24367
24368 goto __pyx_L6_bool_binop_done;
24369 }
24370 __pyx_t_2 = (__pyx_v_self->corner == 1);
24371
24372
24373 __pyx_t_1 = __pyx_t_2;
24374
24375 __pyx_L6_bool_binop_done:;
24376 if (__pyx_t_1) {
24377
24378
24379 /* "equivalent_polynomials.pyx":145
24380 * return 0.0
24381 * elif self.edge == 1 or self.corner == 1:
24382 * return 1.0 # <<<<<<<<<<<<<<
24383 * elif self.inside_out:
24384 * return self._ImH[self.q]
24385*/
24386 {
24387 PyObject *__pyx_temp;
24388 {
24389 __pyx_temp = __pyx_r;
24390 __Pyx_INCREF(__pyx_mstate_global->__pyx_float_1_0);
24391 __pyx_r = __pyx_mstate_global->__pyx_float_1_0;
24392 }
24393 __Pyx_XDECREF(__pyx_temp);
24394 }
24395 goto __pyx_L0;
24396
24397 /* "equivalent_polynomials.pyx":144
24398 * if self.edge == -1 or self.corner == -1:
24399 * return 0.0
24400 * elif self.edge == 1 or self.corner == 1: # <<<<<<<<<<<<<<
24401 * return 1.0
24402 * elif self.inside_out:
24403*/
24404 }
24405
24406 /* "equivalent_polynomials.pyx":146
24407 * elif self.edge == 1 or self.corner == 1:
24408 * return 1.0
24409 * elif self.inside_out: # <<<<<<<<<<<<<<
24410 * return self._ImH[self.q]
24411 * else:
24412*/
24413 __pyx_t_1 = (__pyx_v_self->inside_out != 0);
24414
24415 if (__pyx_t_1) {
24416
24417
24418 /* "equivalent_polynomials.pyx":147
24419 * return 1.0
24420 * elif self.inside_out:
24421 * return self._ImH[self.q] # <<<<<<<<<<<<<<
24422 * else:
24423 * return self._H[self.q]
24424*/
24425 __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->_ImH), __pyx_v_self->q, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
24426 __Pyx_GOTREF(__pyx_t_3);
24427 {
24428 PyObject *__pyx_temp;
24429 {
24430 __pyx_temp = __pyx_r;
24431 __pyx_r = __pyx_t_3;
24432 }
24433 __Pyx_XDECREF(__pyx_temp);
24434 }
24435 __pyx_t_3 = 0;
24436 goto __pyx_L0;
24437
24438 /* "equivalent_polynomials.pyx":146
24439 * elif self.edge == 1 or self.corner == 1:
24440 * return 1.0
24441 * elif self.inside_out: # <<<<<<<<<<<<<<
24442 * return self._ImH[self.q]
24443 * else:
24444*/
24445 }
24446
24447 /* "equivalent_polynomials.pyx":149
24448 * return self._ImH[self.q]
24449 * else:
24450 * return self._H[self.q] # <<<<<<<<<<<<<<
24451 * @property
24452 * def ImH(self):
24453*/
24454 /*else*/ {
24455 __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->_H), __pyx_v_self->q, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error)
24456 __Pyx_GOTREF(__pyx_t_3);
24457 {
24458 PyObject *__pyx_temp;
24459 {
24460 __pyx_temp = __pyx_r;
24461 __pyx_r = __pyx_t_3;
24462 }
24463 __Pyx_XDECREF(__pyx_temp);
24464 }
24465 __pyx_t_3 = 0;
24466 goto __pyx_L0;
24467 }
24468
24469 /* "equivalent_polynomials.pyx":140
24470 * # alone (as this wrapper used to) reports H and ImH exchanged whenever a cell is flagged
24471 * # corner==1, which also sets inside_out for the P2 basis solve.
24472 * @property # <<<<<<<<<<<<<<
24473 * def H(self):
24474 * if self.edge == -1 or self.corner == -1:
24475*/
24476
24477 /* function exit code */
24478 __pyx_L1_error:;
24479 __Pyx_XDECREF(__pyx_t_3);
24480 __Pyx_AddTraceback("equivalent_polynomials.Simplex.H.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24481 __pyx_r = NULL;
24482 __pyx_L0:;
24483 __Pyx_XGIVEREF(__pyx_r);
24484 __Pyx_RefNannyFinishContext();
24485 return __pyx_r;
24486}
24487
24488/* "equivalent_polynomials.pyx":150
24489 * else:
24490 * return self._H[self.q]
24491 * @property # <<<<<<<<<<<<<<
24492 * def ImH(self):
24493 * if self.edge == -1 or self.corner == -1:
24494*/
24495
24496/* Python wrapper */
24497static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_3ImH_1__get__(PyObject *__pyx_v_self); /*proto*/
24498static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_3ImH_1__get__(PyObject *__pyx_v_self) {
24499 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
24500 PyObject *__pyx_r = 0;
24501 __Pyx_RefNannyDeclarations
24502 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
24503 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
24504 __pyx_r = __pyx_pf_22equivalent_polynomials_7Simplex_3ImH___get__(((struct __pyx_obj_22equivalent_polynomials_Simplex *)__pyx_v_self));
24505
24506 /* function exit code */
24507 __Pyx_RefNannyFinishContext();
24508 return __pyx_r;
24509}
24510
24511static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_3ImH___get__(struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self) {
24512 PyObject *__pyx_r = NULL;
24513 __Pyx_RefNannyDeclarations
24514 int __pyx_t_1;
24515 int __pyx_t_2;
24516 PyObject *__pyx_t_3 = NULL;
24517 int __pyx_lineno = 0;
24518 const char *__pyx_filename = NULL;
24519 int __pyx_clineno = 0;
24520 __Pyx_RefNannySetupContext("__get__", 0);
24521
24522 /* "equivalent_polynomials.pyx":152
24523 * @property
24524 * def ImH(self):
24525 * if self.edge == -1 or self.corner == -1: # <<<<<<<<<<<<<<
24526 * return 1.0
24527 * elif self.edge == 1 or self.corner == 1:
24528*/
24529 __pyx_t_2 = (__pyx_v_self->edge == -1L);
24530
24531 if (!__pyx_t_2) {
24532
24533 } else {
24534
24535 __pyx_t_1 = __pyx_t_2;
24536
24537 goto __pyx_L4_bool_binop_done;
24538 }
24539 __pyx_t_2 = (__pyx_v_self->corner == -1L);
24540
24541
24542 __pyx_t_1 = __pyx_t_2;
24543
24544 __pyx_L4_bool_binop_done:;
24545 if (__pyx_t_1) {
24546
24547
24548 /* "equivalent_polynomials.pyx":153
24549 * def ImH(self):
24550 * if self.edge == -1 or self.corner == -1:
24551 * return 1.0 # <<<<<<<<<<<<<<
24552 * elif self.edge == 1 or self.corner == 1:
24553 * return 0.0
24554*/
24555 {
24556 PyObject *__pyx_temp;
24557 {
24558 __pyx_temp = __pyx_r;
24559 __Pyx_INCREF(__pyx_mstate_global->__pyx_float_1_0);
24560 __pyx_r = __pyx_mstate_global->__pyx_float_1_0;
24561 }
24562 __Pyx_XDECREF(__pyx_temp);
24563 }
24564 goto __pyx_L0;
24565
24566 /* "equivalent_polynomials.pyx":152
24567 * @property
24568 * def ImH(self):
24569 * if self.edge == -1 or self.corner == -1: # <<<<<<<<<<<<<<
24570 * return 1.0
24571 * elif self.edge == 1 or self.corner == 1:
24572*/
24573 }
24574
24575 /* "equivalent_polynomials.pyx":154
24576 * if self.edge == -1 or self.corner == -1:
24577 * return 1.0
24578 * elif self.edge == 1 or self.corner == 1: # <<<<<<<<<<<<<<
24579 * return 0.0
24580 * elif self.inside_out:
24581*/
24582 __pyx_t_2 = (__pyx_v_self->edge == 1);
24583
24584 if (!__pyx_t_2) {
24585
24586 } else {
24587
24588 __pyx_t_1 = __pyx_t_2;
24589
24590 goto __pyx_L6_bool_binop_done;
24591 }
24592 __pyx_t_2 = (__pyx_v_self->corner == 1);
24593
24594
24595 __pyx_t_1 = __pyx_t_2;
24596
24597 __pyx_L6_bool_binop_done:;
24598 if (__pyx_t_1) {
24599
24600
24601 /* "equivalent_polynomials.pyx":155
24602 * return 1.0
24603 * elif self.edge == 1 or self.corner == 1:
24604 * return 0.0 # <<<<<<<<<<<<<<
24605 * elif self.inside_out:
24606 * return self._H[self.q]
24607*/
24608 {
24609 PyObject *__pyx_temp;
24610 {
24611 __pyx_temp = __pyx_r;
24612 __Pyx_INCREF(__pyx_mstate_global->__pyx_float_0_0);
24613 __pyx_r = __pyx_mstate_global->__pyx_float_0_0;
24614 }
24615 __Pyx_XDECREF(__pyx_temp);
24616 }
24617 goto __pyx_L0;
24618
24619 /* "equivalent_polynomials.pyx":154
24620 * if self.edge == -1 or self.corner == -1:
24621 * return 1.0
24622 * elif self.edge == 1 or self.corner == 1: # <<<<<<<<<<<<<<
24623 * return 0.0
24624 * elif self.inside_out:
24625*/
24626 }
24627
24628 /* "equivalent_polynomials.pyx":156
24629 * elif self.edge == 1 or self.corner == 1:
24630 * return 0.0
24631 * elif self.inside_out: # <<<<<<<<<<<<<<
24632 * return self._H[self.q]
24633 * else:
24634*/
24635 __pyx_t_1 = (__pyx_v_self->inside_out != 0);
24636
24637 if (__pyx_t_1) {
24638
24639
24640 /* "equivalent_polynomials.pyx":157
24641 * return 0.0
24642 * elif self.inside_out:
24643 * return self._H[self.q] # <<<<<<<<<<<<<<
24644 * else:
24645 * return self._ImH[self.q]
24646*/
24647 __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->_H), __pyx_v_self->q, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error)
24648 __Pyx_GOTREF(__pyx_t_3);
24649 {
24650 PyObject *__pyx_temp;
24651 {
24652 __pyx_temp = __pyx_r;
24653 __pyx_r = __pyx_t_3;
24654 }
24655 __Pyx_XDECREF(__pyx_temp);
24656 }
24657 __pyx_t_3 = 0;
24658 goto __pyx_L0;
24659
24660 /* "equivalent_polynomials.pyx":156
24661 * elif self.edge == 1 or self.corner == 1:
24662 * return 0.0
24663 * elif self.inside_out: # <<<<<<<<<<<<<<
24664 * return self._H[self.q]
24665 * else:
24666*/
24667 }
24668
24669 /* "equivalent_polynomials.pyx":159
24670 * return self._H[self.q]
24671 * else:
24672 * return self._ImH[self.q] # <<<<<<<<<<<<<<
24673 * @property
24674 * def D(self):
24675*/
24676 /*else*/ {
24677 __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->_ImH), __pyx_v_self->q, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error)
24678 __Pyx_GOTREF(__pyx_t_3);
24679 {
24680 PyObject *__pyx_temp;
24681 {
24682 __pyx_temp = __pyx_r;
24683 __pyx_r = __pyx_t_3;
24684 }
24685 __Pyx_XDECREF(__pyx_temp);
24686 }
24687 __pyx_t_3 = 0;
24688 goto __pyx_L0;
24689 }
24690
24691 /* "equivalent_polynomials.pyx":150
24692 * else:
24693 * return self._H[self.q]
24694 * @property # <<<<<<<<<<<<<<
24695 * def ImH(self):
24696 * if self.edge == -1 or self.corner == -1:
24697*/
24698
24699 /* function exit code */
24700 __pyx_L1_error:;
24701 __Pyx_XDECREF(__pyx_t_3);
24702 __Pyx_AddTraceback("equivalent_polynomials.Simplex.ImH.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24703 __pyx_r = NULL;
24704 __pyx_L0:;
24705 __Pyx_XGIVEREF(__pyx_r);
24706 __Pyx_RefNannyFinishContext();
24707 return __pyx_r;
24708}
24709
24710/* "equivalent_polynomials.pyx":160
24711 * else:
24712 * return self._ImH[self.q]
24713 * @property # <<<<<<<<<<<<<<
24714 * def D(self):
24715 * # NOT zeroed for edge/corner: when the interface lies along an element edge it has real
24716*/
24717
24718/* Python wrapper */
24719static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_1D_1__get__(PyObject *__pyx_v_self); /*proto*/
24720static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_1D_1__get__(PyObject *__pyx_v_self) {
24721 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
24722 PyObject *__pyx_r = 0;
24723 __Pyx_RefNannyDeclarations
24724 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
24725 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
24726 __pyx_r = __pyx_pf_22equivalent_polynomials_7Simplex_1D___get__(((struct __pyx_obj_22equivalent_polynomials_Simplex *)__pyx_v_self));
24727
24728 /* function exit code */
24729 __Pyx_RefNannyFinishContext();
24730 return __pyx_r;
24731}
24732
24733static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_1D___get__(struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self) {
24734 PyObject *__pyx_r = NULL;
24735 __Pyx_RefNannyDeclarations
24736 PyObject *__pyx_t_1 = NULL;
24737 int __pyx_lineno = 0;
24738 const char *__pyx_filename = NULL;
24739 int __pyx_clineno = 0;
24740 __Pyx_RefNannySetupContext("__get__", 0);
24741
24742 /* "equivalent_polynomials.pyx":164
24743 * # NOT zeroed for edge/corner: when the interface lies along an element edge it has real
24744 * # nonzero measure (the edge length), which the moment fit already carries in _D.
24745 * return self._D[self.q] # <<<<<<<<<<<<<<
24746 *
24747 * def calc_edge_H(double phi0, double phi1, int nP):
24748*/
24749 __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->_D), __pyx_v_self->q, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
24750 __Pyx_GOTREF(__pyx_t_1);
24751 {
24752 PyObject *__pyx_temp;
24753 {
24754 __pyx_temp = __pyx_r;
24755 __pyx_r = __pyx_t_1;
24756 }
24757 __Pyx_XDECREF(__pyx_temp);
24758 }
24759 __pyx_t_1 = 0;
24760 goto __pyx_L0;
24761
24762 /* "equivalent_polynomials.pyx":160
24763 * else:
24764 * return self._ImH[self.q]
24765 * @property # <<<<<<<<<<<<<<
24766 * def D(self):
24767 * # NOT zeroed for edge/corner: when the interface lies along an element edge it has real
24768*/
24769
24770 /* function exit code */
24771 __pyx_L1_error:;
24772 __Pyx_XDECREF(__pyx_t_1);
24773 __Pyx_AddTraceback("equivalent_polynomials.Simplex.D.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24774 __pyx_r = NULL;
24775 __pyx_L0:;
24776 __Pyx_XGIVEREF(__pyx_r);
24777 __Pyx_RefNannyFinishContext();
24778 return __pyx_r;
24779}
24780
24781/* "(tree fragment)":1
24782 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
24783 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
24784 * def __setstate_cython__(self, __pyx_state):
24785*/
24786
24787/* Python wrapper */
24788static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_7__reduce_cython__(PyObject *__pyx_v_self,
24789#if CYTHON_VECTORCALL
24790PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24791#else
24792PyObject *__pyx_args, PyObject *__pyx_kwds
24793#endif
24794); /*proto*/
24795static PyMethodDef __pyx_mdef_22equivalent_polynomials_7Simplex_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_22equivalent_polynomials_7Simplex_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
24796static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_7__reduce_cython__(PyObject *__pyx_v_self,
24797#if CYTHON_VECTORCALL
24798PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24799#else
24800PyObject *__pyx_args, PyObject *__pyx_kwds
24801#endif
24802) {
24803 #if !CYTHON_VECTORCALL
24804 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
24805 #endif
24806 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
24807 PyObject *__pyx_r = 0;
24808 __Pyx_RefNannyDeclarations
24809 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
24810 #if !CYTHON_VECTORCALL
24811 #if CYTHON_ASSUME_SAFE_SIZE
24812 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
24813 #else
24814 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
24815 #endif
24816 #endif
24817 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
24818 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
24819 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
24820 if (unlikely(__pyx_kwds_len < 0)) return NULL;
24821 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
24822 __pyx_r = __pyx_pf_22equivalent_polynomials_7Simplex_6__reduce_cython__(((struct __pyx_obj_22equivalent_polynomials_Simplex *)__pyx_v_self));
24823
24824 /* function exit code */
24825 __Pyx_RefNannyFinishContext();
24826 return __pyx_r;
24827}
24828
24829static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self) {
24830 PyObject *__pyx_r = NULL;
24831 __Pyx_RefNannyDeclarations
24832 int __pyx_lineno = 0;
24833 const char *__pyx_filename = NULL;
24834 int __pyx_clineno = 0;
24835 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
24836
24837 /* "(tree fragment)":2
24838 * def __reduce_cython__(self):
24839 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
24840 * def __setstate_cython__(self, __pyx_state):
24841 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
24842*/
24843 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
24844 __PYX_ERR(1, 2, __pyx_L1_error)
24845
24846 /* "(tree fragment)":1
24847 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
24848 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
24849 * def __setstate_cython__(self, __pyx_state):
24850*/
24851
24852 /* function exit code */
24853 __pyx_L1_error:;
24854 __Pyx_AddTraceback("equivalent_polynomials.Simplex.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24855 __pyx_r = NULL;
24856 __Pyx_XGIVEREF(__pyx_r);
24857 __Pyx_RefNannyFinishContext();
24858 return __pyx_r;
24859}
24860
24861/* "(tree fragment)":3
24862 * def __reduce_cython__(self):
24863 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
24864 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
24865 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
24866*/
24867
24868/* Python wrapper */
24869static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_9__setstate_cython__(PyObject *__pyx_v_self,
24870#if CYTHON_VECTORCALL
24871PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24872#else
24873PyObject *__pyx_args, PyObject *__pyx_kwds
24874#endif
24875); /*proto*/
24876static PyMethodDef __pyx_mdef_22equivalent_polynomials_7Simplex_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_22equivalent_polynomials_7Simplex_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
24877static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_9__setstate_cython__(PyObject *__pyx_v_self,
24878#if CYTHON_VECTORCALL
24879PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24880#else
24881PyObject *__pyx_args, PyObject *__pyx_kwds
24882#endif
24883) {
24884 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
24885 #if !CYTHON_VECTORCALL
24886 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
24887 #endif
24888 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
24889 PyObject* values[1] = {0};
24890 int __pyx_lineno = 0;
24891 const char *__pyx_filename = NULL;
24892 int __pyx_clineno = 0;
24893 PyObject *__pyx_r = 0;
24894 __Pyx_RefNannyDeclarations
24895 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
24896 #if !CYTHON_VECTORCALL
24897 #if CYTHON_ASSUME_SAFE_SIZE
24898 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
24899 #else
24900 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
24901 #endif
24902 #endif
24903 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
24904 {
24905 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
24906 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
24907 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
24908 if (__pyx_kwds_len > 0) {
24909 switch (__pyx_nargs) {
24910 case 1:
24911 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24912 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
24913 CYTHON_FALLTHROUGH;
24914 case 0: break;
24915 default: goto __pyx_L5_argtuple_error;
24916 }
24917 const Py_ssize_t kwd_pos_args = __pyx_nargs;
24918 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)
24919 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
24920 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
24921 }
24922 } else if (unlikely(__pyx_nargs != 1)) {
24923 goto __pyx_L5_argtuple_error;
24924 } else {
24925 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24926 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
24927 }
24928 __pyx_v___pyx_state = values[0];
24929 }
24930 goto __pyx_L6_skip;
24931 __pyx_L5_argtuple_error:;
24932 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
24933 __pyx_L6_skip:;
24934 goto __pyx_L4_argument_unpacking_done;
24935 __pyx_L3_error:;
24936 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24937 Py_XDECREF(values[__pyx_temp]);
24938 }
24939 __Pyx_AddTraceback("equivalent_polynomials.Simplex.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24940 __Pyx_RefNannyFinishContext();
24941 return NULL;
24942 __pyx_L4_argument_unpacking_done:;
24943 __pyx_r = __pyx_pf_22equivalent_polynomials_7Simplex_8__setstate_cython__(((struct __pyx_obj_22equivalent_polynomials_Simplex *)__pyx_v_self), __pyx_v___pyx_state);
24944
24945 /* function exit code */
24946 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24947 Py_XDECREF(values[__pyx_temp]);
24948 }
24949 __Pyx_RefNannyFinishContext();
24950 return __pyx_r;
24951}
24952
24953static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
24954 PyObject *__pyx_r = NULL;
24955 __Pyx_RefNannyDeclarations
24956 int __pyx_lineno = 0;
24957 const char *__pyx_filename = NULL;
24958 int __pyx_clineno = 0;
24959 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
24960
24961 /* "(tree fragment)":4
24962 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
24963 * def __setstate_cython__(self, __pyx_state):
24964 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
24965*/
24966 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
24967 __PYX_ERR(1, 4, __pyx_L1_error)
24968
24969 /* "(tree fragment)":3
24970 * def __reduce_cython__(self):
24971 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
24972 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
24973 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
24974*/
24975
24976 /* function exit code */
24977 __pyx_L1_error:;
24978 __Pyx_AddTraceback("equivalent_polynomials.Simplex.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24979 __pyx_r = NULL;
24980 __Pyx_XGIVEREF(__pyx_r);
24981 __Pyx_RefNannyFinishContext();
24982 return __pyx_r;
24983}
24984
24985/* "equivalent_polynomials.pyx":166
24986 * return self._D[self.q]
24987 *
24988 * def calc_edge_H(double phi0, double phi1, int nP): # <<<<<<<<<<<<<<
24989 * """Edge-restricted moment-fit Heaviside on a cut edge (reference t in [0,1] from the edge's
24990 * node 0 to node 1). phi0, phi1 must have opposite signs. Returns the monomial coefficients
24991*/
24992
24993/* Python wrapper */
24994static PyObject *__pyx_pw_22equivalent_polynomials_1calc_edge_H(PyObject *__pyx_self,
24995#if CYTHON_VECTORCALL
24996PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24997#else
24998PyObject *__pyx_args, PyObject *__pyx_kwds
24999#endif
25000); /*proto*/
25001PyDoc_STRVAR(__pyx_doc_22equivalent_polynomials_calc_edge_H, "Edge-restricted moment-fit Heaviside on a cut edge (reference t in [0,1] from the edge\047s\n node 0 to node 1). phi0, phi1 must have opposite signs. Returns the monomial coefficients\n of H_hat in {1, t, ..., t**nP}, fitting the indicator of {phi > 0}.");
25002static PyMethodDef __pyx_mdef_22equivalent_polynomials_1calc_edge_H = {"calc_edge_H", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_22equivalent_polynomials_1calc_edge_H, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_22equivalent_polynomials_calc_edge_H};
25003static PyObject *__pyx_pw_22equivalent_polynomials_1calc_edge_H(PyObject *__pyx_self,
25004#if CYTHON_VECTORCALL
25005PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
25006#else
25007PyObject *__pyx_args, PyObject *__pyx_kwds
25008#endif
25009) {
25010 double __pyx_v_phi0;
25011 double __pyx_v_phi1;
25012 int __pyx_v_nP;
25013 #if !CYTHON_VECTORCALL
25014 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
25015 #endif
25016 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
25017 PyObject* values[3] = {0,0,0};
25018 int __pyx_lineno = 0;
25019 const char *__pyx_filename = NULL;
25020 int __pyx_clineno = 0;
25021 PyObject *__pyx_r = 0;
25022 __Pyx_RefNannyDeclarations
25023 __Pyx_RefNannySetupContext("calc_edge_H (wrapper)", 0);
25024 #if !CYTHON_VECTORCALL
25025 #if CYTHON_ASSUME_SAFE_SIZE
25026 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
25027 #else
25028 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
25029 #endif
25030 #endif
25031 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
25032 {
25033 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_phi0,&__pyx_mstate_global->__pyx_n_u_phi1,&__pyx_mstate_global->__pyx_n_u_nP,0};
25034 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
25035 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 166, __pyx_L3_error)
25036 if (__pyx_kwds_len > 0) {
25037 switch (__pyx_nargs) {
25038 case 3:
25039 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
25040 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 166, __pyx_L3_error)
25041 CYTHON_FALLTHROUGH;
25042 case 2:
25043 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
25044 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 166, __pyx_L3_error)
25045 CYTHON_FALLTHROUGH;
25046 case 1:
25047 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
25048 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 166, __pyx_L3_error)
25049 CYTHON_FALLTHROUGH;
25050 case 0: break;
25051 default: goto __pyx_L5_argtuple_error;
25052 }
25053 const Py_ssize_t kwd_pos_args = __pyx_nargs;
25054 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "calc_edge_H", 0) < (0)) __PYX_ERR(0, 166, __pyx_L3_error)
25055 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
25056 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("calc_edge_H", 1, 3, 3, i); __PYX_ERR(0, 166, __pyx_L3_error) }
25057 }
25058 } else if (unlikely(__pyx_nargs != 3)) {
25059 goto __pyx_L5_argtuple_error;
25060 } else {
25061 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
25062 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 166, __pyx_L3_error)
25063 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
25064 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 166, __pyx_L3_error)
25065 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
25066 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 166, __pyx_L3_error)
25067 }
25068 __pyx_v_phi0 = __Pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_phi0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L3_error)
25069 __pyx_v_phi1 = __Pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_phi1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L3_error)
25070 __pyx_v_nP = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nP == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L3_error)
25071 }
25072 goto __pyx_L6_skip;
25073 __pyx_L5_argtuple_error:;
25074 __Pyx_RaiseArgtupleInvalid("calc_edge_H", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 166, __pyx_L3_error)
25075 __pyx_L6_skip:;
25076 goto __pyx_L4_argument_unpacking_done;
25077 __pyx_L3_error:;
25078 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
25079 Py_XDECREF(values[__pyx_temp]);
25080 }
25081 __Pyx_AddTraceback("equivalent_polynomials.calc_edge_H", __pyx_clineno, __pyx_lineno, __pyx_filename);
25082 __Pyx_RefNannyFinishContext();
25083 return NULL;
25084 __pyx_L4_argument_unpacking_done:;
25085 __pyx_r = __pyx_pf_22equivalent_polynomials_calc_edge_H(__pyx_self, __pyx_v_phi0, __pyx_v_phi1, __pyx_v_nP);
25086
25087 /* function exit code */
25088 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
25089 Py_XDECREF(values[__pyx_temp]);
25090 }
25091
25092
25093
25094 __Pyx_RefNannyFinishContext();
25095 return __pyx_r;
25096}
25097
25098static PyObject *__pyx_pf_22equivalent_polynomials_calc_edge_H(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_phi0, double __pyx_v_phi1, int __pyx_v_nP) {
25099 PyArrayObject *__pyx_v_C_H = 0;
25100 PyObject *__pyx_r = NULL;
25101 __Pyx_RefNannyDeclarations
25102 PyObject *__pyx_t_1 = NULL;
25103 PyObject *__pyx_t_2 = NULL;
25104 PyObject *__pyx_t_3 = NULL;
25105 PyObject *__pyx_t_4 = NULL;
25106 size_t __pyx_t_5;
25107 int __pyx_lineno = 0;
25108 const char *__pyx_filename = NULL;
25109 int __pyx_clineno = 0;
25110 __Pyx_RefNannySetupContext("calc_edge_H", 0);
25111
25112 /* "equivalent_polynomials.pyx":170
25113 * node 0 to node 1). phi0, phi1 must have opposite signs. Returns the monomial coefficients
25114 * of H_hat in {1, t, ..., t**nP}, fitting the indicator of {phi > 0}."""
25115 * cdef np.ndarray C_H = np.zeros(nP+1) # <<<<<<<<<<<<<<
25116 * if nP == 1: eqp.calculate_edge_H[nP1T](phi0, phi1, <double*>C_H.data)
25117 * elif nP == 2: eqp.calculate_edge_H[nP2T](phi0, phi1, <double*>C_H.data)
25118*/
25119 __pyx_t_2 = NULL;
25120 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 170, __pyx_L1_error)
25121 __Pyx_GOTREF(__pyx_t_3);
25122 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error)
25123 __Pyx_GOTREF(__pyx_t_4);
25124 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25125 __pyx_t_3 = __Pyx_PyLong_From_long((__pyx_v_nP + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 170, __pyx_L1_error)
25126 __Pyx_GOTREF(__pyx_t_3);
25127 __pyx_t_5 = 1;
25128 #if CYTHON_UNPACK_METHODS
25129 if (unlikely(PyMethod_Check(__pyx_t_4))) {
25130 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
25131 assert(__pyx_t_2);
25132 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
25133 __Pyx_INCREF(__pyx_t_2);
25134 __Pyx_INCREF(__pyx__function);
25135 __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
25136 __pyx_t_5 = 0;
25137 }
25138 #endif
25139 {
25140 PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
25141 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
25142 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
25143 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25144 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25145 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
25146 __Pyx_GOTREF(__pyx_t_1);
25147 }
25148 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 170, __pyx_L1_error)
25149 __pyx_v_C_H = ((PyArrayObject *)__pyx_t_1);
25150 __pyx_t_1 = 0;
25151
25152 /* "equivalent_polynomials.pyx":171
25153 * of H_hat in {1, t, ..., t**nP}, fitting the indicator of {phi > 0}."""
25154 * cdef np.ndarray C_H = np.zeros(nP+1)
25155 * if nP == 1: eqp.calculate_edge_H[nP1T](phi0, phi1, <double*>C_H.data) # <<<<<<<<<<<<<<
25156 * elif nP == 2: eqp.calculate_edge_H[nP2T](phi0, phi1, <double*>C_H.data)
25157 * elif nP == 3: eqp.calculate_edge_H[nP3T](phi0, phi1, <double*>C_H.data)
25158*/
25159 switch (__pyx_v_nP) {
25160 case 1:
25161 equivalent_polynomials::calculate_edge_H<1>(__pyx_v_phi0, __pyx_v_phi1, ((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_C_H)));
25162 break;
25163 case 2:
25164
25165 /* "equivalent_polynomials.pyx":172
25166 * cdef np.ndarray C_H = np.zeros(nP+1)
25167 * if nP == 1: eqp.calculate_edge_H[nP1T](phi0, phi1, <double*>C_H.data)
25168 * elif nP == 2: eqp.calculate_edge_H[nP2T](phi0, phi1, <double*>C_H.data) # <<<<<<<<<<<<<<
25169 * elif nP == 3: eqp.calculate_edge_H[nP3T](phi0, phi1, <double*>C_H.data)
25170 * elif nP == 4: eqp.calculate_edge_H[nP4T](phi0, phi1, <double*>C_H.data)
25171*/
25172 equivalent_polynomials::calculate_edge_H<2>(__pyx_v_phi0, __pyx_v_phi1, ((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_C_H)));
25173 break;
25174 case 3:
25175
25176 /* "equivalent_polynomials.pyx":173
25177 * if nP == 1: eqp.calculate_edge_H[nP1T](phi0, phi1, <double*>C_H.data)
25178 * elif nP == 2: eqp.calculate_edge_H[nP2T](phi0, phi1, <double*>C_H.data)
25179 * elif nP == 3: eqp.calculate_edge_H[nP3T](phi0, phi1, <double*>C_H.data) # <<<<<<<<<<<<<<
25180 * elif nP == 4: eqp.calculate_edge_H[nP4T](phi0, phi1, <double*>C_H.data)
25181 * else: raise ValueError("nP must be 1, 2, 3, or 4")
25182*/
25183 equivalent_polynomials::calculate_edge_H<3>(__pyx_v_phi0, __pyx_v_phi1, ((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_C_H)));
25184 break;
25185 case 4:
25186
25187 /* "equivalent_polynomials.pyx":174
25188 * elif nP == 2: eqp.calculate_edge_H[nP2T](phi0, phi1, <double*>C_H.data)
25189 * elif nP == 3: eqp.calculate_edge_H[nP3T](phi0, phi1, <double*>C_H.data)
25190 * elif nP == 4: eqp.calculate_edge_H[nP4T](phi0, phi1, <double*>C_H.data) # <<<<<<<<<<<<<<
25191 * else: raise ValueError("nP must be 1, 2, 3, or 4")
25192 * return C_H
25193*/
25194 equivalent_polynomials::calculate_edge_H<4>(__pyx_v_phi0, __pyx_v_phi1, ((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_C_H)));
25195 break;
25196 default:
25197
25198 /* "equivalent_polynomials.pyx":175
25199 * elif nP == 3: eqp.calculate_edge_H[nP3T](phi0, phi1, <double*>C_H.data)
25200 * elif nP == 4: eqp.calculate_edge_H[nP4T](phi0, phi1, <double*>C_H.data)
25201 * else: raise ValueError("nP must be 1, 2, 3, or 4") # <<<<<<<<<<<<<<
25202 * return C_H
25203 *
25204*/
25205 __pyx_t_4 = NULL;
25206 __pyx_t_5 = 1;
25207 {
25208 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_nP_must_be_1_2_3_or_4};
25209 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
25210 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25211 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
25212 __Pyx_GOTREF(__pyx_t_1);
25213 }
25214 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
25215 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25216 __PYX_ERR(0, 175, __pyx_L1_error)
25217 break;
25218 }
25219
25220 /* "equivalent_polynomials.pyx":176
25221 * elif nP == 4: eqp.calculate_edge_H[nP4T](phi0, phi1, <double*>C_H.data)
25222 * else: raise ValueError("nP must be 1, 2, 3, or 4")
25223 * return C_H # <<<<<<<<<<<<<<
25224 *
25225 * def eval_edge_poly(np.ndarray C, double t, int nP):
25226*/
25227 {
25228 PyObject *__pyx_temp;
25229 {
25230 __pyx_temp = __pyx_r;
25231 __Pyx_INCREF((PyObject *)__pyx_v_C_H);
25232 __pyx_r = ((PyObject *)__pyx_v_C_H);
25233 }
25234 __Pyx_XDECREF(__pyx_temp);
25235 }
25236 goto __pyx_L0;
25237
25238 /* "equivalent_polynomials.pyx":166
25239 * return self._D[self.q]
25240 *
25241 * def calc_edge_H(double phi0, double phi1, int nP): # <<<<<<<<<<<<<<
25242 * """Edge-restricted moment-fit Heaviside on a cut edge (reference t in [0,1] from the edge's
25243 * node 0 to node 1). phi0, phi1 must have opposite signs. Returns the monomial coefficients
25244*/
25245
25246 /* function exit code */
25247 __pyx_L1_error:;
25248 __Pyx_XDECREF(__pyx_t_1);
25249 __Pyx_XDECREF(__pyx_t_2);
25250 __Pyx_XDECREF(__pyx_t_3);
25251 __Pyx_XDECREF(__pyx_t_4);
25252 __Pyx_AddTraceback("equivalent_polynomials.calc_edge_H", __pyx_clineno, __pyx_lineno, __pyx_filename);
25253 __pyx_r = NULL;
25254 __pyx_L0:;
25255 __Pyx_XDECREF((PyObject *)__pyx_v_C_H);
25256 __Pyx_XGIVEREF(__pyx_r);
25257 __Pyx_RefNannyFinishContext();
25258 return __pyx_r;
25259}
25260
25261/* "equivalent_polynomials.pyx":178
25262 * return C_H
25263 *
25264 * def eval_edge_poly(np.ndarray C, double t, int nP): # <<<<<<<<<<<<<<
25265 * if nP == 1: return eqp.evaluate_edge_poly[nP1T](<double*>C.data, t)
25266 * elif nP == 2: return eqp.evaluate_edge_poly[nP2T](<double*>C.data, t)
25267*/
25268
25269/* Python wrapper */
25270static PyObject *__pyx_pw_22equivalent_polynomials_3eval_edge_poly(PyObject *__pyx_self,
25271#if CYTHON_VECTORCALL
25272PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
25273#else
25274PyObject *__pyx_args, PyObject *__pyx_kwds
25275#endif
25276); /*proto*/
25277static PyMethodDef __pyx_mdef_22equivalent_polynomials_3eval_edge_poly = {"eval_edge_poly", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_22equivalent_polynomials_3eval_edge_poly, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
25278static PyObject *__pyx_pw_22equivalent_polynomials_3eval_edge_poly(PyObject *__pyx_self,
25279#if CYTHON_VECTORCALL
25280PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
25281#else
25282PyObject *__pyx_args, PyObject *__pyx_kwds
25283#endif
25284) {
25285 PyArrayObject *__pyx_v_C = 0;
25286 double __pyx_v_t;
25287 int __pyx_v_nP;
25288 #if !CYTHON_VECTORCALL
25289 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
25290 #endif
25291 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
25292 PyObject* values[3] = {0,0,0};
25293 int __pyx_lineno = 0;
25294 const char *__pyx_filename = NULL;
25295 int __pyx_clineno = 0;
25296 PyObject *__pyx_r = 0;
25297 __Pyx_RefNannyDeclarations
25298 __Pyx_RefNannySetupContext("eval_edge_poly (wrapper)", 0);
25299 #if !CYTHON_VECTORCALL
25300 #if CYTHON_ASSUME_SAFE_SIZE
25301 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
25302 #else
25303 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
25304 #endif
25305 #endif
25306 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
25307 {
25308 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_C,&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_nP,0};
25309 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
25310 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 178, __pyx_L3_error)
25311 if (__pyx_kwds_len > 0) {
25312 switch (__pyx_nargs) {
25313 case 3:
25314 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
25315 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 178, __pyx_L3_error)
25316 CYTHON_FALLTHROUGH;
25317 case 2:
25318 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
25319 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 178, __pyx_L3_error)
25320 CYTHON_FALLTHROUGH;
25321 case 1:
25322 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
25323 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 178, __pyx_L3_error)
25324 CYTHON_FALLTHROUGH;
25325 case 0: break;
25326 default: goto __pyx_L5_argtuple_error;
25327 }
25328 const Py_ssize_t kwd_pos_args = __pyx_nargs;
25329 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "eval_edge_poly", 0) < (0)) __PYX_ERR(0, 178, __pyx_L3_error)
25330 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
25331 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("eval_edge_poly", 1, 3, 3, i); __PYX_ERR(0, 178, __pyx_L3_error) }
25332 }
25333 } else if (unlikely(__pyx_nargs != 3)) {
25334 goto __pyx_L5_argtuple_error;
25335 } else {
25336 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
25337 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 178, __pyx_L3_error)
25338 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
25339 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 178, __pyx_L3_error)
25340 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
25341 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 178, __pyx_L3_error)
25342 }
25343 __pyx_v_C = ((PyArrayObject *)values[0]);
25344 __pyx_v_t = __Pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L3_error)
25345 __pyx_v_nP = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nP == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L3_error)
25346 }
25347 goto __pyx_L6_skip;
25348 __pyx_L5_argtuple_error:;
25349 __Pyx_RaiseArgtupleInvalid("eval_edge_poly", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 178, __pyx_L3_error)
25350 __pyx_L6_skip:;
25351 goto __pyx_L4_argument_unpacking_done;
25352 __pyx_L3_error:;
25353 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
25354 Py_XDECREF(values[__pyx_temp]);
25355 }
25356 __Pyx_AddTraceback("equivalent_polynomials.eval_edge_poly", __pyx_clineno, __pyx_lineno, __pyx_filename);
25357 __Pyx_RefNannyFinishContext();
25358 return NULL;
25359 __pyx_L4_argument_unpacking_done:;
25360 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_C), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "C", 0))) __PYX_ERR(0, 178, __pyx_L1_error)
25361 __pyx_r = __pyx_pf_22equivalent_polynomials_2eval_edge_poly(__pyx_self, __pyx_v_C, __pyx_v_t, __pyx_v_nP);
25362
25363 /* function exit code */
25364 goto __pyx_L0;
25365 __pyx_L1_error:;
25366 __pyx_r = NULL;
25367 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
25368 Py_XDECREF(values[__pyx_temp]);
25369 }
25370 goto __pyx_L7_cleaned_up;
25371 __pyx_L0:;
25372 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
25373 Py_XDECREF(values[__pyx_temp]);
25374 }
25375 __pyx_L7_cleaned_up:;
25376
25377
25378 __Pyx_RefNannyFinishContext();
25379 return __pyx_r;
25380}
25381
25382static PyObject *__pyx_pf_22equivalent_polynomials_2eval_edge_poly(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_C, double __pyx_v_t, int __pyx_v_nP) {
25383 PyObject *__pyx_r = NULL;
25384 __Pyx_RefNannyDeclarations
25385 PyObject *__pyx_t_1 = NULL;
25386 PyObject *__pyx_t_2 = NULL;
25387 size_t __pyx_t_3;
25388 int __pyx_lineno = 0;
25389 const char *__pyx_filename = NULL;
25390 int __pyx_clineno = 0;
25391 __Pyx_RefNannySetupContext("eval_edge_poly", 0);
25392
25393 /* "equivalent_polynomials.pyx":179
25394 *
25395 * def eval_edge_poly(np.ndarray C, double t, int nP):
25396 * if nP == 1: return eqp.evaluate_edge_poly[nP1T](<double*>C.data, t) # <<<<<<<<<<<<<<
25397 * elif nP == 2: return eqp.evaluate_edge_poly[nP2T](<double*>C.data, t)
25398 * elif nP == 3: return eqp.evaluate_edge_poly[nP3T](<double*>C.data, t)
25399*/
25400 switch (__pyx_v_nP) {
25401 case 1:
25402 __pyx_t_1 = PyFloat_FromDouble(equivalent_polynomials::evaluate_edge_poly<1>(((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_C)), __pyx_v_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error)
25403 __Pyx_GOTREF(__pyx_t_1);
25404 {
25405 PyObject *__pyx_temp;
25406 {
25407 __pyx_temp = __pyx_r;
25408 __pyx_r = __pyx_t_1;
25409 }
25410 __Pyx_XDECREF(__pyx_temp);
25411 }
25412 __pyx_t_1 = 0;
25413 goto __pyx_L0;
25414 break;
25415 case 2:
25416
25417 /* "equivalent_polynomials.pyx":180
25418 * def eval_edge_poly(np.ndarray C, double t, int nP):
25419 * if nP == 1: return eqp.evaluate_edge_poly[nP1T](<double*>C.data, t)
25420 * elif nP == 2: return eqp.evaluate_edge_poly[nP2T](<double*>C.data, t) # <<<<<<<<<<<<<<
25421 * elif nP == 3: return eqp.evaluate_edge_poly[nP3T](<double*>C.data, t)
25422 * elif nP == 4: return eqp.evaluate_edge_poly[nP4T](<double*>C.data, t)
25423*/
25424 __pyx_t_1 = PyFloat_FromDouble(equivalent_polynomials::evaluate_edge_poly<2>(((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_C)), __pyx_v_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error)
25425 __Pyx_GOTREF(__pyx_t_1);
25426 {
25427 PyObject *__pyx_temp;
25428 {
25429 __pyx_temp = __pyx_r;
25430 __pyx_r = __pyx_t_1;
25431 }
25432 __Pyx_XDECREF(__pyx_temp);
25433 }
25434 __pyx_t_1 = 0;
25435 goto __pyx_L0;
25436 break;
25437 case 3:
25438
25439 /* "equivalent_polynomials.pyx":181
25440 * if nP == 1: return eqp.evaluate_edge_poly[nP1T](<double*>C.data, t)
25441 * elif nP == 2: return eqp.evaluate_edge_poly[nP2T](<double*>C.data, t)
25442 * elif nP == 3: return eqp.evaluate_edge_poly[nP3T](<double*>C.data, t) # <<<<<<<<<<<<<<
25443 * elif nP == 4: return eqp.evaluate_edge_poly[nP4T](<double*>C.data, t)
25444 * else: raise ValueError("nP must be 1, 2, 3, or 4")
25445*/
25446 __pyx_t_1 = PyFloat_FromDouble(equivalent_polynomials::evaluate_edge_poly<3>(((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_C)), __pyx_v_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error)
25447 __Pyx_GOTREF(__pyx_t_1);
25448 {
25449 PyObject *__pyx_temp;
25450 {
25451 __pyx_temp = __pyx_r;
25452 __pyx_r = __pyx_t_1;
25453 }
25454 __Pyx_XDECREF(__pyx_temp);
25455 }
25456 __pyx_t_1 = 0;
25457 goto __pyx_L0;
25458 break;
25459 case 4:
25460
25461 /* "equivalent_polynomials.pyx":182
25462 * elif nP == 2: return eqp.evaluate_edge_poly[nP2T](<double*>C.data, t)
25463 * elif nP == 3: return eqp.evaluate_edge_poly[nP3T](<double*>C.data, t)
25464 * elif nP == 4: return eqp.evaluate_edge_poly[nP4T](<double*>C.data, t) # <<<<<<<<<<<<<<
25465 * else: raise ValueError("nP must be 1, 2, 3, or 4")
25466*/
25467 __pyx_t_1 = PyFloat_FromDouble(equivalent_polynomials::evaluate_edge_poly<4>(((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_C)), __pyx_v_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error)
25468 __Pyx_GOTREF(__pyx_t_1);
25469 {
25470 PyObject *__pyx_temp;
25471 {
25472 __pyx_temp = __pyx_r;
25473 __pyx_r = __pyx_t_1;
25474 }
25475 __Pyx_XDECREF(__pyx_temp);
25476 }
25477 __pyx_t_1 = 0;
25478 goto __pyx_L0;
25479 break;
25480 default:
25481
25482 /* "equivalent_polynomials.pyx":183
25483 * elif nP == 3: return eqp.evaluate_edge_poly[nP3T](<double*>C.data, t)
25484 * elif nP == 4: return eqp.evaluate_edge_poly[nP4T](<double*>C.data, t)
25485 * else: raise ValueError("nP must be 1, 2, 3, or 4") # <<<<<<<<<<<<<<
25486*/
25487 __pyx_t_2 = NULL;
25488 __pyx_t_3 = 1;
25489 {
25490 PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_nP_must_be_1_2_3_or_4};
25491 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
25492 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
25493 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error)
25494 __Pyx_GOTREF(__pyx_t_1);
25495 }
25496 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
25497 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25498 __PYX_ERR(0, 183, __pyx_L1_error)
25499 break;
25500 }
25501
25502 /* "equivalent_polynomials.pyx":178
25503 * return C_H
25504 *
25505 * def eval_edge_poly(np.ndarray C, double t, int nP): # <<<<<<<<<<<<<<
25506 * if nP == 1: return eqp.evaluate_edge_poly[nP1T](<double*>C.data, t)
25507 * elif nP == 2: return eqp.evaluate_edge_poly[nP2T](<double*>C.data, t)
25508*/
25509
25510 /* function exit code */
25511 __pyx_L1_error:;
25512 __Pyx_XDECREF(__pyx_t_1);
25513 __Pyx_XDECREF(__pyx_t_2);
25514 __Pyx_AddTraceback("equivalent_polynomials.eval_edge_poly", __pyx_clineno, __pyx_lineno, __pyx_filename);
25515 __pyx_r = NULL;
25516 __pyx_L0:;
25517 __Pyx_XGIVEREF(__pyx_r);
25518 __Pyx_RefNannyFinishContext();
25519 return __pyx_r;
25520}
25521/* #### Code section: module_exttypes ### */
25522
25523static PyObject *__pyx_tp_new__initialisation_22equivalent_polynomials_Simplex(PyObject *o,
25524#if CYTHON_VECTORCALL_TPNEW
25525 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
25526#else
25527 PyObject *a, PyObject *k
25528#endif
25529) {
25530 struct __pyx_obj_22equivalent_polynomials_Simplex *p = ((struct __pyx_obj_22equivalent_polynomials_Simplex *)o);
25531 __Pyx_default_placement_construct(&(p->s11));
25532 __Pyx_default_placement_construct(&(p->s12));
25533 __Pyx_default_placement_construct(&(p->s13));
25534 __Pyx_default_placement_construct(&(p->s21));
25535 __Pyx_default_placement_construct(&(p->s22));
25536 __Pyx_default_placement_construct(&(p->s23));
25537 __Pyx_default_placement_construct(&(p->s31));
25538 __Pyx_default_placement_construct(&(p->s32));
25539 __Pyx_default_placement_construct(&(p->s33));
25540 p->xiBuffer = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
25541 p->_H = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
25542 p->_ImH = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
25543 p->_D = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
25544 {
25545 int cinit_result = __pyx_pw_22equivalent_polynomials_7Simplex_1__cinit__(o,
25546#if CYTHON_VECTORCALL_TPNEW
25547 args, nargs, kwnames
25548#else
25549 a, k
25550#endif
25551);
25552 if (unlikely(cinit_result)) goto bad;
25553 }
25554 return o;
25555 bad:
25556 Py_DECREF(o); o = 0;
25557 return NULL;
25558}
25559
25560static PyObject *__pyx_tp_new_vectorcall_22equivalent_polynomials_Simplex(PyTypeObject *t,
25561#if CYTHON_VECTORCALL_TPNEW
25562 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
25563#else
25564 PyObject *a, PyObject *k
25565#endif
25566) {
25567 PyObject *o;
25568 o = __Pyx_AllocateExtensionType(t, 0);
25569 if (unlikely(!o)) return 0;
25570 return __pyx_tp_new__initialisation_22equivalent_polynomials_Simplex(o,
25571#if CYTHON_VECTORCALL_TPNEW
25572 args, nargs, kwnames
25573#else
25574 a, k
25575#endif
25576);
25577}
25578
25579#if CYTHON_VECTORCALL_TPNEW
25580static PyObject *__pyx_tp_new_22equivalent_polynomials_Simplex(PyTypeObject *t, PyObject *a, PyObject *k) {
25581 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_22equivalent_polynomials_Simplex, t, a, k);
25582}
25583#endif
25584
25585#if CYTHON_VECTORCALL_TPNEW
25586static PyObject *__pyx_tp_vectorcall_22equivalent_polynomials_Simplex(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
25587 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_22equivalent_polynomials_Simplex || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
25588 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
25589 }
25590 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
25591 PyObject *o = __pyx_tp_new_vectorcall_22equivalent_polynomials_Simplex((PyTypeObject*)t, args, nargs, kwnames);
25592 return o;
25593}
25594#endif
25595
25596static void __pyx_tp_dealloc_22equivalent_polynomials_Simplex(PyObject *o) {
25597 struct __pyx_obj_22equivalent_polynomials_Simplex *p = (struct __pyx_obj_22equivalent_polynomials_Simplex *)o;
25598 #if CYTHON_USE_TP_FINALIZE
25599 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
25600 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_22equivalent_polynomials_Simplex) {
25601 if (PyObject_CallFinalizerFromDealloc(o)) return;
25602 }
25603 }
25604 #endif
25605 PyObject_GC_UnTrack(o);
25606 __Pyx_call_destructor(p->s11);
25607 __Pyx_call_destructor(p->s12);
25608 __Pyx_call_destructor(p->s13);
25609 __Pyx_call_destructor(p->s21);
25610 __Pyx_call_destructor(p->s22);
25611 __Pyx_call_destructor(p->s23);
25612 __Pyx_call_destructor(p->s31);
25613 __Pyx_call_destructor(p->s32);
25614 __Pyx_call_destructor(p->s33);
25615 Py_CLEAR(p->xiBuffer);
25616 Py_CLEAR(p->_H);
25617 Py_CLEAR(p->_ImH);
25618 Py_CLEAR(p->_D);
25619 PyTypeObject *tp = Py_TYPE(o);
25620 #if CYTHON_USE_TYPE_SLOTS
25621 (*tp->tp_free)(o);
25622 #else
25623 {
25624 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
25625 if (tp_free) tp_free(o);
25626 }
25627 #endif
25628 #if CYTHON_USE_TYPE_SPECS
25629 Py_DECREF(tp);
25630 #endif
25631}
25632
25633static int __pyx_tp_traverse_22equivalent_polynomials_Simplex(PyObject *o, visitproc v, void *a) {
25634 int e;
25635 struct __pyx_obj_22equivalent_polynomials_Simplex *p = (struct __pyx_obj_22equivalent_polynomials_Simplex *)o;
25636 {
25637 e = __Pyx_call_type_traverse(o, 1, v, a);
25638 if (e) return e;
25639 }
25640 if (p->xiBuffer) {
25641 e = (*v)(((PyObject *)p->xiBuffer), a); if (e) return e;
25642 }
25643 if (p->_H) {
25644 e = (*v)(((PyObject *)p->_H), a); if (e) return e;
25645 }
25646 if (p->_ImH) {
25647 e = (*v)(((PyObject *)p->_ImH), a); if (e) return e;
25648 }
25649 if (p->_D) {
25650 e = (*v)(((PyObject *)p->_D), a); if (e) return e;
25651 }
25652 return 0;
25653}
25654
25655static int __pyx_tp_clear_22equivalent_polynomials_Simplex(PyObject *o) {
25656 PyObject* tmp;
25657 struct __pyx_obj_22equivalent_polynomials_Simplex *p = (struct __pyx_obj_22equivalent_polynomials_Simplex *)o;
25658 tmp = ((PyObject*)p->xiBuffer);
25659 p->xiBuffer = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
25660 Py_XDECREF(tmp);
25661 tmp = ((PyObject*)p->_H);
25662 p->_H = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
25663 Py_XDECREF(tmp);
25664 tmp = ((PyObject*)p->_ImH);
25665 p->_ImH = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
25666 Py_XDECREF(tmp);
25667 tmp = ((PyObject*)p->_D);
25668 p->_D = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
25669 Py_XDECREF(tmp);
25670 return 0;
25671}
25672
25673static PyObject *__pyx_getprop_22equivalent_polynomials_7Simplex_H(PyObject *o, CYTHON_UNUSED void *x) {
25674 return __pyx_pw_22equivalent_polynomials_7Simplex_1H_1__get__(o);
25675}
25676
25677static PyObject *__pyx_getprop_22equivalent_polynomials_7Simplex_ImH(PyObject *o, CYTHON_UNUSED void *x) {
25678 return __pyx_pw_22equivalent_polynomials_7Simplex_3ImH_1__get__(o);
25679}
25680
25681static PyObject *__pyx_getprop_22equivalent_polynomials_7Simplex_D(PyObject *o, CYTHON_UNUSED void *x) {
25682 return __pyx_pw_22equivalent_polynomials_7Simplex_1D_1__get__(o);
25683}
25684
25685static PyMethodDef __pyx_methods_22equivalent_polynomials_Simplex[] = {
25686 {"calculate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_22equivalent_polynomials_7Simplex_3calculate, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25687 {"set_quad", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_22equivalent_polynomials_7Simplex_5set_quad, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25688 {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_22equivalent_polynomials_7Simplex_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25689 {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_22equivalent_polynomials_7Simplex_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25690 {0, 0, 0, 0}
25691};
25692
25693static struct PyGetSetDef __pyx_getsets_22equivalent_polynomials_Simplex[] = {
25694 {"H", __pyx_getprop_22equivalent_polynomials_7Simplex_H, 0, 0, 0},
25695 {"ImH", __pyx_getprop_22equivalent_polynomials_7Simplex_ImH, 0, 0, 0},
25696 {"D", __pyx_getprop_22equivalent_polynomials_7Simplex_D, 0, 0, 0},
25697 {0, 0, 0, 0, 0}
25698};
25699#if CYTHON_USE_TYPE_SPECS
25700static PyType_Slot __pyx_type_22equivalent_polynomials_Simplex_slots[] = {
25701 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_22equivalent_polynomials_Simplex},
25702 {Py_tp_traverse, (void *)__pyx_tp_traverse_22equivalent_polynomials_Simplex},
25703 {Py_tp_clear, (void *)__pyx_tp_clear_22equivalent_polynomials_Simplex},
25704 {Py_tp_methods, (void *)__pyx_methods_22equivalent_polynomials_Simplex},
25705 {Py_tp_getset, (void *)__pyx_getsets_22equivalent_polynomials_Simplex},
25706 {Py_tp_new, (void *)__pyx_tp_new_22equivalent_polynomials_Simplex},
25707 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
25708 #if CYTHON_VECTORCALL_TPNEW
25709 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_22equivalent_polynomials_Simplex},
25710 #endif
25711 #endif
25712 {0, 0},
25713};
25714static PyType_Spec __pyx_type_22equivalent_polynomials_Simplex_spec = {
25715 "equivalent_polynomials.Simplex",
25716 sizeof(struct __pyx_obj_22equivalent_polynomials_Simplex),
25717 0,
25718 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
25719 __pyx_type_22equivalent_polynomials_Simplex_slots,
25720};
25721#else
25722
25723static PyTypeObject __pyx_type_22equivalent_polynomials_Simplex = {
25724 PyVarObject_HEAD_INIT(0, 0)
25725 "equivalent_polynomials.""Simplex", /*tp_name*/
25726 sizeof(struct __pyx_obj_22equivalent_polynomials_Simplex), /*tp_basicsize*/
25727 0, /*tp_itemsize*/
25728 __pyx_tp_dealloc_22equivalent_polynomials_Simplex, /*tp_dealloc*/
25729 0, /*tp_vectorcall_offset*/
25730 0, /*tp_getattr*/
25731 0, /*tp_setattr*/
25732 0, /*tp_as_async*/
25733 0, /*tp_repr*/
25734 0, /*tp_as_number*/
25735 0, /*tp_as_sequence*/
25736 0, /*tp_as_mapping*/
25737 0, /*tp_hash*/
25738 0, /*tp_call*/
25739 0, /*tp_str*/
25740 0, /*tp_getattro*/
25741 0, /*tp_setattro*/
25742 0, /*tp_as_buffer*/
25743 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
25744 0, /*tp_doc*/
25745 __pyx_tp_traverse_22equivalent_polynomials_Simplex, /*tp_traverse*/
25746 __pyx_tp_clear_22equivalent_polynomials_Simplex, /*tp_clear*/
25747 0, /*tp_richcompare*/
25748 0, /*tp_weaklistoffset*/
25749 0, /*tp_iter*/
25750 0, /*tp_iternext*/
25751 __pyx_methods_22equivalent_polynomials_Simplex, /*tp_methods*/
25752 0, /*tp_members*/
25753 __pyx_getsets_22equivalent_polynomials_Simplex, /*tp_getset*/
25754 0, /*tp_base*/
25755 0, /*tp_dict*/
25756 0, /*tp_descr_get*/
25757 0, /*tp_descr_set*/
25758 #if !CYTHON_USE_TYPE_SPECS
25759 0, /*tp_dictoffset*/
25760 #endif
25761 0, /*tp_init*/
25762 0, /*tp_alloc*/
25763 __pyx_tp_new_22equivalent_polynomials_Simplex, /*tp_new*/
25764 0, /*tp_free*/
25765 0, /*tp_is_gc*/
25766 0, /*tp_bases*/
25767 0, /*tp_mro*/
25768 0, /*tp_cache*/
25769 0, /*tp_subclasses*/
25770 0, /*tp_weaklist*/
25771 0, /*tp_del*/
25772 0, /*tp_version_tag*/
25773 #if CYTHON_USE_TP_FINALIZE
25774 0, /*tp_finalize*/
25775 #else
25776 NULL, /*tp_finalize*/
25777 #endif
25778 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
25779 #if CYTHON_VECTORCALL_TPNEW
25780 __pyx_tp_vectorcall_22equivalent_polynomials_Simplex, /*tp_vectorcall*/
25781 #else
25782 NULL, /*tp_vectorcall*/
25783 #endif
25784 #endif
25785 #if __PYX_NEED_TP_PRINT_SLOT == 1
25786 0, /*tp_print*/
25787 #endif
25788 #if PY_VERSION_HEX >= 0x030C0000
25789 0, /*tp_watched*/
25790 #endif
25791 #if PY_VERSION_HEX >= 0x030d00A4
25792 0, /*tp_versions_used*/
25793 #endif
25794 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
25795 0, /*tp_pypy_flags*/
25796 #endif
25797};
25798#endif
25799static struct __pyx_vtabstruct_array __pyx_vtable_array;
25800
25801static PyObject *__pyx_tp_new__initialisation_array(PyObject *o,
25802#if CYTHON_VECTORCALL_TPNEW
25803 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
25804#else
25805 PyObject *a, PyObject *k
25806#endif
25807) {
25808 struct __pyx_array_obj *p = ((struct __pyx_array_obj *)o);
25809 p->__pyx_vtab = __pyx_vtabptr_array;
25810 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
25811 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
25812 {
25813 int cinit_result = __pyx_array___cinit__(o,
25814#if CYTHON_VECTORCALL_TPNEW
25815 args, nargs, kwnames
25816#else
25817 a, k
25818#endif
25819);
25820 if (unlikely(cinit_result)) goto bad;
25821 }
25822 return o;
25823 bad:
25824 Py_DECREF(o); o = 0;
25825 return NULL;
25826}
25827
25828static PyObject *__pyx_tp_new_vectorcall_array(PyTypeObject *t,
25829#if CYTHON_VECTORCALL_TPNEW
25830 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
25831#else
25832 PyObject *a, PyObject *k
25833#endif
25834) {
25835 PyObject *o;
25836 o = __Pyx_AllocateExtensionType(t, 0);
25837 if (unlikely(!o)) return 0;
25838 return __pyx_tp_new__initialisation_array(o,
25839#if CYTHON_VECTORCALL_TPNEW
25840 args, nargs, kwnames
25841#else
25842 a, k
25843#endif
25844);
25845}
25846
25847#if CYTHON_VECTORCALL_TPNEW
25848static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
25849 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_array, t, a, k);
25850}
25851#endif
25852
25853#if CYTHON_VECTORCALL_TPNEW
25854static PyObject *__pyx_tp_vectorcall_array(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
25855 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_array_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
25856 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
25857 }
25858 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
25859 PyObject *o = __pyx_tp_new_vectorcall_array((PyTypeObject*)t, args, nargs, kwnames);
25860 return o;
25861}
25862#endif
25863
25864static void __pyx_tp_dealloc_array(PyObject *o) {
25865 struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
25866 #if CYTHON_USE_TP_FINALIZE
25867 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
25868 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_array) {
25869 if (PyObject_CallFinalizerFromDealloc(o)) return;
25870 }
25871 }
25872 #endif
25873 {
25874 PyObject *etype, *eval, *etb;
25875 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
25876 __Pyx_DeallocKeepAliveBegin(o);
25877 __pyx_array___dealloc__(o);
25878 __Pyx_DeallocKeepAliveEnd(o);
25879 __Pyx_PyErr_RestoreException(etype, eval, etb);
25880 }
25881 Py_CLEAR(p->mode);
25882 Py_CLEAR(p->_format);
25883 PyTypeObject *tp = Py_TYPE(o);
25884 #if CYTHON_USE_TYPE_SLOTS
25885 (*tp->tp_free)(o);
25886 #else
25887 {
25888 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
25889 if (tp_free) tp_free(o);
25890 }
25891 #endif
25892 #if CYTHON_USE_TYPE_SPECS
25893 Py_DECREF(tp);
25894 #endif
25895}
25896
25897static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
25898 PyObject *r;
25899 PyObject *x = PyLong_FromSsize_t(i); if (unlikely(!x)) return NULL;
25900 #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
25901 binaryfunc f = Py_TYPE(o)->tp_as_mapping->mp_subscript;
25902 #else
25903 binaryfunc f = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript));
25904 #endif
25905 r = f(o, x);
25906 Py_DECREF(x);
25907 return r;
25908}
25909
25910static PyObject *__pyx_mp_subscript_array(PyObject *o, PyObject *i) {
25911 return __pyx_array___getitem__(o, i);
25912}
25913
25914static int __pyx_sq_ass_item_array(PyObject *o, Py_ssize_t i, PyObject *v) {
25915 if (likely(v)) {
25916 PyObject *x = PyLong_FromSsize_t(i); if (unlikely(!x)) return -1;
25917 int r = __pyx_array___setitem__(o, x, v);
25918 Py_DECREF(x);
25919 return r;
25920 } else {
25921 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError, "Subscript %.10s not supported by " __Pyx_FMT_TYPENAME, "deletion", o);
25922 return -1;
25923 }
25924}
25925
25926static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
25927 if (likely(v)) {
25928 return __pyx_array___setitem__(o, i, v);
25929 } else {
25930 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError, "Subscript %.10s not supported by " __Pyx_FMT_TYPENAME, "deletion", o);
25931 return -1;
25932 }
25933}
25934
25935static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
25936 PyObject *v = PyObject_GenericGetAttr(o, n);
25937 if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25938 PyErr_Clear();
25939 v = __pyx_array___getattr__(o, n);
25940 }
25941 return v;
25942}
25943
25944static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
25945 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
25946}
25947
25948static PyMethodDef __pyx_methods_array[] = {
25949 {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
25950 {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25951 {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25952 {0, 0, 0, 0}
25953};
25954
25955static struct PyGetSetDef __pyx_getsets_array[] = {
25956 {"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
25957 {0, 0, 0, 0, 0}
25958};
25959#if CYTHON_USE_TYPE_SPECS
25960#if !CYTHON_COMPILING_IN_LIMITED_API
25961
25962static PyBufferProcs __pyx_tp_as_buffer_array = {
25963 __pyx_array_getbuffer, /*bf_getbuffer*/
25964 0, /*bf_releasebuffer*/
25965};
25966#endif
25967static PyType_Slot __pyx_type___pyx_array_slots[] = {
25968 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_array},
25969 {Py_sq_length, (void *)__pyx_array___len__},
25970 {Py_sq_item, (void *)__pyx_sq_item_array},
25971 {Py_sq_ass_item, (void *)__pyx_sq_ass_item_array},
25972 {Py_mp_length, (void *)__pyx_array___len__},
25973 {Py_mp_subscript, (void *)__pyx_mp_subscript_array},
25974 {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_array},
25975 {Py_tp_getattro, (void *)__pyx_tp_getattro_array},
25976 #if defined(Py_bf_getbuffer)
25977 {Py_bf_getbuffer, (void *)__pyx_array_getbuffer},
25978 #endif
25979 {Py_tp_methods, (void *)__pyx_methods_array},
25980 {Py_tp_getset, (void *)__pyx_getsets_array},
25981 {Py_tp_new, (void *)__pyx_tp_new_array},
25982 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
25983 #if CYTHON_VECTORCALL_TPNEW
25984 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_array},
25985 #endif
25986 #endif
25987 {0, 0},
25988};
25989static PyType_Spec __pyx_type___pyx_array_spec = {
25990 "equivalent_polynomials.array",
25991 sizeof(struct __pyx_array_obj),
25992 0,
25993 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE,
25994 __pyx_type___pyx_array_slots,
25995};
25996#else
25997
25998static PySequenceMethods __pyx_tp_as_sequence_array = {
25999 __pyx_array___len__, /*sq_length*/
26000 0, /*sq_concat*/
26001 0, /*sq_repeat*/
26002 __pyx_sq_item_array, /*sq_item*/
26003 0, /*sq_slice*/
26004 __pyx_sq_ass_item_array, /*sq_ass_item*/
26005 0, /*sq_ass_slice*/
26006 0, /*sq_contains*/
26007 0, /*sq_inplace_concat*/
26008 0, /*sq_inplace_repeat*/
26009};
26010
26011static PyMappingMethods __pyx_tp_as_mapping_array = {
26012 __pyx_array___len__, /*mp_length*/
26013 __pyx_mp_subscript_array, /*mp_subscript*/
26014 __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
26015};
26016
26017static PyBufferProcs __pyx_tp_as_buffer_array = {
26018 __pyx_array_getbuffer, /*bf_getbuffer*/
26019 0, /*bf_releasebuffer*/
26020};
26021
26022static PyTypeObject __pyx_type___pyx_array = {
26023 PyVarObject_HEAD_INIT(0, 0)
26024 "equivalent_polynomials.""array", /*tp_name*/
26025 sizeof(struct __pyx_array_obj), /*tp_basicsize*/
26026 0, /*tp_itemsize*/
26027 __pyx_tp_dealloc_array, /*tp_dealloc*/
26028 0, /*tp_vectorcall_offset*/
26029 0, /*tp_getattr*/
26030 0, /*tp_setattr*/
26031 0, /*tp_as_async*/
26032 0, /*tp_repr*/
26033 0, /*tp_as_number*/
26034 &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
26035 &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
26036 0, /*tp_hash*/
26037 0, /*tp_call*/
26038 0, /*tp_str*/
26039 __pyx_tp_getattro_array, /*tp_getattro*/
26040 0, /*tp_setattro*/
26041 &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
26042 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
26043 0, /*tp_doc*/
26044 0, /*tp_traverse*/
26045 0, /*tp_clear*/
26046 0, /*tp_richcompare*/
26047 0, /*tp_weaklistoffset*/
26048 0, /*tp_iter*/
26049 0, /*tp_iternext*/
26050 __pyx_methods_array, /*tp_methods*/
26051 0, /*tp_members*/
26052 __pyx_getsets_array, /*tp_getset*/
26053 0, /*tp_base*/
26054 0, /*tp_dict*/
26055 0, /*tp_descr_get*/
26056 0, /*tp_descr_set*/
26057 #if !CYTHON_USE_TYPE_SPECS
26058 0, /*tp_dictoffset*/
26059 #endif
26060 0, /*tp_init*/
26061 0, /*tp_alloc*/
26062 __pyx_tp_new_array, /*tp_new*/
26063 0, /*tp_free*/
26064 0, /*tp_is_gc*/
26065 0, /*tp_bases*/
26066 0, /*tp_mro*/
26067 0, /*tp_cache*/
26068 0, /*tp_subclasses*/
26069 0, /*tp_weaklist*/
26070 0, /*tp_del*/
26071 0, /*tp_version_tag*/
26072 #if CYTHON_USE_TP_FINALIZE
26073 0, /*tp_finalize*/
26074 #else
26075 NULL, /*tp_finalize*/
26076 #endif
26077 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26078 #if CYTHON_VECTORCALL_TPNEW
26079 __pyx_tp_vectorcall_array, /*tp_vectorcall*/
26080 #else
26081 NULL, /*tp_vectorcall*/
26082 #endif
26083 #endif
26084 #if __PYX_NEED_TP_PRINT_SLOT == 1
26085 0, /*tp_print*/
26086 #endif
26087 #if PY_VERSION_HEX >= 0x030C0000
26088 0, /*tp_watched*/
26089 #endif
26090 #if PY_VERSION_HEX >= 0x030d00A4
26091 0, /*tp_versions_used*/
26092 #endif
26093 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
26094 0, /*tp_pypy_flags*/
26095 #endif
26096};
26097#endif
26098
26099static PyObject *__pyx_tp_new__initialisation_Enum(PyObject *o,
26100#if CYTHON_VECTORCALL_TPNEW
26101 CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
26102#else
26103 CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
26104#endif
26105) {
26106 struct __pyx_MemviewEnum_obj *p = ((struct __pyx_MemviewEnum_obj *)o);
26107 p->name = Py_None; Py_INCREF(Py_None);
26108 return o;
26109}
26110
26111static PyObject *__pyx_tp_new_vectorcall_Enum(PyTypeObject *t,
26112#if CYTHON_VECTORCALL_TPNEW
26113 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
26114#else
26115 PyObject *a, PyObject *k
26116#endif
26117) {
26118 PyObject *o;
26119 o = __Pyx_AllocateExtensionType(t, 0);
26120 if (unlikely(!o)) return 0;
26121 return __pyx_tp_new__initialisation_Enum(o,
26122#if CYTHON_VECTORCALL_TPNEW
26123 args, nargs, kwnames
26124#else
26125 a, k
26126#endif
26127);
26128}
26129
26130#if CYTHON_VECTORCALL_TPNEW
26131static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k) {
26132 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_Enum, t, a, k);
26133}
26134#endif
26135
26136#if CYTHON_VECTORCALL_TPNEW
26137static PyObject *__pyx_tp_vectorcall_Enum(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
26138 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_MemviewEnum_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
26139 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
26140 }
26141 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
26142 PyObject *o = __pyx_tp_new_vectorcall_Enum((PyTypeObject*)t, args, nargs, kwnames);
26143 if (likely(o)) {
26144 assert(Py_TYPE(o) == (PyTypeObject*)t);
26145 if (unlikely(__pyx_MemviewEnum___init__(o, args, nargs, kwnames) < 0)) {
26146 Py_CLEAR(o);
26147 }
26148 }
26149 return o;
26150}
26151#endif
26152
26153#if CYTHON_VECTORCALL_TPNEW
26154static int __pyx_tp_init_Enum(PyObject *o, PyObject *args, PyObject *kwds) {
26155 return __Pyx_CallTpinitAsVectorcall(__pyx_MemviewEnum___init__, o, args, kwds);
26156}
26157#endif
26158
26159static void __pyx_tp_dealloc_Enum(PyObject *o) {
26160 struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
26161 #if CYTHON_USE_TP_FINALIZE
26162 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
26163 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_Enum) {
26164 if (PyObject_CallFinalizerFromDealloc(o)) return;
26165 }
26166 }
26167 #endif
26168 PyObject_GC_UnTrack(o);
26169 Py_CLEAR(p->name);
26170 PyTypeObject *tp = Py_TYPE(o);
26171 #if CYTHON_USE_TYPE_SLOTS
26172 (*tp->tp_free)(o);
26173 #else
26174 {
26175 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
26176 if (tp_free) tp_free(o);
26177 }
26178 #endif
26179 #if CYTHON_USE_TYPE_SPECS
26180 Py_DECREF(tp);
26181 #endif
26182}
26183
26184static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
26185 int e;
26186 struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
26187 {
26188 e = __Pyx_call_type_traverse(o, 1, v, a);
26189 if (e) return e;
26190 }
26191 if (p->name) {
26192 e = (*v)(p->name, a); if (e) return e;
26193 }
26194 return 0;
26195}
26196
26197static int __pyx_tp_clear_Enum(PyObject *o) {
26198 PyObject* tmp;
26199 struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
26200 tmp = ((PyObject*)p->name);
26201 p->name = Py_None; Py_INCREF(Py_None);
26202 Py_XDECREF(tmp);
26203 return 0;
26204}
26205
26206static PyMethodDef __pyx_methods_Enum[] = {
26207 {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26208 {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26209 {0, 0, 0, 0}
26210};
26211#if CYTHON_USE_TYPE_SPECS
26212static PyType_Slot __pyx_type___pyx_MemviewEnum_slots[] = {
26213 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_Enum},
26214 {Py_tp_repr, (void *)__pyx_MemviewEnum___repr__},
26215 {Py_tp_traverse, (void *)__pyx_tp_traverse_Enum},
26216 {Py_tp_clear, (void *)__pyx_tp_clear_Enum},
26217 {Py_tp_methods, (void *)__pyx_methods_Enum},
26218 {Py_tp_init, (void *)__pyx_tp_init_Enum},
26219 {Py_tp_new, (void *)__pyx_tp_new_Enum},
26220 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26221 #if CYTHON_VECTORCALL_TPNEW
26222 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_Enum},
26223 #endif
26224 #endif
26225 {0, 0},
26226};
26227static PyType_Spec __pyx_type___pyx_MemviewEnum_spec = {
26228 "equivalent_polynomials.Enum",
26229 sizeof(struct __pyx_MemviewEnum_obj),
26230 0,
26231 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
26232 __pyx_type___pyx_MemviewEnum_slots,
26233};
26234#else
26235
26236static PyTypeObject __pyx_type___pyx_MemviewEnum = {
26237 PyVarObject_HEAD_INIT(0, 0)
26238 "equivalent_polynomials.""Enum", /*tp_name*/
26239 sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
26240 0, /*tp_itemsize*/
26241 __pyx_tp_dealloc_Enum, /*tp_dealloc*/
26242 0, /*tp_vectorcall_offset*/
26243 0, /*tp_getattr*/
26244 0, /*tp_setattr*/
26245 0, /*tp_as_async*/
26246 __pyx_MemviewEnum___repr__, /*tp_repr*/
26247 0, /*tp_as_number*/
26248 0, /*tp_as_sequence*/
26249 0, /*tp_as_mapping*/
26250 0, /*tp_hash*/
26251 0, /*tp_call*/
26252 0, /*tp_str*/
26253 0, /*tp_getattro*/
26254 0, /*tp_setattro*/
26255 0, /*tp_as_buffer*/
26256 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
26257 0, /*tp_doc*/
26258 __pyx_tp_traverse_Enum, /*tp_traverse*/
26259 __pyx_tp_clear_Enum, /*tp_clear*/
26260 0, /*tp_richcompare*/
26261 0, /*tp_weaklistoffset*/
26262 0, /*tp_iter*/
26263 0, /*tp_iternext*/
26264 __pyx_methods_Enum, /*tp_methods*/
26265 0, /*tp_members*/
26266 0, /*tp_getset*/
26267 0, /*tp_base*/
26268 0, /*tp_dict*/
26269 0, /*tp_descr_get*/
26270 0, /*tp_descr_set*/
26271 #if !CYTHON_USE_TYPE_SPECS
26272 0, /*tp_dictoffset*/
26273 #endif
26274 __pyx_tp_init_Enum, /*tp_init*/
26275 0, /*tp_alloc*/
26276 __pyx_tp_new_Enum, /*tp_new*/
26277 0, /*tp_free*/
26278 0, /*tp_is_gc*/
26279 0, /*tp_bases*/
26280 0, /*tp_mro*/
26281 0, /*tp_cache*/
26282 0, /*tp_subclasses*/
26283 0, /*tp_weaklist*/
26284 0, /*tp_del*/
26285 0, /*tp_version_tag*/
26286 #if CYTHON_USE_TP_FINALIZE
26287 0, /*tp_finalize*/
26288 #else
26289 NULL, /*tp_finalize*/
26290 #endif
26291 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26292 #if CYTHON_VECTORCALL_TPNEW
26293 __pyx_tp_vectorcall_Enum, /*tp_vectorcall*/
26294 #else
26295 NULL, /*tp_vectorcall*/
26296 #endif
26297 #endif
26298 #if __PYX_NEED_TP_PRINT_SLOT == 1
26299 0, /*tp_print*/
26300 #endif
26301 #if PY_VERSION_HEX >= 0x030C0000
26302 0, /*tp_watched*/
26303 #endif
26304 #if PY_VERSION_HEX >= 0x030d00A4
26305 0, /*tp_versions_used*/
26306 #endif
26307 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
26308 0, /*tp_pypy_flags*/
26309 #endif
26310};
26311#endif
26312static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
26313
26314static PyObject *__pyx_tp_new__initialisation_memoryview(PyObject *o,
26315#if CYTHON_VECTORCALL_TPNEW
26316 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
26317#else
26318 PyObject *a, PyObject *k
26319#endif
26320) {
26321 struct __pyx_memoryview_obj *p = ((struct __pyx_memoryview_obj *)o);
26322 p->__pyx_vtab = __pyx_vtabptr_memoryview;
26323 p->obj = Py_None; Py_INCREF(Py_None);
26324 p->_size = Py_None; Py_INCREF(Py_None);
26325 p->view.obj = NULL;
26326 {
26327 int cinit_result = __pyx_memoryview___cinit__(o,
26328#if CYTHON_VECTORCALL_TPNEW
26329 args, nargs, kwnames
26330#else
26331 a, k
26332#endif
26333);
26334 if (unlikely(cinit_result)) goto bad;
26335 }
26336 return o;
26337 bad:
26338 Py_DECREF(o); o = 0;
26339 return NULL;
26340}
26341
26342static PyObject *__pyx_tp_new_vectorcall_memoryview(PyTypeObject *t,
26343#if CYTHON_VECTORCALL_TPNEW
26344 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
26345#else
26346 PyObject *a, PyObject *k
26347#endif
26348) {
26349 PyObject *o;
26350 o = __Pyx_AllocateExtensionType(t, 0);
26351 if (unlikely(!o)) return 0;
26352 return __pyx_tp_new__initialisation_memoryview(o,
26353#if CYTHON_VECTORCALL_TPNEW
26354 args, nargs, kwnames
26355#else
26356 a, k
26357#endif
26358);
26359}
26360
26361#if CYTHON_VECTORCALL_TPNEW
26362static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
26363 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_memoryview, t, a, k);
26364}
26365#endif
26366
26367#if CYTHON_VECTORCALL_TPNEW
26368static PyObject *__pyx_tp_vectorcall_memoryview(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
26369 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_memoryview_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
26370 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
26371 }
26372 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
26373 PyObject *o = __pyx_tp_new_vectorcall_memoryview((PyTypeObject*)t, args, nargs, kwnames);
26374 return o;
26375}
26376#endif
26377
26378static void __pyx_tp_dealloc_memoryview(PyObject *o) {
26379 struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
26380 #if CYTHON_USE_TP_FINALIZE
26381 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
26382 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_memoryview) {
26383 if (PyObject_CallFinalizerFromDealloc(o)) return;
26384 }
26385 }
26386 #endif
26387 PyObject_GC_UnTrack(o);
26388 {
26389 PyObject *etype, *eval, *etb;
26390 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
26391 __Pyx_DeallocKeepAliveBegin(o);
26392 __pyx_memoryview___dealloc__(o);
26393 __Pyx_DeallocKeepAliveEnd(o);
26394 __Pyx_PyErr_RestoreException(etype, eval, etb);
26395 }
26396 Py_CLEAR(p->obj);
26397 Py_CLEAR(p->_size);
26398 PyTypeObject *tp = Py_TYPE(o);
26399 #if CYTHON_USE_TYPE_SLOTS
26400 (*tp->tp_free)(o);
26401 #else
26402 {
26403 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
26404 if (tp_free) tp_free(o);
26405 }
26406 #endif
26407 #if CYTHON_USE_TYPE_SPECS
26408 Py_DECREF(tp);
26409 #endif
26410}
26411
26412static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
26413 int e;
26414 struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
26415 {
26416 e = __Pyx_call_type_traverse(o, 1, v, a);
26417 if (e) return e;
26418 }
26419 if (p->obj) {
26420 e = (*v)(p->obj, a); if (e) return e;
26421 }
26422 if (p->_size) {
26423 e = (*v)(p->_size, a); if (e) return e;
26424 }
26425 if (p->view.obj) {
26426 e = (*v)(p->view.obj, a); if (e) return e;
26427 }
26428 return 0;
26429}
26430
26431static int __pyx_tp_clear_memoryview(PyObject *o) {
26432 PyObject* tmp;
26433 struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
26434 tmp = ((PyObject*)p->obj);
26435 p->obj = Py_None; Py_INCREF(Py_None);
26436 Py_XDECREF(tmp);
26437 tmp = ((PyObject*)p->_size);
26438 p->_size = Py_None; Py_INCREF(Py_None);
26439 Py_XDECREF(tmp);
26440 Py_CLEAR(p->view.obj);
26441 return 0;
26442}
26443
26444static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
26445 PyObject *r;
26446 PyObject *x = PyLong_FromSsize_t(i); if (unlikely(!x)) return NULL;
26447 #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
26448 binaryfunc f = Py_TYPE(o)->tp_as_mapping->mp_subscript;
26449 #else
26450 binaryfunc f = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript));
26451 #endif
26452 r = f(o, x);
26453 Py_DECREF(x);
26454 return r;
26455}
26456
26457static PyObject *__pyx_mp_subscript_memoryview(PyObject *o, PyObject *i) {
26458 return __pyx_memoryview___getitem__(o, i);
26459}
26460
26461static int __pyx_sq_ass_item_memoryview(PyObject *o, Py_ssize_t i, PyObject *v) {
26462 if (likely(v)) {
26463 PyObject *x = PyLong_FromSsize_t(i); if (unlikely(!x)) return -1;
26464 int r = __pyx_memoryview___setitem__(o, x, v);
26465 Py_DECREF(x);
26466 return r;
26467 } else {
26468 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError, "Subscript %.10s not supported by " __Pyx_FMT_TYPENAME, "deletion", o);
26469 return -1;
26470 }
26471}
26472
26473static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
26474 if (likely(v)) {
26475 return __pyx_memoryview___setitem__(o, i, v);
26476 } else {
26477 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError, "Subscript %.10s not supported by " __Pyx_FMT_TYPENAME, "deletion", o);
26478 return -1;
26479 }
26480}
26481
26482static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
26483 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
26484}
26485
26486static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
26487 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
26488}
26489
26490static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
26491 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
26492}
26493
26494static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
26495 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
26496}
26497
26498static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
26499 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
26500}
26501
26502static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
26503 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
26504}
26505
26506static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
26507 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
26508}
26509
26510static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
26511 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
26512}
26513
26514static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
26515 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
26516}
26517
26518static PyMethodDef __pyx_methods_memoryview[] = {
26519 {"is_c_contig", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_c_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26520 {"is_f_contig", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_f_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26521 {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26522 {"copy_fortran", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy_fortran, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26523 {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26524 {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26525 {0, 0, 0, 0}
26526};
26527
26528static struct PyGetSetDef __pyx_getsets_memoryview[] = {
26529 {"T", __pyx_getprop___pyx_memoryview_T, 0, 0, 0},
26530 {"base", __pyx_getprop___pyx_memoryview_base, 0, 0, 0},
26531 {"shape", __pyx_getprop___pyx_memoryview_shape, 0, 0, 0},
26532 {"strides", __pyx_getprop___pyx_memoryview_strides, 0, 0, 0},
26533 {"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, 0, 0},
26534 {"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, 0, 0},
26535 {"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, 0, 0},
26536 {"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, 0, 0},
26537 {"size", __pyx_getprop___pyx_memoryview_size, 0, 0, 0},
26538 {0, 0, 0, 0, 0}
26539};
26540#if CYTHON_USE_TYPE_SPECS
26541#if !CYTHON_COMPILING_IN_LIMITED_API
26542
26543static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
26544 __pyx_memoryview_getbuffer, /*bf_getbuffer*/
26545 0, /*bf_releasebuffer*/
26546};
26547#endif
26548static PyType_Slot __pyx_type___pyx_memoryview_slots[] = {
26549 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_memoryview},
26550 {Py_tp_repr, (void *)__pyx_memoryview___repr__},
26551 {Py_sq_length, (void *)__pyx_memoryview___len__},
26552 {Py_sq_item, (void *)__pyx_sq_item_memoryview},
26553 {Py_sq_ass_item, (void *)__pyx_sq_ass_item_memoryview},
26554 {Py_mp_length, (void *)__pyx_memoryview___len__},
26555 {Py_mp_subscript, (void *)__pyx_mp_subscript_memoryview},
26556 {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_memoryview},
26557 {Py_tp_str, (void *)__pyx_memoryview___str__},
26558 #if defined(Py_bf_getbuffer)
26559 {Py_bf_getbuffer, (void *)__pyx_memoryview_getbuffer},
26560 #endif
26561 {Py_tp_traverse, (void *)__pyx_tp_traverse_memoryview},
26562 {Py_tp_clear, (void *)__pyx_tp_clear_memoryview},
26563 {Py_tp_methods, (void *)__pyx_methods_memoryview},
26564 {Py_tp_getset, (void *)__pyx_getsets_memoryview},
26565 {Py_tp_new, (void *)__pyx_tp_new_memoryview},
26566 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26567 #if CYTHON_VECTORCALL_TPNEW
26568 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_memoryview},
26569 #endif
26570 #endif
26571 {0, 0},
26572};
26573static PyType_Spec __pyx_type___pyx_memoryview_spec = {
26574 "equivalent_polynomials.memoryview",
26575 sizeof(struct __pyx_memoryview_obj),
26576 0,
26577 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
26578 __pyx_type___pyx_memoryview_slots,
26579};
26580#else
26581
26582static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
26583 __pyx_memoryview___len__, /*sq_length*/
26584 0, /*sq_concat*/
26585 0, /*sq_repeat*/
26586 __pyx_sq_item_memoryview, /*sq_item*/
26587 0, /*sq_slice*/
26588 __pyx_sq_ass_item_memoryview, /*sq_ass_item*/
26589 0, /*sq_ass_slice*/
26590 0, /*sq_contains*/
26591 0, /*sq_inplace_concat*/
26592 0, /*sq_inplace_repeat*/
26593};
26594
26595static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
26596 __pyx_memoryview___len__, /*mp_length*/
26597 __pyx_mp_subscript_memoryview, /*mp_subscript*/
26598 __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
26599};
26600
26601static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
26602 __pyx_memoryview_getbuffer, /*bf_getbuffer*/
26603 0, /*bf_releasebuffer*/
26604};
26605
26606static PyTypeObject __pyx_type___pyx_memoryview = {
26607 PyVarObject_HEAD_INIT(0, 0)
26608 "equivalent_polynomials.""memoryview", /*tp_name*/
26609 sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
26610 0, /*tp_itemsize*/
26611 __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
26612 0, /*tp_vectorcall_offset*/
26613 0, /*tp_getattr*/
26614 0, /*tp_setattr*/
26615 0, /*tp_as_async*/
26616 __pyx_memoryview___repr__, /*tp_repr*/
26617 0, /*tp_as_number*/
26618 &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
26619 &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
26620 0, /*tp_hash*/
26621 0, /*tp_call*/
26622 __pyx_memoryview___str__, /*tp_str*/
26623 0, /*tp_getattro*/
26624 0, /*tp_setattro*/
26625 &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
26626 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
26627 0, /*tp_doc*/
26628 __pyx_tp_traverse_memoryview, /*tp_traverse*/
26629 __pyx_tp_clear_memoryview, /*tp_clear*/
26630 0, /*tp_richcompare*/
26631 0, /*tp_weaklistoffset*/
26632 0, /*tp_iter*/
26633 0, /*tp_iternext*/
26634 __pyx_methods_memoryview, /*tp_methods*/
26635 0, /*tp_members*/
26636 __pyx_getsets_memoryview, /*tp_getset*/
26637 0, /*tp_base*/
26638 0, /*tp_dict*/
26639 0, /*tp_descr_get*/
26640 0, /*tp_descr_set*/
26641 #if !CYTHON_USE_TYPE_SPECS
26642 0, /*tp_dictoffset*/
26643 #endif
26644 0, /*tp_init*/
26645 0, /*tp_alloc*/
26646 __pyx_tp_new_memoryview, /*tp_new*/
26647 0, /*tp_free*/
26648 0, /*tp_is_gc*/
26649 0, /*tp_bases*/
26650 0, /*tp_mro*/
26651 0, /*tp_cache*/
26652 0, /*tp_subclasses*/
26653 0, /*tp_weaklist*/
26654 0, /*tp_del*/
26655 0, /*tp_version_tag*/
26656 #if CYTHON_USE_TP_FINALIZE
26657 0, /*tp_finalize*/
26658 #else
26659 NULL, /*tp_finalize*/
26660 #endif
26661 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26662 #if CYTHON_VECTORCALL_TPNEW
26663 __pyx_tp_vectorcall_memoryview, /*tp_vectorcall*/
26664 #else
26665 NULL, /*tp_vectorcall*/
26666 #endif
26667 #endif
26668 #if __PYX_NEED_TP_PRINT_SLOT == 1
26669 0, /*tp_print*/
26670 #endif
26671 #if PY_VERSION_HEX >= 0x030C0000
26672 0, /*tp_watched*/
26673 #endif
26674 #if PY_VERSION_HEX >= 0x030d00A4
26675 0, /*tp_versions_used*/
26676 #endif
26677 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
26678 0, /*tp_pypy_flags*/
26679 #endif
26680};
26681#endif
26682static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
26683
26684static PyObject *__pyx_tp_new__initialisation__memoryviewslice(PyObject *o,
26685#if CYTHON_VECTORCALL_TPNEW
26686 CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
26687#else
26688 CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
26689#endif
26690) {
26691 struct __pyx_memoryviewslice_obj *p = ((struct __pyx_memoryviewslice_obj *)o);
26692 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
26693 __Pyx_default_placement_construct(&(p->from_slice));
26694 p->from_object = Py_None; Py_INCREF(Py_None);
26695 p->from_slice.memview = NULL;
26696 return o;
26697}
26698
26699static PyObject *__pyx_tp_new_vectorcall__memoryviewslice(PyTypeObject *t,
26700#if CYTHON_VECTORCALL_TPNEW
26701 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
26702#else
26703 PyObject *a, PyObject *k
26704#endif
26705) {
26706 PyObject *o;
26707 o = __pyx_tp_new_vectorcall_memoryview(t,
26708#if CYTHON_VECTORCALL_TPNEW
26709 args, nargs, kwnames
26710#else
26711 a, k
26712#endif
26713);
26714 if (unlikely(!o)) return 0;
26715 return __pyx_tp_new__initialisation__memoryviewslice(o,
26716#if CYTHON_VECTORCALL_TPNEW
26717 args, nargs, kwnames
26718#else
26719 a, k
26720#endif
26721);
26722}
26723
26724#if CYTHON_VECTORCALL_TPNEW
26725static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
26726 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall__memoryviewslice, t, a, k);
26727}
26728#endif
26729
26730#if CYTHON_VECTORCALL_TPNEW
26731static PyObject *__pyx_tp_vectorcall__memoryviewslice(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
26732 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_memoryviewslice_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
26733 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
26734 }
26735 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
26736 PyObject *o = __pyx_tp_new_vectorcall__memoryviewslice((PyTypeObject*)t, args, nargs, kwnames);
26737 return o;
26738}
26739#endif
26740
26741static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
26742 struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
26743 #if CYTHON_USE_TP_FINALIZE
26744 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
26745 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc__memoryviewslice) {
26746 if (PyObject_CallFinalizerFromDealloc(o)) return;
26747 }
26748 }
26749 #endif
26750 PyObject_GC_UnTrack(o);
26751 {
26752 PyObject *etype, *eval, *etb;
26753 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
26754 __Pyx_DeallocKeepAliveBegin(o);
26755 __pyx_memoryviewslice___dealloc__(o);
26756 __Pyx_DeallocKeepAliveEnd(o);
26757 __Pyx_PyErr_RestoreException(etype, eval, etb);
26758 }
26759 __Pyx_call_destructor(p->from_slice);
26760 Py_CLEAR(p->from_object);
26761 PyObject_GC_Track(o);
26762 __pyx_tp_dealloc_memoryview(o);
26763}
26764
26765static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
26766 int e;
26767 struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
26768 e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
26769 if (p->from_object) {
26770 e = (*v)(p->from_object, a); if (e) return e;
26771 }
26772 return 0;
26773}
26774
26775static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
26776 PyObject* tmp;
26777 struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
26778 __pyx_tp_clear_memoryview(o);
26779 tmp = ((PyObject*)p->from_object);
26780 p->from_object = Py_None; Py_INCREF(Py_None);
26781 Py_XDECREF(tmp);
26782 __PYX_XCLEAR_MEMVIEW(&p->from_slice, 1);
26783 return 0;
26784}
26785
26786static PyMethodDef __pyx_methods__memoryviewslice[] = {
26787 {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26788 {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26789 {0, 0, 0, 0}
26790};
26791#if CYTHON_USE_TYPE_SPECS
26792static PyType_Slot __pyx_type___pyx_memoryviewslice_slots[] = {
26793 {Py_tp_dealloc, (void *)__pyx_tp_dealloc__memoryviewslice},
26794 {Py_tp_doc, (void *)PyDoc_STR("Internal class for passing memoryview slices to Python")},
26795 {Py_tp_traverse, (void *)__pyx_tp_traverse__memoryviewslice},
26796 {Py_tp_clear, (void *)__pyx_tp_clear__memoryviewslice},
26797 {Py_tp_methods, (void *)__pyx_methods__memoryviewslice},
26798 {Py_tp_new, (void *)__pyx_tp_new__memoryviewslice},
26799 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26800 #if CYTHON_VECTORCALL_TPNEW
26801 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall__memoryviewslice},
26802 #endif
26803 #endif
26804 {0, 0},
26805};
26806static PyType_Spec __pyx_type___pyx_memoryviewslice_spec = {
26807 "equivalent_polynomials._memoryviewslice",
26808 sizeof(struct __pyx_memoryviewslice_obj),
26809 0,
26810 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE,
26811 __pyx_type___pyx_memoryviewslice_slots,
26812};
26813#else
26814
26815static PyTypeObject __pyx_type___pyx_memoryviewslice = {
26816 PyVarObject_HEAD_INIT(0, 0)
26817 "equivalent_polynomials.""_memoryviewslice", /*tp_name*/
26818 sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
26819 0, /*tp_itemsize*/
26820 __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
26821 0, /*tp_vectorcall_offset*/
26822 0, /*tp_getattr*/
26823 0, /*tp_setattr*/
26824 0, /*tp_as_async*/
26825 #if CYTHON_COMPILING_IN_PYPY || 0
26826 __pyx_memoryview___repr__, /*tp_repr*/
26827 #else
26828 0, /*tp_repr*/
26829 #endif
26830 0, /*tp_as_number*/
26831 0, /*tp_as_sequence*/
26832 0, /*tp_as_mapping*/
26833 0, /*tp_hash*/
26834 0, /*tp_call*/
26835 #if CYTHON_COMPILING_IN_PYPY || 0
26836 __pyx_memoryview___str__, /*tp_str*/
26837 #else
26838 0, /*tp_str*/
26839 #endif
26840 0, /*tp_getattro*/
26841 0, /*tp_setattro*/
26842 0, /*tp_as_buffer*/
26843 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
26844 PyDoc_STR("Internal class for passing memoryview slices to Python"), /*tp_doc*/
26845 __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
26846 __pyx_tp_clear__memoryviewslice, /*tp_clear*/
26847 0, /*tp_richcompare*/
26848 0, /*tp_weaklistoffset*/
26849 0, /*tp_iter*/
26850 0, /*tp_iternext*/
26851 __pyx_methods__memoryviewslice, /*tp_methods*/
26852 0, /*tp_members*/
26853 0, /*tp_getset*/
26854 0, /*tp_base*/
26855 0, /*tp_dict*/
26856 0, /*tp_descr_get*/
26857 0, /*tp_descr_set*/
26858 #if !CYTHON_USE_TYPE_SPECS
26859 0, /*tp_dictoffset*/
26860 #endif
26861 0, /*tp_init*/
26862 0, /*tp_alloc*/
26863 __pyx_tp_new__memoryviewslice, /*tp_new*/
26864 0, /*tp_free*/
26865 0, /*tp_is_gc*/
26866 0, /*tp_bases*/
26867 0, /*tp_mro*/
26868 0, /*tp_cache*/
26869 0, /*tp_subclasses*/
26870 0, /*tp_weaklist*/
26871 0, /*tp_del*/
26872 0, /*tp_version_tag*/
26873 #if CYTHON_USE_TP_FINALIZE
26874 0, /*tp_finalize*/
26875 #else
26876 NULL, /*tp_finalize*/
26877 #endif
26878 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26879 #if CYTHON_VECTORCALL_TPNEW
26880 __pyx_tp_vectorcall__memoryviewslice, /*tp_vectorcall*/
26881 #else
26882 NULL, /*tp_vectorcall*/
26883 #endif
26884 #endif
26885 #if __PYX_NEED_TP_PRINT_SLOT == 1
26886 0, /*tp_print*/
26887 #endif
26888 #if PY_VERSION_HEX >= 0x030C0000
26889 0, /*tp_watched*/
26890 #endif
26891 #if PY_VERSION_HEX >= 0x030d00A4
26892 0, /*tp_versions_used*/
26893 #endif
26894 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
26895 0, /*tp_pypy_flags*/
26896 #endif
26897};
26898#endif
26899
26900static PyMethodDef __pyx_methods[] = {
26901 {0, 0, 0, 0}
26902};
26903/* #### Code section: initfunc_declarations ### */
26904static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/
26905static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
26906static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/
26907static CYTHON_SMALL_CODE int __Pyx_InitAfterSharedUtility(void); /*proto*/
26908static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
26909static CYTHON_SMALL_CODE int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
26910static CYTHON_SMALL_CODE int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
26911static CYTHON_SMALL_CODE int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
26912static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_22equivalent_polynomials_Simplex(__pyx_mstatetype *__pyx_mstate); /*proto*/
26913static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_array_obj(__pyx_mstatetype *__pyx_mstate); /*proto*/
26914static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_MemviewEnum_obj(__pyx_mstatetype *__pyx_mstate); /*proto*/
26915static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_memoryview_obj(__pyx_mstatetype *__pyx_mstate); /*proto*/
26916static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_memoryviewslice_obj(__pyx_mstatetype *__pyx_mstate); /*proto*/
26917static CYTHON_SMALL_CODE int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
26918static CYTHON_SMALL_CODE int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
26919static CYTHON_SMALL_CODE int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
26920static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/
26921/* #### Code section: init_module ### */
26922
26923static int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate) {
26924 __Pyx_RefNannyDeclarations
26925 CYTHON_UNUSED_VAR(__pyx_mstate);
26926 __Pyx_RefNannySetupContext("__Pyx_modinit_Global_init_code", 0);
26927 /*--- Global init code ---*/
26928 __pyx_collections_abc_Sequence = Py_None; Py_INCREF(Py_None);
26929 generic = Py_None; Py_INCREF(Py_None);
26930 strided = Py_None; Py_INCREF(Py_None);
26931 indirect = Py_None; Py_INCREF(Py_None);
26932 contiguous = Py_None; Py_INCREF(Py_None);
26933 indirect_contiguous = Py_None; Py_INCREF(Py_None);
26934 __Pyx_RefNannyFinishContext();
26935 return 0;
26936}
26937
26938static int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate) {
26939 __Pyx_RefNannyDeclarations
26940 CYTHON_UNUSED_VAR(__pyx_mstate);
26941 __Pyx_RefNannySetupContext("__Pyx_modinit_Variable_export_code", 0);
26942 /*--- Variable export code ---*/
26943 __Pyx_RefNannyFinishContext();
26944 return 0;
26945}
26946
26947static int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate) {
26948 __Pyx_RefNannyDeclarations
26949 CYTHON_UNUSED_VAR(__pyx_mstate);
26950 __Pyx_RefNannySetupContext("__Pyx_modinit_Function_export_code", 0);
26951 /*--- Function export code ---*/
26952 __Pyx_RefNannyFinishContext();
26953 return 0;
26954}
26955
26956static int __Pyx_modinit_Exttype___pyx_obj_22equivalent_polynomials_Simplex(__pyx_mstatetype *__pyx_mstate) {
26957 __Pyx_RefNannyDeclarations
26958 int __pyx_lineno = 0;
26959 const char *__pyx_filename = NULL;
26960 int __pyx_clineno = 0;
26961 CYTHON_UNUSED_VAR(__pyx_mstate);
26962 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_22equivalent_polynomials_Simplex", 0);
26963 /*--- Exttype __pyx_obj_22equivalent_polynomials_Simplex ---*/
26964 #if CYTHON_USE_TYPE_SPECS
26965 __pyx_mstate->__pyx_ptype_22equivalent_polynomials_Simplex = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_22equivalent_polynomials_Simplex_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_22equivalent_polynomials_Simplex)) __PYX_ERR(0, 30, __pyx_L1_error)
26966 #else
26967 __pyx_mstate->__pyx_ptype_22equivalent_polynomials_Simplex = &__pyx_type_22equivalent_polynomials_Simplex;
26968 #endif
26969 #if !CYTHON_COMPILING_IN_LIMITED_API
26970 #endif
26971 #if !CYTHON_USE_TYPE_SPECS
26972 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_22equivalent_polynomials_Simplex) < (0)) __PYX_ERR(0, 30, __pyx_L1_error)
26973 #endif
26974 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26975 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_22equivalent_polynomials_Simplex);
26976 #endif
26977 #if !CYTHON_COMPILING_IN_LIMITED_API
26978 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_22equivalent_polynomials_Simplex->tp_dictoffset && __pyx_mstate->__pyx_ptype_22equivalent_polynomials_Simplex->tp_getattro == PyObject_GenericGetAttr)) {
26979 __pyx_mstate->__pyx_ptype_22equivalent_polynomials_Simplex->tp_getattro = PyObject_GenericGetAttr;
26980 }
26981 #endif
26982 if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Simplex, (PyObject *) __pyx_mstate->__pyx_ptype_22equivalent_polynomials_Simplex) < (0)) __PYX_ERR(0, 30, __pyx_L1_error)
26983 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_22equivalent_polynomials_Simplex) < (0)) __PYX_ERR(0, 30, __pyx_L1_error)
26984 __Pyx_RefNannyFinishContext();
26985 return 0;
26986 __pyx_L1_error:;
26987 __Pyx_RefNannyFinishContext();
26988 return -1;
26989}
26990
26991static int __Pyx_modinit_Exttype___pyx_array_obj(__pyx_mstatetype *__pyx_mstate) {
26992 __Pyx_RefNannyDeclarations
26993 int __pyx_lineno = 0;
26994 const char *__pyx_filename = NULL;
26995 int __pyx_clineno = 0;
26996 CYTHON_UNUSED_VAR(__pyx_mstate);
26997 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_array_obj", 0);
26998 /*--- Exttype __pyx_array_obj ---*/
26999 __pyx_vtabptr_array = &__pyx_vtable_array;
27000 __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
27001 #if CYTHON_USE_TYPE_SPECS
27002 __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)
27003 #if !CYTHON_COMPILING_IN_LIMITED_API
27004 __pyx_mstate->__pyx_array_type->tp_as_buffer = &__pyx_tp_as_buffer_array;
27005 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) {
27006 __pyx_mstate->__pyx_array_type->tp_as_buffer->bf_releasebuffer = __pyx_mstate->__pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer;
27007 }
27008 #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
27009 /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
27010 #elif defined(_MSC_VER)
27011 #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
27012 #else
27013 #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
27014 #endif
27015 #else
27016 __pyx_mstate->__pyx_array_type = &__pyx_type___pyx_array;
27017 #endif
27018 if (__Pyx_ApplySequenceOrMappingFlag(__pyx_mstate->__pyx_array_type, 1) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
27019 #if !CYTHON_COMPILING_IN_LIMITED_API
27020 #endif
27021 #if !CYTHON_USE_TYPE_SPECS
27022 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_array_type) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
27023 #endif
27024 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27025 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_array_type);
27026 #endif
27027 if (__Pyx_SetVtable(__pyx_mstate->__pyx_array_type, __pyx_vtabptr_array) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
27028 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_array_type) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
27029 __Pyx_RefNannyFinishContext();
27030 return 0;
27031 __pyx_L1_error:;
27032 __Pyx_RefNannyFinishContext();
27033 return -1;
27034}
27035
27036static int __Pyx_modinit_Exttype___pyx_MemviewEnum_obj(__pyx_mstatetype *__pyx_mstate) {
27037 __Pyx_RefNannyDeclarations
27038 int __pyx_lineno = 0;
27039 const char *__pyx_filename = NULL;
27040 int __pyx_clineno = 0;
27041 CYTHON_UNUSED_VAR(__pyx_mstate);
27042 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_MemviewEnum_obj", 0);
27043 /*--- Exttype __pyx_MemviewEnum_obj ---*/
27044 #if CYTHON_USE_TYPE_SPECS
27045 __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)
27046 #else
27047 __pyx_mstate->__pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
27048 #endif
27049 #if !CYTHON_COMPILING_IN_LIMITED_API
27050 #endif
27051 #if !CYTHON_USE_TYPE_SPECS
27052 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_MemviewEnum_type) < (0)) __PYX_ERR(1, 318, __pyx_L1_error)
27053 #endif
27054 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27055 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_MemviewEnum_type);
27056 #endif
27057 #if !CYTHON_COMPILING_IN_LIMITED_API
27058 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)) {
27059 __pyx_mstate->__pyx_MemviewEnum_type->tp_getattro = PyObject_GenericGetAttr;
27060 }
27061 #endif
27062 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_MemviewEnum_type) < (0)) __PYX_ERR(1, 318, __pyx_L1_error)
27063 __Pyx_RefNannyFinishContext();
27064 return 0;
27065 __pyx_L1_error:;
27066 __Pyx_RefNannyFinishContext();
27067 return -1;
27068}
27069
27070static int __Pyx_modinit_Exttype___pyx_memoryview_obj(__pyx_mstatetype *__pyx_mstate) {
27071 __Pyx_RefNannyDeclarations
27072 int __pyx_lineno = 0;
27073 const char *__pyx_filename = NULL;
27074 int __pyx_clineno = 0;
27075 CYTHON_UNUSED_VAR(__pyx_mstate);
27076 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_memoryview_obj", 0);
27077 /*--- Exttype __pyx_memoryview_obj ---*/
27078 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
27079 __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
27080 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
27081 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
27082 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
27083 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
27084 __pyx_vtable_memoryview.setitem_indexed1 = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed1;
27085 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
27086 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
27087 __pyx_vtable_memoryview._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryview__get_base;
27088 #if CYTHON_USE_TYPE_SPECS
27089 __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)
27090 #if !CYTHON_COMPILING_IN_LIMITED_API
27091 __pyx_mstate->__pyx_memoryview_type->tp_as_buffer = &__pyx_tp_as_buffer_memoryview;
27092 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) {
27093 __pyx_mstate->__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer = __pyx_mstate->__pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer;
27094 }
27095 #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
27096 /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
27097 #elif defined(_MSC_VER)
27098 #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
27099 #else
27100 #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
27101 #endif
27102 #else
27103 __pyx_mstate->__pyx_memoryview_type = &__pyx_type___pyx_memoryview;
27104 #endif
27105 #if !CYTHON_COMPILING_IN_LIMITED_API
27106 #endif
27107 #if !CYTHON_USE_TYPE_SPECS
27108 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_memoryview_type) < (0)) __PYX_ERR(1, 353, __pyx_L1_error)
27109 #endif
27110 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27111 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_memoryview_type);
27112 #endif
27113 #if !CYTHON_COMPILING_IN_LIMITED_API
27114 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)) {
27115 __pyx_mstate->__pyx_memoryview_type->tp_getattro = PyObject_GenericGetAttr;
27116 }
27117 #endif
27118 if (__Pyx_SetVtable(__pyx_mstate->__pyx_memoryview_type, __pyx_vtabptr_memoryview) < (0)) __PYX_ERR(1, 353, __pyx_L1_error)
27119 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_memoryview_type) < (0)) __PYX_ERR(1, 353, __pyx_L1_error)
27120 __Pyx_RefNannyFinishContext();
27121 return 0;
27122 __pyx_L1_error:;
27123 __Pyx_RefNannyFinishContext();
27124 return -1;
27125}
27126
27127static int __Pyx_modinit_Exttype___pyx_memoryviewslice_obj(__pyx_mstatetype *__pyx_mstate) {
27128 __Pyx_RefNannyDeclarations
27129 PyObject *__pyx_t_1 = NULL;
27130 int __pyx_lineno = 0;
27131 const char *__pyx_filename = NULL;
27132 int __pyx_clineno = 0;
27133 CYTHON_UNUSED_VAR(__pyx_mstate);
27134 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_memoryviewslice_obj", 0);
27135 /*--- Exttype __pyx_memoryviewslice_obj ---*/
27136 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
27137 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
27138 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
27139 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
27140 __pyx_vtable__memoryviewslice.__pyx_base._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryviewslice__get_base;
27141 #if CYTHON_USE_TYPE_SPECS
27142 __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)
27143 __Pyx_GOTREF(__pyx_t_1);
27144 __pyx_mstate->__pyx_memoryviewslice_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryviewslice_spec, __pyx_t_1);
27145 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27146 if (unlikely(!__pyx_mstate->__pyx_memoryviewslice_type)) __PYX_ERR(1, 947, __pyx_L1_error)
27147 #else
27148 __pyx_mstate->__pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
27149 #endif
27150 if (__Pyx_ApplySequenceOrMappingFlag(__pyx_mstate->__pyx_memoryviewslice_type, 1) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
27151 #if !CYTHON_COMPILING_IN_LIMITED_API
27152 __pyx_mstate_global->__pyx_memoryviewslice_type->tp_base = __pyx_mstate_global->__pyx_memoryview_type;
27153 #endif
27154 #if !CYTHON_USE_TYPE_SPECS
27155 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_memoryviewslice_type) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
27156 #endif
27157 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27158 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_memoryviewslice_type);
27159 #endif
27160 #if !CYTHON_COMPILING_IN_LIMITED_API
27161 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)) {
27162 __pyx_mstate->__pyx_memoryviewslice_type->tp_getattro = PyObject_GenericGetAttr;
27163 }
27164 #endif
27165 if (__Pyx_SetVtable(__pyx_mstate->__pyx_memoryviewslice_type, __pyx_vtabptr__memoryviewslice) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
27166 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_memoryviewslice_type) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
27167 __Pyx_RefNannyFinishContext();
27168 return 0;
27169 __pyx_L1_error:;
27170 __Pyx_XDECREF(__pyx_t_1);
27171 __Pyx_RefNannyFinishContext();
27172 return -1;
27173}
27174
27175static int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate) {
27176 __Pyx_RefNannyDeclarations
27177 PyObject *__pyx_t_1 = NULL;
27178 int __pyx_lineno = 0;
27179 const char *__pyx_filename = NULL;
27180 int __pyx_clineno = 0;
27181 CYTHON_UNUSED_VAR(__pyx_mstate);
27182 __Pyx_RefNannySetupContext("__Pyx_modinit_Type_import_code", 0);
27183 /*--- Type import code ---*/
27184 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
27185 __Pyx_GOTREF(__pyx_t_1);
27186 __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_3_0(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
27187 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27188 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyTypeObject),
27189 #elif CYTHON_COMPILING_IN_LIMITED_API
27190 0, 0,
27191 #else
27192 sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyHeapTypeObject),
27193 #endif
27194 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
27195 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27196 __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 229, __pyx_L1_error)
27197 __Pyx_GOTREF(__pyx_t_1);
27198 __pyx_mstate->__pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "dtype",
27199 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27200 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
27201 #elif CYTHON_COMPILING_IN_LIMITED_API
27202 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
27203 #else
27204 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
27205 #endif
27206 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 229, __pyx_L1_error)
27207 __pyx_mstate->__pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "flatiter",
27208 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27209 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
27210 #elif CYTHON_COMPILING_IN_LIMITED_API
27211 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
27212 #else
27213 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
27214 #endif
27215 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 286, __pyx_L1_error)
27216 __pyx_mstate->__pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "broadcast",
27217 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27218 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
27219 #elif CYTHON_COMPILING_IN_LIMITED_API
27220 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
27221 #else
27222 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
27223 #endif
27224 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 290, __pyx_L1_error)
27225 __pyx_mstate->__pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "ndarray",
27226 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27227 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
27228 #elif CYTHON_COMPILING_IN_LIMITED_API
27229 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
27230 #else
27231 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
27232 #endif
27233 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 329, __pyx_L1_error)
27234 __pyx_mstate->__pyx_ptype_5numpy_generic = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "generic",
27235 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27236 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27237 #elif CYTHON_COMPILING_IN_LIMITED_API
27238 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27239 #else
27240 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27241 #endif
27242 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_generic) __PYX_ERR(2, 847, __pyx_L1_error)
27243 __pyx_mstate->__pyx_ptype_5numpy_number = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "number",
27244 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27245 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27246 #elif CYTHON_COMPILING_IN_LIMITED_API
27247 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27248 #else
27249 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27250 #endif
27251 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_number) __PYX_ERR(2, 849, __pyx_L1_error)
27252 __pyx_mstate->__pyx_ptype_5numpy_integer = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "integer",
27253 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27254 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27255 #elif CYTHON_COMPILING_IN_LIMITED_API
27256 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27257 #else
27258 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27259 #endif
27260 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_integer) __PYX_ERR(2, 851, __pyx_L1_error)
27261 __pyx_mstate->__pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "signedinteger",
27262 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27263 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27264 #elif CYTHON_COMPILING_IN_LIMITED_API
27265 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27266 #else
27267 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27268 #endif
27269 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 853, __pyx_L1_error)
27270 __pyx_mstate->__pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "unsignedinteger",
27271 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27272 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27273 #elif CYTHON_COMPILING_IN_LIMITED_API
27274 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27275 #else
27276 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27277 #endif
27278 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 855, __pyx_L1_error)
27279 __pyx_mstate->__pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "inexact",
27280 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27281 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27282 #elif CYTHON_COMPILING_IN_LIMITED_API
27283 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27284 #else
27285 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27286 #endif
27287 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 857, __pyx_L1_error)
27288 __pyx_mstate->__pyx_ptype_5numpy_floating = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "floating",
27289 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27290 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27291 #elif CYTHON_COMPILING_IN_LIMITED_API
27292 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27293 #else
27294 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27295 #endif
27296 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_floating) __PYX_ERR(2, 859, __pyx_L1_error)
27297 __pyx_mstate->__pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "complexfloating",
27298 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27299 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27300 #elif CYTHON_COMPILING_IN_LIMITED_API
27301 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27302 #else
27303 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27304 #endif
27305 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 861, __pyx_L1_error)
27306 __pyx_mstate->__pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "flexible",
27307 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27308 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27309 #elif CYTHON_COMPILING_IN_LIMITED_API
27310 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27311 #else
27312 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27313 #endif
27314 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 863, __pyx_L1_error)
27315 __pyx_mstate->__pyx_ptype_5numpy_character = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "character",
27316 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27317 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27318 #elif CYTHON_COMPILING_IN_LIMITED_API
27319 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27320 #else
27321 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27322 #endif
27323 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_character) __PYX_ERR(2, 865, __pyx_L1_error)
27324 __pyx_mstate->__pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "ufunc",
27325 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27326 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
27327 #elif CYTHON_COMPILING_IN_LIMITED_API
27328 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
27329 #else
27330 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
27331 #endif
27332 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 946, __pyx_L1_error)
27333 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27334 __Pyx_RefNannyFinishContext();
27335 return 0;
27336 __pyx_L1_error:;
27337 __Pyx_XDECREF(__pyx_t_1);
27338 __Pyx_RefNannyFinishContext();
27339 return -1;
27340}
27341
27342static int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate) {
27343 __Pyx_RefNannyDeclarations
27344 CYTHON_UNUSED_VAR(__pyx_mstate);
27345 __Pyx_RefNannySetupContext("__Pyx_modinit_Variable_import_code", 0);
27346 /*--- Variable import code ---*/
27347 __Pyx_RefNannyFinishContext();
27348 return 0;
27349}
27350
27351static int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate) {
27352 __Pyx_RefNannyDeclarations
27353 CYTHON_UNUSED_VAR(__pyx_mstate);
27354 __Pyx_RefNannySetupContext("__Pyx_modinit_Function_import_code", 0);
27355 /*--- Function import code ---*/
27356 __Pyx_RefNannyFinishContext();
27357 return 0;
27358}
27359
27360#if CYTHON_PEP489_MULTI_PHASE_INIT
27361static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
27362static int __pyx_pymod_exec_equivalent_polynomials(PyObject* module); /*proto*/
27363static PyModuleDef_Slot __pyx_moduledef_slots[] = {
27364 {Py_mod_create, (void*)__pyx_pymod_create},
27365 {Py_mod_exec, (void*)__pyx_pymod_exec_equivalent_polynomials},
27366 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
27367 {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},
27368 #endif
27369 #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
27370 {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
27371 #endif
27372 {0, NULL}
27373};
27374#endif
27375
27376#ifdef __cplusplus
27377namespace {
27378 struct PyModuleDef __pyx_moduledef =
27379 #else
27380 static struct PyModuleDef __pyx_moduledef =
27381 #endif
27382 {
27383 PyModuleDef_HEAD_INIT,
27384 "equivalent_polynomials",
27385 0, /* m_doc */
27386 #if CYTHON_USE_MODULE_STATE
27387 sizeof(__pyx_mstatetype), /* m_size */
27388 #else
27389 (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */
27390 #endif
27391 __pyx_methods /* m_methods */,
27392 #if CYTHON_PEP489_MULTI_PHASE_INIT
27393 __pyx_moduledef_slots, /* m_slots */
27394 #else
27395 NULL, /* m_reload */
27396 #endif
27397 #if CYTHON_USE_MODULE_STATE
27398 __pyx_m_traverse, /* m_traverse */
27399 __pyx_m_clear, /* m_clear */
27400 NULL /* m_free */
27401 #else
27402 NULL, /* m_traverse */
27403 NULL, /* m_clear */
27404 NULL /* m_free */
27405 #endif
27406 };
27407 #ifdef __cplusplus
27408} /* anonymous namespace */
27409#endif
27410
27411/* PyModInitFuncType */
27412#ifndef CYTHON_NO_PYINIT_EXPORT
27413 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
27414#else
27415 #ifdef __cplusplus
27416 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
27417 #else
27418 #define __Pyx_PyMODINIT_FUNC PyObject *
27419 #endif
27420#endif
27421
27422__Pyx_PyMODINIT_FUNC PyInit_equivalent_polynomials(void) CYTHON_SMALL_CODE; /*proto*/
27423__Pyx_PyMODINIT_FUNC PyInit_equivalent_polynomials(void)
27424#if CYTHON_PEP489_MULTI_PHASE_INIT
27425{
27426 return PyModuleDef_Init(&__pyx_moduledef);
27427}
27428/* ModuleCreationPEP489 */
27429#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
27430 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
27431static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) {
27432 {
27433 PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think
27434 if (!module) {
27435 if (!PyErr_ExceptionMatches(PyExc_Exception)) {
27436 goto bad; // BaseException
27437 }
27438 PyErr_Clear(); // just try the 3.8-3.12 version
27439 module = PyImport_ImportModule("_xxsubinterpreters");
27440 if (!module) goto bad;
27441 }
27442 PyObject *current = PyObject_CallMethod(module, "get_current", NULL);
27443 Py_DECREF(module);
27444 if (!current) goto bad;
27445 if (PyTuple_Check(current)) {
27446 PyObject *new_current = PySequence_GetItem(current, 0);
27447 Py_DECREF(current);
27448 current = new_current;
27449 if (!new_current) goto bad;
27450 }
27451 long long as_c_int = PyLong_AsLongLong(current);
27452 Py_DECREF(current);
27453 return as_c_int;
27454 }
27455 bad:
27456 PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
27457 return -1;
27458}
27459#endif
27460#if !CYTHON_USE_MODULE_STATE
27461static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
27462 static PY_INT64_T main_interpreter_id = -1;
27463#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
27464 PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
27465#elif CYTHON_COMPILING_IN_GRAAL
27466 PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
27467#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
27468 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
27469 PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
27470#elif CYTHON_COMPILING_IN_LIMITED_API
27471 PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
27472#else
27473 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
27474#endif
27475 if (unlikely(current_id == -1)) {
27476 return -1;
27477 }
27478 if (main_interpreter_id == -1) {
27479 main_interpreter_id = current_id;
27480 return 0;
27481 } else if (unlikely(main_interpreter_id != current_id)) {
27482 PyErr_SetString(
27483 PyExc_ImportError,
27484 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
27485 return -1;
27486 }
27487 return 0;
27488}
27489#endif
27490static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
27491{
27492 PyObject *value = PyObject_GetAttrString(spec, from_name);
27493 int result = 0;
27494 if (likely(value)) {
27495 if (allow_none || value != Py_None) {
27496 result = PyDict_SetItemString(moddict, to_name, value);
27497 }
27498 Py_DECREF(value);
27499 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
27500 PyErr_Clear();
27501 } else {
27502 result = -1;
27503 }
27504 return result;
27505}
27506static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
27507 PyObject *module = NULL, *moddict, *modname;
27508 CYTHON_UNUSED_VAR(def);
27509 #if !CYTHON_USE_MODULE_STATE
27510 if (__Pyx_check_single_interpreter())
27511 return NULL;
27512 #endif
27513 if (__pyx_m)
27514 return __Pyx_NewRef(__pyx_m);
27515 modname = PyObject_GetAttrString(spec, "name");
27516 if (unlikely(!modname)) goto bad;
27517 module = PyModule_NewObject(modname);
27518 Py_DECREF(modname);
27519 if (unlikely(!module)) goto bad;
27520 moddict = PyModule_GetDict(module);
27521 if (unlikely(!moddict)) goto bad;
27522 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
27523 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
27524 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
27525 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
27526 return module;
27527bad:
27528 Py_XDECREF(module);
27529 return NULL;
27530}
27531
27532
27533static CYTHON_SMALL_CODE int __pyx_pymod_exec_equivalent_polynomials(PyObject *__pyx_pyinit_module)
27534#endif
27535{
27536 int stringtab_initialized = 0;
27537 #if CYTHON_USE_MODULE_STATE
27538 int pystate_addmodule_run = 0;
27539 #endif
27540 __pyx_mstatetype *__pyx_mstate = NULL;
27541 PyObject *__pyx_t_1 = NULL;
27542 PyObject *__pyx_t_2 = NULL;
27543 PyObject *__pyx_t_3 = NULL;
27544 PyObject *__pyx_t_4 = NULL;
27545 PyObject *__pyx_t_5 = NULL;
27546 size_t __pyx_t_6;
27547 static PyThread_type_lock __pyx_t_7[8];
27548 int __pyx_t_8;
27549 int __pyx_lineno = 0;
27550 const char *__pyx_filename = NULL;
27551 int __pyx_clineno = 0;
27552 __Pyx_RefNannyDeclarations
27553 #if CYTHON_PEP489_MULTI_PHASE_INIT
27554 if (__pyx_m) {
27555 if (__pyx_m == __pyx_pyinit_module) return 0;
27556 PyErr_SetString(PyExc_RuntimeError, "Module 'equivalent_polynomials' has already been imported. Re-initialisation is not supported.");
27557 return -1;
27558 }
27559 #else
27560 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
27561 #endif
27562 /*--- Module creation code ---*/
27563 #if CYTHON_PEP489_MULTI_PHASE_INIT
27564 __pyx_t_1 = __pyx_pyinit_module;
27565 Py_INCREF(__pyx_t_1);
27566 #else
27567 __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
27568 #endif
27569 #if CYTHON_USE_MODULE_STATE
27570 {
27571 int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
27572 __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "equivalent_polynomials" pseudovariable */
27573 if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27574 pystate_addmodule_run = 1;
27575 }
27576 #else
27577 __pyx_m = __pyx_t_1;
27578 #endif
27579 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
27580 PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
27581 #endif
27582 __pyx_mstate = __pyx_mstate_global;
27583 CYTHON_UNUSED_VAR(__pyx_t_1);
27584 __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
27585 Py_INCREF(__pyx_mstate->__pyx_d);
27586 __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
27587 __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
27588 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27589 /* ImportRefnannyAPI */
27590 #if CYTHON_REFNANNY
27591 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
27592 if (!__Pyx_RefNanny) {
27593 if (PyErr_ExceptionMatches(PyExc_Exception)) {
27594 PyErr_Clear();
27595 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
27596 }
27597 if (!__Pyx_RefNanny)
27598 Py_FatalError("failed to import 'refnanny' module");
27599 }
27600 #endif
27601
27602__Pyx_RefNannySetupContext("PyInit_equivalent_polynomials", 0);
27603 __Pyx_init_runtime_version();
27604 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)
27605 __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
27606 __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
27607 __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
27608 /*--- Library function declarations ---*/
27609 /*--- Initialize various global constants etc. ---*/
27610 if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
27611 stringtab_initialized = 1;
27612 if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
27613 if (__pyx_module_is_main_equivalent_polynomials) {
27614 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)
27615 }
27616 {
27617 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
27618 if (!PyDict_GetItemString(modules, "equivalent_polynomials")) {
27619 if (unlikely((PyDict_SetItemString(modules, "equivalent_polynomials", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27620 }
27621 }
27622 /*--- Builtin init code ---*/
27623 if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
27624 /*--- Constants init code ---*/
27625 if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
27626 if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
27627 /*--- Global type/function init code ---*/
27628 (void)__Pyx_modinit_Global_init_code(__pyx_mstate);
27629 (void)__Pyx_modinit_Variable_export_code(__pyx_mstate);
27630 (void)__Pyx_modinit_Function_export_code(__pyx_mstate);
27631 /*--- Type init code ---*/
27632 if (unlikely((__Pyx_modinit_Exttype___pyx_obj_22equivalent_polynomials_Simplex(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27633 if (unlikely((__Pyx_modinit_Exttype___pyx_array_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27634 if (unlikely((__Pyx_modinit_Exttype___pyx_MemviewEnum_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27635 if (unlikely((__Pyx_modinit_Exttype___pyx_memoryview_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27636 if (unlikely((__Pyx_modinit_Exttype___pyx_memoryviewslice_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27637 if (unlikely((__Pyx_modinit_Type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27638 (void)__Pyx_modinit_Variable_import_code(__pyx_mstate);
27639 (void)__Pyx_modinit_Function_import_code(__pyx_mstate);
27640 if (__Pyx_InitAfterSharedUtility() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
27641 /*--- Execution code ---*/
27642
27643 /* "View.MemoryView":118
27644 *
27645 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27646 * try: # <<<<<<<<<<<<<<
27647 * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27648 * except:
27649*/
27650 {
27651 __Pyx_PyThreadState_declare
27652 __Pyx_PyThreadState_assign
27653 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
27654 __Pyx_XGOTREF(__pyx_t_1);
27655 __Pyx_XGOTREF(__pyx_t_2);
27656 __Pyx_XGOTREF(__pyx_t_3);
27657 /*try:*/ {
27658
27659 /* "View.MemoryView":119
27660 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27661 * try:
27662 * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence # <<<<<<<<<<<<<<
27663 * except:
27664 *
27665*/
27666 __pyx_t_5 = NULL;
27667 __pyx_t_6 = 1;
27668 {
27669 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_collections_abc};
27670 __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));
27671 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27672 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 119, __pyx_L2_error)
27673 __Pyx_GOTREF(__pyx_t_4);
27674 }
27675 __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)
27676 __Pyx_GOTREF(__pyx_t_5);
27677 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27678 __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)
27679 __Pyx_GOTREF(__pyx_t_4);
27680 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27681 __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
27682 __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_4);
27683 __Pyx_GIVEREF(__pyx_t_4);
27684 __pyx_t_4 = 0;
27685
27686 /* "View.MemoryView":118
27687 *
27688 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27689 * try: # <<<<<<<<<<<<<<
27690 * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27691 * except:
27692*/
27693 }
27694 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27695 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27696 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27697 goto __pyx_L7_try_end;
27698 __pyx_L2_error:;
27699 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27700 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27701
27702 /* "View.MemoryView":120
27703 * try:
27704 * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27705 * except: # <<<<<<<<<<<<<<
27706 *
27707 * __pyx_collections_abc_Sequence = None
27708*/
27709 /*except:*/ {
27710 __Pyx_ErrRestore(0,0,0);
27711
27712 /* "View.MemoryView":122
27713 * except:
27714 *
27715 * __pyx_collections_abc_Sequence = None # <<<<<<<<<<<<<<
27716 *
27717 *
27718*/
27719 __Pyx_INCREF(Py_None);
27720 __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
27721 __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, Py_None);
27722 __Pyx_GIVEREF(Py_None);
27723 goto __pyx_L3_exception_handled;
27724 }
27725 __pyx_L3_exception_handled:;
27726 __Pyx_XGIVEREF(__pyx_t_1);
27727 __Pyx_XGIVEREF(__pyx_t_2);
27728 __Pyx_XGIVEREF(__pyx_t_3);
27729 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
27730 __pyx_L7_try_end:;
27731 }
27732
27733 /* "View.MemoryView":258
27734 *
27735 *
27736 * try: # <<<<<<<<<<<<<<
27737 * count = __pyx_collections_abc_Sequence.count
27738 * index = __pyx_collections_abc_Sequence.index
27739*/
27740 {
27741 __Pyx_PyThreadState_declare
27742 __Pyx_PyThreadState_assign
27743 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
27744 __Pyx_XGOTREF(__pyx_t_3);
27745 __Pyx_XGOTREF(__pyx_t_2);
27746 __Pyx_XGOTREF(__pyx_t_1);
27747 /*try:*/ {
27748
27749 /* "View.MemoryView":259
27750 *
27751 * try:
27752 * count = __pyx_collections_abc_Sequence.count # <<<<<<<<<<<<<<
27753 * index = __pyx_collections_abc_Sequence.index
27754 * except:
27755*/
27756 __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)
27757 __Pyx_GOTREF(__pyx_t_4);
27758 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)
27759 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27760
27761 /* "View.MemoryView":260
27762 * try:
27763 * count = __pyx_collections_abc_Sequence.count
27764 * index = __pyx_collections_abc_Sequence.index # <<<<<<<<<<<<<<
27765 * except:
27766 * pass
27767*/
27768 __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)
27769 __Pyx_GOTREF(__pyx_t_4);
27770 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)
27771 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27772
27773 /* "View.MemoryView":258
27774 *
27775 *
27776 * try: # <<<<<<<<<<<<<<
27777 * count = __pyx_collections_abc_Sequence.count
27778 * index = __pyx_collections_abc_Sequence.index
27779*/
27780 }
27781 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27782 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27783 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27784 goto __pyx_L15_try_end;
27785 __pyx_L10_error:;
27786 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27787 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27788
27789 /* "View.MemoryView":261
27790 * count = __pyx_collections_abc_Sequence.count
27791 * index = __pyx_collections_abc_Sequence.index
27792 * except: # <<<<<<<<<<<<<<
27793 * pass
27794 *
27795*/
27796 /*except:*/ {
27797 __Pyx_ErrRestore(0,0,0);
27798 goto __pyx_L11_exception_handled;
27799 }
27800 __pyx_L11_exception_handled:;
27801 __Pyx_XGIVEREF(__pyx_t_3);
27802 __Pyx_XGIVEREF(__pyx_t_2);
27803 __Pyx_XGIVEREF(__pyx_t_1);
27804 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
27805 __pyx_L15_try_end:;
27806 }
27807
27808 /* "View.MemoryView":326
27809 * return self.name
27810 *
27811 * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
27812 * cdef strided = Enum("<strided and direct>") # default
27813 * cdef indirect = Enum("<strided and indirect>")
27814*/
27815 __pyx_t_5 = NULL;
27816 __pyx_t_6 = 1;
27817 {
27818 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_direct_or_indirect};
27819 __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));
27820 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27821 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 326, __pyx_L1_error)
27822 __Pyx_GOTREF((PyObject *)__pyx_t_4);
27823 }
27824 __Pyx_XGOTREF(generic);
27825 __Pyx_DECREF_SET(generic, ((PyObject *)__pyx_t_4));
27826 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
27827 __pyx_t_4 = 0;
27828
27829 /* "View.MemoryView":327
27830 *
27831 * cdef generic = Enum("<strided and direct or indirect>")
27832 * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
27833 * cdef indirect = Enum("<strided and indirect>")
27834 *
27835*/
27836 __pyx_t_5 = NULL;
27837 __pyx_t_6 = 1;
27838 {
27839 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_direct};
27840 __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));
27841 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27842 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 327, __pyx_L1_error)
27843 __Pyx_GOTREF((PyObject *)__pyx_t_4);
27844 }
27845 __Pyx_XGOTREF(strided);
27846 __Pyx_DECREF_SET(strided, ((PyObject *)__pyx_t_4));
27847 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
27848 __pyx_t_4 = 0;
27849
27850 /* "View.MemoryView":328
27851 * cdef generic = Enum("<strided and direct or indirect>")
27852 * cdef strided = Enum("<strided and direct>") # default
27853 * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
27854 *
27855 *
27856*/
27857 __pyx_t_5 = NULL;
27858 __pyx_t_6 = 1;
27859 {
27860 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_indirect};
27861 __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));
27862 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27863 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 328, __pyx_L1_error)
27864 __Pyx_GOTREF((PyObject *)__pyx_t_4);
27865 }
27866 __Pyx_XGOTREF(indirect);
27867 __Pyx_DECREF_SET(indirect, ((PyObject *)__pyx_t_4));
27868 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
27869 __pyx_t_4 = 0;
27870
27871 /* "View.MemoryView":331
27872 *
27873 *
27874 * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
27875 * cdef indirect_contiguous = Enum("<contiguous and indirect>")
27876 *
27877*/
27878 __pyx_t_5 = NULL;
27879 __pyx_t_6 = 1;
27880 {
27881 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_contiguous_and_direct};
27882 __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));
27883 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27884 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 331, __pyx_L1_error)
27885 __Pyx_GOTREF((PyObject *)__pyx_t_4);
27886 }
27887 __Pyx_XGOTREF(contiguous);
27888 __Pyx_DECREF_SET(contiguous, ((PyObject *)__pyx_t_4));
27889 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
27890 __pyx_t_4 = 0;
27891
27892 /* "View.MemoryView":332
27893 *
27894 * cdef contiguous = Enum("<contiguous and direct>")
27895 * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
27896 *
27897 *
27898*/
27899 __pyx_t_5 = NULL;
27900 __pyx_t_6 = 1;
27901 {
27902 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_contiguous_and_indirect};
27903 __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));
27904 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27905 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 332, __pyx_L1_error)
27906 __Pyx_GOTREF((PyObject *)__pyx_t_4);
27907 }
27908 __Pyx_XGOTREF(indirect_contiguous);
27909 __Pyx_DECREF_SET(indirect_contiguous, ((PyObject *)__pyx_t_4));
27910 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
27911 __pyx_t_4 = 0;
27912
27913 /* "View.MemoryView":340
27914 *
27915 *
27916 * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
27917 * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [
27918 * PyThread_allocate_lock(),
27919*/
27920 __pyx_memoryview_thread_locks_used = 0;
27921
27922 /* "View.MemoryView":341
27923 *
27924 * cdef int __pyx_memoryview_thread_locks_used = 0
27925 * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
27926 * PyThread_allocate_lock(),
27927 * PyThread_allocate_lock(),
27928*/
27929 __pyx_t_7[0] = PyThread_allocate_lock();
27930 __pyx_t_7[1] = PyThread_allocate_lock();
27931 __pyx_t_7[2] = PyThread_allocate_lock();
27932 __pyx_t_7[3] = PyThread_allocate_lock();
27933 __pyx_t_7[4] = PyThread_allocate_lock();
27934 __pyx_t_7[5] = PyThread_allocate_lock();
27935 __pyx_t_7[6] = PyThread_allocate_lock();
27936 __pyx_t_7[7] = PyThread_allocate_lock();
27937 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_7, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
27938
27939 /* "View.MemoryView":979
27940 *
27941 *
27942 * try: # <<<<<<<<<<<<<<
27943 * count = __pyx_collections_abc_Sequence.count
27944 * index = __pyx_collections_abc_Sequence.index
27945*/
27946 {
27947 __Pyx_PyThreadState_declare
27948 __Pyx_PyThreadState_assign
27949 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
27950 __Pyx_XGOTREF(__pyx_t_1);
27951 __Pyx_XGOTREF(__pyx_t_2);
27952 __Pyx_XGOTREF(__pyx_t_3);
27953 /*try:*/ {
27954
27955 /* "View.MemoryView":980
27956 *
27957 * try:
27958 * count = __pyx_collections_abc_Sequence.count # <<<<<<<<<<<<<<
27959 * index = __pyx_collections_abc_Sequence.index
27960 * except:
27961*/
27962 __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)
27963 __Pyx_GOTREF(__pyx_t_4);
27964 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)
27965 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27966
27967 /* "View.MemoryView":981
27968 * try:
27969 * count = __pyx_collections_abc_Sequence.count
27970 * index = __pyx_collections_abc_Sequence.index # <<<<<<<<<<<<<<
27971 * except:
27972 * pass
27973*/
27974 __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)
27975 __Pyx_GOTREF(__pyx_t_4);
27976 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)
27977 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27978
27979 /* "View.MemoryView":979
27980 *
27981 *
27982 * try: # <<<<<<<<<<<<<<
27983 * count = __pyx_collections_abc_Sequence.count
27984 * index = __pyx_collections_abc_Sequence.index
27985*/
27986 }
27987 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27988 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27989 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27990 goto __pyx_L23_try_end;
27991 __pyx_L18_error:;
27992 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27993 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27994
27995 /* "View.MemoryView":982
27996 * count = __pyx_collections_abc_Sequence.count
27997 * index = __pyx_collections_abc_Sequence.index
27998 * except: # <<<<<<<<<<<<<<
27999 * pass
28000 *
28001*/
28002 /*except:*/ {
28003 __Pyx_ErrRestore(0,0,0);
28004 goto __pyx_L19_exception_handled;
28005 }
28006 __pyx_L19_exception_handled:;
28007 __Pyx_XGIVEREF(__pyx_t_1);
28008 __Pyx_XGIVEREF(__pyx_t_2);
28009 __Pyx_XGIVEREF(__pyx_t_3);
28010 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
28011 __pyx_L23_try_end:;
28012 }
28013
28014 /* "View.MemoryView":985
28015 * pass
28016 *
28017 * try: # <<<<<<<<<<<<<<
28018 * if __pyx_collections_abc_Sequence:
28019 *
28020*/
28021 {
28022 __Pyx_PyThreadState_declare
28023 __Pyx_PyThreadState_assign
28024 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
28025 __Pyx_XGOTREF(__pyx_t_3);
28026 __Pyx_XGOTREF(__pyx_t_2);
28027 __Pyx_XGOTREF(__pyx_t_1);
28028 /*try:*/ {
28029
28030 /* "View.MemoryView":986
28031 *
28032 * try:
28033 * if __pyx_collections_abc_Sequence: # <<<<<<<<<<<<<<
28034 *
28035 *
28036*/
28037 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_collections_abc_Sequence); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 986, __pyx_L26_error)
28038 if (__pyx_t_8) {
28039
28040
28041 /* "View.MemoryView":990
28042 *
28043 *
28044 * __pyx_collections_abc_Sequence.register(_memoryviewslice) # <<<<<<<<<<<<<<
28045 * __pyx_collections_abc_Sequence.register(array)
28046 * except:
28047*/
28048 __pyx_t_5 = __pyx_collections_abc_Sequence;
28049 __Pyx_INCREF(__pyx_t_5);
28050 __pyx_t_6 = 0;
28051 {
28052 PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_mstate_global->__pyx_memoryviewslice_type)};
28053 __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));
28054 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28055 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 990, __pyx_L26_error)
28056 __Pyx_GOTREF(__pyx_t_4);
28057 }
28058 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28059
28060 /* "View.MemoryView":991
28061 *
28062 * __pyx_collections_abc_Sequence.register(_memoryviewslice)
28063 * __pyx_collections_abc_Sequence.register(array) # <<<<<<<<<<<<<<
28064 * except:
28065 * pass # ignore failure, it's a minor issue
28066*/
28067 __pyx_t_5 = __pyx_collections_abc_Sequence;
28068 __Pyx_INCREF(__pyx_t_5);
28069 __pyx_t_6 = 0;
28070 {
28071 PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_mstate_global->__pyx_array_type)};
28072 __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));
28073 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28074 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 991, __pyx_L26_error)
28075 __Pyx_GOTREF(__pyx_t_4);
28076 }
28077 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28078
28079 /* "View.MemoryView":986
28080 *
28081 * try:
28082 * if __pyx_collections_abc_Sequence: # <<<<<<<<<<<<<<
28083 *
28084 *
28085*/
28086 }
28087
28088 /* "View.MemoryView":985
28089 * pass
28090 *
28091 * try: # <<<<<<<<<<<<<<
28092 * if __pyx_collections_abc_Sequence:
28093 *
28094*/
28095 }
28096 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
28097 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
28098 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
28099 goto __pyx_L31_try_end;
28100 __pyx_L26_error:;
28101 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
28102 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28103
28104 /* "View.MemoryView":992
28105 * __pyx_collections_abc_Sequence.register(_memoryviewslice)
28106 * __pyx_collections_abc_Sequence.register(array)
28107 * except: # <<<<<<<<<<<<<<
28108 * pass # ignore failure, it's a minor issue
28109 *
28110*/
28111 /*except:*/ {
28112 __Pyx_ErrRestore(0,0,0);
28113 goto __pyx_L27_exception_handled;
28114 }
28115 __pyx_L27_exception_handled:;
28116 __Pyx_XGIVEREF(__pyx_t_3);
28117 __Pyx_XGIVEREF(__pyx_t_2);
28118 __Pyx_XGIVEREF(__pyx_t_1);
28119 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
28120 __pyx_L31_try_end:;
28121 }
28122
28123 /* "(tree fragment)":4
28124 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
28125 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
28126 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<<
28127 * cdef object __pyx_result
28128 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
28129*/
28130 __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)
28131 __Pyx_GOTREF(__pyx_t_4);
28132 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)
28133 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28134
28135 /* "equivalent_polynomials.pyx":2
28136 * # A type of -*- python -*- file
28137 * import numpy as np # <<<<<<<<<<<<<<
28138 * cimport numpy as np
28139 * cimport equivalent_polynomials as eqp
28140*/
28141 __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)
28142 __pyx_t_4 = __pyx_t_1;
28143 __Pyx_GOTREF(__pyx_t_4);
28144 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)
28145 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28146
28147 /* "equivalent_polynomials.pyx":60
28148 * self.nEBQ=nQ#cek hack
28149 * self.q=0
28150 * def calculate(self, np.ndarray phi_dof, np.ndarray phi_nodes, np.ndarray xi): # <<<<<<<<<<<<<<
28151 * self.xiBuffer[:xi.shape[0]]=xi
28152 * if (self.nSpace,self.nP) == (1,1):
28153*/
28154 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_22equivalent_polynomials_7Simplex_3calculate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Simplex_calculate, NULL, __pyx_mstate_global->__pyx_n_u_equivalent_polynomials, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 60, __pyx_L1_error)
28155 __Pyx_GOTREF(__pyx_t_4);
28156 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28157 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28158 #endif
28159 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_22equivalent_polynomials_Simplex, __pyx_mstate_global->__pyx_n_u_calculate, __pyx_t_4) < (0)) __PYX_ERR(0, 60, __pyx_L1_error)
28160 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28161
28162 /* "equivalent_polynomials.pyx":134
28163 * self.edge = self.s33.edge
28164 * self.corner = self.s33.corner
28165 * def set_quad(self, int q): # <<<<<<<<<<<<<<
28166 * self.q=q
28167 * # Mirrors Simplex::set_quad() in equivalent_polynomials.h, including its precedence:
28168*/
28169 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_22equivalent_polynomials_7Simplex_5set_quad, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Simplex_set_quad, NULL, __pyx_mstate_global->__pyx_n_u_equivalent_polynomials, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error)
28170 __Pyx_GOTREF(__pyx_t_4);
28171 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28172 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28173 #endif
28174 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_22equivalent_polynomials_Simplex, __pyx_mstate_global->__pyx_n_u_set_quad, __pyx_t_4) < (0)) __PYX_ERR(0, 134, __pyx_L1_error)
28175 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28176
28177 /* "(tree fragment)":1
28178 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
28179 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
28180 * def __setstate_cython__(self, __pyx_state):
28181*/
28182 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_22equivalent_polynomials_7Simplex_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Simplex___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_equivalent_polynomials, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
28183 __Pyx_GOTREF(__pyx_t_4);
28184 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28185 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28186 #endif
28187 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)
28188 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28189
28190 /* "(tree fragment)":3
28191 * def __reduce_cython__(self):
28192 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
28193 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
28194 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
28195*/
28196 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_22equivalent_polynomials_7Simplex_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Simplex___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_equivalent_polynomials, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error)
28197 __Pyx_GOTREF(__pyx_t_4);
28198 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28199 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28200 #endif
28201 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)
28202 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28203
28204 /* "equivalent_polynomials.pyx":166
28205 * return self._D[self.q]
28206 *
28207 * def calc_edge_H(double phi0, double phi1, int nP): # <<<<<<<<<<<<<<
28208 * """Edge-restricted moment-fit Heaviside on a cut edge (reference t in [0,1] from the edge's
28209 * node 0 to node 1). phi0, phi1 must have opposite signs. Returns the monomial coefficients
28210*/
28211 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_22equivalent_polynomials_1calc_edge_H, 0, __pyx_mstate_global->__pyx_n_u_calc_edge_H, NULL, __pyx_mstate_global->__pyx_n_u_equivalent_polynomials, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
28212 __Pyx_GOTREF(__pyx_t_4);
28213 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28214 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28215 #endif
28216 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_calc_edge_H, __pyx_t_4) < (0)) __PYX_ERR(0, 166, __pyx_L1_error)
28217 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28218
28219 /* "equivalent_polynomials.pyx":178
28220 * return C_H
28221 *
28222 * def eval_edge_poly(np.ndarray C, double t, int nP): # <<<<<<<<<<<<<<
28223 * if nP == 1: return eqp.evaluate_edge_poly[nP1T](<double*>C.data, t)
28224 * elif nP == 2: return eqp.evaluate_edge_poly[nP2T](<double*>C.data, t)
28225*/
28226 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_22equivalent_polynomials_3eval_edge_poly, 0, __pyx_mstate_global->__pyx_n_u_eval_edge_poly, NULL, __pyx_mstate_global->__pyx_n_u_equivalent_polynomials, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L1_error)
28227 __Pyx_GOTREF(__pyx_t_4);
28228 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28229 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28230 #endif
28231 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_eval_edge_poly, __pyx_t_4) < (0)) __PYX_ERR(0, 178, __pyx_L1_error)
28232 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28233
28234 /* "equivalent_polynomials.pyx":1
28235 * # A type of -*- python -*- file # <<<<<<<<<<<<<<
28236 * import numpy as np
28237 * cimport numpy as np
28238*/
28239 __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
28240 __Pyx_GOTREF(__pyx_t_4);
28241 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)
28242 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28243
28244 /*--- Wrapped vars code ---*/
28245
28246 goto __pyx_L0;
28247 __pyx_L1_error:;
28248 __Pyx_XDECREF(__pyx_t_4);
28249 __Pyx_XDECREF(__pyx_t_5);
28250 if (__pyx_m) {
28251 if (__pyx_mstate->__pyx_d && stringtab_initialized) {
28252 __Pyx_AddTraceback("init equivalent_polynomials", __pyx_clineno, __pyx_lineno, __pyx_filename);
28253 }
28254 #if !CYTHON_USE_MODULE_STATE
28255 Py_CLEAR(__pyx_m);
28256 #else
28257 Py_DECREF(__pyx_m);
28258 if (pystate_addmodule_run) {
28259 PyObject *tp, *value, *tb;
28260 __Pyx_PyErr_FetchException(&tp, &value, &tb);
28261 __Pyx_State_RemoveModule(&__pyx_moduledef);
28262 __Pyx_PyErr_RestoreException(tp, value, tb);
28263 }
28264 #endif
28265 } else if (!PyErr_Occurred()) {
28266 PyErr_SetString(PyExc_ImportError, "init equivalent_polynomials");
28267 }
28268 __pyx_L0:;
28269 __Pyx_RefNannyFinishContext();
28270 #if CYTHON_PEP489_MULTI_PHASE_INIT
28271 return (__pyx_m != NULL) ? 0 : -1;
28272 #else
28273 return __pyx_m;
28274 #endif
28275}
28276/* #### Code section: pystring_table ### */
28277/* #### Code section: cached_builtins ### */
28278
28279static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
28280 int __pyx_lineno = 0;
28281 const char *__pyx_filename = NULL;
28282 int __pyx_clineno = 0;
28283 CYTHON_UNUSED_VAR(__pyx_mstate);
28284 __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_import); if (!__pyx_builtin___import__) __PYX_ERR(1, 119, __pyx_L1_error)
28285 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 175, __pyx_L1_error)
28286 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 436, __pyx_L1_error)
28287 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_id); if (!__pyx_builtin_id) __PYX_ERR(1, 662, __pyx_L1_error)
28288
28289 /* Cached unbound methods */
28290 __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
28291 __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items;
28292 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
28293 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
28294 __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
28295 __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values;
28296 return 0;
28297 __pyx_L1_error:;
28298 return -1;
28299}
28300/* #### Code section: cached_constants ### */
28301
28302static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
28303 __Pyx_RefNannyDeclarations
28304 int __pyx_lineno = 0;
28305 const char *__pyx_filename = NULL;
28306 int __pyx_clineno = 0;
28307 CYTHON_UNUSED_VAR(__pyx_mstate);
28308 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
28309
28310 /* "View.MemoryView":625
28311 * def suboffsets(self):
28312 * if self.view.suboffsets == NULL:
28313 * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
28314 *
28315 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
28316*/
28317 __pyx_mstate_global->__pyx_tuple[0] = PyTuple_New(1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(1, 625, __pyx_L1_error)
28318 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
28319 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_neg_1);
28320 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_neg_1);
28321 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);
28322 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);
28323
28324 /* "View.MemoryView":745
28325 *
28326 * if first_ellipsis_index >= 0:
28327 * result = [slice(None)] * ndim # <<<<<<<<<<<<<<
28328 *
28329 * for idx in range(first_ellipsis_index):
28330*/
28331 __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)
28332 __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]);
28333 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
28334
28335 /* "View.MemoryView":763
28336 *
28337 * have_slices = True
28338 * index_tuple += (slice(None),) * (ndim - idx) # <<<<<<<<<<<<<<
28339 *
28340 * return have_slices, index_tuple
28341*/
28342 __pyx_mstate_global->__pyx_tuple[1] = PyTuple_New(1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(1, 763, __pyx_L1_error)
28343 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
28344 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
28345 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
28346 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);
28347 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);
28348
28349 /* "equivalent_polynomials.pyx":54
28350 * cdef eqp.cSimplex[nSpace3T,nDOF3T,nP3T,nQT,nEBQT] s33
28351 * def __cinit__(self, nSpace, nP, nQ):
28352 * self.xiBuffer=np.zeros((50,3),'d') # <<<<<<<<<<<<<<
28353 * self.nSpace = nSpace
28354 * self.nP = nP
28355*/
28356 {
28357 PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_int_50, __pyx_mstate_global->__pyx_int_3};
28358 __pyx_mstate_global->__pyx_tuple[2] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 54, __pyx_L1_error)
28359 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
28360 }
28361 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);
28362 {
28363 PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_tuple[2], __pyx_mstate_global->__pyx_n_u_d};
28364 __pyx_mstate_global->__pyx_tuple[3] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 54, __pyx_L1_error)
28365 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]);
28366 }
28367 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]);
28368
28369 /* "equivalent_polynomials.pyx":62
28370 * def calculate(self, np.ndarray phi_dof, np.ndarray phi_nodes, np.ndarray xi):
28371 * self.xiBuffer[:xi.shape[0]]=xi
28372 * if (self.nSpace,self.nP) == (1,1): # <<<<<<<<<<<<<<
28373 * icase = self.s11.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
28374 * self._H = np.asarray(<double[:self.nQ]>self.s11.get_H())
28375*/
28376 {
28377 PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_1};
28378 __pyx_mstate_global->__pyx_tuple[4] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(0, 62, __pyx_L1_error)
28379 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]);
28380 }
28381 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);
28382
28383 /* "equivalent_polynomials.pyx":70
28384 * self.edge = self.s11.edge
28385 * self.corner = self.s11.corner
28386 * elif (self.nSpace,self.nP) == (1,2): # <<<<<<<<<<<<<<
28387 * icase = self.s12.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
28388 * self._H = np.asarray(<double[:self.nQ]>self.s12.get_H())
28389*/
28390 {
28391 PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_2};
28392 __pyx_mstate_global->__pyx_tuple[5] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[5])) __PYX_ERR(0, 70, __pyx_L1_error)
28393 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[5]);
28394 }
28395 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[5]);
28396
28397 /* "equivalent_polynomials.pyx":78
28398 * self.edge = self.s12.edge
28399 * self.corner = self.s12.corner
28400 * elif (self.nSpace,self.nP) == (1,3): # <<<<<<<<<<<<<<
28401 * icase = self.s13.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
28402 * self._H = np.asarray(<double[:self.nQ]>self.s13.get_H())
28403*/
28404 {
28405 PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_3};
28406 __pyx_mstate_global->__pyx_tuple[6] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[6])) __PYX_ERR(0, 78, __pyx_L1_error)
28407 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[6]);
28408 }
28409 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[6]);
28410
28411 /* "equivalent_polynomials.pyx":86
28412 * self.edge = self.s13.edge
28413 * self.corner = self.s13.corner
28414 * elif (self.nSpace,self.nP) == (2,1): # <<<<<<<<<<<<<<
28415 * icase = self.s21.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
28416 * self._H = np.asarray(<double[:self.nQ]>self.s21.get_H())
28417*/
28418 {
28419 PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_int_2, __pyx_mstate_global->__pyx_int_1};
28420 __pyx_mstate_global->__pyx_tuple[7] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[7])) __PYX_ERR(0, 86, __pyx_L1_error)
28421 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[7]);
28422 }
28423 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[7]);
28424
28425 /* "equivalent_polynomials.pyx":94
28426 * self.edge = self.s21.edge
28427 * self.corner = self.s21.corner
28428 * elif (self.nSpace,self.nP) == (2,2): # <<<<<<<<<<<<<<
28429 * icase = self.s22.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
28430 * self._H = np.asarray(<double[:self.nQ]>self.s22.get_H())
28431*/
28432 {
28433 PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_int_2, __pyx_mstate_global->__pyx_int_2};
28434 __pyx_mstate_global->__pyx_tuple[8] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[8])) __PYX_ERR(0, 94, __pyx_L1_error)
28435 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[8]);
28436 }
28437 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[8]);
28438
28439 /* "equivalent_polynomials.pyx":102
28440 * self.edge = self.s22.edge
28441 * self.corner = self.s22.corner
28442 * elif (self.nSpace,self.nP) == (2,3): # <<<<<<<<<<<<<<
28443 * icase = self.s23.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
28444 * self._H = np.asarray(<double[:self.nQ]>self.s23.get_H())
28445*/
28446 {
28447 PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_int_2, __pyx_mstate_global->__pyx_int_3};
28448 __pyx_mstate_global->__pyx_tuple[9] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[9])) __PYX_ERR(0, 102, __pyx_L1_error)
28449 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[9]);
28450 }
28451 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[9]);
28452
28453 /* "equivalent_polynomials.pyx":110
28454 * self.edge = self.s23.edge
28455 * self.corner = self.s23.corner
28456 * if (self.nSpace,self.nP) == (3,1): # <<<<<<<<<<<<<<
28457 * icase = self.s31.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
28458 * self._H = np.asarray(<double[:self.nQ]>self.s31.get_H())
28459*/
28460 {
28461 PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_int_3, __pyx_mstate_global->__pyx_int_1};
28462 __pyx_mstate_global->__pyx_tuple[10] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[10])) __PYX_ERR(0, 110, __pyx_L1_error)
28463 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[10]);
28464 }
28465 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[10]);
28466
28467 /* "equivalent_polynomials.pyx":118
28468 * self.edge = self.s31.edge
28469 * self.corner = self.s31.corner
28470 * elif (self.nSpace,self.nP) == (3,2): # <<<<<<<<<<<<<<
28471 * icase = self.s32.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
28472 * self._H = np.asarray(<double[:self.nQ]>self.s32.get_H())
28473*/
28474 {
28475 PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_int_3, __pyx_mstate_global->__pyx_int_2};
28476 __pyx_mstate_global->__pyx_tuple[11] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[11])) __PYX_ERR(0, 118, __pyx_L1_error)
28477 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[11]);
28478 }
28479 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[11]);
28480
28481 /* "equivalent_polynomials.pyx":126
28482 * self.edge = self.s32.edge
28483 * self.corner = self.s32.corner
28484 * elif (self.nSpace,self.nP) == (3,3): # <<<<<<<<<<<<<<
28485 * icase = self.s33.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
28486 * self._H = np.asarray(<double[:self.nQ]>self.s33.get_H())
28487*/
28488 {
28489 PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_int_3, __pyx_mstate_global->__pyx_int_3};
28490 __pyx_mstate_global->__pyx_tuple[12] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[12])) __PYX_ERR(0, 126, __pyx_L1_error)
28491 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[12]);
28492 }
28493 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[12]);
28494 #if CYTHON_IMMORTAL_CONSTANTS
28495 {
28496 PyObject **table = __pyx_mstate->__pyx_tuple;
28497 for (Py_ssize_t i=0; i<13; ++i) {
28498 #if PY_VERSION_HEX >= 0x030F0000
28499 PyUnstable_SetImmortal(table[i]);
28500 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
28501 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
28502 #if PY_VERSION_HEX < 0x030E0000
28503 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
28504 #else
28505 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
28506 #endif
28507 {
28508 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
28509 }
28510 #else
28511 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
28512 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
28513 #endif
28514 }
28515 }
28516 #endif
28517 #if CYTHON_IMMORTAL_CONSTANTS
28518 {
28519 PyObject **table = __pyx_mstate->__pyx_slice;
28520 for (Py_ssize_t i=0; i<1; ++i) {
28521 #if PY_VERSION_HEX >= 0x030F0000
28522 PyUnstable_SetImmortal(table[i]);
28523 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
28524 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
28525 #if PY_VERSION_HEX < 0x030E0000
28526 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
28527 #else
28528 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
28529 #endif
28530 {
28531 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
28532 }
28533 #else
28534 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
28535 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
28536 #endif
28537 }
28538 }
28539 #endif
28540 __Pyx_RefNannyFinishContext();
28541 return 0;
28542 __pyx_L1_error:;
28543 __Pyx_RefNannyFinishContext();
28544 return -1;
28545}
28546/* #### Code section: init_constants ### */
28547
28548static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
28549 int __pyx_lineno = 0;
28550 const char *__pyx_filename = NULL;
28551 int __pyx_clineno = 0;
28552 CYTHON_UNUSED_VAR(__pyx_mstate);
28553 {
28554 const struct { const unsigned int length: 8; } str_length_index[] = {{6},{8},{1},{15},{1},{1},{1},{2},{15},{23},{25},{32},{20},{22},{1},{1},{37},{45},{22},{179},{8},{15},{7},{6},{2},{9},{24},{50},{39},{34},{34},{30},{37},{5},{1},{3},{8},{8},{7},{25},{27},{17},{16},{15},{20},{12},{9},{17},{8},{8},{12},{10},{8},{10},{8},{7},{14},{11},{10},{19},{14},{12},{10},{17},{13},{12},{12},{19},{8},{13},{3},{15},{7},{18},{4},{1},{11},{9},{18},{5},{1},{15},{6},{9},{22},{5},{14},{5},{6},{7},{5},{2},{5},{5},{8},{4},{7},{4},{2},{2},{6},{4},{4},{2},{5},{3},{4},{4},{4},{7},{9},{3},{1},{8},{4},{8},{10},{5},{4},{5},{4},{4},{6},{1},{6},{6},{6},{1},{2},{5}};
28555 const struct { const unsigned int length: 11; } bytes_length_index[] = {{0},{1},{1},{2},{1},{1},{109},{9},{131},{9},{1481}};
28556 #ifndef CYTHON_COMPRESS_STRINGS
28557 #define CYTHON_COMPRESS_STRINGS 90
28558 #endif
28559 #if (CYTHON_COMPRESS_STRINGS) == 1 /* compression: zlib (1135 bytes) */
28560static const char cstring[] = "x\332\355T\313O\033G\030/\025i\\\212\242\244\242\255\242\36604\250@\013NHQ\324FQ*\004D\241RS\036i\024)RG\343\331o\355\t\2633\353y\270^\252J\0349\372\270\307=\372\350#G\216=\372\350?\243\177B\277\331\305@K\224K\216a\245\335\231\375\236\277\357I\230#\367\272D7^\003w\217\027\026\234\001 \261a\315\004\224[\\\\\252?$\217~\201D\233\354\205\200?\210\216\311#\256\225\023M\257\275%LE$\022&\250\376\237,\324\230a\235\021\021D\027\204\2116o\345\377\227v&\371\370\247u\246\224v\204Y+\232\2128M\014\260hY+\231\221\244\004\331A\220[\252\303\244\210H\242#X\"\320MQ\027M\315\363\371\340w>\326\306\031\246\346\227H\023M\215\205m\213\245\200\256\010\353\nK\236i\007\304\26507\353\231kiE\220\026\201\024\r0\314\001z\013\370\320\252\tB\212lon/\257\376\260Z\2425\0202i\211\365\r.\021(\330\220\264\206\027\322\241u\227\245`\353d+&\231\366D\001\342\302(R\224\273\250\340Z\240\210\005\027.d\276\214\2319\241\025Eu\241\232\363\247i\022\035\010\332O\230\264PgQDQ\016\270\2262\360\264\262u\326\340\221\260\254!\001T\3706\271\260\325-R\333$\361\326\221\006\220\225%r\177\211|\277\024\262\263\2524\006\0323/\035\241\324@\3449PJ\"_zRZ-c\340\035\301$r\271P\302Q\252|\222fu\312\265\201z\202z\202\031\3032\0223!\253\350D\222b\312/\212\371\204\271\326%\211\324 |o\357B\333\013,\n\366\037M\265\314\224N\320\237\255\247Y\327\227\330\203\006\223Rs,\005\251\234E\314\261\372\033\270UUCY\252\206\262\365\265\275\365\255\255\365u\372tSJ\221Za\367\320\035(\016{\010BB\367\364\250\237\005\317\313\006\240\364\234\201\205\261X\217\313,\316$\367\0229c\002J\322\266gQ\030\235\372\371\024Q\272\235u\361\335\300\026\242\317\240\353v!\246\364\264\314\230nLmh\204\363K\023\234p\220\004B\024t\360\211\275\342\341l\216\301\340S\2451\334\022&Ty\352\310\313\222\247XR\235\301=\245\230L\312[\300\367\255O\252\277S+\341\032\232\264\272y\225\n\276\217\0266\325X\256\343B\226\203\r\214L\216\315\216;\345R\332\316\010\320\r?!#c\035{\001\372\245\234R\352\300\206X\204\r=\243=N\017`?\217KK\033>\216q\032m\331\000\314f\212\013]?\223\264\rf\201\207\202P\210""\232@\237\236\325\206KdSL\017.\001\016\r\306\367\271\366\312EQ\0315z\253V!\266\004\256\017\300\260\313\221\177sO\2021\330\316H\257\234\004N,Y\323\342\212\301\016?]4\202#\024\021\341\026\203n\250\242\255>\007\360Z\013\205[+\254\254\260\252\324\266\332Q{)\202\n\t\302\235\227\250\264\034\032\004\204\324\375\264%\356\341\273\202/\215t\034\016\205j6\325i\333@SX\\G\026d<n:<O\047\271\234\202\340\021Sl0\317\220Z\247\3615\236;\207%F\343>\305\021\n\221x\260\335.\212\032m\037\376\372\374\317\337\377:\234\030M^?\264Gw\216~\353};\374\352n\2773\330\031\210\343\366\311\365\223\366\350\343\351\243\365#\373\356\364\251\233\275\251|6_\t\316\246\216\276\353\355\034N\374S\373\340\332\227\371\327\371\223b\266\270_\354\024l\014\343\345\360\263o\212\270\277\326\1771xp|\373\344\316\311Ne\266\363\356\3641\214\321\344\047G+\207k\243Z\220kW\227\255\336n\317\344\237\347\355b\262(\t\033\275Z>\231o\0263\305n\321\036M\317\3646\360\367\347\202\025\007\203/\216k\047S\177/\016\367^\r_\301\020\304P\230\241\311\206\331\301h\372f\357\243^#\257\025\023\305\355\376\\\037\006\253\003w\374\340\344V`\324\362\017\363\005\214\366\307\376\306\340\332\340\371\361\314\361K\304\3646\215\033yT\314afJ\345\311|\243\230\010\327\251|\016\351\263\243\033\237\366\026\360\n\305ja\372\267\256\020^!\274B\370f\204W\323\374^ \374\027\357\035-l";
28561 PyObject *data = __Pyx_DecompressString(cstring, 1135, 1);
28562 #define __Pyx_DecompressString_LZSS_UNUSED
28563 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
28564 const char* const bytes = __Pyx_PyBytes_AsString(data);
28565 #if !CYTHON_ASSUME_SAFE_MACROS
28566 if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
28567 #endif
28568 #elif (CYTHON_COMPRESS_STRINGS) > 0 && (CYTHON_COMPRESS_STRINGS) <= 90 /* compression: lzss (1481 bytes) */
28569static const char cstring[] = "\377 at 0x o\377bject>((\377tree fra\377gment)),\377.: <Memo\377ryView o\377f <conti\377guous an\237d dir7\001\007\ri\375n\021\005stride\275d\"\010 or \004\031>\371<(\tA\006>?Can\377not assi\377gn to re\377ad-only \365m\240\002v\242\000Inva\377lid mode\237, exp\327\000|\000\047\373c\047t\001\047fort\177ran\047, gH\000\276%\005shape\222\000 \377axis Not\357e th\231 Cyt\357hon \021\000del\177iberatek\000\336\320\001cter!\001n \177PEP-484\212\"\373re\306!s sub\333cl\246\000es\261!bu\357ilti\260\000ype\377s. If yoOu ne\224 \303\000p\316\000\376%\tthen se\335t\200\000e \047\357\002at\377ion_typi\267ng\047\355$iv\242\000o\377 False.a\367dd_\231 ecol\371l\310@+\000s.abc\377disablee\275n\002\001gcis\004\003d\377nP must \377be 1, 2,\367 3,\222A4no \377default \377__reduce\337__ due\002no{n-\312@vial\033\000\377cinit__n\377umpy._co\357re.m5\000iar\377ray fail\316\330\003imp\360 \033\tum\267ath\021\016pr\363 u?s/equi\277@\375`\377_polynom~m\000s.pyxu\301\002\276\364Aalloc\210@ >g\003data.\013\020\320C\374\242\204\001\377cs.ASCI\377ICC_HEll\277ipsisSl\000e\357nceS\244\000lexj\000\004.\364\006c\374B__\017\007\326\226@st\204`_\013\rca\217lcul\236`=\005\300@_\257quad\267\205\001.\274\205\007_\357_Pyx\001\000Dic\377t_NextRegf__\340D\354 __\265b\373__\001\005getit\313em\r\001d0\001\027\000fu\003nc\035\001\030\000\207\003+\000\343#3\001\357main\003\002odu\335lM\002nam\002\003ew\374T\001\312 _check\003suT\000\n\001?\004\025\001\343`\362@~\037\001unpick?\000\033En \005vt\314a\230\001\327\000alO\005\242e\246.\274fex\314\001\340\216!\203\005\277&\346\000\303.__t\273es\333`_is\327ao\377utineabc\376\361E_buffer\373as\351basync\277io.cor$\003s\337basec\215A_e\337dge_H\223Fcl\372F\000_\234 trace\377backcoun\207tdd\361\002k\000\205\211\003\220`o?deenum\356\206\002\376s\377erroreva\371l_\003\252\204\001flags\277format\342\207\004i\375c\210\000idinde\365x\302As\000\002izej?oinmem\257\210\001\247\210\001\177nPnQnSp\222\000~\250Andimnp\327\205\002\367obj\023\000kphi\3650\001\0001\005\000_dof\376""\003\001nodespo\377pqregist\277erself\355es\323et\303\206\004\327\210\002so\000st\367art%\000psto>\001\000ructt\340@\201 \337updat\306\001ue\367sxx\232\000ros:\377OT{^}\200\001\330\377\004\007\200s\210#\210U\377\220*\320\034/\250v\260\377Q\260i\270q\300\007\300\377q\330\t\014\210C\210s\374\000\025\006\047\n\020\220\n\230!\373\2301i\001\n\210+\220Q\377\200\001\360\010\000\005\033\230\377\"\230F\240!\2402\240\367Q\240a\177\005X\320\025&\377\240f\250A\250V\2606\277\270\031\300#\300Q\201\003v\370\000\025\006\047\177\005\330\004\013\2101\257\200A\330\010\333\001q\003\003I\377\220R\220r\230\026\230q\367\240\004\240\025\002D\220\010\230\377\004\230E\240\024\240R\240\277q\330\014\024\220D\014\000J\377\240a\240z\260\027\270\010\377\300\n\310)\320S[\320\377[e\320ei\320ir\377\320ry\320yz\330\014\377\020\220\006\220b\230\010\240\377\001\240\031\250$\250e\260\1774\260t\2706\300\021\025\001\337\010\230\002\230(\353\0009\250\377D\260\005\260T\270\024\270\371X\331\000\026\031\016\230d\240$\270\227 S\000\210\001D\240\001]\001\n\373\230$\025\000!\330\016\022\220\375(\010\000e\2404\240r\250\301\021\000\237B\377\202s\344\200\377\312\204]\010\014\001\210\314\204\377\216\206\337";
28570 PyObject *data = __Pyx_DecompressString_LZSS(cstring, 1481, 3308);
28571 #define __Pyx_DecompressString_UNUSED
28572 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
28573 const char* const bytes = __Pyx_PyBytes_AsString(data);
28574 #if !CYTHON_ASSUME_SAFE_MACROS
28575 if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
28576 #endif
28577 #else /* compression: none (3308 bytes) */
28578static 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.abcdisableenablegcisenablednP must be 1, 2, 3, or 4no default __reduce__ due to non-trivial __cinit__numpy._core.multiarray failed to importnumpy._core.umath failed to importproteus/equivalent_polynomials.pyxunable to allocate array data.unable to allocate shape and strides.ASCIICC_HEllipsisSequenceSimplexSimplex.__reduce_cython__Simplex.__setstate_cython__Simplex.calculateSimplex.set_quadView.MemoryView__Pyx_PyDict_NextRef__annotate____class____class_getitem____dict____func____getstate____import____main____module____name____new____pyx_checksum__pyx_state__pyx_type__pyx_unpickle_Enum__pyx_vtable____qualname____reduce____reduce_cython____reduce_ex____set_name____setstate____setstate_cython____test___is_coroutineabcallocate_bufferasarrayasyncio.coroutinesbaseccalc_edge_Hcalculatecline_in_tracebackcountddtype_is_objectencodeenumerateequivalent_polynomialserroreval_edge_polyflagsformatfortranicaseidindexitemsitemsizejoinmemviewmodenPnQnSpacenamendimnpnumpyobjpackphi0phi1phi_dofphi_nodespopqregisterselfset_quadsetdefaultshapesizestartstepstopstructtunpackupdatevaluesxxizeros:OT{^}\200\001\330\004\007\200s\210#\210U\220*\320\034/\250v\260Q\260i\270q\300\007\300q\330\t\014\210C\210s\220*\320\034/\250v\260Q\260i\270q\300\007\300q\330\t\014\210C\210s\220*\320\034/\250v\260Q\260i\270q\300\007\300q\330\t\014\210C\210s\220*\320\034/\250v\260Q\260i\270q\300\007\300q\330\n\020\220\n\230!\2301\200\001\330\004\n\210+\220Q\200\001\360\010\000\005\033\230\"\230F\240!\2402\240Q\240a\330\004\007\200s""\210#\210X\320\025&\240f\250A\250V\2606\270\031\300#\300Q\330\t\014\210C\210v\320\025&\240f\250A\250V\2606\270\031\300#\300Q\330\t\014\210C\210v\320\025&\240f\250A\250V\2606\270\031\300#\300Q\330\t\014\210C\210v\320\025&\240f\250A\250V\2606\270\031\300#\300Q\330\n\020\220\n\230!\2301\330\004\013\2101\200A\330\010\014\210C\210q\200A\330\010\014\210I\220R\220r\230\026\230q\240\004\240A\330\010\014\210D\220\010\230\004\230E\240\024\240R\240q\330\014\024\220D\230\004\230J\240a\240z\260\027\270\010\300\n\310)\320S[\320[e\320ei\320ir\320ry\320yz\330\014\020\220\006\220b\230\010\240\001\240\031\250$\250e\2604\260t\2706\300\021\330\014\020\220\010\230\002\230(\240!\2409\250D\260\005\260T\270\024\270X\300Q\330\014\020\220\006\220b\230\010\240\001\240\031\250$\250e\2604\260t\2706\300\021\330\014\020\220\016\230d\240$\240a\330\014\020\220\010\230\004\230D\240\001\330\014\020\220\n\230$\230d\240!\330\016\022\220(\230$\230e\2404\240r\250\021\330\014\024\220D\230\004\230J\240a\240z\260\027\270\010\300\n\310)\320S[\320[e\320ei\320ir\320ry\320yz\330\014\020\220\006\220b\230\010\240\001\240\031\250$\250e\2604\260t\2706\300\021\330\014\020\220\010\230\002\230(\240!\2409\250D\260\005\260T\270\024\270X\300Q\330\014\020\220\006\220b\230\010\240\001\240\031\250$\250e\2604\260t\2706\300\021\330\014\020\220\016\230d\240$\240a\330\014\020\220\010\230\004\230D\240\001\330\014\020\220\n\230$\230d\240!\330\016\022\220(\230$\230e\2404\240r\250\021\330\014\024\220D\230\004\230J\240a\240z\260\027\270\010\300\n\310)\320S[\320[e\320ei\320ir\320ry\320yz\330\014\020\220\006\220b\230\010\240\001\240\031\250$\250e\2604\260t\2706\300\021\330\014\020\220\010\230\002\230(\240!\2409\250D\260\005\260T\270\024\270X\300Q\330\014\020\220\006\220b\230\010\240\001\240\031\250$\250e\2604\260t\2706\300\021\330\014\020\220\016\230d\240$\240a\330\014\020\220\010\230\004\230D\240\001\330\014\020\220\n\230$\230d\240!\330\016\022\220(\230$\230e\2404\240r\250\021\330\014\024\220D\230\004\230J\240a\240z\260\027\270\010""\300\n\310)\320S[\320[e\320ei\320ir\320ry\320yz\330\014\020\220\006\220b\230\010\240\001\240\031\250$\250e\2604\260t\2706\300\021\330\014\020\220\010\230\002\230(\240!\2409\250D\260\005\260T\270\024\270X\300Q\330\014\020\220\006\220b\230\010\240\001\240\031\250$\250e\2604\260t\2706\300\021\330\014\020\220\016\230d\240$\240a\330\014\020\220\010\230\004\230D\240\001\330\014\020\220\n\230$\230d\240!\330\016\022\220(\230$\230e\2404\240r\250\021\330\014\024\220D\230\004\230J\240a\240z\260\027\270\010\300\n\310)\320S[\320[e\320ei\320ir\320ry\320yz\330\014\020\220\006\220b\230\010\240\001\240\031\250$\250e\2604\260t\2706\300\021\330\014\020\220\010\230\002\230(\240!\2409\250D\260\005\260T\270\024\270X\300Q\330\014\020\220\006\220b\230\010\240\001\240\031\250$\250e\2604\260t\2706\300\021\330\014\020\220\016\230d\240$\240a\330\014\020\220\010\230\004\230D\240\001\330\014\020\220\n\230$\230d\240!\330\016\022\220(\230$\230e\2404\240r\250\021\330\014\024\220D\230\004\230J\240a\240z\260\027\270\010\300\n\310)\320S[\320[e\320ei\320ir\320ry\320yz\330\014\020\220\006\220b\230\010\240\001\240\031\250$\250e\2604\260t\2706\300\021\330\014\020\220\010\230\002\230(\240!\2409\250D\260\005\260T\270\024\270X\300Q\330\014\020\220\006\220b\230\010\240\001\240\031\250$\250e\2604\260t\2706\300\021\330\014\020\220\016\230d\240$\240a\330\014\020\220\010\230\004\230D\240\001\330\014\020\220\n\230$\230d\240!\330\010\014\210D\220\010\230\004\230E\240\024\240R\240q\330\014\024\220D\230\004\230J\240a\240z\260\027\270\010\300\n\310)\320S[\320[e\320ei\320ir\320ry\320yz\330\014\020\220\006\220b\230\010\240\001\240\031\250$\250e\2604\260t\2706\300\021\330\014\020\220\010\230\002\230(\240!\2409\250D\260\005\260T\270\024\270X\300Q\330\014\020\220\006\220b\230\010\240\001\240\031\250$\250e\2604\260t\2706\300\021\330\014\020\220\016\230d\240$\240a\330\014\020\220\010\230\004\230D\240\001\330\014\020\220\n\230$\230d\240!\330\016\022\220(\230$\230e\2404\240r\250\021\330\014\024\220D\230\004\230J\240a\240z\260""\027\270\010\300\n\310)\320S[\320[e\320ei\320ir\320ry\320yz\330\014\020\220\006\220b\230\010\240\001\240\031\250$\250e\2604\260t\2706\300\021\330\014\020\220\010\230\002\230(\240!\2409\250D\260\005\260T\270\024\270X\300Q\330\014\020\220\006\220b\230\010\240\001\240\031\250$\250e\2604\260t\2706\300\021\330\014\020\220\016\230d\240$\240a\330\014\020\220\010\230\004\230D\240\001\330\014\020\220\n\230$\230d\240!\330\016\022\220(\230$\230e\2404\240r\250\021\330\014\024\220D\230\004\230J\240a\240z\260\027\270\010\300\n\310)\320S[\320[e\320ei\320ir\320ry\320yz\330\014\020\220\006\220b\230\010\240\001\240\031\250$\250e\2604\260t\2706\300\021\330\014\020\220\010\230\002\230(\240!\2409\250D\260\005\260T\270\024\270X\300Q\330\014\020\220\006\220b\230\010\240\001\240\031\250$\250e\2604\260t\2706\300\021\330\014\020\220\016\230d\240$\240a\330\014\020\220\010\230\004\230D\240\001\330\014\020\220\n\230$\230d\240!";
28579 PyObject *data = NULL;
28580 #define __Pyx_DecompressString_UNUSED
28581 #define __Pyx_DecompressString_LZSS_UNUSED
28582 #endif
28583 PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
28584 Py_ssize_t pos = 0;
28585 for (int i = 0; i < 130; i++) {
28586 Py_ssize_t bytes_length = str_length_index[i].length;
28587 PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
28588 if (likely(string) && i >= 33) PyUnicode_InternInPlace(&string);
28589 if (unlikely(!string)) {
28590 Py_XDECREF(data);
28591 __PYX_ERR(0, 1, __pyx_L1_error)
28592 }
28593 stringtab[i] = string;
28594 pos += bytes_length;
28595 }
28596 for (int i = 130; i < 141; i++) {
28597 Py_ssize_t bytes_length = bytes_length_index[i-130].length;
28598 PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
28599 stringtab[i] = string;
28600 pos += bytes_length;
28601 if (unlikely(!string)) {
28602 Py_XDECREF(data);
28603 __PYX_ERR(0, 1, __pyx_L1_error)
28604 }
28605 }
28606 Py_XDECREF(data);
28607 for (Py_ssize_t i = 0; i < 141; i++) {
28608 if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
28609 __PYX_ERR(0, 1, __pyx_L1_error)
28610 }
28611 }
28612 #if CYTHON_IMMORTAL_CONSTANTS
28613 {
28614 PyObject **table = stringtab + 130;
28615 for (Py_ssize_t i=0; i<11; ++i) {
28616 #if PY_VERSION_HEX >= 0x030F0000
28617 PyUnstable_SetImmortal(table[i]);
28618 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
28619 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
28620 #if PY_VERSION_HEX < 0x030E0000
28621 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
28622 #else
28623 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
28624 #endif
28625 {
28626 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
28627 }
28628 #else
28629 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
28630 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
28631 #endif
28632 }
28633 }
28634 #endif
28635 }
28636 {
28637 PyObject **numbertab = __pyx_mstate->__pyx_number_tab;
28638 double const c_constants[] = {0.0,1.0};
28639 for (int i = 0; i < 2; i++) {
28640 numbertab[i] = PyFloat_FromDouble(c_constants[i]);
28641 if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
28642 }
28643 }
28644 {
28645 PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 2;
28646 int8_t const cint_constants_1[] = {0,-1,1,2,3,50};
28647 int32_t const cint_constants_4[] = {136983863L};
28648 for (int i = 0; i < 7; i++) {
28649 numbertab[i] = PyLong_FromLong((i < 6 ? cint_constants_1[i - 0] : cint_constants_4[i - 6]));
28650 if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
28651 }
28652 }
28653 #if CYTHON_IMMORTAL_CONSTANTS
28654 {
28655 PyObject **table = __pyx_mstate->__pyx_number_tab;
28656 for (Py_ssize_t i=0; i<9; ++i) {
28657 #if PY_VERSION_HEX >= 0x030F0000
28658 PyUnstable_SetImmortal(table[i]);
28659 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
28660 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
28661 #if PY_VERSION_HEX < 0x030E0000
28662 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
28663 #else
28664 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
28665 #endif
28666 {
28667 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
28668 }
28669 #else
28670 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
28671 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
28672 #endif
28673 }
28674 }
28675 #endif
28676 return 0;
28677 __pyx_L1_error:;
28678 return -1;
28679}
28680/* #### Code section: init_codeobjects ### */
28681#ifdef __cplusplus
28682namespace {
28683#endif
28684typedef struct {
28685 unsigned int argcount : 3;
28686 unsigned int num_posonly_args : 1;
28687 unsigned int num_kwonly_args : 1;
28688 unsigned int nlocals : 3;
28689 unsigned int flags : 10;
28690 unsigned int first_line : 8;
28691} __Pyx_PyCode_New_function_description;
28692#ifdef __cplusplus
28693} /* anonymous namespace */
28694#endif
28695/* NewCodeObj.proto */
28696static PyObject* __Pyx_PyCode_New(
28697 const __Pyx_PyCode_New_function_description descr,
28698 PyObject * const *varnames,
28699 PyObject *filename,
28700 PyObject *funcname,
28701 PyObject *line_table,
28702 PyObject *tuple_dedup_map
28703);
28704
28705
28706static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
28707 PyObject* tuple_dedup_map = PyDict_New();
28708 if (unlikely(!tuple_dedup_map)) return -1;
28709 {
28710 const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 60};
28711 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_phi_dof, __pyx_mstate->__pyx_n_u_phi_nodes, __pyx_mstate->__pyx_n_u_xi, __pyx_mstate->__pyx_n_u_icase};
28712 __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_equivalent_polynomials_p, __pyx_mstate->__pyx_n_u_calculate, __pyx_mstate->__pyx_kp_b_iso88591_A_IRr_q_A_D_E_Rq_D_Jaz_S_eeiirry, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
28713 }
28714 {
28715 const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 134};
28716 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_q};
28717 __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_equivalent_polynomials_p, __pyx_mstate->__pyx_n_u_set_quad, __pyx_mstate->__pyx_kp_b_iso88591_A_Cq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad;
28718 }
28719 {
28720 const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
28721 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
28722 __pyx_mstate_global->__pyx_codeobj_tab[2] = __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[2])) goto bad;
28723 }
28724 {
28725 const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
28726 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
28727 __pyx_mstate_global->__pyx_codeobj_tab[3] = __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[3])) goto bad;
28728 }
28729 {
28730 const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 166};
28731 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_phi0, __pyx_mstate->__pyx_n_u_phi1, __pyx_mstate->__pyx_n_u_nP, __pyx_mstate->__pyx_n_u_C_H};
28732 __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_equivalent_polynomials_p, __pyx_mstate->__pyx_n_u_calc_edge_H, __pyx_mstate->__pyx_kp_b_iso88591_F_2Qa_s_X_fAV6_Q_Cv_fAV6_Q_Cv_f, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad;
28733 }
28734 {
28735 const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 178};
28736 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_C, __pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_nP};
28737 __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_equivalent_polynomials_p, __pyx_mstate->__pyx_n_u_eval_edge_poly, __pyx_mstate->__pyx_kp_b_iso88591_s_U_vQiq_q_Cs_vQiq_q_Cs_vQiq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad;
28738 }
28739 Py_DECREF(tuple_dedup_map);
28740 return 0;
28741 bad:
28742 Py_DECREF(tuple_dedup_map);
28743 return -1;
28744}
28745/* #### Code section: init_globals ### */
28746
28747static int __Pyx_InitGlobals(void) {
28748 int __pyx_lineno = 0;
28749 const char *__pyx_filename = NULL;
28750 int __pyx_clineno = 0;
28751 /* PythonCompatibility.init */
28752 if (likely(__Pyx_init_co_variables() == 0 && __Pyx_init_tpflags_variables() == 0)); else
28753
28754 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
28755
28756 /* PyFrozenDict.init */
28757 #if CYTHON_COMPILING_IN_LIMITED_API
28758 {
28759 PyObject *builtins = PyEval_GetBuiltins(); // borrowed
28760 if (likely(builtins)) {
28761 PyObject *type_name = PyUnicode_FromStringAndSize("frozendict", sizeof("frozendict")-1);
28762 if (likely(type_name)) {
28763 PyObject *frozendict_type = PyObject_GetItem(builtins, type_name);
28764 Py_DECREF(type_name);
28765 if (!frozendict_type && PyErr_ExceptionMatches(PyExc_KeyError)) {
28766 PyErr_Clear();
28767 frozendict_type = (PyObject*) &PyDict_Type;
28768 Py_INCREF(frozendict_type);
28769 }
28770 __pyx_mstate_global->__Pyx_PyFrozenDictType = frozendict_type;
28771 }
28772 }
28773 } // error handling follows
28774 #endif
28775
28776 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
28777
28778 /* AssertionsEnabled.init */
28779 if (likely(__Pyx_init_assertions_enabled() == 0)); else
28780
28781 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
28782
28783 /* NumpyImportArray.init */
28784 /*
28785 * Cython has automatically inserted a call to _import_array since
28786 * you didn't include one when you cimported numpy. To disable this
28787 * add the line
28788 * <void>numpy._import_array
28789 */
28790 #ifdef NPY_FEATURE_VERSION
28791 #ifndef NO_IMPORT_ARRAY
28792 if (unlikely(_import_array() == -1)) {
28793 PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import "
28794 "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; "
28795 "use '<void>numpy._import_array' to disable if you are certain you don't need it).");
28796 }
28797 #endif
28798 #endif
28799
28800 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
28801
28802 /* CommonTypesMetaclass.init */
28803 if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else
28804
28805 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
28806
28807 /* CachedMethodType.init */
28808 #if CYTHON_COMPILING_IN_LIMITED_API
28809 {
28810 PyObject *typesModule=NULL;
28811 typesModule = PyImport_ImportModule("types");
28812 if (typesModule) {
28813 __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType");
28814 Py_DECREF(typesModule);
28815 }
28816 } // error handling follows
28817 #endif
28818
28819 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
28820
28821 return 0;
28822 __pyx_L1_error:;
28823 return -1;
28824}
28825/* #### Code section: init_after_shared_utility ### */
28826
28827static int __Pyx_InitAfterSharedUtility(void) {
28828 int __pyx_lineno = 0;
28829 const char *__pyx_filename = NULL;
28830 int __pyx_clineno = 0;
28831 /* CythonFunctionPerModule.init */
28832 if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else
28833
28834 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
28835
28836 return 0;
28837 __pyx_L1_error:;
28838 return -1;
28839}
28840/* #### Code section: cleanup_globals ### */
28841/* #### Code section: cleanup_module ### */
28842/* #### Code section: main_method ### */
28843/* #### Code section: utility_code_pragmas ### */
28844#ifdef _MSC_VER
28845#pragma warning( push )
28846/* Warning 4127: conditional expression is constant
28847 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
28848 * compile-time, so this warning is not useful
28849 */
28850#pragma warning( disable : 4127 )
28851#endif
28852
28853
28854
28855/* #### Code section: utility_code_def ### */
28856
28857/* --- Runtime support code --- */
28858/* Refnanny */
28859#if CYTHON_REFNANNY
28860static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
28861 PyObject *m = NULL, *p = NULL;
28862 void *r = NULL;
28863 m = PyImport_ImportModule(modname);
28864 if (!m) goto end;
28865 p = PyObject_GetAttrString(m, "RefNannyAPI");
28866 if (!p) goto end;
28867 r = PyLong_AsVoidPtr(p);
28868end:
28869 Py_XDECREF(p);
28870 Py_XDECREF(m);
28871 return (__Pyx_RefNannyAPIStruct *)r;
28872}
28873#endif
28874
28875/* CopyObjectArray (used by TupleOrListFromArrayImpl) */
28876#if CYTHON_COMPILING_IN_CPYTHON
28877static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
28878 PyObject *v;
28879 Py_ssize_t i;
28880 for (i = 0; i < length; i++) {
28881 v = dest[i] = src[i];
28882 Py_INCREF(v);
28883 }
28884}
28885#endif
28886
28887/* TupleOrListFromArrayImpl (used by TupleFromArray) */
28888#if !(PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API)
28889CYTHON_UNUSED static PyObject *
28890__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) {
28891 if (n <= 0) {
28892 return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
28893 }
28894 PyObject *res = PyTuple_New(n);
28895 if (unlikely(res == NULL)) return NULL;
28896 #if CYTHON_COMPILING_IN_CPYTHON
28897 __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
28898 #else
28899 Py_ssize_t i;
28900 for (i = 0; i < n; i++) {
28901 Py_INCREF(src[i]);
28902 if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
28903 Py_DECREF(res);
28904 return NULL;
28905 }
28906 }
28907 #endif
28908 return res;
28909}
28910#endif
28911
28912/* PyObjectCompare (used by UnicodeEquals) */
28913#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
28914#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
28915static CYTHON_INLINE int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
28916 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
28917 int result = PyUnicode_Equal(s1, s2);
28918 #if !CYTHON_COMPILING_IN_CPYTHON
28919 if (unlikely(result == -1)) return -1;
28920 #endif
28921 if (result == 0) goto __pyx_return_false; else goto __pyx_return_true;
28922 #else
28923 int result = PyUnicode_Compare(s1, s2);
28924 if (unlikely((result == -1) && PyErr_Occurred())) return -1;
28925 if (result == 0) goto __pyx_return_true; else goto __pyx_return_false;
28926 #endif
28927__pyx_return_true:
28928 return 1;
28929__pyx_return_false:
28930 return 0;
28931}
28932#endif
28933static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2, int pyop) {
28934 CYTHON_UNUSED_VAR(pyop);
28935 if (unlikely(op1 == Py_None)) {
28936 if (op2 == Py_None) goto __pyx_return_true; else goto __pyx_return_false;
28937 }
28938 if (unlikely(op2 == Py_None)) {
28939 if (op1 == Py_None) goto __pyx_return_true; else goto __pyx_return_false;
28940 }
28941
28942 if (likely(op1 != Py_None)) {
28943 if (op1 == op2) goto __pyx_return_true;
28944 if (likely(op2 != Py_None)) {
28945 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
28946 }
28947 goto __pyx_richcmp;
28948 }
28949
28950 if ((0)) goto __pyx_richcmp;
28951 if ((0)) goto __pyx_return_true;
28952 if ((0)) goto __pyx_return_false;
28953__pyx_richcmp:
28954 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
28955__pyx_return_true:
28956 return 1;
28957__pyx_return_false:
28958 return 0;
28959}
28960
28961/* fastcall */
28962#if CYTHON_VECTORCALL
28963static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
28964{
28965 Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames);
28966 #if !CYTHON_ASSUME_SAFE_SIZE
28967 if (unlikely(n == -1)) return NULL;
28968 #endif
28969 for (i = 0; i < n; i++)
28970 {
28971 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
28972 #if !CYTHON_ASSUME_SAFE_MACROS
28973 if (unlikely(!namei)) return NULL;
28974 #endif
28975 if (s == namei) return kwvalues[i];
28976 }
28977 for (i = 0; i < n; i++)
28978 {
28979 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
28980 #if !CYTHON_ASSUME_SAFE_MACROS
28981 if (unlikely(!namei)) return NULL;
28982 #endif
28983 int eq = __Pyx_PyUnicode_Equals(s, namei);
28984 if (unlikely(eq != 0)) {
28985 if (unlikely(eq < 0)) return NULL;
28986 return kwvalues[i];
28987 }
28988 }
28989 return NULL;
28990}
28991#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
28992CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
28993 Py_ssize_t i, nkwargs;
28994 PyObject *dict;
28995#if !CYTHON_ASSUME_SAFE_SIZE
28996 nkwargs = PyTuple_Size(kwnames);
28997 if (unlikely(nkwargs < 0)) return NULL;
28998#else
28999 nkwargs = PyTuple_GET_SIZE(kwnames);
29000#endif
29001 dict = PyDict_New();
29002 if (unlikely(!dict))
29003 return NULL;
29004 for (i=0; i<nkwargs; i++) {
29005#if !CYTHON_ASSUME_SAFE_MACROS
29006 PyObject *key = PyTuple_GetItem(kwnames, i);
29007 if (!key) goto bad;
29008#else
29009 PyObject *key = PyTuple_GET_ITEM(kwnames, i);
29010#endif
29011 if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
29012 goto bad;
29013 }
29014 return dict;
29015bad:
29016 Py_DECREF(dict);
29017 return NULL;
29018}
29019#endif
29020#endif
29021
29022/* PyObjectCall (used by PyObjectFastCall) */
29023#if CYTHON_COMPILING_IN_CPYTHON
29024static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
29025 PyObject *result;
29026 ternaryfunc call = Py_TYPE(func)->tp_call;
29027 if (unlikely(!call))
29028 return PyObject_Call(func, arg, kw);
29029 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
29030 return NULL;
29031 result = (*call)(func, arg, kw);
29032 Py_LeaveRecursiveCall();
29033 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
29034 PyErr_SetString(
29035 PyExc_SystemError,
29036 "NULL result without error in PyObject_Call");
29037 }
29038 return result;
29039}
29040#endif
29041
29042/* PyObjectCallMethO (used by PyObjectFastCall) */
29043#if CYTHON_COMPILING_IN_CPYTHON
29044static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
29045 PyObject *self, *result;
29046 PyCFunction cfunc;
29047 cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
29048 self = __Pyx_CyOrPyCFunction_GET_SELF(func);
29049 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
29050 return NULL;
29051 result = cfunc(self, arg);
29052 Py_LeaveRecursiveCall();
29053 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
29054 PyErr_SetString(
29055 PyExc_SystemError,
29056 "NULL result without error in PyObject_Call");
29057 }
29058 return result;
29059}
29060#endif
29061
29062/* PyObjectFastCall (used by PyObjectCallOneArg) */
29063#if CYTHON_COMPILING_IN_LIMITED_API
29064static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) {
29065 PyObject *argstuple;
29066 PyObject *result = 0;
29067 size_t i;
29068 argstuple = PyTuple_New((Py_ssize_t)nargs);
29069 if (unlikely(!argstuple)) return NULL;
29070 for (i = 0; i < nargs; i++) {
29071 Py_INCREF(args[i]);
29072 if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad;
29073 }
29074 result = __Pyx_PyObject_Call(func, argstuple, kwargs);
29075 bad:
29076 Py_DECREF(argstuple);
29077 return result;
29078}
29079#endif
29080#if CYTHON_VECTORCALL && !(CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY)
29081 #if CYTHON_COMPILING_IN_CPYTHON
29082static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
29083 PyTypeObject *tp = Py_TYPE(callable);
29084 #if defined(__Pyx_CyFunction_USED)
29085 if (__Pyx_CyFunction_CheckExact(callable)) {
29086 return __Pyx_CyFunction_func_vectorcall(callable);
29087 }
29088 #endif
29089 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
29090 return NULL;
29091 }
29092 assert(PyCallable_Check(callable));
29093 Py_ssize_t offset = tp->tp_vectorcall_offset;
29094 assert(offset > 0);
29095 vectorcallfunc ptr;
29096 memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
29097 return ptr;
29098}
29099 #else
29100 #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
29101 #endif
29102#endif
29103static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwargs) {
29104 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
29105#if CYTHON_COMPILING_IN_CPYTHON
29106 if (nargs == 0 && kwargs == NULL) {
29107 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
29108 return __Pyx_PyObject_CallMethO(func, NULL);
29109 }
29110 else if (nargs == 1 && kwargs == NULL) {
29111 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
29112 return __Pyx_PyObject_CallMethO(func, args[0]);
29113 }
29114#endif
29115 if (kwargs == NULL) {
29116 #if CYTHON_VECTORCALL
29117 #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
29118 return PyObject_Vectorcall(func, args, nargsf, NULL);
29119 #else
29120 vectorcallfunc f = __Pyx_PyVectorcall_Function(func);
29121 if (f) {
29122 return f(func, args, nargsf, NULL);
29123 }
29124 #endif
29125 #endif
29126 }
29127 if (nargs == 0) {
29128 return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
29129 }
29130 #if CYTHON_COMPILING_IN_LIMITED_API
29131 return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
29132 #elif CYTHON_COMPILING_IN_PYPY
29133 return PyObject_VectorcallDict(func, args, (size_t) nargs, kwargs);
29134 #else
29135 return PyObject_VectorcallDict(func, args, nargsf, kwargs);
29136 #endif
29137}
29138
29139/* PyObjectCallOneArg (used by CallUnboundCMethod0) */
29140static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
29141 PyObject *args[2] = {NULL, arg};
29142 return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
29143}
29144
29145/* IgnoreException (used by UnpackUnboundCMethod_impl) */
29146static CYTHON_INLINE int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception) {
29147 if (PyErr_GivenExceptionMatches(given_exception ? given_exception : PyErr_Occurred(), ignorable_exception)) {
29148 PyErr_Clear();
29149 return 1;
29150 }
29151 return 0;
29152}
29153
29154/* FastTypeChecks (used by UnpackUnboundCMethod_impl) */
29155#if CYTHON_COMPILING_IN_CPYTHON
29156static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
29157 while (a) {
29158 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
29159 if (a == b)
29160 return 1;
29161 }
29162 return b == &PyBaseObject_Type;
29163}
29164static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
29165 PyObject *mro;
29166 if (a == b) return 1;
29167 mro = a->tp_mro;
29168 if (likely(mro)) {
29169 Py_ssize_t i, n;
29170 n = PyTuple_GET_SIZE(mro);
29171 for (i = 0; i < n; i++) {
29172 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
29173 return 1;
29174 }
29175 return 0;
29176 }
29177 return __Pyx_InBases(a, b);
29178}
29179static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
29180 PyObject *mro;
29181 if (cls == a || cls == b) return 1;
29182 mro = cls->tp_mro;
29183 if (likely(mro)) {
29184 Py_ssize_t i, n;
29185 n = PyTuple_GET_SIZE(mro);
29186 for (i = 0; i < n; i++) {
29187 PyObject *base = PyTuple_GET_ITEM(mro, i);
29188 if (base == (PyObject *)a || base == (PyObject *)b)
29189 return 1;
29190 }
29191 return 0;
29192 }
29193 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
29194}
29195#endif
29196
29197/* PyObjectGetAttrStr (used by UnpackUnboundCMethod_impl) */
29198#if CYTHON_USE_TYPE_SLOTS
29199static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
29200 PyTypeObject* tp = Py_TYPE(obj);
29201 if (likely(tp->tp_getattro))
29202 return tp->tp_getattro(obj, attr_name);
29203 return PyObject_GetAttr(obj, attr_name);
29204}
29205#endif
29206
29207/* UnpackUnboundCMethod_impl (used by UnpackUnboundCMethod) */
29208#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
29209static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
29210 PyObject *result;
29211 PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
29212 if (unlikely(!selfless_args)) return NULL;
29213 result = PyObject_Call(method, selfless_args, kwargs);
29214 Py_DECREF(selfless_args);
29215 return result;
29216}
29217#else
29218static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) {
29219 return PyObject_Vectorcall(method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames);
29220}
29221#endif
29222static PyMethodDef __Pyx_UnboundCMethod_Def = {
29223 "CythonUnboundCMethod",
29224 __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
29225#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
29226 METH_VARARGS | METH_KEYWORDS,
29227#else
29228 METH_FASTCALL | METH_KEYWORDS,
29229#endif
29230 NULL
29231};
29232static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
29233 PyObject *method, *result=NULL;
29234 method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
29235 if (unlikely(!method))
29236 return -1;
29237 result = method;
29238#if CYTHON_COMPILING_IN_CPYTHON
29239 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
29240 {
29241 PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
29242 target->func = descr->d_method->ml_meth;
29243 target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
29244 } else
29245#endif
29246#if CYTHON_COMPILING_IN_PYPY
29247#else
29248 if (PyCFunction_Check(method))
29249#endif
29250 {
29251 PyObject *self;
29252 int self_found;
29253#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
29254 self = PyObject_GetAttrString(method, "__self__");
29255 if (!self && !__Pyx_IgnoreException(PyExc_AttributeError)) {
29256 return -1;
29257 }
29258#else
29259 self = PyCFunction_GET_SELF(method);
29260#endif
29261 self_found = (self && self != Py_None);
29262#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
29263 Py_XDECREF(self);
29264#endif
29265 if (self_found) {
29266 PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
29267 if (unlikely(!unbound_method)) return -1;
29268 Py_DECREF(method);
29269 result = unbound_method;
29270 }
29271 }
29272#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
29273 if (unlikely(target->method)) {
29274 Py_DECREF(result);
29275 } else
29276#endif
29277 target->method = result;
29278 return 0;
29279}
29280
29281/* CallUnboundCMethod0 */
29282#if CYTHON_COMPILING_IN_CPYTHON
29283static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
29284 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
29285 if (likely(was_initialized == 2 && cfunc->func)) {
29286 if (likely(cfunc->flag == METH_NOARGS))
29287 return __Pyx_CallCFunction(cfunc, self, NULL);
29288 if (likely(cfunc->flag == METH_FASTCALL))
29289 return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
29290 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
29291 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
29292 if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
29293 return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
29294 if (cfunc->flag == METH_VARARGS)
29295 return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
29296 return __Pyx__CallUnboundCMethod0(cfunc, self);
29297 }
29298#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
29299 else if (unlikely(was_initialized == 1)) {
29300 __Pyx_CachedCFunction tmp_cfunc = {
29301#ifndef __cplusplus
29302 0
29303#endif
29304 };
29305 tmp_cfunc.type = cfunc->type;
29306 tmp_cfunc.method_name = cfunc->method_name;
29307 return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
29308 }
29309#endif
29310 PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
29311 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
29312 return result;
29313}
29314#endif
29315static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
29316 PyObject *result;
29317 if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
29318 result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
29319 return result;
29320}
29321
29322/* py_dict_items (used by OwnedDictNext) */
29323static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
29324 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
29325}
29326
29327/* py_dict_values (used by OwnedDictNext) */
29328static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
29329 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
29330}
29331
29332/* OwnedDictNext (used by ParseKeywordsImpl) */
29333#if CYTHON_AVOID_BORROWED_REFS
29334static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
29335 PyObject *next = NULL;
29336 if (!*ppos) {
29337 if (pvalue) {
29338 PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p);
29339 if (unlikely(!dictview)) goto bad;
29340 *ppos = PyObject_GetIter(dictview);
29341 Py_DECREF(dictview);
29342 } else {
29343 *ppos = PyObject_GetIter(p);
29344 }
29345 if (unlikely(!*ppos)) goto bad;
29346 }
29347 next = PyIter_Next(*ppos);
29348 if (!next) {
29349 if (PyErr_Occurred()) goto bad;
29350 return 0;
29351 }
29352 if (pkey && pvalue) {
29353 *pkey = __Pyx_PySequence_ITEM(next, 0);
29354 if (unlikely(*pkey)) goto bad;
29355 *pvalue = __Pyx_PySequence_ITEM(next, 1);
29356 if (unlikely(*pvalue)) goto bad;
29357 Py_DECREF(next);
29358 } else if (pkey) {
29359 *pkey = next;
29360 } else {
29361 assert(pvalue);
29362 *pvalue = next;
29363 }
29364 return 1;
29365 bad:
29366 Py_XDECREF(next);
29367#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
29368 PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef");
29369#else
29370 PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
29371#endif
29372 if (pkey) *pkey = NULL;
29373 if (pvalue) *pvalue = NULL;
29374 return 0;
29375}
29376#else // !CYTHON_AVOID_BORROWED_REFS
29377static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) {
29378 int result = PyDict_Next(p, ppos, pkey, pvalue);
29379 if (likely(result == 1)) {
29380 if (pkey) Py_INCREF(*pkey);
29381 if (pvalue) Py_INCREF(*pvalue);
29382 }
29383 return result;
29384}
29385#endif
29386
29387/* RaiseDoubleKeywords (used by ParseKeywordsImpl) */
29388static void __Pyx_RaiseDoubleKeywordsError(
29389 const char* func_name,
29390 PyObject* kw_name)
29391{
29392 PyErr_Format(PyExc_TypeError,
29393 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
29394}
29395
29396/* CallUnboundCMethod2 */
29397#if CYTHON_COMPILING_IN_CPYTHON
29398static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
29399 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
29400 if (likely(was_initialized == 2 && cfunc->func)) {
29401 PyObject *args[2] = {arg1, arg2};
29402 if (cfunc->flag == METH_FASTCALL) {
29403 return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
29404 }
29405 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
29406 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
29407 }
29408#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
29409 else if (unlikely(was_initialized == 1)) {
29410 __Pyx_CachedCFunction tmp_cfunc = {
29411#ifndef __cplusplus
29412 0
29413#endif
29414 };
29415 tmp_cfunc.type = cfunc->type;
29416 tmp_cfunc.method_name = cfunc->method_name;
29417 return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
29418 }
29419#endif
29420 PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
29421 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
29422 return result;
29423}
29424#endif
29425static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
29426 if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
29427#if CYTHON_COMPILING_IN_CPYTHON
29428 if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
29429 PyObject *result = NULL;
29430 PyObject *args = PyTuple_New(2);
29431 if (unlikely(!args)) return NULL;
29432 Py_INCREF(arg1);
29433 PyTuple_SET_ITEM(args, 0, arg1);
29434 Py_INCREF(arg2);
29435 PyTuple_SET_ITEM(args, 1, arg2);
29436 if (cfunc->flag & METH_KEYWORDS)
29437 result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
29438 else
29439 result = __Pyx_CallCFunction(cfunc, self, args);
29440 Py_DECREF(args);
29441 return result;
29442 }
29443#endif
29444 {
29445 PyObject *args[4] = {NULL, self, arg1, arg2};
29446 return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
29447 }
29448}
29449
29450/* ParseKeywordsImpl (used by ParseKeywords) */
29451static int __Pyx_ValidateDuplicatePosArgs(
29452 PyObject *kwds,
29453 PyObject ** const argnames[],
29454 PyObject ** const *first_kw_arg,
29455 const char* function_name)
29456{
29457 PyObject ** const *name = argnames;
29458 while (name != first_kw_arg) {
29459 PyObject *key = **name;
29460 int found = PyDict_Contains(kwds, key);
29461 if (unlikely(found)) {
29462 if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
29463 goto bad;
29464 }
29465 name++;
29466 }
29467 return 0;
29468bad:
29469 return -1;
29470}
29471#if CYTHON_USE_UNICODE_INTERNALS
29472static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
29473 int kind;
29474 Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
29475 if (len != PyUnicode_GET_LENGTH(s2)) return 0;
29476 kind = PyUnicode_KIND(s1);
29477 if (kind != PyUnicode_KIND(s2)) return 0;
29478 const void *data1 = PyUnicode_DATA(s1);
29479 const void *data2 = PyUnicode_DATA(s2);
29480 return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0);
29481}
29482#endif
29483static int __Pyx_MatchKeywordArg_str(
29484 PyObject *key,
29485 PyObject ** const argnames[],
29486 PyObject ** const *first_kw_arg,
29487 size_t *index_found,
29488 const char *function_name)
29489{
29490 PyObject ** const *name;
29491 #if CYTHON_USE_UNICODE_INTERNALS
29492 Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
29493 if (unlikely(key_hash == -1)) {
29494 key_hash = PyObject_Hash(key);
29495 if (unlikely(key_hash == -1))
29496 goto bad;
29497 }
29498 #endif
29499 name = first_kw_arg;
29500 while (*name) {
29501 PyObject *name_str = **name;
29502 #if CYTHON_USE_UNICODE_INTERNALS
29503 if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
29504 *index_found = (size_t) (name - argnames);
29505 return 1;
29506 }
29507 #else
29508 #if CYTHON_ASSUME_SAFE_SIZE
29509 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
29510 #endif
29511 {
29512 int cmp = PyUnicode_Compare(name_str, key);
29513 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
29514 if (cmp == 0) {
29515 *index_found = (size_t) (name - argnames);
29516 return 1;
29517 }
29518 }
29519 #endif
29520 name++;
29521 }
29522 name = argnames;
29523 while (name != first_kw_arg) {
29524 PyObject *name_str = **name;
29525 #if CYTHON_USE_UNICODE_INTERNALS
29526 if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
29527 if (__Pyx_UnicodeKeywordsEqual(name_str, key))
29528 goto arg_passed_twice;
29529 }
29530 #else
29531 #if CYTHON_ASSUME_SAFE_SIZE
29532 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
29533 #endif
29534 {
29535 if (unlikely(name_str == key)) goto arg_passed_twice;
29536 int cmp = PyUnicode_Compare(name_str, key);
29537 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
29538 if (cmp == 0) goto arg_passed_twice;
29539 }
29540 #endif
29541 name++;
29542 }
29543 return 0;
29544arg_passed_twice:
29545 __Pyx_RaiseDoubleKeywordsError(function_name, key);
29546 goto bad;
29547bad:
29548 return -1;
29549}
29550static int __Pyx_MatchKeywordArg_nostr(
29551 PyObject *key,
29552 PyObject ** const argnames[],
29553 PyObject ** const *first_kw_arg,
29554 size_t *index_found,
29555 const char *function_name)
29556{
29557 PyObject ** const *name;
29558 if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type;
29559 name = first_kw_arg;
29560 while (*name) {
29561 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
29562 if (cmp == 1) {
29563 *index_found = (size_t) (name - argnames);
29564 return 1;
29565 }
29566 if (unlikely(cmp == -1)) goto bad;
29567 name++;
29568 }
29569 name = argnames;
29570 while (name != first_kw_arg) {
29571 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
29572 if (unlikely(cmp != 0)) {
29573 if (cmp == 1) goto arg_passed_twice;
29574 else goto bad;
29575 }
29576 name++;
29577 }
29578 return 0;
29579arg_passed_twice:
29580 __Pyx_RaiseDoubleKeywordsError(function_name, key);
29581 goto bad;
29582invalid_keyword_type:
29583 PyErr_Format(PyExc_TypeError,
29584 "%.200s() keywords must be strings", function_name);
29585 goto bad;
29586bad:
29587 return -1;
29588}
29589static CYTHON_INLINE int __Pyx_MatchKeywordArg(
29590 PyObject *key,
29591 PyObject ** const argnames[],
29592 PyObject ** const *first_kw_arg,
29593 size_t *index_found,
29594 const char *function_name)
29595{
29596 return likely(PyUnicode_CheckExact(key)) ?
29597 __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
29598 __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
29599}
29600static void __Pyx_RejectUnknownKeyword(
29601 PyObject *kwds,
29602 PyObject ** const argnames[],
29603 PyObject ** const *first_kw_arg,
29604 const char *function_name)
29605{
29606 #if CYTHON_AVOID_BORROWED_REFS
29607 PyObject *pos = NULL;
29608 #else
29609 Py_ssize_t pos = 0;
29610 #endif
29611 PyObject *key = NULL;
29612 __Pyx_BEGIN_CRITICAL_SECTION(kwds);
29613 #if CYTHON_AVOID_BORROWED_REFS
29614 while (__Pyx_PyDict_NextRef(kwds, &pos, &key, NULL))
29615 #else
29616 (void) __Pyx_PyDict_NextRef;
29617 while (PyDict_Next(kwds, &pos, &key, NULL))
29618 #endif
29619 {
29620 PyObject** const *name = first_kw_arg;
29621 while (*name && (**name != key)) name++;
29622 if (!*name) {
29623 size_t index_found = 0;
29624 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
29625 if (cmp != 1) {
29626 if (cmp == 0) {
29627 PyErr_Format(PyExc_TypeError,
29628 "%s() got an unexpected keyword argument '%U'",
29629 function_name, key);
29630 }
29631 #if CYTHON_AVOID_BORROWED_REFS
29632 Py_DECREF(key);
29633 #endif
29634 break;
29635 }
29636 }
29637 #if CYTHON_AVOID_BORROWED_REFS
29638 Py_DECREF(key);
29639 #endif
29640 }
29641 __Pyx_END_CRITICAL_SECTION();
29642 #if CYTHON_AVOID_BORROWED_REFS
29643 Py_XDECREF(pos);
29644 #endif
29645 assert(PyErr_Occurred());
29646}
29647static int __Pyx_ParseKeywordDict(
29648 PyObject *kwds,
29649 PyObject ** const argnames[],
29650 PyObject *values[],
29651 Py_ssize_t num_pos_args,
29652 Py_ssize_t num_kwargs,
29653 const char* function_name,
29654 int ignore_unknown_kwargs)
29655{
29656 PyObject** const *name;
29657 PyObject** const *first_kw_arg = argnames + num_pos_args;
29658 Py_ssize_t extracted = 0;
29659#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
29660 if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
29661#endif
29662 name = first_kw_arg;
29663 while (*name && num_kwargs > extracted) {
29664 PyObject * key = **name;
29665 PyObject *value;
29666 int found = 0;
29667 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
29668 found = PyDict_GetItemRef(kwds, key, &value);
29669 #else
29670 value = PyDict_GetItemWithError(kwds, key);
29671 if (value) {
29672 Py_INCREF(value);
29673 found = 1;
29674 } else {
29675 if (unlikely(PyErr_Occurred())) goto bad;
29676 }
29677 #endif
29678 if (found) {
29679 if (unlikely(found < 0)) goto bad;
29680 values[name-argnames] = value;
29681 extracted++;
29682 }
29683 name++;
29684 }
29685 if (num_kwargs > extracted) {
29686 if (ignore_unknown_kwargs) {
29687 if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
29688 goto bad;
29689 } else {
29690 __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
29691 goto bad;
29692 }
29693 }
29694 return 0;
29695bad:
29696 return -1;
29697}
29698static int __Pyx_ParseKeywordDictToDict(
29699 PyObject *kwds,
29700 PyObject ** const argnames[],
29701 PyObject *kwds2,
29702 PyObject *values[],
29703 Py_ssize_t num_pos_args,
29704 const char* function_name)
29705{
29706 PyObject** const *name;
29707 PyObject** const *first_kw_arg = argnames + num_pos_args;
29708 Py_ssize_t len;
29709#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
29710 if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
29711#endif
29712 if (PyDict_Update(kwds2, kwds) < 0) goto bad;
29713 name = first_kw_arg;
29714 while (*name) {
29715 PyObject *key = **name;
29716 PyObject *value;
29717#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
29718 int found = PyDict_Pop(kwds2, key, &value);
29719 if (found) {
29720 if (unlikely(found < 0)) goto bad;
29721 values[name-argnames] = value;
29722 }
29723#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
29724 int found = PyDict_GetItemRef(kwds2, key, &value);
29725 if (found) {
29726 if (unlikely(found < 0)) goto bad;
29727 values[name-argnames] = value;
29728 if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad;
29729 }
29730#else
29731 #if CYTHON_COMPILING_IN_CPYTHON
29732 value = _PyDict_Pop(kwds2, key, kwds2);
29733 #else
29734 value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
29735 #endif
29736 if (value == kwds2) {
29737 Py_DECREF(value);
29738 } else {
29739 if (unlikely(!value)) goto bad;
29740 values[name-argnames] = value;
29741 }
29742#endif
29743 name++;
29744 }
29745 len = PyDict_Size(kwds2);
29746 if (len > 0) {
29747 return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
29748 } else if (unlikely(len == -1)) {
29749 goto bad;
29750 }
29751 return 0;
29752bad:
29753 return -1;
29754}
29755static int __Pyx_ParseKeywordsTuple(
29756 PyObject *kwds,
29757 PyObject * const *kwvalues,
29758 PyObject ** const argnames[],
29759 PyObject *kwds2,
29760 PyObject *values[],
29761 Py_ssize_t num_pos_args,
29762 Py_ssize_t num_kwargs,
29763 const char* function_name,
29764 int ignore_unknown_kwargs)
29765{
29766 PyObject *key = NULL;
29767 PyObject** const * name;
29768 PyObject** const *first_kw_arg = argnames + num_pos_args;
29769 for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
29770#if CYTHON_AVOID_BORROWED_REFS
29771 key = __Pyx_PySequence_ITEM(kwds, pos);
29772#else
29773 key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
29774#endif
29775#if !CYTHON_ASSUME_SAFE_MACROS
29776 if (unlikely(!key)) goto bad;
29777#endif
29778 name = first_kw_arg;
29779 while (*name && (**name != key)) name++;
29780 if (*name) {
29781 PyObject *value = kwvalues[pos];
29782 values[name-argnames] = __Pyx_NewRef(value);
29783 } else {
29784 size_t index_found = 0;
29785 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
29786 if (cmp == 1) {
29787 PyObject *value = kwvalues[pos];
29788 values[index_found] = __Pyx_NewRef(value);
29789 } else {
29790 if (unlikely(cmp == -1)) goto bad;
29791 if (kwds2) {
29792 PyObject *value = kwvalues[pos];
29793 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
29794 } else if (!ignore_unknown_kwargs) {
29795 goto invalid_keyword;
29796 }
29797 }
29798 }
29799 #if CYTHON_AVOID_BORROWED_REFS
29800 Py_DECREF(key);
29801 key = NULL;
29802 #endif
29803 }
29804 return 0;
29805invalid_keyword:
29806 PyErr_Format(PyExc_TypeError,
29807 "%s() got an unexpected keyword argument '%U'",
29808 function_name, key);
29809 goto bad;
29810bad:
29811 #if CYTHON_AVOID_BORROWED_REFS
29812 Py_XDECREF(key);
29813 #endif
29814 return -1;
29815}
29816
29817/* ParseKeywords */
29818static int __Pyx_ParseKeywords(
29819 PyObject *kwds,
29820 PyObject * const *kwvalues,
29821 PyObject ** const argnames[],
29822 PyObject *kwds2,
29823 PyObject *values[],
29824 Py_ssize_t num_pos_args,
29825 Py_ssize_t num_kwargs,
29826 const char* function_name,
29827 int ignore_unknown_kwargs)
29828{
29829 if (CYTHON_VECTORCALL && likely(PyTuple_Check(kwds)))
29830 return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
29831 else if (kwds2)
29832 return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
29833 else
29834 return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
29835}
29836
29837/* RaiseArgTupleInvalid */
29838static void __Pyx_RaiseArgtupleInvalid(
29839 const char* func_name,
29840 int exact,
29841 Py_ssize_t num_min,
29842 Py_ssize_t num_max,
29843 Py_ssize_t num_found)
29844{
29845 Py_ssize_t num_expected;
29846 const char *more_or_less;
29847 if (num_found < num_min) {
29848 num_expected = num_min;
29849 more_or_less = "at least";
29850 } else {
29851 num_expected = num_max;
29852 more_or_less = "at most";
29853 }
29854 if (exact) {
29855 more_or_less = "exactly";
29856 }
29857 PyErr_Format(PyExc_TypeError,
29858 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
29859 func_name, more_or_less, num_expected,
29860 (num_expected == 1) ? "" : "s", num_found);
29861}
29862
29863/* ArgTypeTestError (used by ArgTypeTest) */
29864static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type, const char *name, int exact)
29865{
29866 __Pyx_TypeName type_name;
29867 __Pyx_TypeName obj_type_name;
29868 PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode;
29869 int from_annotation_subclass = 0;
29870 if (unlikely(!type)) {
29871 PyErr_SetString(PyExc_SystemError, "Missing type object");
29872 return;
29873 } else if (exact == 2) {
29874 if (__Pyx_TypeCheck(obj, type)) {
29875 from_annotation_subclass = 1;
29876 extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately;
29877 }
29878 }
29879 type_name = __Pyx_PyType_GetFullyQualifiedName(type);
29880 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
29881 if (unlikely(!type_name)) return;
29882 #endif
29883 obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
29884 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
29885 if (unlikely(!obj_type_name)) goto obj_type_name_failed;
29886 #endif
29887 PyErr_Format(PyExc_TypeError,
29888 "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")"
29889#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
29890 "%s%U"
29891#endif
29892 , name, type_name, obj_type_name
29893#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
29894 , (from_annotation_subclass ? ". " : ""), extra_info
29895#endif
29896 );
29897#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
29898 if (exact == 2 && from_annotation_subclass) {
29899 PyObject *res;
29900 PyObject *vargs[2];
29901 vargs[0] = PyErr_GetRaisedException();
29902 vargs[1] = extra_info;
29903 res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL);
29904 Py_XDECREF(res);
29905 PyErr_SetRaisedException(vargs[0]);
29906 }
29907#endif
29908 __Pyx_DECREF_TypeName(obj_type_name);
29909#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
29910obj_type_name_failed:
29911#endif
29912 __Pyx_DECREF_TypeName(type_name);
29913 return;
29914}
29915
29916/* ArgTypeTest */
29917static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) {
29918 if (likely(Py_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None))))
29919 return 1;
29920 if (!exact && likely(type) && likely(__Pyx_TypeCheck(obj, type)))
29921 return 1;
29922 __Pyx_ArgTypeError(obj, type, name, exact);
29923 return 0;
29924}
29925
29926/* PyErrFetchRestore (used by GivenExceptionMatches) */
29927#if CYTHON_FAST_THREAD_STATE
29928static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
29929#if PY_VERSION_HEX >= 0x030C00A6
29930 PyObject *tmp_value;
29931 assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
29932 if (value) {
29933 #if CYTHON_COMPILING_IN_CPYTHON
29934 if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
29935 #endif
29936 PyException_SetTraceback(value, tb);
29937 }
29938 tmp_value = tstate->current_exception;
29939 tstate->current_exception = value;
29940 Py_XDECREF(tmp_value);
29941 Py_XDECREF(type);
29942 Py_XDECREF(tb);
29943#else
29944 PyObject *tmp_type, *tmp_value, *tmp_tb;
29945 tmp_type = tstate->curexc_type;
29946 tmp_value = tstate->curexc_value;
29947 tmp_tb = tstate->curexc_traceback;
29948 tstate->curexc_type = type;
29949 tstate->curexc_value = value;
29950 tstate->curexc_traceback = tb;
29951 Py_XDECREF(tmp_type);
29952 Py_XDECREF(tmp_value);
29953 Py_XDECREF(tmp_tb);
29954#endif
29955}
29956static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
29957#if PY_VERSION_HEX >= 0x030C00A6
29958 PyObject* exc_value;
29959 exc_value = tstate->current_exception;
29960 tstate->current_exception = 0;
29961 *value = exc_value;
29962 *type = NULL;
29963 *tb = NULL;
29964 if (exc_value) {
29965 *type = (PyObject*) Py_TYPE(exc_value);
29966 Py_INCREF(*type);
29967 #if CYTHON_COMPILING_IN_CPYTHON
29968 *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
29969 Py_XINCREF(*tb);
29970 #else
29971 *tb = PyException_GetTraceback(exc_value);
29972 #endif
29973 }
29974#else
29975 *type = tstate->curexc_type;
29976 *value = tstate->curexc_value;
29977 *tb = tstate->curexc_traceback;
29978 tstate->curexc_type = 0;
29979 tstate->curexc_value = 0;
29980 tstate->curexc_traceback = 0;
29981#endif
29982}
29983#endif
29984
29985/* GivenExceptionMatches (used by PyErrExceptionMatches) */
29986#if CYTHON_COMPILING_IN_CPYTHON
29987static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
29988 if (exc_type1) {
29989 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
29990 } else {
29991 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
29992 }
29993}
29994static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
29995 Py_ssize_t i, n;
29996 assert(PyExceptionClass_Check(exc_type));
29997 n = PyTuple_GET_SIZE(tuple);
29998 for (i=0; i<n; i++) {
29999 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
30000 }
30001 for (i=0; i<n; i++) {
30002 PyObject *t = PyTuple_GET_ITEM(tuple, i);
30003 if (likely(PyExceptionClass_Check(t))) {
30004 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
30005 } else {
30006 }
30007 }
30008 return 0;
30009}
30010static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
30011 if (likely(err == exc_type)) return 1;
30012 if (likely(PyExceptionClass_Check(err))) {
30013 if (likely(PyExceptionClass_Check(exc_type))) {
30014 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
30015 } else if (likely(PyTuple_Check(exc_type))) {
30016 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
30017 } else {
30018 }
30019 }
30020 return PyErr_GivenExceptionMatches(err, exc_type);
30021}
30022static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
30023 assert(PyExceptionClass_Check(exc_type1));
30024 assert(PyExceptionClass_Check(exc_type2));
30025 if (likely(err == exc_type1 || err == exc_type2)) return 1;
30026 if (likely(PyExceptionClass_Check(err))) {
30027 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
30028 }
30029 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
30030}
30031#endif
30032
30033/* PyErrExceptionMatches (used by PyObjectGetAttrStrNoError) */
30034#if CYTHON_FAST_THREAD_STATE
30035static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
30036 Py_ssize_t i, n;
30037 n = PyTuple_GET_SIZE(tuple);
30038 for (i=0; i<n; i++) {
30039 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
30040 }
30041 for (i=0; i<n; i++) {
30042 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
30043 }
30044 return 0;
30045}
30046static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
30047 int result;
30048 PyObject *exc_type;
30049#if PY_VERSION_HEX >= 0x030C00A6
30050 PyObject *current_exception = tstate->current_exception;
30051 if (unlikely(!current_exception)) return 0;
30052 exc_type = (PyObject*) Py_TYPE(current_exception);
30053 if (exc_type == err) return 1;
30054#else
30055 exc_type = tstate->curexc_type;
30056 if (exc_type == err) return 1;
30057 if (unlikely(!exc_type)) return 0;
30058#endif
30059 #if CYTHON_AVOID_BORROWED_REFS
30060 Py_INCREF(exc_type);
30061 #endif
30062 if (unlikely(PyTuple_Check(err))) {
30063 result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
30064 } else {
30065 result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
30066 }
30067 #if CYTHON_AVOID_BORROWED_REFS
30068 Py_DECREF(exc_type);
30069 #endif
30070 return result;
30071}
30072#endif
30073
30074/* PyObjectGetAttrStrNoError (used by GetBuiltinName) */
30075#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
30076static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
30077 __Pyx_PyThreadState_declare
30078 __Pyx_PyThreadState_assign
30079 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
30080 __Pyx_PyErr_Clear();
30081}
30082#endif
30083static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
30084 PyObject *result;
30085#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
30086 (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
30087 return result;
30088#else
30089#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
30090 PyTypeObject* tp = Py_TYPE(obj);
30091 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
30092 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
30093 }
30094#endif
30095 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
30096 if (unlikely(!result)) {
30097 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
30098 }
30099 return result;
30100#endif
30101}
30102
30103/* GetBuiltinName */
30104static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
30105 PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name);
30106 if (unlikely(!result) && !PyErr_Occurred()) {
30107 PyErr_Format(PyExc_NameError,
30108 "name '%U' is not defined", name);
30109 }
30110 return result;
30111}
30112
30113/* PyObjectFastCallMethod */
30114#if !CYTHON_VECTORCALL
30115static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) {
30116 PyObject *result;
30117 switch (__Pyx_PyVectorcall_NARGS(nargsf)) {
30118 case 1:
30119 return PyObject_CallMethodObjArgs(args[0], name, NULL);
30120 case 2:
30121 return PyObject_CallMethodObjArgs(args[0], name, args[1], NULL);
30122 case 3:
30123 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], NULL);
30124 case 4:
30125 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], NULL);
30126 case 5:
30127 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], args[4], NULL);
30128 }
30129 PyObject *attr = PyObject_GetAttr(args[0], name);
30130 if (unlikely(!attr))
30131 return NULL;
30132 result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1);
30133 Py_DECREF(attr);
30134 return result;
30135}
30136#endif
30137
30138/* FormatTypeName (used by RaiseErrorWithObjectType1) */
30139#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
30140static __Pyx_TypeName
30141__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
30142{
30143 PyObject *module = NULL, *name = NULL, *result = NULL;
30144 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
30145 name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
30146 __pyx_mstate_global->__pyx_n_u_qualname);
30147 #else
30148 name = PyType_GetQualName(tp);
30149 #endif
30150 if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad;
30151 module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
30152 __pyx_mstate_global->__pyx_n_u_module);
30153 if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad;
30154 if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) {
30155 result = name;
30156 name = NULL;
30157 goto done;
30158 }
30159 result = PyUnicode_FromFormat("%U.%U", module, name);
30160 if (unlikely(result == NULL)) goto bad;
30161 done:
30162 Py_XDECREF(name);
30163 Py_XDECREF(module);
30164 return result;
30165 bad:
30166 PyErr_Clear();
30167 if (name) {
30168 result = name;
30169 name = NULL;
30170 } else {
30171 result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u_);
30172 }
30173 goto done;
30174}
30175#endif
30176
30177/* RaiseErrorWithObjectType1 (used by RaiseUnexpectedTypeError) */
30178static void __Pyx_RaiseErrorWithType1(PyObject* exc_type, const char* message, const char *arg, PyTypeObject *type_obj) {
30179 __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
30180 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
30181 if (unlikely(!type_name)) return;
30182 #endif
30183 PyErr_Format(exc_type, message, arg, type_name);
30184 __Pyx_DECREF_TypeName(type_name);
30185}
30186
30187/* RaiseUnexpectedTypeError */
30188static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) {
30189 __Pyx_RaiseTypeErrorWithObjectType1(
30190 "Expected %.42s, got " __Pyx_FMT_TYPENAME,
30191 expected, obj);
30192 return 0;
30193}
30194
30195/* RaiseException */
30196static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
30197 PyObject* owned_instance = NULL;
30198 if (tb == Py_None) {
30199 tb = 0;
30200 } else if (tb && !PyTraceBack_Check(tb)) {
30201 PyErr_SetString(PyExc_TypeError,
30202 "raise: arg 3 must be a traceback or None");
30203 goto bad;
30204 }
30205 if (value == Py_None)
30206 value = 0;
30207 if (PyExceptionInstance_Check(type)) {
30208 if (value) {
30209 PyErr_SetString(PyExc_TypeError,
30210 "instance exception may not have a separate value");
30211 goto bad;
30212 }
30213 value = type;
30214 type = (PyObject*) Py_TYPE(value);
30215 } else if (PyExceptionClass_Check(type)) {
30216 PyObject *instance_class = NULL;
30217 if (value && PyExceptionInstance_Check(value)) {
30218 instance_class = (PyObject*) Py_TYPE(value);
30219 if (instance_class != type) {
30220 int is_subclass = PyObject_IsSubclass(instance_class, type);
30221 if (!is_subclass) {
30222 instance_class = NULL;
30223 } else if (unlikely(is_subclass == -1)) {
30224 goto bad;
30225 } else {
30226 type = instance_class;
30227 }
30228 }
30229 }
30230 if (!instance_class) {
30231 PyObject *args;
30232 if (!value)
30233 args = PyTuple_New(0);
30234 else if (PyTuple_Check(value)) {
30235 Py_INCREF(value);
30236 args = value;
30237 } else
30238 args = PyTuple_Pack(1, value);
30239 if (!args)
30240 goto bad;
30241 owned_instance = PyObject_Call(type, args, NULL);
30242 Py_DECREF(args);
30243 if (!owned_instance)
30244 goto bad;
30245 value = owned_instance;
30246 if (!PyExceptionInstance_Check(value)) {
30247 PyErr_Format(PyExc_TypeError,
30248 "calling %R should have returned an instance of "
30249 "BaseException, not %R",
30250 type, Py_TYPE(value));
30251 goto bad;
30252 }
30253 }
30254 } else {
30255 PyErr_SetString(PyExc_TypeError,
30256 "raise: exception class must be a subclass of BaseException");
30257 goto bad;
30258 }
30259 if (cause) {
30260 PyObject *fixed_cause;
30261 if (cause == Py_None) {
30262 fixed_cause = NULL;
30263 } else if (PyExceptionClass_Check(cause)) {
30264 fixed_cause = PyObject_CallObject(cause, NULL);
30265 if (fixed_cause == NULL)
30266 goto bad;
30267 } else if (PyExceptionInstance_Check(cause)) {
30268 fixed_cause = cause;
30269 Py_INCREF(fixed_cause);
30270 } else {
30271 PyErr_SetString(PyExc_TypeError,
30272 "exception causes must derive from "
30273 "BaseException");
30274 goto bad;
30275 }
30276 PyException_SetCause(value, fixed_cause);
30277 }
30278 PyErr_SetObject(type, value);
30279 if (tb) {
30280#if PY_VERSION_HEX >= 0x030C00A6
30281 PyException_SetTraceback(value, tb);
30282#elif CYTHON_FAST_THREAD_STATE
30283 PyThreadState *tstate = __Pyx_PyThreadState_Current;
30284 PyObject* tmp_tb = tstate->curexc_traceback;
30285 if (tb != tmp_tb) {
30286 Py_INCREF(tb);
30287 tstate->curexc_traceback = tb;
30288 Py_XDECREF(tmp_tb);
30289 }
30290#else
30291 PyObject *tmp_type, *tmp_value, *tmp_tb;
30292 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
30293 Py_INCREF(tb);
30294 PyErr_Restore(tmp_type, tmp_value, tb);
30295 Py_XDECREF(tmp_tb);
30296#endif
30297 }
30298bad:
30299 Py_XDECREF(owned_instance);
30300 return;
30301}
30302
30303/* CIntToDigits (used by CIntToPyUnicode) */
30304static const char DIGIT_PAIRS_10[2*10*10+1] = {
30305 "00010203040506070809"
30306 "10111213141516171819"
30307 "20212223242526272829"
30308 "30313233343536373839"
30309 "40414243444546474849"
30310 "50515253545556575859"
30311 "60616263646566676869"
30312 "70717273747576777879"
30313 "80818283848586878889"
30314 "90919293949596979899"
30315};
30316static const char DIGIT_PAIRS_8[2*8*8+1] = {
30317 "0001020304050607"
30318 "1011121314151617"
30319 "2021222324252627"
30320 "3031323334353637"
30321 "4041424344454647"
30322 "5051525354555657"
30323 "6061626364656667"
30324 "7071727374757677"
30325};
30326static const char DIGITS_HEX[2*16+1] = {
30327 "0123456789abcdef"
30328 "0123456789ABCDEF"
30329};
30330
30331/* BuildPyUnicode (used by COrdinalToPyUnicode) */
30332static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const char* chars, int clength,
30333 int prepend_sign, char padding_char) {
30334 PyObject *uval;
30335 Py_ssize_t uoffset = ulength - clength;
30336#if CYTHON_USE_UNICODE_INTERNALS
30337 Py_ssize_t i;
30338 void *udata;
30339 uval = PyUnicode_New(ulength, 127);
30340 if (unlikely(!uval)) return NULL;
30341 udata = PyUnicode_DATA(uval);
30342 if (uoffset > 0) {
30343 i = 0;
30344 if (prepend_sign) {
30345 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
30346 i++;
30347 }
30348 for (; i < uoffset; i++) {
30349 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
30350 }
30351 }
30352 for (i=0; i < clength; i++) {
30353 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
30354 }
30355#else
30356 {
30357 PyObject *sign = NULL, *padding = NULL;
30358 uval = NULL;
30359 if (uoffset > 0) {
30360 prepend_sign = !!prepend_sign;
30361 if (uoffset > prepend_sign) {
30362 padding = PyUnicode_FromOrdinal(padding_char);
30363 if (likely(padding) && uoffset > prepend_sign + 1) {
30364 PyObject *tmp = PySequence_Repeat(padding, uoffset - prepend_sign);
30365 Py_DECREF(padding);
30366 padding = tmp;
30367 }
30368 if (unlikely(!padding)) goto done_or_error;
30369 }
30370 if (prepend_sign) {
30371 sign = PyUnicode_FromOrdinal('-');
30372 if (unlikely(!sign)) goto done_or_error;
30373 }
30374 }
30375 uval = PyUnicode_DecodeASCII(chars, clength, NULL);
30376 if (likely(uval) && padding) {
30377 PyObject *tmp = PyUnicode_Concat(padding, uval);
30378 Py_DECREF(uval);
30379 uval = tmp;
30380 }
30381 if (likely(uval) && sign) {
30382 PyObject *tmp = PyUnicode_Concat(sign, uval);
30383 Py_DECREF(uval);
30384 uval = tmp;
30385 }
30386done_or_error:
30387 Py_XDECREF(padding);
30388 Py_XDECREF(sign);
30389 }
30390#endif
30391 return uval;
30392}
30393
30394/* COrdinalToPyUnicode (used by CIntToPyUnicode) */
30395static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value) {
30396 return value <= 1114111;
30397}
30398static PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t ulength, char padding_char) {
30399 Py_ssize_t padding_length = ulength - 1;
30400 if (likely((padding_length <= 250) && (value < 0xD800 || value > 0xDFFF))) {
30401 char chars[256];
30402 if (value <= 255) {
30403 memset(chars, padding_char, (size_t) padding_length);
30404 chars[ulength-1] = (char) value;
30405 return PyUnicode_DecodeLatin1(chars, ulength, NULL);
30406 }
30407 char *cpos = chars + sizeof(chars);
30408 if (value < 0x800) {
30409 *--cpos = (char) (0x80 | (value & 0x3f));
30410 value >>= 6;
30411 *--cpos = (char) (0xc0 | (value & 0x1f));
30412 } else if (value < 0x10000) {
30413 *--cpos = (char) (0x80 | (value & 0x3f));
30414 value >>= 6;
30415 *--cpos = (char) (0x80 | (value & 0x3f));
30416 value >>= 6;
30417 *--cpos = (char) (0xe0 | (value & 0x0f));
30418 } else {
30419 *--cpos = (char) (0x80 | (value & 0x3f));
30420 value >>= 6;
30421 *--cpos = (char) (0x80 | (value & 0x3f));
30422 value >>= 6;
30423 *--cpos = (char) (0x80 | (value & 0x3f));
30424 value >>= 6;
30425 *--cpos = (char) (0xf0 | (value & 0x07));
30426 }
30427 cpos -= padding_length;
30428 memset(cpos, padding_char, (size_t) padding_length);
30429 return PyUnicode_DecodeUTF8(cpos, chars + sizeof(chars) - cpos, NULL);
30430 }
30431 if (value <= 127 && CYTHON_USE_UNICODE_INTERNALS) {
30432 const char chars[1] = {(char) value};
30433 return __Pyx_PyUnicode_BuildFromAscii(ulength, chars, 1, 0, padding_char);
30434 }
30435 {
30436 PyObject *uchar, *padding_uchar, *padding, *result;
30437 padding_uchar = PyUnicode_FromOrdinal(padding_char);
30438 if (unlikely(!padding_uchar)) return NULL;
30439 padding = PySequence_Repeat(padding_uchar, padding_length);
30440 Py_DECREF(padding_uchar);
30441 if (unlikely(!padding)) return NULL;
30442 uchar = PyUnicode_FromOrdinal(value);
30443 if (unlikely(!uchar)) {
30444 Py_DECREF(padding);
30445 return NULL;
30446 }
30447 result = PyUnicode_Concat(padding, uchar);
30448 Py_DECREF(padding);
30449 Py_DECREF(uchar);
30450 return result;
30451 }
30452}
30453
30454/* CIntToPyUnicode */
30455static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char) {
30456#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30457#pragma GCC diagnostic push
30458#pragma GCC diagnostic ignored "-Wconversion"
30459#endif
30460 const int neg_one = (int) -1, const_zero = (int) 0;
30461#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30462#pragma GCC diagnostic pop
30463#endif
30464 const int is_unsigned = neg_one > const_zero;
30465 if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
30466 !(sizeof(value) <= 2 || value & ~ (int) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
30467 PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
30468 return NULL;
30469 }
30470 if (width <= 1) {
30471 return PyUnicode_FromOrdinal((int) value);
30472 }
30473 return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
30474}
30475static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) {
30476 char digits[sizeof(int)*3+2];
30477 char *dpos, *end = digits + sizeof(int)*3+2;
30478 const char *hex_digits = DIGITS_HEX;
30479 Py_ssize_t length, ulength;
30480 int prepend_sign, last_one_off;
30481 int remaining;
30482#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30483#pragma GCC diagnostic push
30484#pragma GCC diagnostic ignored "-Wconversion"
30485#endif
30486 const int neg_one = (int) -1, const_zero = (int) 0;
30487#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30488#pragma GCC diagnostic pop
30489#endif
30490 const int is_unsigned = neg_one > const_zero;
30491 if (format_char == 'X') {
30492 hex_digits += 16;
30493 format_char = 'x';
30494 }
30495 remaining = value;
30496 last_one_off = 0;
30497 dpos = end;
30498 do {
30499 int digit_pos;
30500 switch (format_char) {
30501 case 'o':
30502 digit_pos = abs((int)(remaining % (8*8)));
30503 remaining = (int) (remaining / (8*8));
30504 dpos -= 2;
30505 memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
30506 last_one_off = (digit_pos < 8);
30507 break;
30508 case 'd':
30509 digit_pos = abs((int)(remaining % (10*10)));
30510 remaining = (int) (remaining / (10*10));
30511 dpos -= 2;
30512 memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
30513 last_one_off = (digit_pos < 10);
30514 break;
30515 case 'x':
30516 *(--dpos) = hex_digits[abs((int)(remaining % 16))];
30517 remaining = (int) (remaining / 16);
30518 break;
30519 default:
30520 assert(0);
30521 break;
30522 }
30523 } while (unlikely(remaining != 0));
30524 assert(!last_one_off || *dpos == '0');
30525 dpos += last_one_off;
30526 length = end - dpos;
30527 ulength = length;
30528 prepend_sign = 0;
30529 if (!is_unsigned && value <= neg_one) {
30530 if (padding_char == ' ' || width <= length + 1) {
30531 *(--dpos) = '-';
30532 ++length;
30533 } else {
30534 prepend_sign = 1;
30535 }
30536 ++ulength;
30537 }
30538 if (width > ulength) {
30539 ulength = width;
30540 }
30541 if (ulength == 1) {
30542 return PyUnicode_FromOrdinal(*dpos);
30543 }
30544 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
30545}
30546
30547/* CIntToPyUnicode */
30548static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char) {
30549#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30550#pragma GCC diagnostic push
30551#pragma GCC diagnostic ignored "-Wconversion"
30552#endif
30553 const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
30554#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30555#pragma GCC diagnostic pop
30556#endif
30557 const int is_unsigned = neg_one > const_zero;
30558 if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
30559 !(sizeof(value) <= 2 || value & ~ (Py_ssize_t) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
30560 PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
30561 return NULL;
30562 }
30563 if (width <= 1) {
30564 return PyUnicode_FromOrdinal((int) value);
30565 }
30566 return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
30567}
30568static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) {
30569 char digits[sizeof(Py_ssize_t)*3+2];
30570 char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2;
30571 const char *hex_digits = DIGITS_HEX;
30572 Py_ssize_t length, ulength;
30573 int prepend_sign, last_one_off;
30574 Py_ssize_t remaining;
30575#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30576#pragma GCC diagnostic push
30577#pragma GCC diagnostic ignored "-Wconversion"
30578#endif
30579 const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
30580#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30581#pragma GCC diagnostic pop
30582#endif
30583 const int is_unsigned = neg_one > const_zero;
30584 if (format_char == 'X') {
30585 hex_digits += 16;
30586 format_char = 'x';
30587 }
30588 remaining = value;
30589 last_one_off = 0;
30590 dpos = end;
30591 do {
30592 int digit_pos;
30593 switch (format_char) {
30594 case 'o':
30595 digit_pos = abs((int)(remaining % (8*8)));
30596 remaining = (Py_ssize_t) (remaining / (8*8));
30597 dpos -= 2;
30598 memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
30599 last_one_off = (digit_pos < 8);
30600 break;
30601 case 'd':
30602 digit_pos = abs((int)(remaining % (10*10)));
30603 remaining = (Py_ssize_t) (remaining / (10*10));
30604 dpos -= 2;
30605 memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
30606 last_one_off = (digit_pos < 10);
30607 break;
30608 case 'x':
30609 *(--dpos) = hex_digits[abs((int)(remaining % 16))];
30610 remaining = (Py_ssize_t) (remaining / 16);
30611 break;
30612 default:
30613 assert(0);
30614 break;
30615 }
30616 } while (unlikely(remaining != 0));
30617 assert(!last_one_off || *dpos == '0');
30618 dpos += last_one_off;
30619 length = end - dpos;
30620 ulength = length;
30621 prepend_sign = 0;
30622 if (!is_unsigned && value <= neg_one) {
30623 if (padding_char == ' ' || width <= length + 1) {
30624 *(--dpos) = '-';
30625 ++length;
30626 } else {
30627 prepend_sign = 1;
30628 }
30629 ++ulength;
30630 }
30631 if (width > ulength) {
30632 ulength = width;
30633 }
30634 if (ulength == 1) {
30635 return PyUnicode_FromOrdinal(*dpos);
30636 }
30637 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
30638}
30639
30640/* JoinPyUnicode */
30641static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, int kind) {
30642#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH && CYTHON_USE_UNICODE_INTERNALS
30643 PyObject *result_uval;
30644 int result_ukind, kind_shift;
30645 Py_ssize_t i, char_pos;
30646 void *result_udata;
30647 static const Py_UCS4 max_char[5] = {0x7fU, 0xffU, 0xffffU, 0xffffU, 0x10ffffU};
30648 assert (kind >= 0);
30649 if (kind > PyUnicode_4BYTE_KIND) kind = PyUnicode_4BYTE_KIND;
30650 result_uval = PyUnicode_New(result_ulength, max_char[kind]);
30651 if (unlikely(!result_uval)) return NULL;
30652 kind_shift = kind >> 1; // 0, 1, 2
30653 result_ukind = 1 << kind_shift; // 1, 2, 4
30654 result_udata = PyUnicode_DATA(result_uval);
30655 assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
30656 if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0))
30657 goto overflow;
30658 char_pos = 0;
30659 for (i=0; i < value_count; i++) {
30660 int ukind;
30661 Py_ssize_t ulength;
30662 void *udata;
30663 PyObject *uval = values[i];
30664 if (__Pyx_PyUnicode_READY(uval) == (-1))
30665 goto bad;
30666 ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
30667 #if !CYTHON_ASSUME_SAFE_SIZE
30668 if (unlikely(ulength < 0)) goto bad;
30669 #endif
30670 if (unlikely(!ulength))
30671 continue;
30672 if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
30673 goto overflow;
30674 ukind = __Pyx_PyUnicode_KIND(uval);
30675 udata = __Pyx_PyUnicode_DATA(uval);
30676 if (ukind == result_ukind) {
30677 memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
30678 } else {
30679 #if PY_VERSION_HEX >= 0x030d0000
30680 if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
30681 #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters)
30682 _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
30683 #else
30684 Py_ssize_t j;
30685 for (j=0; j < ulength; j++) {
30686 Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
30687 __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
30688 }
30689 #endif
30690 }
30691 char_pos += ulength;
30692 }
30693 return result_uval;
30694overflow:
30695 PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
30696bad:
30697 Py_DECREF(result_uval);
30698 return NULL;
30699#else
30700 Py_ssize_t i;
30701 PyObject *result = NULL;
30702 PyObject *value_tuple = PyTuple_New(value_count);
30703 if (unlikely(!value_tuple)) return NULL;
30704 CYTHON_UNUSED_VAR(kind);
30705 CYTHON_UNUSED_VAR(result_ulength);
30706 for (i=0; i<value_count; i++) {
30707 Py_INCREF(values[i]);
30708 if (__Pyx_PyTuple_SET_ITEM(value_tuple, i, values[i]) != (0)) goto bad;
30709 }
30710 result = PyUnicode_Join(__pyx_mstate_global->__pyx_empty_unicode, value_tuple);
30711bad:
30712 Py_DECREF(value_tuple);
30713 return result;
30714#endif
30715}
30716
30717/* UnicodeEqualsUCS4 (used by UnicodeEquals_uchar) */
30718#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL)
30719static CYTHON_INLINE int __Pyx__PyUnicode_EqualsUCS4(PyObject* s1, Py_UCS4 ch2, int equals) {
30720 Py_ssize_t length;
30721 Py_UCS4 ch1;
30722 int kind;
30723 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0)) goto bad;
30724 length = __Pyx_PyUnicode_GET_LENGTH(s1);
30725 #if !CYTHON_ASSUME_SAFE_SIZE
30726 if (unlikely(length < 0)) goto bad;
30727 #endif
30728 if (length != 1) goto return_ne;
30729 kind = PyUnicode_KIND(s1);
30730 if (ch2 < 256) {
30731 if (likely(kind == PyUnicode_1BYTE_KIND)) {
30732 ch1 = PyUnicode_1BYTE_DATA(s1)[0];
30733 } else if (kind == PyUnicode_2BYTE_KIND) {
30734 ch1 = PyUnicode_2BYTE_DATA(s1)[0];
30735 } else {
30736 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
30737 }
30738 } else if (ch2 < 65536) {
30739 if (kind == PyUnicode_2BYTE_KIND) {
30740 ch1 = PyUnicode_2BYTE_DATA(s1)[0];
30741 } else if (kind == PyUnicode_4BYTE_KIND) {
30742 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
30743 } else {
30744 goto return_ne;
30745 }
30746 } else {
30747 if (kind == PyUnicode_4BYTE_KIND){
30748 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
30749 } else {
30750 goto return_ne;
30751 }
30752 }
30753 if (ch1 == ch2) {
30754 goto return_eq;
30755 } else {
30756 goto return_ne;
30757 }
30758return_eq:
30759 return (equals == Py_EQ);
30760return_ne:
30761 return (equals == Py_NE);
30762bad:
30763 return -1;
30764}
30765#endif
30766
30767/* PyObjectCompare */
30768#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
30769#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
30770static CYTHON_INLINE int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
30771 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
30772 int result = PyUnicode_Equal(s1, s2);
30773 #if !CYTHON_COMPILING_IN_CPYTHON
30774 if (unlikely(result == -1)) return -1;
30775 #endif
30776 if (result == 0) goto __pyx_return_false; else goto __pyx_return_true;
30777 #else
30778 int result = PyUnicode_Compare(s1, s2);
30779 if (unlikely((result == -1) && PyErr_Occurred())) return -1;
30780 if (result == 0) goto __pyx_return_true; else goto __pyx_return_false;
30781 #endif
30782__pyx_return_true:
30783 return 1;
30784__pyx_return_false:
30785 return 0;
30786}
30787#endif
30788static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_object_str(PyObject *op1, PyObject *op2, int pyop) {
30789 CYTHON_UNUSED_VAR(pyop);
30790 if (unlikely(op2 == Py_None)) {
30791 if (op1 == Py_None) goto __pyx_return_true; else goto __pyx_richcmp;
30792 }
30793 if (PyFloat_CheckExact(op1)) {
30794 goto __pyx_richcmp;
30795 }
30796 if (PyLong_CheckExact(op1)) {
30797 if (op1 == op2) goto __pyx_return_true;
30798 goto __pyx_richcmp;
30799 }
30800
30801 if (likely(PyUnicode_CheckExact(op1))) {
30802 if (op1 == op2) goto __pyx_return_true;
30803 if (likely(op2 != Py_None)) {
30804 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
30805 }
30806 goto __pyx_richcmp;
30807 }
30808
30809 if ((0)) goto __pyx_richcmp;
30810 if ((0)) goto __pyx_return_true;
30811 if ((0)) goto __pyx_return_false;
30812__pyx_richcmp:
30813 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
30814__pyx_return_true:
30815 return 1;
30816__pyx_return_false:
30817 return 0;
30818}
30819
30820/* PyObjectCompare */
30821#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
30822#ifndef __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesEq
30823#define __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesEq
30824static CYTHON_INLINE PyObject* __Pyx_PyObject_ComparePyBytesPyBytesEq(PyObject* s1, PyObject* s2) {
30825 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
30826 const char *ps1, *ps2;
30827 Py_ssize_t length = PyBytes_GET_SIZE(s1);
30828 if (length != PyBytes_GET_SIZE(s2)) goto __pyx_return_false;
30829 ps1 = PyBytes_AS_STRING(s1);
30830 ps2 = PyBytes_AS_STRING(s2);
30831 #else
30832 char *ps1, *ps2;
30833 Py_ssize_t length, length2;
30834 if (unlikely(PyBytes_AsStringAndSize(s1, &ps1, &length) == -1)) return NULL;
30835 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1)) return NULL;
30836 if (length != length2) goto __pyx_return_false;
30837 #endif
30838 if (ps1[0] != ps2[0]) goto __pyx_return_false;
30839 if (length == 1) goto __pyx_return_true;
30840 {
30841 int cmp;
30842#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
30843 Py_hash_t hash1 = ((PyBytesObject*)s1)->ob_shash;
30844 Py_hash_t hash2 = ((PyBytesObject*)s2)->ob_shash;
30845 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) goto __pyx_return_false;
30846#endif
30847 cmp = memcmp(ps1, ps2, (size_t)length);
30848 if (cmp == 0) goto __pyx_return_true; else goto __pyx_return_false;
30849 }
30850__pyx_return_true:
30851 Py_RETURN_TRUE;
30852__pyx_return_false:
30853 Py_RETURN_FALSE;
30854}
30855#endif
30856#endif
30857#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
30858#ifndef __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesEq
30859#define __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesEq
30860static CYTHON_INLINE PyObject* __Pyx_PyObject_ComparePyByteArrayPyBytesEq(PyObject* s1, PyObject* s2) {
30861 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
30862 const char *ps1, *ps2;
30863 Py_ssize_t length = PyByteArray_GET_SIZE(s1);
30864 if (length != PyBytes_GET_SIZE(s2)) goto __pyx_return_false;
30865 ps1 = PyByteArray_AS_STRING(s1);
30866 ps2 = PyBytes_AS_STRING(s2);
30867 #else
30868 char *ps1, *ps2;
30869 Py_ssize_t length, length2;
30870 ps1 = __Pyx_PyByteArray_AsString(s1); if (unlikely(!ps1)) return NULL;
30871 length = __Pyx_PyByteArray_GET_SIZE(s1); if (unlikely(length == -1)) return NULL;
30872 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1)) return NULL;
30873 if (length != length2) goto __pyx_return_false;
30874 #endif
30875 if (length == 0) goto __pyx_return_true;
30876 if (ps1[0] != ps2[0]) goto __pyx_return_false;
30877 if (length == 1) goto __pyx_return_true;
30878 {
30879 int cmp;
30880 cmp = memcmp(ps1, ps2, (size_t)length);
30881 if (cmp == 0) goto __pyx_return_true; else goto __pyx_return_false;
30882 }
30883__pyx_return_true:
30884 Py_RETURN_TRUE;
30885__pyx_return_false:
30886 Py_RETURN_FALSE;
30887}
30888#endif
30889#endif
30890static CYTHON_INLINE PyObject* __Pyx_PyObject_CompareEq_object_bytes(PyObject *op1, PyObject *op2, int pyop) {
30891 CYTHON_UNUSED_VAR(pyop);
30892 if (unlikely(op2 == Py_None)) {
30893 if (op1 == Py_None) goto __pyx_return_true; else goto __pyx_richcmp;
30894 }
30895 if (PyFloat_CheckExact(op1)) {
30896 goto __pyx_richcmp;
30897 }
30898 if (PyLong_CheckExact(op1)) {
30899 if (op1 == op2) goto __pyx_return_true;
30900 goto __pyx_richcmp;
30901 }
30902 #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
30903 if (likely(PyBytes_CheckExact(op1))) {
30904 if (op1 == op2) goto __pyx_return_true;
30905 if (likely(op2 != Py_None)) {
30906 return __Pyx_PyObject_ComparePyBytesPyBytesEq(op1, op2);
30907 }
30908 goto __pyx_richcmp;
30909 }
30910 #endif
30911 if ((0)) goto __pyx_richcmp;
30912 if ((0)) goto __pyx_return_true;
30913 if ((0)) goto __pyx_return_false;
30914__pyx_richcmp:
30915 return PyObject_RichCompare(op1, op2, Py_EQ);
30916__pyx_return_true:
30917 Py_RETURN_TRUE;
30918__pyx_return_false:
30919 Py_RETURN_FALSE;
30920}
30921
30922/* GetAttr */
30923static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
30924#if CYTHON_USE_TYPE_SLOTS
30925 if (likely(PyUnicode_Check(n)))
30926 return __Pyx_PyObject_GetAttrStr(o, n);
30927#endif
30928 return PyObject_GetAttr(o, n);
30929}
30930
30931/* PyFrozenDict (used by GetItemInt) */
30932#if CYTHON_COMPILING_IN_LIMITED_API
30933static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it) {
30934 return PyObject_CallFunctionObjArgs(frozendict_type, it, NULL);
30935}
30936#endif
30937
30938/* GettItemInt_wraparound (used by GetItemInt) */
30939#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
30940static int __Pyx_GetItemInt_wraparound(PyObject *o, PySequenceMethods *sm, Py_ssize_t *i) {
30941 assert(*i < 0);
30942 if (likely(sm->sq_length)) {
30943 Py_ssize_t l = sm->sq_length(o);
30944 if (likely(l >= 0)) {
30945 *i += l;
30946 } else {
30947 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
30948 return -1;
30949 PyErr_Clear();
30950 }
30951 }
30952 return 0;
30953}
30954#endif
30955
30956/* GetItemInt */
30957static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
30958 PyObject *r;
30959 if (unlikely(!j)) return NULL;
30960 r = PyObject_GetItem(o, j);
30961 Py_DECREF(j);
30962 return r;
30963}
30964static PyObject *__Pyx_GetItemInt_Generic_size(PyObject *o, Py_ssize_t i) {
30965 return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
30966}
30967static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
30968 int wraparound, int boundscheck, int unsafe_shared) {
30969 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
30970#if CYTHON_AVOID_BORROWED_REFS
30971 CYTHON_UNUSED_VAR(boundscheck);
30972 Py_ssize_t wrapped_i = i;
30973 if (wraparound & unlikely(i < 0)) {
30974 Py_ssize_t size = __Pyx_PyList_GET_SIZE(o);
30975 #if !CYTHON_ASSUME_SAFE_SIZE
30976 if (unlikely(size < 0)) return NULL;
30977 #endif
30978 wrapped_i += size;
30979 }
30980 return __Pyx_PyList_GetItemRef(o, wrapped_i);
30981#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
30982 Py_ssize_t wrapped_i = i;
30983 Py_ssize_t size = (wraparound | boundscheck) ? PyList_GET_SIZE(o) : -1;
30984 if (wraparound & unlikely(i < 0)) {
30985 wrapped_i += size;
30986 }
30987 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
30988 return __Pyx_PyList_GET_ITEM_REF(o, wrapped_i, unsafe_shared);
30989 }
30990 return __Pyx_GetItemInt_Generic_size(o, i);
30991#else
30992 (void)wraparound;
30993 (void)boundscheck;
30994 return PySequence_GetItem(o, i);
30995#endif
30996}
30997static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
30998 int wraparound, int boundscheck, int unsafe_shared) {
30999 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
31000#if CYTHON_AVOID_BORROWED_REFS
31001 CYTHON_UNUSED_VAR(boundscheck);
31002 Py_ssize_t wrapped_i = i;
31003 if (wraparound & unlikely(i < 0)) {
31004 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(o);
31005 #if !CYTHON_ASSUME_SAFE_SIZE
31006 if (unlikely(size < 0)) return NULL;
31007 #endif
31008 wrapped_i += size;
31009 }
31010 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_LIMITED_API
31011 return PySequence_ITEM(o, wrapped_i);
31012 #else
31013 if (unlikely(wrapped_i < 0)) {
31014 PyErr_SetString(PyExc_IndexError, "tuple index out of range");
31015 return NULL;
31016 }
31017 return PySequence_GetItem(o, wrapped_i);
31018 #endif
31019#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
31020 Py_ssize_t wrapped_i = i;
31021 Py_ssize_t size = (wraparound | boundscheck) ? PyTuple_GET_SIZE(o) : -1;
31022 if (wraparound & unlikely(i < 0)) {
31023 wrapped_i += size;
31024 }
31025 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
31026 return __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(o, wrapped_i));
31027 }
31028 return __Pyx_GetItemInt_Generic_size(o, i);
31029#else
31030 (void)wraparound;
31031 (void)boundscheck;
31032 return PySequence_GetItem(o, i);
31033#endif
31034}
31035#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
31036static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast_mapping(PyObject *o, binaryfunc getitem, Py_ssize_t i) {
31037 PyObject *r, *key = PyLong_FromSsize_t(i);
31038 if (unlikely(!key)) return NULL;
31039 r = getitem(o, key);
31040 Py_DECREF(key);
31041 return r;
31042}
31043#endif
31044static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
31045 int wraparound, int boundscheck, int unsafe_shared) {
31046 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
31047#if CYTHON_ASSUME_SAFE_SIZE
31048 if (PyList_CheckExact(o)) {
31049 return __Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck, unsafe_shared);
31050 } else
31051 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
31052 if (PyTuple_CheckExact(o)) {
31053 return __Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck, unsafe_shared);
31054 } else
31055 #endif
31056#else
31057 if ((!wraparound || i >= 0) & PyList_CheckExact(o)) {
31058 return boundscheck ? __Pyx_PyList_GetItemRef(o, i) : __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared);
31059 } else
31060#endif
31061#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
31062 if (PyDict_CheckExact(o)) {
31063 return __Pyx_GetItemInt_Fast_mapping(o, PyDict_Type.tp_as_mapping->mp_subscript, i);
31064 #if defined(PyFrozenDict_CheckExact)
31065 } else if (PyFrozenDict_CheckExact(o)) {
31066 return __Pyx_GetItemInt_Fast_mapping(o, PyFrozenDict_Type.tp_as_mapping->mp_subscript, i);
31067 #endif
31068 } else
31069 {
31070 PyTypeObject *obj_type = Py_TYPE(o);
31071 int seq_or_mapping = __Pyx_PyType_GetFlags(obj_type) & (Py_TPFLAGS_SEQUENCE|Py_TPFLAGS_MAPPING);
31072 if (seq_or_mapping != Py_TPFLAGS_SEQUENCE) {
31073 PyMappingMethods *mm = obj_type->tp_as_mapping;
31074 if (mm && mm->mp_subscript)
31075 return __Pyx_GetItemInt_Fast_mapping(o, mm->mp_subscript, i);
31076 }
31077 PySequenceMethods *sm = obj_type->tp_as_sequence;
31078 if (likely(sm && sm->sq_item)) {
31079 if (wraparound && (i < 0) && unlikely(__Pyx_GetItemInt_wraparound(o, sm, &i) == -1))
31080 return NULL;
31081 return sm->sq_item(o, i);
31082 }
31083 if (seq_or_mapping == Py_TPFLAGS_SEQUENCE) {
31084 PyMappingMethods *mm = obj_type->tp_as_mapping;
31085 if (likely(mm && mm->mp_subscript))
31086 return __Pyx_GetItemInt_Fast_mapping(o, mm->mp_subscript, i);
31087 }
31088 }
31089#else
31090 if (!PyMapping_Check(o)) {
31091 return PySequence_GetItem(o, i);
31092 }
31093#endif
31094 (void)wraparound;
31095 (void)boundscheck;
31096 return __Pyx_GetItemInt_Generic_size(o, i);
31097}
31098
31099/* RaiseErrorWithObjectType (used by ObjectGetItem) */
31100static void __Pyx_RaiseErrorWithType(PyObject* exc_type, const char* message, PyTypeObject *type_obj) {
31101 __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
31102 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
31103 if (unlikely(!type_name)) return;
31104 #endif
31105 PyErr_Format(exc_type, message, type_name);
31106 __Pyx_DECREF_TypeName(type_name);
31107}
31108
31109/* ObjectGetItem */
31110#if CYTHON_USE_TYPE_SLOTS
31111static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
31112 PyObject *runerr = NULL;
31113 Py_ssize_t key_value;
31114 key_value = __Pyx_PyIndex_AsSsize_t(index);
31115 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
31116 return __Pyx_GetItemInt_Fast(obj, key_value, 1, 1, 1);
31117 }
31118 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
31119 PyErr_Clear();
31120 __Pyx_RaiseErrorWithObjectType(
31121 PyExc_IndexError,
31122 "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer",
31123 index);
31124 }
31125 return NULL;
31126}
31127static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
31128 if (likely(PyType_Check(obj))) {
31129 if ((PyTypeObject*)obj == &PyType_Type) {
31130 return Py_GenericAlias(obj, key);
31131 }
31132 PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem);
31133 if (!meth) {
31134 if (PyErr_Occurred()) {
31135 return NULL;
31136 }
31137 } else {
31138 PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
31139 Py_DECREF(meth);
31140 return result;
31141 }
31142 }
31143 __Pyx_RaiseTypeErrorWithObjectType(
31144 "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj);
31145 return NULL;
31146}
31147static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
31148 PyTypeObject *tp = Py_TYPE(obj);
31149 PyMappingMethods *mm = tp->tp_as_mapping;
31150 PySequenceMethods *sm = tp->tp_as_sequence;
31151 if (likely(mm && mm->mp_subscript)) {
31152 return mm->mp_subscript(obj, key);
31153 }
31154 if (likely(sm && sm->sq_item)) {
31155 return __Pyx_PyObject_GetIndex(obj, key);
31156 }
31157 return __Pyx_PyObject_GetItem_Slow(obj, key);
31158}
31159#endif
31160
31161/* RejectKeywords */
31162static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds) {
31163 PyObject *key = NULL;
31164 if (CYTHON_VECTORCALL && likely(PyTuple_Check(kwds))) {
31165 key = __Pyx_PySequence_ITEM(kwds, 0);
31166 } else {
31167#if CYTHON_AVOID_BORROWED_REFS
31168 PyObject *pos = NULL;
31169#else
31170 Py_ssize_t pos = 0;
31171#endif
31172#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
31173 if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return;
31174#endif
31175 __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL);
31176#if CYTHON_AVOID_BORROWED_REFS
31177 Py_XDECREF(pos);
31178#endif
31179 }
31180 if (likely(key)) {
31181 PyErr_Format(PyExc_TypeError,
31182 "%s() got an unexpected keyword argument '%U'",
31183 function_name, key);
31184 Py_DECREF(key);
31185 }
31186}
31187
31188/* DivInt[Py_ssize_t] */
31189static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b, int b_is_constant) {
31190 Py_ssize_t q = a / b;
31191 Py_ssize_t r = a - q*b;
31192 Py_ssize_t adapt_python = (b_is_constant ?
31193 ((r != 0) & ((r < 0) ^ (b < 0))) :
31194 ((r != 0) & ((r ^ b) < 0))
31195 );
31196 return q - adapt_python;
31197}
31198
31199/* GetAttr3 */
31200#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
31201static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
31202 __Pyx_PyThreadState_declare
31203 __Pyx_PyThreadState_assign
31204 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
31205 return NULL;
31206 __Pyx_PyErr_Clear();
31207 Py_INCREF(d);
31208 return d;
31209}
31210#endif
31211static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
31212 PyObject *r;
31213#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
31214 int res = PyObject_GetOptionalAttr(o, n, &r);
31215 return (res != 0) ? r : __Pyx_NewRef(d);
31216#else
31217 #if CYTHON_USE_TYPE_SLOTS
31218 if (likely(PyUnicode_Check(n))) {
31219 r = __Pyx_PyObject_GetAttrStrNoError(o, n);
31220 if (unlikely(!r) && likely(!PyErr_Occurred())) {
31221 r = __Pyx_NewRef(d);
31222 }
31223 return r;
31224 }
31225 #endif
31226 r = PyObject_GetAttr(o, n);
31227 return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
31228#endif
31229}
31230
31231/* PyDictVersioning (used by GetModuleGlobalName) */
31232#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
31233static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
31234 PyObject *dict = Py_TYPE(obj)->tp_dict;
31235 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
31236}
31237static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
31238 PyObject **dictptr = NULL;
31239 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
31240 if (offset) {
31241#if CYTHON_COMPILING_IN_CPYTHON
31242 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
31243#else
31244 dictptr = _PyObject_GetDictPtr(obj);
31245#endif
31246 }
31247 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
31248}
31249static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
31250 PyObject *dict = Py_TYPE(obj)->tp_dict;
31251 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
31252 return 0;
31253 return obj_dict_version == __Pyx_get_object_dict_version(obj);
31254}
31255#endif
31256
31257/* GetModuleGlobalName */
31258#if CYTHON_USE_DICT_VERSIONS
31259static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
31260#else
31261static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
31262#endif
31263{
31264 PyObject *result;
31265#if CYTHON_COMPILING_IN_LIMITED_API
31266 if (unlikely(!__pyx_m)) {
31267 if (!PyErr_Occurred())
31268 PyErr_SetNone(PyExc_NameError);
31269 return NULL;
31270 }
31271 result = PyObject_GetAttr(__pyx_m, name);
31272 if (likely(result)) {
31273 return result;
31274 }
31275 if (!__Pyx_IgnoreException(PyExc_Exception)) {
31276 return NULL; // BaseException
31277 }
31278#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
31279 if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) {
31280 if (!__Pyx_IgnoreException(PyExc_Exception)) {
31281 return NULL; // BaseException
31282 }
31283 }
31284 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
31285 if (likely(result)) {
31286 return result;
31287 }
31288#else
31289 result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
31290 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
31291 if (likely(result)) {
31292 return __Pyx_NewRef(result);
31293 }
31294 PyObject *exc = PyErr_Occurred();
31295 if (unlikely(exc) && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
31296 return NULL; // BaseException
31297 }
31298#endif
31299 return __Pyx_GetBuiltinName(name);
31300}
31301
31302/* RaiseTooManyValuesToUnpack */
31303static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
31304 PyErr_Format(PyExc_ValueError,
31305 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
31306}
31307
31308/* RaiseNeedMoreValuesToUnpack */
31309static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
31310 PyErr_Format(PyExc_ValueError,
31311 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
31312 index, (index == 1) ? "" : "s");
31313}
31314
31315/* RaiseNoneIterError */
31316static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
31317 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
31318}
31319
31320/* GetTopmostException (used by SaveResetException) */
31321#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
31322static _PyErr_StackItem *
31323__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
31324{
31325 _PyErr_StackItem *exc_info = tstate->exc_info;
31326 while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
31327 exc_info->previous_item != NULL)
31328 {
31329 exc_info = exc_info->previous_item;
31330 }
31331 return exc_info;
31332}
31333#endif
31334
31335/* SaveResetException */
31336#if CYTHON_FAST_THREAD_STATE
31337static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
31338 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
31339 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
31340 PyObject *exc_value = exc_info->exc_value;
31341 if (exc_value == NULL || exc_value == Py_None) {
31342 *value = NULL;
31343 *type = NULL;
31344 *tb = NULL;
31345 } else {
31346 *value = exc_value;
31347 Py_INCREF(*value);
31348 *type = (PyObject*) Py_TYPE(exc_value);
31349 Py_INCREF(*type);
31350 *tb = PyException_GetTraceback(exc_value);
31351 }
31352 #elif CYTHON_USE_EXC_INFO_STACK
31353 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
31354 *type = exc_info->exc_type;
31355 *value = exc_info->exc_value;
31356 *tb = exc_info->exc_traceback;
31357 Py_XINCREF(*type);
31358 Py_XINCREF(*value);
31359 Py_XINCREF(*tb);
31360 #else
31361 *type = tstate->exc_type;
31362 *value = tstate->exc_value;
31363 *tb = tstate->exc_traceback;
31364 Py_XINCREF(*type);
31365 Py_XINCREF(*value);
31366 Py_XINCREF(*tb);
31367 #endif
31368}
31369static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
31370 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
31371 _PyErr_StackItem *exc_info = tstate->exc_info;
31372 PyObject *tmp_value = exc_info->exc_value;
31373 exc_info->exc_value = value;
31374 Py_XDECREF(tmp_value);
31375 Py_XDECREF(type);
31376 Py_XDECREF(tb);
31377 #else
31378 PyObject *tmp_type, *tmp_value, *tmp_tb;
31379 #if CYTHON_USE_EXC_INFO_STACK
31380 _PyErr_StackItem *exc_info = tstate->exc_info;
31381 tmp_type = exc_info->exc_type;
31382 tmp_value = exc_info->exc_value;
31383 tmp_tb = exc_info->exc_traceback;
31384 exc_info->exc_type = type;
31385 exc_info->exc_value = value;
31386 exc_info->exc_traceback = tb;
31387 #else
31388 tmp_type = tstate->exc_type;
31389 tmp_value = tstate->exc_value;
31390 tmp_tb = tstate->exc_traceback;
31391 tstate->exc_type = type;
31392 tstate->exc_value = value;
31393 tstate->exc_traceback = tb;
31394 #endif
31395 Py_XDECREF(tmp_type);
31396 Py_XDECREF(tmp_value);
31397 Py_XDECREF(tmp_tb);
31398 #endif
31399}
31400#endif
31401
31402/* RaiseErrorWithObjectTypes (used by ExtTypeTest) */
31403static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type, const char *message, const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2) {
31404 __Pyx_TypeName type_name1 = __Pyx_PyType_GetFullyQualifiedName(type_obj1);
31405 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
31406 if (unlikely(!type_name1)) return;
31407 #endif
31408 __Pyx_TypeName type_name2 = __Pyx_PyType_GetFullyQualifiedName(type_obj2);
31409 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
31410 if (unlikely(!type_name2)) goto type2_failed;
31411 #endif
31412 PyErr_Format(exc_type, message, arg, type_name1, type_name2);
31413 __Pyx_DECREF_TypeName(type_name2);
31414#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
31415type2_failed:
31416#endif
31417 __Pyx_DECREF_TypeName(type_name1);
31418}
31419
31420/* ExtTypeTest */
31421static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
31422 if (unlikely(!type)) {
31423 PyErr_SetString(PyExc_SystemError, "Missing type object");
31424 return 0;
31425 }
31426 if (likely(__Pyx_TypeCheck(obj, type)))
31427 return 1;
31428 __Pyx_RaiseTypeErrorWithTypes(
31429 "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
31430 Py_TYPE(obj), type);
31431 return 0;
31432}
31433
31434/* GetException */
31435#if CYTHON_FAST_THREAD_STATE
31436static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
31437#else
31438static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
31439#endif
31440{
31441 PyObject *local_type = NULL, *local_value, *local_tb = NULL;
31442#if CYTHON_FAST_THREAD_STATE
31443 PyObject *tmp_type, *tmp_value, *tmp_tb;
31444 #if PY_VERSION_HEX >= 0x030C0000
31445 local_value = tstate->current_exception;
31446 tstate->current_exception = 0;
31447 #else
31448 local_type = tstate->curexc_type;
31449 local_value = tstate->curexc_value;
31450 local_tb = tstate->curexc_traceback;
31451 tstate->curexc_type = 0;
31452 tstate->curexc_value = 0;
31453 tstate->curexc_traceback = 0;
31454 #endif
31455#elif __PYX_LIMITED_VERSION_HEX >= 0x030C0000
31456 local_value = PyErr_GetRaisedException();
31457#else
31458 PyErr_Fetch(&local_type, &local_value, &local_tb);
31459#endif
31460#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
31461 if (likely(local_value)) {
31462 local_type = (PyObject*) Py_TYPE(local_value);
31463 Py_INCREF(local_type);
31464 local_tb = PyException_GetTraceback(local_value);
31465 }
31466#else
31467 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
31468#if CYTHON_FAST_THREAD_STATE
31469 if (unlikely(tstate->curexc_type))
31470#else
31471 if (unlikely(PyErr_Occurred()))
31472#endif
31473 goto bad;
31474 if (local_tb) {
31475 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
31476 goto bad;
31477 }
31478#endif // __PYX_LIMITED_VERSION_HEX >= 0x030C0000
31479 Py_XINCREF(local_tb);
31480 Py_XINCREF(local_type);
31481 Py_XINCREF(local_value);
31482 *type = local_type;
31483 *value = local_value;
31484 *tb = local_tb;
31485#if CYTHON_FAST_THREAD_STATE
31486 #if CYTHON_USE_EXC_INFO_STACK
31487 {
31488 _PyErr_StackItem *exc_info = tstate->exc_info;
31489 #if PY_VERSION_HEX >= 0x030B00a4
31490 tmp_value = exc_info->exc_value;
31491 exc_info->exc_value = local_value;
31492 tmp_type = NULL;
31493 tmp_tb = NULL;
31494 Py_XDECREF(local_type);
31495 Py_XDECREF(local_tb);
31496 #else
31497 tmp_type = exc_info->exc_type;
31498 tmp_value = exc_info->exc_value;
31499 tmp_tb = exc_info->exc_traceback;
31500 exc_info->exc_type = local_type;
31501 exc_info->exc_value = local_value;
31502 exc_info->exc_traceback = local_tb;
31503 #endif
31504 }
31505 #else
31506 tmp_type = tstate->exc_type;
31507 tmp_value = tstate->exc_value;
31508 tmp_tb = tstate->exc_traceback;
31509 tstate->exc_type = local_type;
31510 tstate->exc_value = local_value;
31511 tstate->exc_traceback = local_tb;
31512 #endif
31513 Py_XDECREF(tmp_type);
31514 Py_XDECREF(tmp_value);
31515 Py_XDECREF(tmp_tb);
31516#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
31517 PyErr_SetHandledException(local_value);
31518 Py_XDECREF(local_value);
31519 Py_XDECREF(local_type);
31520 Py_XDECREF(local_tb);
31521#else
31522 PyErr_SetExcInfo(local_type, local_value, local_tb);
31523#endif
31524 return 0;
31525#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
31526bad:
31527 *type = 0;
31528 *value = 0;
31529 *tb = 0;
31530 Py_XDECREF(local_type);
31531 Py_XDECREF(local_value);
31532 Py_XDECREF(local_tb);
31533 return -1;
31534#endif
31535}
31536
31537/* SwapException */
31538#if CYTHON_FAST_THREAD_STATE
31539static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
31540 PyObject *tmp_type, *tmp_value, *tmp_tb;
31541 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
31542 _PyErr_StackItem *exc_info = tstate->exc_info;
31543 tmp_value = exc_info->exc_value;
31544 exc_info->exc_value = *value;
31545 if (tmp_value == NULL || tmp_value == Py_None) {
31546 Py_XDECREF(tmp_value);
31547 tmp_value = NULL;
31548 tmp_type = NULL;
31549 tmp_tb = NULL;
31550 } else {
31551 tmp_type = (PyObject*) Py_TYPE(tmp_value);
31552 Py_INCREF(tmp_type);
31553 #if CYTHON_COMPILING_IN_CPYTHON
31554 tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
31555 Py_XINCREF(tmp_tb);
31556 #else
31557 tmp_tb = PyException_GetTraceback(tmp_value);
31558 #endif
31559 }
31560 #elif CYTHON_USE_EXC_INFO_STACK
31561 _PyErr_StackItem *exc_info = tstate->exc_info;
31562 tmp_type = exc_info->exc_type;
31563 tmp_value = exc_info->exc_value;
31564 tmp_tb = exc_info->exc_traceback;
31565 exc_info->exc_type = *type;
31566 exc_info->exc_value = *value;
31567 exc_info->exc_traceback = *tb;
31568 #else
31569 tmp_type = tstate->exc_type;
31570 tmp_value = tstate->exc_value;
31571 tmp_tb = tstate->exc_traceback;
31572 tstate->exc_type = *type;
31573 tstate->exc_value = *value;
31574 tstate->exc_traceback = *tb;
31575 #endif
31576 *type = tmp_type;
31577 *value = tmp_value;
31578 *tb = tmp_tb;
31579}
31580#else
31581static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
31582 PyObject *tmp_type, *tmp_value, *tmp_tb;
31583 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
31584 PyErr_SetExcInfo(*type, *value, *tb);
31585 *type = tmp_type;
31586 *value = tmp_value;
31587 *tb = tmp_tb;
31588}
31589#endif
31590
31591/* HasAttr (used by ImportImpl) */
31592#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
31593static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
31594 PyObject *r;
31595 if (unlikely(!PyUnicode_Check(n))) {
31596 PyErr_SetString(PyExc_TypeError,
31597 "hasattr(): attribute name must be string");
31598 return -1;
31599 }
31600 r = __Pyx_PyObject_GetAttrStrNoError(o, n);
31601 if (!r) {
31602 return (unlikely(PyErr_Occurred())) ? -1 : 0;
31603 } else {
31604 Py_DECREF(r);
31605 return 1;
31606 }
31607}
31608#endif
31609
31610/* TupleOrListFromArrayImpl (used by ListFromArray) */
31611CYTHON_UNUSED static PyObject *
31612__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) {
31613 PyObject *res = PyList_New(n);
31614 if (unlikely(res == NULL)) return NULL;
31615 #if CYTHON_COMPILING_IN_CPYTHON
31616 __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
31617 #else
31618 Py_ssize_t i;
31619 for (i = 0; i < n; i++) {
31620 Py_INCREF(src[i]);
31621 if (unlikely(__Pyx_PyList_SET_ITEM(res, i, src[i]) < (0))) {
31622 Py_DECREF(res);
31623 return NULL;
31624 }
31625 }
31626 #endif
31627 return res;
31628}
31629
31630/* ImportImpl (used by Import) */
31631static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
31632 PyObject *imported_module = PyImport_GetModule(qualname);
31633 if (unlikely(!imported_module)) {
31634 *module = NULL;
31635 if (PyErr_Occurred()) {
31636 return -1;
31637 }
31638 return 0;
31639 }
31640 *module = imported_module;
31641 return 1;
31642}
31643static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
31644 PyObject *imported_module;
31645 PyObject *top_level_package_name;
31646 Py_ssize_t i;
31647 int status, module_found;
31648 Py_ssize_t dot_index;
31649 module_found = __Pyx__Import_GetModule(qualname, &imported_module);
31650 if (unlikely(!module_found || module_found == -1)) {
31651 *module = NULL;
31652 return module_found;
31653 }
31654 if (imported_names) {
31655 for (i = 0; i < len_imported_names; i++) {
31656 PyObject *imported_name = imported_names[i];
31657#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
31658 int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
31659#else
31660 int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
31661 if (unlikely(has_imported_attribute == -1)) goto error;
31662#endif
31663 if (!has_imported_attribute) {
31664 goto not_found;
31665 }
31666 }
31667 *module = imported_module;
31668 return 1;
31669 }
31670 dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1);
31671 if (dot_index == -1) {
31672 *module = imported_module;
31673 return 1;
31674 }
31675 if (unlikely(dot_index == -2)) goto error;
31676 top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
31677 if (unlikely(!top_level_package_name)) goto error;
31678 Py_DECREF(imported_module);
31679 status = __Pyx__Import_GetModule(top_level_package_name, module);
31680 Py_DECREF(top_level_package_name);
31681 return status;
31682error:
31683 Py_DECREF(imported_module);
31684 *module = NULL;
31685 return -1;
31686not_found:
31687 Py_DECREF(imported_module);
31688 *module = NULL;
31689 return 0;
31690}
31691static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level) {
31692 PyObject *module = 0;
31693 PyObject *empty_dict = 0;
31694 PyObject *from_list = 0;
31695 int module_found;
31696 if (!qualname) {
31697 qualname = name;
31698 }
31699 module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
31700 if (likely(module_found == 1)) {
31701 return module;
31702 } else if (unlikely(module_found == -1)) {
31703 return NULL;
31704 }
31705 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030f00a6
31706 empty_dict = PyFrozenDict_New(NULL);
31707 #else
31708 empty_dict = PyDict_New();
31709 #endif
31710 if (unlikely(!empty_dict))
31711 goto bad;
31712 if (imported_names) {
31713 from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
31714 if (unlikely(!from_list))
31715 goto bad;
31716 }
31717 if (level == -1) {
31718 const char* package_sep = strchr(__Pyx_MODULE_NAME, '.');
31719 if (package_sep != (0)) {
31720 module = PyImport_ImportModuleLevelObject(
31721 name, moddict, empty_dict, from_list, 1);
31722 if (unlikely(!module)) {
31723 if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
31724 goto bad;
31725 PyErr_Clear();
31726 }
31727 }
31728 level = 0;
31729 }
31730 if (!module) {
31731 module = PyImport_ImportModuleLevelObject(
31732 name, moddict, empty_dict, from_list, level);
31733 }
31734bad:
31735 Py_XDECREF(from_list);
31736 Py_XDECREF(empty_dict);
31737 return module;
31738}
31739
31740/* Import */
31741static PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level) {
31742 return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
31743}
31744
31745/* ListAppendAndDecrefInternal (used by ListCompAppendAndDecref) */
31746#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
31747static CYTHON_INLINE void __Pyx__ListComp_AppendAndDecref(PyObject* list, Py_ssize_t len, PyObject* x) {
31748 PyList_SET_ITEM(list, len, x);
31749 Py_SET_SIZE(list, len + 1);
31750}
31751#endif
31752
31753/* ListCompAppendAndDecref */
31754#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
31755static CYTHON_INLINE int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x) {
31756 PyListObject* L = (PyListObject*) list;
31757 Py_ssize_t len = Py_SIZE(list);
31758 if (likely(L->allocated > len)) {
31759 __Pyx__ListComp_AppendAndDecref(list, len, x);
31760 return 0;
31761 }
31762 int result = PyList_Append(list, x);
31763 Py_DECREF(x);
31764 return result;
31765}
31766#else
31767static CYTHON_INLINE int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x) {
31768 int result = PyList_Append(list, x);
31769 Py_DECREF(x);
31770 return result;
31771}
31772#endif
31773
31774/* PySequenceMultiply */
31775#if CYTHON_USE_TYPE_SLOTS
31776static PyObject* __Pyx_PySequence_Multiply_Generic(PyObject *seq, Py_ssize_t mul) {
31777 PyObject *result, *pymul = PyLong_FromSsize_t(mul);
31778 if (unlikely(!pymul))
31779 return NULL;
31780 result = PyNumber_Multiply(seq, pymul);
31781 Py_DECREF(pymul);
31782 return result;
31783}
31784static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul) {
31785 PyTypeObject *type = Py_TYPE(seq);
31786 if (likely(type->tp_as_sequence && type->tp_as_sequence->sq_repeat)) {
31787 return type->tp_as_sequence->sq_repeat(seq, mul);
31788 } else {
31789 return __Pyx_PySequence_Multiply_Generic(seq, mul);
31790 }
31791}
31792#endif
31793
31794/* PyNumberBinop */
31795#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API)
31796#if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
31797#ifndef __Pyx_DEFINED_BinopTypeError
31798#define __Pyx_DEFINED_BinopTypeError
31799static void __Pyx_BinopTypeError(PyObject *op1, PyObject *op2, const char* op, int inplace) {
31800 char opname[4] = {op[0], op[1], 0, 0};
31801 if (inplace) {
31802 opname[op[1] ? 2 : 1] = '=';
31803 }
31804 __Pyx_RaiseErrorWithObjectTypes1(
31805 PyExc_TypeError,
31806 "unsupported operand type(s) for %.3s: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'",
31807 opname, op1, op2);
31808}
31809#endif
31810#endif
31811#ifndef __Pyx_DEFINED_PyNumber_Multiply_xfloat_int
31812#define __Pyx_DEFINED_PyNumber_Multiply_xfloat_int
31813static PyObject* __Pyx_PyNumber_Multiply_xfloat_int(PyObject *op1, PyObject *op2, int inplace) {
31814 if (likely(op2 != Py_None)) {
31815 double int_op2;
31816 #if CYTHON_USE_PYLONG_INTERNALS
31817 if (__Pyx_PyLong_IsCompact(op2)) {
31818 Py_ssize_t compact_op2 = __Pyx_PyLong_CompactValue(op2);
31819 int_op2 = (double) compact_op2;
31820 } else
31821 #endif
31822 {
31823 int_op2 = PyLong_AsDouble(op2);
31824 if (unlikely((int_op2 == -1.) && PyErr_Occurred())) return NULL;
31825 }
31826 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
31827 #if !CYTHON_ASSUME_SAFE_MACROS
31828 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
31829 #endif
31830 if (float_op1 == 0.) return __Pyx_NewRef(op1);
31831 return PyFloat_FromDouble(float_op1 * int_op2);
31832 }
31833 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
31834 {
31835 PyTypeObject *type_op2 = Py_TYPE(op2);
31836 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
31837 if (likely(slot_func)) {
31838 PyObject *result = slot_func(op1, op2);
31839 if (likely(result != Py_NotImplemented)) {
31840 return result;
31841 }
31842 Py_DECREF(result);
31843 }
31844 __Pyx_BinopTypeError(op1, op2, "*", inplace);
31845 return NULL;
31846 }
31847 #else
31848 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
31849 #endif
31850}
31851#endif
31852#ifndef __Pyx_DEFINED_PyNumber_Multiply_xint_int
31853#define __Pyx_DEFINED_PyNumber_Multiply_xint_int
31854static PyObject* __Pyx_PyNumber_Multiply_xint_int(PyObject *op1, PyObject *op2, int inplace) {
31855 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
31856 {
31857 PyTypeObject *type_op2 = Py_TYPE(op2);
31858 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
31859 if (likely(slot_func)) {
31860 PyObject *result = slot_func(op1, op2);
31861 if (likely(result != Py_NotImplemented)) {
31862 return result;
31863 }
31864 Py_DECREF(result);
31865 }
31866 ssizeargfunc repeat_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_sequence, sq_repeat, ssizeargfunc);
31867 if (likely(repeat_func)) {
31868 Py_ssize_t count;
31869 #if CYTHON_USE_PYLONG_INTERNALS
31870 if (__Pyx_PyLong_IsCompact(op1)) {
31871 count = __Pyx_PyLong_CompactValue(op1);
31872 } else
31873 #endif
31874 {
31875 count = PyLong_AsSsize_t(op1);
31876 if (unlikely((count == -1) && PyErr_Occurred())) return NULL;
31877 }
31878 return repeat_func(op2, count);
31879 }
31880 __Pyx_BinopTypeError(op1, op2, "*", inplace);
31881 return NULL;
31882 }
31883 #else
31884 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
31885 #endif
31886}
31887#endif
31888static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_object_int(PyObject *op1, PyObject *op2, int inplace) {
31889 if (PyFloat_CheckExact(op1)) {
31890 return __Pyx_PyNumber_Multiply_xfloat_int(op1, op2, inplace);
31891 }
31892 if (likely(PyLong_CheckExact(op1))) {
31893 if (likely(op2 != Py_None)) {
31894 #if CYTHON_USE_PYLONG_INTERNALS
31895 if (__Pyx_PyLong_IsCompact(op1)) {
31896 long long int_op1 = (long long) __Pyx_PyLong_CompactValue(op1);
31897 if (int_op1 == 0) return __Pyx_NewRef(op1);
31898 if (__Pyx_PyLong_IsCompact(op2)) {
31899 long long int_op2 = (long long) __Pyx_PyLong_CompactValue(op2);
31900 if (int_op2 == 0) return __Pyx_NewRef(op2);
31901 return PyLong_FromLongLong(int_op1 * int_op2);
31902 }
31903 }
31904 else if (__Pyx_PyLong_IsZero(op2)) return __Pyx_NewRef(op2);
31905 #endif
31906 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyLong_Type, tp_as_number, nb_multiply, binaryfunc);
31907 if (likely(slot_func)) {
31908 return slot_func(op1, op2);
31909 }
31910 }
31911 return __Pyx_PyNumber_Multiply_xint_int(op1, op2, inplace);
31912 }
31913 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
31914}
31915#endif
31916
31917/* PyObjectFormatAndDecref */
31918static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
31919 if (unlikely(!s)) return NULL;
31920 if (likely(PyUnicode_CheckExact(s))) return s;
31921 return __Pyx_PyObject_FormatAndDecref(s, f);
31922}
31923static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
31924 PyObject *result;
31925 if (unlikely(!s)) return NULL;
31926 result = PyObject_Format(s, f);
31927 Py_DECREF(s);
31928 return result;
31929}
31930
31931/* PyObjectFormat */
31932#if CYTHON_USE_UNICODE_WRITER
31933static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) {
31934 int ret;
31935 _PyUnicodeWriter writer;
31936 if (likely(PyFloat_CheckExact(obj))) {
31937 _PyUnicodeWriter_Init(&writer);
31938 ret = _PyFloat_FormatAdvancedWriter(
31939 &writer,
31940 obj,
31941 format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
31942 } else if (likely(PyLong_CheckExact(obj))) {
31943 _PyUnicodeWriter_Init(&writer);
31944 ret = _PyLong_FormatAdvancedWriter(
31945 &writer,
31946 obj,
31947 format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
31948 } else {
31949 return PyObject_Format(obj, format_spec);
31950 }
31951 if (unlikely(ret == -1)) {
31952 _PyUnicodeWriter_Dealloc(&writer);
31953 return NULL;
31954 }
31955 return _PyUnicodeWriter_Finish(&writer);
31956}
31957#endif
31958
31959/* SetItemInt */
31960static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
31961 int r;
31962 if (unlikely(!j)) return -1;
31963 r = PyObject_SetItem(o, j, v);
31964 Py_DECREF(j);
31965 return r;
31966}
31967#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
31968static CYTHON_INLINE int __Pyx_SetItemInt_Fast_mapping(PyObject *o, objobjargproc setitem, Py_ssize_t i, PyObject *value) {
31969 PyObject *key = PyLong_FromSsize_t(i);
31970 if (unlikely(!key)) return -1;
31971 int r = setitem(o, key, value);
31972 Py_DECREF(key);
31973 return r;
31974}
31975#endif
31976static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
31977 int wraparound, int boundscheck, int unsafe_shared) {
31978 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
31979#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS
31980 if (PyList_CheckExact(o)) {
31981 Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
31982 if ((CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared))) {
31983 Py_INCREF(v);
31984 return PyList_SetItem(o, n, v);
31985 } else if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
31986 PyObject* old;
31987 Py_INCREF(v);
31988 old = PyList_GET_ITEM(o, n);
31989 PyList_SET_ITEM(o, n, v);
31990 Py_DECREF(old);
31991 return 0;
31992 }
31993 } else
31994#endif
31995#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
31996 if (PyDict_CheckExact(o)) {
31997 return __Pyx_SetItemInt_Fast_mapping(o, PyDict_Type.tp_as_mapping->mp_ass_subscript, i, v);
31998 } else
31999 {
32000 PyTypeObject *obj_type = Py_TYPE(o);
32001 int seq_or_mapping = __Pyx_PyType_GetFlags(obj_type) & (Py_TPFLAGS_SEQUENCE|Py_TPFLAGS_MAPPING);
32002 if (seq_or_mapping != Py_TPFLAGS_SEQUENCE) {
32003 PyMappingMethods *mm = obj_type->tp_as_mapping;
32004 if (mm && mm->mp_ass_subscript)
32005 return __Pyx_SetItemInt_Fast_mapping(o, mm->mp_ass_subscript, i, v);
32006 }
32007 PySequenceMethods *sm = obj_type->tp_as_sequence;
32008 if (likely(sm && sm->sq_ass_item)) {
32009 if (wraparound && (i < 0) && unlikely(__Pyx_GetItemInt_wraparound(o, sm, &i) == -1))
32010 return -1;
32011 return sm->sq_ass_item(o, i, v);
32012 }
32013 if (seq_or_mapping == Py_TPFLAGS_SEQUENCE) {
32014 PyMappingMethods *mm = obj_type->tp_as_mapping;
32015 if (likely(mm && mm->mp_ass_subscript))
32016 return __Pyx_SetItemInt_Fast_mapping(o, mm->mp_ass_subscript, i, v);
32017 }
32018 }
32019#else
32020 if (!PyMapping_Check(o)) {
32021 return PySequence_SetItem(o, i, v);
32022 }
32023#endif
32024 (void)wraparound;
32025 (void)boundscheck;
32026 return __Pyx_SetItemInt_Generic(o, PyLong_FromSsize_t(i), v);
32027}
32028
32029/* RaiseUnboundLocalError */
32030static void __Pyx_RaiseUnboundLocalError(const char *varname) {
32031 PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
32032}
32033
32034/* DivInt[long] */
32035static CYTHON_INLINE long __Pyx_div_long(long a, long b, int b_is_constant) {
32036 long q = a / b;
32037 long r = a - q*b;
32038 long adapt_python = (b_is_constant ?
32039 ((r != 0) & ((r < 0) ^ (b < 0))) :
32040 ((r != 0) & ((r ^ b) < 0))
32041 );
32042 return q - adapt_python;
32043}
32044
32045/* ListAppend */
32046#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
32047static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
32048 PyListObject* L = (PyListObject*) list;
32049 Py_ssize_t len = Py_SIZE(list);
32050 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
32051 Py_INCREF(x);
32052 __Pyx__ListComp_AppendAndDecref(list, len, x);
32053 return 0;
32054 }
32055 return PyList_Append(list, x);
32056}
32057#endif
32058
32059/* PyObjectCallMethod1 (used by StringJoin) */
32060static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
32061#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || !CYTHON_COMPILING_IN_LIMITED_API)
32062 PyObject *args[2] = {obj, arg};
32063 return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
32064#elif CYTHON_COMPILING_IN_LIMITED_API
32065 return PyObject_CallMethodObjArgs(obj, method_name, arg, NULL);
32066#else
32067 return PyObject_CallMethodOneArg(obj, method_name, arg);
32068#endif
32069}
32070
32071/* StringJoin */
32072static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
32073 (void) __Pyx_PyObject_CallMethod1;
32074#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030e0000 || defined(PyBytes_Join)
32075 return PyBytes_Join(sep, values);
32076#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyBytes_Join)
32077 return _PyBytes_Join(sep, values);
32078#else
32079 return __Pyx_PyObject_CallMethod1(sep, __pyx_mstate_global->__pyx_n_u_join, values);
32080#endif
32081}
32082
32083/* CIntToPyUnicode */
32084static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char) {
32085#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32086#pragma GCC diagnostic push
32087#pragma GCC diagnostic ignored "-Wconversion"
32088#endif
32089 const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
32090#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32091#pragma GCC diagnostic pop
32092#endif
32093 const int is_unsigned = neg_one > const_zero;
32094 if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
32095 !(sizeof(value) <= 2 || value & ~ (size_t) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
32096 PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
32097 return NULL;
32098 }
32099 if (width <= 1) {
32100 return PyUnicode_FromOrdinal((int) value);
32101 }
32102 return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
32103}
32104static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char, char format_char) {
32105 char digits[sizeof(size_t)*3+2];
32106 char *dpos, *end = digits + sizeof(size_t)*3+2;
32107 const char *hex_digits = DIGITS_HEX;
32108 Py_ssize_t length, ulength;
32109 int prepend_sign, last_one_off;
32110 size_t remaining;
32111#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32112#pragma GCC diagnostic push
32113#pragma GCC diagnostic ignored "-Wconversion"
32114#endif
32115 const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
32116#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32117#pragma GCC diagnostic pop
32118#endif
32119 const int is_unsigned = neg_one > const_zero;
32120 if (format_char == 'X') {
32121 hex_digits += 16;
32122 format_char = 'x';
32123 }
32124 remaining = value;
32125 last_one_off = 0;
32126 dpos = end;
32127 do {
32128 int digit_pos;
32129 switch (format_char) {
32130 case 'o':
32131 digit_pos = abs((int)(remaining % (8*8)));
32132 remaining = (size_t) (remaining / (8*8));
32133 dpos -= 2;
32134 memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
32135 last_one_off = (digit_pos < 8);
32136 break;
32137 case 'd':
32138 digit_pos = abs((int)(remaining % (10*10)));
32139 remaining = (size_t) (remaining / (10*10));
32140 dpos -= 2;
32141 memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
32142 last_one_off = (digit_pos < 10);
32143 break;
32144 case 'x':
32145 *(--dpos) = hex_digits[abs((int)(remaining % 16))];
32146 remaining = (size_t) (remaining / 16);
32147 break;
32148 default:
32149 assert(0);
32150 break;
32151 }
32152 } while (unlikely(remaining != 0));
32153 assert(!last_one_off || *dpos == '0');
32154 dpos += last_one_off;
32155 length = end - dpos;
32156 ulength = length;
32157 prepend_sign = 0;
32158 if (!is_unsigned && value <= neg_one) {
32159 if (padding_char == ' ' || width <= length + 1) {
32160 *(--dpos) = '-';
32161 ++length;
32162 } else {
32163 prepend_sign = 1;
32164 }
32165 ++ulength;
32166 }
32167 if (width > ulength) {
32168 ulength = width;
32169 }
32170 if (ulength == 1) {
32171 return PyUnicode_FromOrdinal(*dpos);
32172 }
32173 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
32174}
32175
32176/* SliceObject */
32177static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
32178 Py_ssize_t cstart, Py_ssize_t cstop,
32179 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
32180 int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
32181#if CYTHON_USE_TYPE_SLOTS
32182 PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping;
32183 if (likely(mp && mp->mp_ass_subscript))
32184#else
32185 if ((1))
32186#endif
32187 {
32188 int result;
32189 PyObject *py_slice, *py_start, *py_stop;
32190 if (_py_slice) {
32191 py_slice = *_py_slice;
32192 } else {
32193 PyObject* owned_start = NULL;
32194 PyObject* owned_stop = NULL;
32195 if (_py_start) {
32196 py_start = *_py_start;
32197 } else {
32198 if (has_cstart) {
32199 owned_start = py_start = PyLong_FromSsize_t(cstart);
32200 if (unlikely(!py_start)) goto bad;
32201 } else
32202 py_start = Py_None;
32203 }
32204 if (_py_stop) {
32205 py_stop = *_py_stop;
32206 } else {
32207 if (has_cstop) {
32208 owned_stop = py_stop = PyLong_FromSsize_t(cstop);
32209 if (unlikely(!py_stop)) {
32210 Py_XDECREF(owned_start);
32211 goto bad;
32212 }
32213 } else
32214 py_stop = Py_None;
32215 }
32216 py_slice = PySlice_New(py_start, py_stop, Py_None);
32217 Py_XDECREF(owned_start);
32218 Py_XDECREF(owned_stop);
32219 if (unlikely(!py_slice)) goto bad;
32220 }
32221#if CYTHON_USE_TYPE_SLOTS
32222 result = mp->mp_ass_subscript(obj, py_slice, value);
32223#else
32224 result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
32225#endif
32226 if (!_py_slice) {
32227 Py_DECREF(py_slice);
32228 }
32229 return result;
32230 } else {
32231 __Pyx_RaiseTypeErrorWithObjectType(
32232 (value) ?
32233 "'" __Pyx_FMT_TYPENAME "' object does not support slice assignment" :
32234 "'" __Pyx_FMT_TYPENAME "' object does not support slice deletion",
32235 obj);
32236 }
32237bad:
32238 return -1;
32239}
32240
32241/* AllocateExtensionType */
32242static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final) {
32243 if (is_final || likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
32244 allocfunc alloc_func = __Pyx_PyType_GetSlot(t, tp_alloc, allocfunc);
32245 return alloc_func(t, 0);
32246 } else {
32247 newfunc tp_new = __Pyx_PyType_TryGetSlot(&PyBaseObject_Type, tp_new, newfunc);
32248 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
32249 if (!tp_new) {
32250 PyObject *new_str = PyUnicode_FromString("__new__");
32251 if (likely(new_str)) {
32252 PyObject *o = PyObject_CallMethodObjArgs((PyObject *)&PyBaseObject_Type, new_str, t, NULL);
32253 Py_DECREF(new_str);
32254 return o;
32255 } else
32256 return NULL;
32257 } else
32258 #endif
32259 return tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
32260 }
32261}
32262
32263/* CallSlotAsVectorcallUnpackDict (used by CallSlotAsVectorcall) */
32264static CYTHON_INLINE int __Pyx_CallSlotAsVectorcallUnpackDict(Py_ssize_t args_size, PyObject *keys_dict, PyObject **args, PyObject *kwnames) {
32265 Py_ssize_t pos = 0, i = 0;
32266 PyObject *key, *value;
32267 while (PyDict_Next(keys_dict, &pos, &key, &value)) {
32268 Py_INCREF(value);
32269 args[args_size+i] = value;
32270 Py_INCREF(key);
32271 if (unlikely(__Pyx_PyTuple_SET_ITEM(kwnames, i, key) == -1)) {
32272 return -1;
32273 }
32274 ++i;
32275 }
32276 return 0;
32277}
32278
32279/* CallSlotAsVectorcall */
32280#if CYTHON_VECTORCALL_TPNEW
32281static PyObject * __Pyx_CallTpnewAsVectorcall(__Pyx_tpnewvectorcallfunc f, PyTypeObject* o, PyObject *a, PyObject *k) {
32282 Py_ssize_t k_size = k ? __Pyx_PyDict_GET_SIZE(k) : 0;
32283#if !CYTHON_ASSUME_SAFE_SIZE
32284 if (unlikely(k_size < 0)) return NULL;
32285#endif
32286 Py_ssize_t a_size = __Pyx_PyTuple_GET_SIZE(a);
32287#if !CYTHON_ASSUME_SAFE_SIZE
32288 if (unlikely(a_size < 0)) return NULL;
32289#endif
32290#if CYTHON_ASSUME_SAFE_MACROS
32291 if (k_size == 0) {
32292 return f(o, &PyTuple_GET_ITEM(a, 0), a_size, NULL);
32293 }
32294#else
32295 if (k_size == 0 && a_size == 0) {
32296 return f(o, NULL, 0, NULL);
32297 }
32298#endif
32299 PyObject *stack_args[5];
32300 PyObject **args = stack_args;
32301 Py_ssize_t maxnargs = PY_SSIZE_T_MAX / sizeof(PyObject*) - 1;
32302 if (a_size > maxnargs - k_size) {
32303 PyErr_NoMemory();
32304 return NULL;
32305 }
32306 Py_ssize_t total_size = a_size + k_size;
32307 if (total_size > 5) {
32308 args = (PyObject**)PyMem_Malloc(((size_t)total_size)*sizeof(PyObject*));
32309 if (unlikely(!args)) {
32310 PyErr_NoMemory();
32311 return NULL;
32312 }
32313 }
32314 PyObject * result = NULL;
32315 PyObject *kwnames = NULL;
32316 int unpack_dict_result;
32317 Py_ssize_t i = 0;
32318 for (; i < a_size; ++i) {
32319 args[i] = __Pyx_PyTuple_GET_ITEM(a, i);
32320#if !CYTHON_ASSUME_SAFE_MACROS
32321 if (unlikely(!args[i])) goto cleanup;
32322#endif
32323 }
32324#if !CYTHON_ASSUME_SAFE_MACROS
32325 if (k) // There's a specific shortcut earlier for ASSUME_SAFE_MACROS with no keywords
32326#endif
32327 {
32328 kwnames = PyTuple_New(k_size);
32329 if (unlikely(!kwnames)) goto cleanup;
32330 __Pyx_BEGIN_CRITICAL_SECTION(k);
32331 unpack_dict_result = __Pyx_CallSlotAsVectorcallUnpackDict(a_size, k, args, kwnames);
32332 __Pyx_END_CRITICAL_SECTION();
32333 if (unlikely(unpack_dict_result == -1)) goto cleanup;
32334 }
32335 result = f(o, args, a_size, kwnames);
32336 cleanup:
32337 Py_XDECREF(kwnames);
32338 for (i=a_size; i<total_size; ++i) {
32339 Py_XDECREF(args[i]);
32340 }
32341 if (args != stack_args) {
32342 PyMem_Free(args);
32343 }
32344 return result;
32345}
32346#endif
32347
32348/* CallNewInitFromVectorcall */
32349#if CYTHON_VECTORCALL_TPNEW
32350static PyObject *__Pyx_CallNewInitFromVectorcall(PyTypeObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
32351 newfunc tp_new = __Pyx_PyType_GetSlot(t, tp_new, newfunc);
32352 if (unlikely(!tp_new)) {
32353 __Pyx_RaiseErrorWithType(PyExc_TypeError, "cannot create " __Pyx_FMT_TYPENAME " instances", t);
32354 return NULL;
32355 }
32356 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
32357 PyObject *result = NULL, *args_tuple = NULL, *kwds_dict = NULL;
32358 Py_ssize_t kw_size = kwnames ? __Pyx_PyTuple_GET_SIZE(kwnames) : 0;
32359#if !CYTHON_ASSUME_SAFE_SIZE
32360 if (unlikely(kw_size == -1)) {
32361 return NULL;
32362 }
32363#endif
32364 if (kw_size) {
32365 kwds_dict = __Pyx_PyDict_NewPresized(kw_size);
32366 if (unlikely(!kwds_dict)) {
32367 return NULL;
32368 }
32369 for (Py_ssize_t i=0; i<kw_size; ++i) {
32370 PyObject *v = args[nargs + i];
32371 PyObject *k = __Pyx_PyTuple_GET_ITEM(kwnames, i);
32372#if !CYTHON_ASSUME_SAFE_MACROS
32373 if (unlikely(!k)) {
32374 goto end;
32375 }
32376#endif
32377 if (unlikely(PyDict_SetItem(kwds_dict, k, v) < 0)) {
32378 goto end;
32379 }
32380 }
32381 }
32382 if (nargs) {
32383 args_tuple = __Pyx_PyTuple_FromArray(args, nargs);
32384 if (unlikely(!args_tuple)) {
32385 goto end;
32386 }
32387 } else {
32388 args_tuple = __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
32389 }
32390 result = tp_new(t, args_tuple, kwds_dict);
32391 if (unlikely(!result)) {
32392 goto end;
32393 }
32394 if (PyObject_TypeCheck(result, t)) {
32395 initproc tp_init = __Pyx_PyObject_GetSlot(result, tp_init, initproc);
32396 if (tp_init && unlikely(tp_init(result, args_tuple, kwds_dict) < 0)) {
32397 Py_CLEAR(result);
32398 }
32399 }
32400 end:
32401 Py_XDECREF(args_tuple);
32402 Py_XDECREF(kwds_dict);
32403 return result;
32404}
32405#endif
32406
32407/* CallTypeTraverse */
32408#if !CYTHON_USE_TYPE_SPECS
32409#else
32410static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) {
32411 if (!always_call) {
32412 PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
32413 unsigned long flags = PyType_GetFlags(base);
32414 if (flags & Py_TPFLAGS_HEAPTYPE) {
32415 return 0;
32416 }
32417 }
32418 Py_VISIT((PyObject*)Py_TYPE(o));
32419 return 0;
32420}
32421#endif
32422
32423/* CallSlotAsVectorcall */
32424#if CYTHON_VECTORCALL_TPNEW
32425static int __Pyx_CallTpinitAsVectorcall(__Pyx_tpinitvectorcallfunc f, PyObject* o, PyObject *a, PyObject *k) {
32426 Py_ssize_t k_size = k ? __Pyx_PyDict_GET_SIZE(k) : 0;
32427#if !CYTHON_ASSUME_SAFE_SIZE
32428 if (unlikely(k_size < 0)) return -1;
32429#endif
32430 Py_ssize_t a_size = __Pyx_PyTuple_GET_SIZE(a);
32431#if !CYTHON_ASSUME_SAFE_SIZE
32432 if (unlikely(a_size < 0)) return -1;
32433#endif
32434#if CYTHON_ASSUME_SAFE_MACROS
32435 if (k_size == 0) {
32436 return f(o, &PyTuple_GET_ITEM(a, 0), a_size, NULL);
32437 }
32438#else
32439 if (k_size == 0 && a_size == 0) {
32440 return f(o, NULL, 0, NULL);
32441 }
32442#endif
32443 PyObject *stack_args[5];
32444 PyObject **args = stack_args;
32445 Py_ssize_t maxnargs = PY_SSIZE_T_MAX / sizeof(PyObject*) - 1;
32446 if (a_size > maxnargs - k_size) {
32447 PyErr_NoMemory();
32448 return -1;
32449 }
32450 Py_ssize_t total_size = a_size + k_size;
32451 if (total_size > 5) {
32452 args = (PyObject**)PyMem_Malloc(((size_t)total_size)*sizeof(PyObject*));
32453 if (unlikely(!args)) {
32454 PyErr_NoMemory();
32455 return -1;
32456 }
32457 }
32458 int result = -1;
32459 PyObject *kwnames = NULL;
32460 int unpack_dict_result;
32461 Py_ssize_t i = 0;
32462 for (; i < a_size; ++i) {
32463 args[i] = __Pyx_PyTuple_GET_ITEM(a, i);
32464#if !CYTHON_ASSUME_SAFE_MACROS
32465 if (unlikely(!args[i])) goto cleanup;
32466#endif
32467 }
32468#if !CYTHON_ASSUME_SAFE_MACROS
32469 if (k) // There's a specific shortcut earlier for ASSUME_SAFE_MACROS with no keywords
32470#endif
32471 {
32472 kwnames = PyTuple_New(k_size);
32473 if (unlikely(!kwnames)) goto cleanup;
32474 __Pyx_BEGIN_CRITICAL_SECTION(k);
32475 unpack_dict_result = __Pyx_CallSlotAsVectorcallUnpackDict(a_size, k, args, kwnames);
32476 __Pyx_END_CRITICAL_SECTION();
32477 if (unlikely(unpack_dict_result == -1)) goto cleanup;
32478 }
32479 result = f(o, args, a_size, kwnames);
32480 cleanup:
32481 Py_XDECREF(kwnames);
32482 for (i=a_size; i<total_size; ++i) {
32483 Py_XDECREF(args[i]);
32484 }
32485 if (args != stack_args) {
32486 PyMem_Free(args);
32487 }
32488 return result;
32489}
32490#endif
32491
32492/* PyObjectCallMethod0 (used by PyType_Ready) */
32493static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
32494#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || !CYTHON_COMPILING_IN_LIMITED_API)
32495 return PyObject_VectorcallMethod(method_name, &obj, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
32496#elif CYTHON_COMPILING_IN_LIMITED_API
32497 return PyObject_CallMethodObjArgs(obj, method_name, NULL);
32498#else
32499 return PyObject_CallMethodNoArgs(obj, method_name);
32500#endif
32501}
32502
32503/* GetTypeDictOffset (used by ValidateBasesTuple) */
32504#if !CYTHON_USE_TYPE_SLOTS
32505CYTHON_UNUSED static Py_ssize_t __Pyx_GetTypeDictOffset(PyObject *tp, int require_cython_valid_result) {
32506 PyObject *tp_dictoffset_o;
32507 Py_ssize_t tp_dictoffset;
32508 tp_dictoffset_o = PyObject_GetAttrString(tp, "__dictoffset__");
32509 if (unlikely(!tp_dictoffset_o)) return -1;
32510 tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
32511 Py_DECREF(tp_dictoffset_o);
32512 if (unlikely(require_cython_valid_result && tp_dictoffset == 0)) {
32513 PyErr_SetString(
32514 PyExc_TypeError,
32515 "'type' doesn't have a dictoffset");
32516 return -1;
32517 } else if (unlikely(require_cython_valid_result && tp_dictoffset < 0)) {
32518 PyErr_SetString(
32519 PyExc_TypeError,
32520 "'type' has an unexpected negative dictoffset. "
32521 "Please report this as Cython bug");
32522 return -1;
32523 }
32524 return tp_dictoffset;
32525}
32526#endif
32527
32528/* ValidateBasesTuple (used by PyType_Ready) */
32529#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
32530static int __Pyx_validate_bases_tuple(const char *type_name, int has_dictoffset, PyObject *bases) {
32531 Py_ssize_t i, n;
32532#if CYTHON_ASSUME_SAFE_SIZE
32533 n = PyTuple_GET_SIZE(bases);
32534#else
32535 n = PyTuple_Size(bases);
32536 if (unlikely(n < 0)) return -1;
32537#endif
32538 if (!has_dictoffset) {
32539 PyObject *b;
32540#if CYTHON_AVOID_BORROWED_REFS
32541 b = PySequence_GetItem(bases, 0);
32542 if (!b) return -1;
32543#elif CYTHON_ASSUME_SAFE_MACROS
32544 b = PyTuple_GET_ITEM(bases, 0);
32545#else
32546 b = PyTuple_GetItem(bases, 0);
32547 if (!b) return -1;
32548#endif
32549#if CYTHON_USE_TYPE_SLOTS
32550 has_dictoffset = ((PyTypeObject*)b)->tp_dictoffset != 0;
32551#else
32552 Py_ssize_t dictoffset = __Pyx_GetTypeDictOffset(b, 0);
32553 has_dictoffset = dictoffset != 0;
32554#endif
32555#if CYTHON_AVOID_BORROWED_REFS
32556 Py_DECREF(b);
32557#endif
32558#if !CYTHON_USE_TYPE_SLOTS
32559 if (dictoffset == -1 && PyErr_Occurred()) return -1;
32560#endif
32561 }
32562 for (i = 1; i < n; i++)
32563 {
32564 PyTypeObject *b;
32565#if CYTHON_AVOID_BORROWED_REFS
32566 PyObject *b0 = PySequence_GetItem(bases, i);
32567 if (!b0) return -1;
32568#elif CYTHON_ASSUME_SAFE_MACROS
32569 PyObject *b0 = PyTuple_GET_ITEM(bases, i);
32570#else
32571 PyObject *b0 = PyTuple_GetItem(bases, i);
32572 if (!b0) return -1;
32573#endif
32574 b = (PyTypeObject*) b0;
32575 if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
32576 {
32577 __Pyx_RaiseErrorWithType(
32578 PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b);
32579#if CYTHON_AVOID_BORROWED_REFS
32580 Py_DECREF(b0);
32581#endif
32582 return -1;
32583 }
32584 if (!has_dictoffset)
32585 {
32586 Py_ssize_t b_dictoffset = 0;
32587#if CYTHON_USE_TYPE_SLOTS
32588 b_dictoffset = b->tp_dictoffset;
32589#else
32590 b_dictoffset = __Pyx_GetTypeDictOffset((PyObject*)b, 0);
32591 if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
32592#endif
32593 if (b_dictoffset) {
32594 __Pyx_RaiseErrorWithType1(
32595 PyExc_TypeError,
32596 "extension type '%.200s' has no __dict__ slot, "
32597 "but base type '" __Pyx_FMT_TYPENAME "' has: "
32598 "either add 'cdef dict __dict__' to the extension type "
32599 "or add '__slots__ = [...]' to the base type",
32600 type_name, b);
32601#if !CYTHON_USE_TYPE_SLOTS
32602 dictoffset_return:
32603#endif
32604#if CYTHON_AVOID_BORROWED_REFS
32605 Py_DECREF(b0);
32606#endif
32607 return -1;
32608 }
32609 }
32610#if CYTHON_AVOID_BORROWED_REFS
32611 Py_DECREF(b0);
32612#endif
32613 }
32614 return 0;
32615}
32616#endif
32617
32618/* PyType_Ready */
32619CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) {
32620 while (t) {
32621 PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
32622 if (bases) {
32623 return 1;
32624 }
32625 t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*);
32626 }
32627 return 0;
32628}
32629static int __Pyx_PyType_Ready(PyTypeObject *t) {
32630#if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON
32631 (void)__Pyx_PyObject_CallMethod0;
32632#if CYTHON_USE_TYPE_SPECS
32633 (void)__Pyx_validate_bases_tuple;
32634#endif
32635 return PyType_Ready(t);
32636#else
32637 int r;
32638 if (!__Pyx_PyType_HasMultipleInheritance(t)) {
32639 return PyType_Ready(t);
32640 }
32641 PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
32642 if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset != 0, bases) == -1))
32643 return -1;
32644 {
32645 int gc_was_enabled;
32646 #if PY_VERSION_HEX >= 0x030A00b1
32647 gc_was_enabled = PyGC_Disable();
32648 (void)__Pyx_PyObject_CallMethod0;
32649 #else
32650 PyObject *ret, *py_status;
32651 PyObject *gc = NULL;
32652 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\
32653 !CYTHON_COMPILING_IN_GRAAL
32654 gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc);
32655 #endif
32656 if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc);
32657 if (unlikely(!gc)) return -1;
32658 py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled);
32659 if (unlikely(!py_status)) {
32660 Py_DECREF(gc);
32661 return -1;
32662 }
32663 gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
32664 Py_DECREF(py_status);
32665 if (gc_was_enabled > 0) {
32666 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable);
32667 if (unlikely(!ret)) {
32668 Py_DECREF(gc);
32669 return -1;
32670 }
32671 Py_DECREF(ret);
32672 } else if (unlikely(gc_was_enabled == -1)) {
32673 Py_DECREF(gc);
32674 return -1;
32675 }
32676 #endif
32677 t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
32678#if PY_VERSION_HEX >= 0x030A0000
32679 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
32680#endif
32681 r = PyType_Ready(t);
32682 t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
32683 #if PY_VERSION_HEX >= 0x030A00b1
32684 if (gc_was_enabled)
32685 PyGC_Enable();
32686 #else
32687 if (gc_was_enabled) {
32688 PyObject *tp, *v, *tb;
32689 PyErr_Fetch(&tp, &v, &tb);
32690 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable);
32691 if (likely(ret || r == -1)) {
32692 Py_XDECREF(ret);
32693 PyErr_Restore(tp, v, tb);
32694 } else {
32695 Py_XDECREF(tp);
32696 Py_XDECREF(v);
32697 Py_XDECREF(tb);
32698 r = -1;
32699 }
32700 }
32701 Py_DECREF(gc);
32702 #endif
32703 }
32704 return r;
32705#endif
32706}
32707
32708/* LimitedApiGetTypeTypeDict (used by DelItemOnTypeDict) */
32709#if CYTHON_COMPILING_IN_LIMITED_API
32710static PyObject *__Pyx_GetTypeTypeDict(PyTypeObject *tp) {
32711 static Py_ssize_t tp_dictoffset = 0;
32712 if (unlikely(tp_dictoffset == 0)) {
32713 tp_dictoffset = __Pyx_GetTypeDictOffset((PyObject*)(&PyType_Type), 1);
32714 if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) {
32715 tp_dictoffset = 0; // try again next time?
32716 return NULL;
32717 }
32718 }
32719 return *(PyObject**)((char*)tp + tp_dictoffset);
32720}
32721#endif
32722
32723/* DelItemOnTypeDict (used by SetupReduce) */
32724static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k) {
32725 int result;
32726 PyObject *tp_dict;
32727#if CYTHON_COMPILING_IN_LIMITED_API
32728 tp_dict = __Pyx_GetTypeTypeDict(tp);
32729 if (unlikely(!tp_dict)) return -1;
32730#else
32731 tp_dict = tp->tp_dict;
32732#endif
32733 result = PyDict_DelItem(tp_dict, k);
32734 if (likely(!result)) PyType_Modified(tp);
32735 return result;
32736}
32737
32738/* SetItemOnTypeDict (used by SetupReduce) */
32739static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) {
32740 int result;
32741 PyObject *tp_dict;
32742#if CYTHON_COMPILING_IN_LIMITED_API
32743 tp_dict = __Pyx_GetTypeTypeDict(tp);
32744 if (unlikely(!tp_dict)) return -1;
32745#else
32746 tp_dict = tp->tp_dict;
32747#endif
32748 result = PyDict_SetItem(tp_dict, k, v);
32749 if (likely(!result)) {
32750 PyType_Modified(tp);
32751 if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) {
32752 PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name, (PyObject *) tp, k, NULL);
32753 if (!setNameResult) return -1;
32754 Py_DECREF(setNameResult);
32755 }
32756 }
32757 return result;
32758}
32759
32760/* SetupReduce */
32761static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
32762 int ret;
32763 PyObject *name_attr;
32764 name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_mstate_global->__pyx_n_u_name_2);
32765 if (likely(name_attr)) {
32766 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
32767 } else {
32768 ret = -1;
32769 }
32770 if (unlikely(ret < 0) && __Pyx_IgnoreException(PyExc_Exception)) {
32771 ret = 0; // But BaseException is still propagated.
32772 }
32773 Py_XDECREF(name_attr);
32774 return ret;
32775}
32776static PyObject *__Pyx_setup_reduce_get_reduce_attribute(PyObject *type_obj, PyObject *name, int allow_not_present) {
32777#if CYTHON_USE_PYTYPE_LOOKUP
32778 CYTHON_UNUSED_VAR(allow_not_present);
32779 return _PyType_Lookup((PyTypeObject*)type_obj, name);
32780#else
32781 if (allow_not_present) {
32782 return __Pyx_PyObject_GetAttrStrNoError(type_obj, name);
32783 } else {
32784 return __Pyx_PyObject_GetAttrStr(type_obj, name);
32785 }
32786#endif
32787}
32788static int __Pyx_setup_reduce(PyObject* type_obj) {
32789 int ret = 0;
32790 PyObject *object_reduce = NULL;
32791 PyObject *object_getstate = NULL;
32792 PyObject *object_reduce_ex = NULL;
32793 PyObject *reduce = NULL;
32794 PyObject *reduce_ex = NULL;
32795 PyObject *reduce_cython = NULL;
32796 PyObject *setstate = NULL;
32797 PyObject *setstate_cython = NULL;
32798 PyObject *getstate = NULL;
32799 getstate = __Pyx_setup_reduce_get_reduce_attribute(type_obj, __pyx_mstate_global->__pyx_n_u_getstate, 1);
32800 if (!getstate && PyErr_Occurred()) {
32801 goto __PYX_BAD;
32802 }
32803 if (getstate) {
32804 object_getstate = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate, 1);
32805 if (!object_getstate && PyErr_Occurred()) {
32806 goto __PYX_BAD;
32807 }
32808 if (object_getstate != getstate) {
32809 goto __PYX_GOOD;
32810 }
32811 }
32812 object_reduce_ex = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex, 0);
32813 if (unlikely(!object_reduce_ex)) goto __PYX_BAD;
32814 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
32815 if (reduce_ex == object_reduce_ex) {
32816 object_reduce = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce, 0);
32817 if (!object_reduce) goto __PYX_BAD;
32818 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
32819 int try_to_replace_reduce = (reduce == object_reduce);
32820 if (!try_to_replace_reduce) {
32821 try_to_replace_reduce = __Pyx_setup_reduce_is_named(reduce, __pyx_mstate_global->__pyx_n_u_reduce_cython);
32822 if (unlikely(try_to_replace_reduce < 0)) {
32823 goto __PYX_BAD;
32824 }
32825 }
32826 if (try_to_replace_reduce) {
32827 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython);
32828 if (likely(reduce_cython)) {
32829 ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
32830 ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
32831 } else if (reduce == object_reduce || PyErr_Occurred()) {
32832 goto __PYX_BAD;
32833 }
32834 setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate);
32835 int try_to_replace_setstate;
32836 if (!setstate) {
32837 PyObject *exc = PyErr_Occurred();
32838 if (exc && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
32839 goto __PYX_BAD;
32840 }
32841 try_to_replace_setstate = 1;
32842 } else {
32843 try_to_replace_setstate = __Pyx_setup_reduce_is_named(setstate, __pyx_mstate_global->__pyx_n_u_setstate_cython);
32844 if (unlikely(try_to_replace_setstate < 0)) {
32845 goto __PYX_BAD;
32846 }
32847 }
32848 if (try_to_replace_setstate) {
32849 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython);
32850 if (likely(setstate_cython)) {
32851 ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
32852 ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
32853 } else if (!setstate || PyErr_Occurred()) {
32854 goto __PYX_BAD;
32855 }
32856 }
32857 PyType_Modified((PyTypeObject*)type_obj);
32858 }
32859 }
32860 goto __PYX_GOOD;
32861__PYX_BAD:
32862 if (!PyErr_Occurred()) {
32863 __Pyx_RaiseErrorWithType(
32864 PyExc_RuntimeError,
32865 "Unable to initialize pickling for " __Pyx_FMT_TYPENAME,
32866 (PyTypeObject*)type_obj);
32867 }
32868 ret = -1;
32869__PYX_GOOD:
32870#if !CYTHON_USE_PYTYPE_LOOKUP
32871 Py_XDECREF(object_reduce);
32872 Py_XDECREF(object_reduce_ex);
32873 Py_XDECREF(object_getstate);
32874 Py_XDECREF(getstate);
32875#endif
32876 Py_XDECREF(reduce);
32877 Py_XDECREF(reduce_ex);
32878 Py_XDECREF(reduce_cython);
32879 Py_XDECREF(setstate);
32880 Py_XDECREF(setstate_cython);
32881 return ret;
32882}
32883
32884/* ApplySequenceOrMappingFlag */
32885#if CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_PYPY && CYTHON_USE_TYPE_SPECS)
32886int __Pyx_ApplySequenceOrMappingFlag(PyTypeObject *tp, int is_sequence) {
32887 PyObject *abc;
32888 PyObject *collections_abc = PyImport_ImportModule("collections.abc");
32889 if (unlikely(!collections_abc)) return -1;
32890 abc = PyObject_GetAttrString(collections_abc, is_sequence ? "Sequence": "Mapping");
32891 Py_DECREF(collections_abc);
32892 if (unlikely(!abc)) return -1;
32893 PyObject *register_result = PyObject_CallMethod(abc, "register", "O", (PyObject*)tp);
32894 Py_DECREF(abc);
32895 if (unlikely(!register_result)) return -1;
32896 Py_DECREF(register_result);
32897 return 0;
32898}
32899#elif CYTHON_COMPILING_IN_PYPY // && !CYTHON_USE_TYPE_SPECS
32900int __Pyx_ApplySequenceOrMappingFlag(PyTypeObject *tp, int is_sequence) {
32901 CYTHON_UNUSED_VAR(tp);
32902 CYTHON_UNUSED_VAR(is_sequence);
32903 return PyErr_WarnEx(
32904 PyExc_RuntimeWarning,
32905 "cython.collection_type only works on PyPy with the C flag CYTHON_USE_TYPE_SPECS=1",
32906 1
32907 );
32908}
32909#endif
32910
32911/* GetVTable (used by MergeVTables) */
32912static int __Pyx_GetVtable(PyTypeObject *type, void** table) {
32913 void* ptr;
32914 *table = NULL;
32915#if CYTHON_COMPILING_IN_LIMITED_API
32916 PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
32917#else
32918 PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
32919#endif
32920 if (!ob)
32921 goto no_attr;
32922 ptr = PyCapsule_GetPointer(ob, 0);
32923 if (!ptr && !PyErr_Occurred())
32924 PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
32925 Py_DECREF(ob);
32926 *table = ptr;
32927 return 1;
32928no_attr:
32929 if (PyErr_ExceptionMatches(CYTHON_COMPILING_IN_LIMITED_API ? PyExc_AttributeError : PyExc_KeyError)) {
32930 return 0;
32931 }
32932 Py_XDECREF(ob);
32933 return -1;
32934}
32935
32936/* MergeVTables (used by SetVTable) */
32937static int __Pyx_MergeVtables(PyTypeObject *type) {
32938 int i=0;
32939 Py_ssize_t size;
32940 void** base_vtables;
32941 void* unknown = (void*)-1;
32942 PyObject* bases = __Pyx_PyType_GetSlot(type, tp_bases, PyObject*);
32943 int base_depth = 0;
32944 {
32945 PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
32946 while (base) {
32947 base_depth += 1;
32948 base = __Pyx_PyType_TryGetSlot(base, tp_base, PyTypeObject*);
32949 }
32950 }
32951 base_vtables = (void**) PyMem_Malloc(sizeof(void*) * (size_t)(base_depth + 1));
32952 if (unlikely(!base_vtables)) {
32953 PyErr_NoMemory();
32954 return -1;
32955 }
32956 base_vtables[0] = unknown;
32957#if CYTHON_COMPILING_IN_LIMITED_API
32958 size = PyTuple_Size(bases);
32959 if (size < 0) goto other_failure;
32960#else
32961 size = PyTuple_GET_SIZE(bases);
32962#endif
32963 for (i = 1; i < size; i++) {
32964 PyObject *basei;
32965 void* base_vtable;
32966#if CYTHON_AVOID_BORROWED_REFS
32967 basei = PySequence_GetItem(bases, i);
32968 if (unlikely(!basei)) goto other_failure;
32969#elif !CYTHON_ASSUME_SAFE_MACROS
32970 basei = PyTuple_GetItem(bases, i);
32971 if (unlikely(!basei)) goto other_failure;
32972#else
32973 basei = PyTuple_GET_ITEM(bases, i);
32974#endif
32975 int get_vtable_result = __Pyx_GetVtable((PyTypeObject*)basei, &base_vtable);
32976#if CYTHON_AVOID_BORROWED_REFS
32977 Py_DECREF(basei);
32978#endif
32979 if (get_vtable_result != 1) {
32980 if (get_vtable_result == -1) {
32981 goto other_failure;
32982 }
32983 PyErr_Clear(); // Class doesn't have a vtable.
32984 } else {
32985 assert(base_vtable != NULL);
32986 int j;
32987 PyTypeObject* base = __Pyx_PyType_TryGetSlot(type, tp_base, PyTypeObject*);
32988#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
32989 if (!base) goto bad;
32990#endif
32991 for (j = 0; j < base_depth; j++) {
32992 if (base_vtables[j] == unknown) {
32993 switch (__Pyx_GetVtable(base, &base_vtables[j])) {
32994 case 1:
32995 assert(base_vtables[j] == NULL);
32996 break;
32997 case 0:
32998 goto bad;
32999 case -1:
33000 default:
33001 goto other_failure;
33002 }
33003 base_vtables[j + 1] = unknown;
33004 }
33005 if (base_vtables[j] == base_vtable) {
33006 break;
33007 }
33008 base = __Pyx_PyType_TryGetSlot(base, tp_base, PyTypeObject*);
33009#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
33010 if (!base) goto bad;
33011#endif
33012 }
33013 }
33014 }
33015 PyMem_Free(base_vtables);
33016 return 0;
33017bad:
33018 {
33019 PyTypeObject* tp_base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
33020 PyTypeObject* basei;
33021#if CYTHON_AVOID_BORROWED_REFS
33022 basei = (PyTypeObject*)PySequence_GetItem(bases, i);
33023 if (unlikely(!basei)) goto other_failure;
33024#elif !CYTHON_ASSUME_SAFE_MACROS
33025 basei = (PyTypeObject*)PyTuple_GetItem(bases, i);
33026 if (unlikely(!basei)) goto other_failure;
33027#else
33028 basei = (PyTypeObject*)PyTuple_GET_ITEM(bases, i);
33029#endif
33030 __Pyx_RaiseTypeErrorWithTypes(
33031 "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base, basei);
33032#if CYTHON_AVOID_BORROWED_REFS
33033 Py_DECREF(basei);
33034#endif
33035 }
33036other_failure:
33037 PyMem_Free(base_vtables);
33038 return -1;
33039}
33040
33041/* SetVTable */
33042static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
33043 PyObject *ob = PyCapsule_New(vtable, 0, 0);
33044 if (unlikely(!ob))
33045 goto bad;
33046#if CYTHON_COMPILING_IN_LIMITED_API
33047 if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
33048#else
33049 if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
33050#endif
33051 goto bad;
33052 Py_DECREF(ob);
33053 return __Pyx_MergeVtables(type);
33054bad:
33055 Py_XDECREF(ob);
33056 return -1;
33057}
33058
33059/* TypeImport */
33060#ifndef __PYX_HAVE_RT_ImportType_3_3_0
33061#define __PYX_HAVE_RT_ImportType_3_3_0
33062static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject *module, const char *module_name, const char *class_name,
33063 size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_3_0 check_size)
33064{
33065 PyObject *result = 0;
33066 Py_ssize_t basicsize;
33067 Py_ssize_t itemsize;
33068#if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API)
33069 PyObject *py_basicsize;
33070 PyObject *py_itemsize;
33071#endif
33072 result = PyObject_GetAttrString(module, class_name);
33073 if (!result)
33074 goto bad;
33075 if (!PyType_Check(result)) {
33076 PyErr_Format(PyExc_TypeError,
33077 "%.200s.%.200s is not a type object",
33078 module_name, class_name);
33079 goto bad;
33080 }
33081#if !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) )
33082 basicsize = ((PyTypeObject *)result)->tp_basicsize;
33083 itemsize = ((PyTypeObject *)result)->tp_itemsize;
33084#else
33085 if (size == 0) {
33086 return (PyTypeObject *)result;
33087 }
33088 py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
33089 if (!py_basicsize)
33090 goto bad;
33091 basicsize = PyLong_AsSsize_t(py_basicsize);
33092 Py_DECREF(py_basicsize);
33093 py_basicsize = 0;
33094 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
33095 goto bad;
33096 py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
33097 if (!py_itemsize)
33098 goto bad;
33099 itemsize = PyLong_AsSsize_t(py_itemsize);
33100 Py_DECREF(py_itemsize);
33101 py_itemsize = 0;
33102 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
33103 goto bad;
33104#endif
33105 if (itemsize) {
33106 if (size % alignment) {
33107 alignment = size % alignment;
33108 }
33109 if (itemsize < (Py_ssize_t)alignment)
33110 itemsize = (Py_ssize_t)alignment;
33111 }
33112 if ((size_t)(basicsize + itemsize) < size) {
33113 PyErr_Format(PyExc_ValueError,
33114 "%.200s.%.200s size changed, may indicate binary incompatibility. "
33115 "Expected %zd from C header, got %zd from PyObject",
33116 module_name, class_name, size, basicsize+itemsize);
33117 goto bad;
33118 }
33119 if (check_size == __Pyx_ImportType_CheckSize_Error_3_3_0 &&
33120 ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
33121 PyErr_Format(PyExc_ValueError,
33122 "%.200s.%.200s size changed, may indicate binary incompatibility. "
33123 "Expected %zd from C header, got %zd-%zd from PyObject",
33124 module_name, class_name, size, basicsize, basicsize+itemsize);
33125 goto bad;
33126 }
33127 else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_3_0 && (size_t)basicsize > size) {
33128 if (PyErr_WarnFormat(NULL, 0,
33129 "%.200s.%.200s size changed, may indicate binary incompatibility. "
33130 "Expected %zd from C header, got %zd from PyObject",
33131 module_name, class_name, size, basicsize) < 0) {
33132 goto bad;
33133 }
33134 }
33135 return (PyTypeObject *)result;
33136bad:
33137 Py_XDECREF(result);
33138 return NULL;
33139}
33140#endif
33141
33142/* dict_setdefault (used by FetchCommonType) */
33143static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
33144 PyObject* value;
33145#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
33146 PyDict_SetDefaultRef(d, key, default_value, &value);
33147#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
33148 PyObject *args[] = {d, key, default_value};
33149 value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
33150#elif CYTHON_COMPILING_IN_LIMITED_API
33151 value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
33152#else
33153 value = PyDict_SetDefault(d, key, default_value);
33154 if (unlikely(!value)) return NULL;
33155 Py_INCREF(value);
33156#endif
33157 return value;
33158}
33159
33160/* AddModuleRef (used by FetchSharedCythonModule) */
33161#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3
33162 static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
33163 PyObject *module_dict = PyImport_GetModuleDict();
33164 PyObject *m;
33165 if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
33166 return NULL;
33167 }
33168 if (m != NULL && PyModule_Check(m)) {
33169 return m;
33170 }
33171 Py_XDECREF(m);
33172 m = PyModule_NewObject(name);
33173 if (m == NULL)
33174 return NULL;
33175 if (PyDict_CheckExact(module_dict)) {
33176 PyObject *new_m;
33177 (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
33178 Py_DECREF(m);
33179 return new_m;
33180 } else {
33181 if (PyObject_SetItem(module_dict, name, m) != 0) {
33182 Py_DECREF(m);
33183 return NULL;
33184 }
33185 return m;
33186 }
33187 }
33188 static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
33189 if ((PY_VERSION_HEX >= 0x030E0000) && Py_Version >= 0x030E0100) {
33190 return PyImport_AddModuleRef(name);
33191 }
33192 PyObject *py_name = PyUnicode_FromString(name);
33193 if (!py_name) return NULL;
33194 PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
33195 Py_DECREF(py_name);
33196 return module;
33197 }
33198#elif __PYX_LIMITED_VERSION_HEX < 0x030d0000
33199 static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
33200 PyObject *module = PyImport_AddModule(name);
33201 Py_XINCREF(module);
33202 return module;
33203 }
33204#endif
33205
33206/* FetchSharedCythonModule (used by FetchCommonType) */
33207static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
33208 return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
33209}
33210
33211/* VerifyCachedType (used by FetchCommonType) */
33212static int __Pyx_VerifyCachedType(PyObject *cached_type,
33213 const char *name,
33214 Py_ssize_t expected_basicsize) {
33215 Py_ssize_t basicsize;
33216 if (!PyType_Check(cached_type)) {
33217 PyErr_Format(PyExc_TypeError,
33218 "Shared Cython type %.200s is not a type object", name);
33219 return -1;
33220 }
33221 if (expected_basicsize == 0) {
33222 return 0; // size is inherited, nothing useful to check
33223 }
33224#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_OPAQUE_OBJECTS
33225 if (expected_basicsize < 0) {
33226 basicsize = PyType_GetTypeDataSize((PyTypeObject*)cached_type);
33227 } else
33228#endif
33229 {
33230 #if CYTHON_COMPILING_IN_LIMITED_API
33231 PyObject *py_basicsize;
33232 py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
33233 if (unlikely(!py_basicsize)) return -1;
33234 basicsize = PyLong_AsSsize_t(py_basicsize);
33235 Py_DECREF(py_basicsize);
33236 py_basicsize = NULL;
33237 if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1;
33238 #else
33239 basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
33240 #endif
33241 }
33242 if ((expected_basicsize >= 0) ?
33243 (basicsize != expected_basicsize) :
33244 (basicsize < -expected_basicsize)) {
33245 PyErr_Format(PyExc_TypeError,
33246 "Shared Cython type %.200s has the wrong size, try recompiling",
33247 name);
33248 return -1;
33249 }
33250 return 0;
33251}
33252
33253/* FetchCommonType (used by CommonTypesMetaclass) */
33254#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
33255static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
33256 PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
33257 if (result && metaclass) {
33258 PyObject *old_tp = (PyObject*)Py_TYPE(result);
33259 Py_INCREF((PyObject*)metaclass);
33260 Py_SET_TYPE(result, metaclass);
33261 Py_DECREF(old_tp);
33262 PyType_Modified((PyTypeObject*)result);
33263 }
33264 return result;
33265}
33266#else
33267#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
33268#endif
33269static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
33270 PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
33271 int get_item_ref_result;
33272 const char* object_name = strrchr(spec->name, '.');
33273 object_name = object_name ? object_name+1 : spec->name;
33274 py_object_name = PyUnicode_FromString(object_name);
33275 if (!py_object_name) return NULL;
33276 abi_module = __Pyx_FetchSharedCythonABIModule();
33277 if (!abi_module) goto done;
33278 abi_module_dict = PyModule_GetDict(abi_module);
33279 if (!abi_module_dict) goto done;
33280 get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
33281 if (get_item_ref_result == 1) {
33282 if (__Pyx_VerifyCachedType(
33283 cached_type,
33284 object_name,
33285 spec->basicsize) < 0) {
33286 goto bad;
33287 }
33288 goto done;
33289 } else if (unlikely(get_item_ref_result == -1)) {
33290 goto bad;
33291 }
33292 cached_type = __Pyx_PyType_FromMetaclass(
33293 metaclass,
33294 CYTHON_USE_MODULE_STATE ? module : abi_module,
33295 spec, bases);
33296 if (unlikely(!cached_type)) goto bad;
33297 new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type);
33298 if (unlikely(new_cached_type != cached_type)) {
33299 if (unlikely(!new_cached_type)) goto bad;
33300 Py_DECREF(cached_type);
33301 cached_type = new_cached_type;
33302 if (__Pyx_VerifyCachedType(
33303 cached_type,
33304 object_name,
33305 spec->basicsize) < 0) {
33306 goto bad;
33307 }
33308 goto done;
33309 } else {
33310 Py_DECREF(new_cached_type);
33311 }
33312done:
33313 Py_XDECREF(abi_module);
33314 Py_DECREF(py_object_name);
33315 assert(cached_type == NULL || PyType_Check(cached_type));
33316 return (PyTypeObject *) cached_type;
33317bad:
33318 Py_XDECREF(cached_type);
33319 cached_type = NULL;
33320 goto done;
33321}
33322
33323/* CommonTypesMetaclass (used by CythonFunctionShared) */
33324static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
33325 return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
33326}
33327#if __PYX_LIMITED_VERSION_HEX < 0x030A0000
33328static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) {
33329 PyErr_SetString(PyExc_TypeError, "Cannot instantiate Cython internal types");
33330 return NULL;
33331}
33332static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) {
33333 PyErr_SetString(PyExc_TypeError, "Cython internal types are immutable");
33334 return -1;
33335}
33336#endif
33337static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
33338 {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
33339 {0, 0, 0, 0, 0}
33340};
33341static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
33342 {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset},
33343 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
33344 {Py_tp_call, (void*)__pyx_CommonTypesMetaclass_call},
33345 {Py_tp_new, (void*)__pyx_CommonTypesMetaclass_call},
33346 {Py_tp_setattro, (void*)__pyx_CommonTypesMetaclass_setattr},
33347 #endif
33348 {0, 0}
33349};
33350static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
33351 __PYX_TYPE_MODULE_PREFIX "_common_types_metatype",
33352 0,
33353 0,
33354 Py_TPFLAGS_IMMUTABLETYPE |
33355 Py_TPFLAGS_DISALLOW_INSTANTIATION |
33356 Py_TPFLAGS_DEFAULT,
33357 __pyx_CommonTypesMetaclass_slots
33358};
33359static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
33360 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
33361 PyObject *bases = PyTuple_Pack(1, &PyType_Type);
33362 if (unlikely(!bases)) {
33363 return -1;
33364 }
33365 mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
33366 Py_DECREF(bases);
33367 if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
33368 return -1;
33369 }
33370 return 0;
33371}
33372
33373/* CythonFunctionPerModule (used by CythonFunctionShared) */
33374#if CYTHON_COMPILING_IN_LIMITED_API
33375static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) {
33376 if (__Pyx_CyFunction_Check(func)) {
33377 return __Pyx_as_CyFunctionObject(func)->func_methoddef->ml_meth == (PyCFunction) cfunc;
33378 } else if (PyCFunction_Check(func)) {
33379 return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
33380 }
33381 return 0;
33382}
33383static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
33384 if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
33385 int result;
33386 PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
33387 if (unlikely(!newFunc)) {
33388 PyErr_Clear(); // It's only an optimization, so don't throw an error
33389 return 0;
33390 }
33391 result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
33392 Py_DECREF(newFunc);
33393 return result;
33394 }
33395 return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
33396}
33397#else
33398static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
33399 if (PyMethod_Check(func)) {
33400 func = PyMethod_GET_FUNCTION(func);
33401 }
33402 return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
33403}
33404#endif
33405static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
33406#if CYTHON_COMPILING_IN_LIMITED_API
33407 __Pyx_Py_XDECREF_SET(
33408 __Pyx__CyFunction_GetClassObj(f),
33409 ((classobj) ? __Pyx_NewRef(classobj) : NULL));
33410#else
33411 __Pyx_Py_XDECREF_SET(
33412 ((PyCMethodObject *) (f))->mm_class,
33413 (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
33414#endif
33415}
33416static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
33417 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
33418 m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type);
33419 if (unlikely(!m->defaults))
33420 return NULL;
33421 return m->defaults;
33422}
33423static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
33424 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
33425 m->defaults_tuple = tuple;
33426 Py_INCREF(tuple);
33427}
33428static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
33429 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
33430 m->defaults_kwdict = dict;
33431 Py_INCREF(dict);
33432}
33433static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
33434 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
33435 m->func_annotations = dict;
33436 Py_INCREF(dict);
33437}
33438
33439/* PyMethodNew (used by CythonFunctionShared) */
33440#if CYTHON_COMPILING_IN_LIMITED_API
33441static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
33442 PyObject *result;
33443 CYTHON_UNUSED_VAR(typ);
33444 if (!self)
33445 return __Pyx_NewRef(func);
33446 #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
33447 {
33448 PyObject *args[] = {func, self};
33449 result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
33450 }
33451 #else
33452 result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
33453 #endif
33454 return result;
33455}
33456#else
33457static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
33458 CYTHON_UNUSED_VAR(typ);
33459 if (!self)
33460 return __Pyx_NewRef(func);
33461 return PyMethod_New(func, self);
33462}
33463#endif
33464
33465/* PyVectorcallFastCallDict (used by CythonFunctionShared) */
33466#if CYTHON_VECTORCALL
33467static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
33468{
33469 PyObject *res = NULL;
33470 PyObject *kwnames;
33471 PyObject **newargs;
33472 PyObject **kwvalues;
33473 Py_ssize_t i;
33474 #if CYTHON_AVOID_BORROWED_REFS
33475 PyObject *pos;
33476 #else
33477 Py_ssize_t pos;
33478 #endif
33479 size_t j;
33480 PyObject *key, *value;
33481 unsigned long keys_are_strings;
33482 #if !CYTHON_ASSUME_SAFE_SIZE
33483 Py_ssize_t nkw = PyDict_Size(kw);
33484 if (unlikely(nkw == -1)) return NULL;
33485 #else
33486 Py_ssize_t nkw = PyDict_GET_SIZE(kw);
33487 #endif
33488 newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
33489 if (unlikely(newargs == NULL)) {
33490 PyErr_NoMemory();
33491 return NULL;
33492 }
33493 for (j = 0; j < nargs; j++) newargs[j] = args[j];
33494 kwnames = PyTuple_New(nkw);
33495 if (unlikely(kwnames == NULL)) {
33496 PyMem_Free(newargs);
33497 return NULL;
33498 }
33499 kwvalues = newargs + nargs;
33500 pos = 0;
33501 i = 0;
33502 keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
33503 while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) {
33504 keys_are_strings &=
33505 #if CYTHON_COMPILING_IN_LIMITED_API
33506 PyType_GetFlags(Py_TYPE(key));
33507 #else
33508 Py_TYPE(key)->tp_flags;
33509 #endif
33510 #if !CYTHON_ASSUME_SAFE_MACROS
33511 if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup;
33512 #else
33513 PyTuple_SET_ITEM(kwnames, i, key);
33514 #endif
33515 kwvalues[i] = value;
33516 i++;
33517 }
33518 if (unlikely(!keys_are_strings)) {
33519 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
33520 goto cleanup;
33521 }
33522 res = vc(func, newargs, nargs, kwnames);
33523cleanup:
33524 #if CYTHON_AVOID_BORROWED_REFS
33525 Py_DECREF(pos);
33526 #endif
33527 Py_DECREF(kwnames);
33528 for (i = 0; i < nkw; i++)
33529 Py_DECREF(kwvalues[i]);
33530 PyMem_Free(newargs);
33531 return res;
33532}
33533static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
33534{
33535 Py_ssize_t kw_size =
33536 likely(kw == NULL) ?
33537 0 :
33538#if !CYTHON_ASSUME_SAFE_SIZE
33539 PyDict_Size(kw);
33540#else
33541 PyDict_GET_SIZE(kw);
33542#endif
33543 if (kw_size == 0) {
33544 return vc(func, args, nargs, NULL);
33545 }
33546#if !CYTHON_ASSUME_SAFE_SIZE
33547 else if (unlikely(kw_size == -1)) {
33548 return NULL;
33549 }
33550#endif
33551 return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
33552}
33553#endif
33554
33555/* CythonFunctionShared (used by CythonFunction) */
33556static PyObject *
33557__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
33558{
33559 if (unlikely(op->func_doc == NULL)) {
33560#if CYTHON_COMPILING_IN_LIMITED_API
33561 const char *doc = op->func_methoddef->ml_doc;
33562#else
33563 const char *doc = ((PyCFunctionObject*)op)->m_ml->ml_doc;
33564#endif
33565 if (doc) {
33566 op->func_doc = PyUnicode_FromString(doc);
33567 if (unlikely(op->func_doc == NULL))
33568 return NULL;
33569 } else {
33570 Py_INCREF(Py_None);
33571 return Py_None;
33572 }
33573 }
33574 Py_INCREF(op->func_doc);
33575 return op->func_doc;
33576}
33577static PyObject *
33578__Pyx_CyFunction_get_doc(PyObject *op_in, void *closure) {
33579 PyObject *result;
33580 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
33581 CYTHON_UNUSED_VAR(closure);
33582 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
33583 result = __Pyx_CyFunction_get_doc_locked(op);
33584 __Pyx_END_CRITICAL_SECTION();
33585 return result;
33586}
33587static int
33588__Pyx_CyFunction_set_doc(PyObject *op_in, PyObject *value, void *context)
33589{
33590 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
33591 CYTHON_UNUSED_VAR(context);
33592 if (value == NULL) {
33593 value = Py_None;
33594 }
33595 Py_INCREF(value);
33596 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
33597 __Pyx_Py_XDECREF_SET(op->func_doc, value);
33598 __Pyx_END_CRITICAL_SECTION();
33599 return 0;
33600}
33601static PyObject *
33602__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
33603{
33604 if (unlikely(op->func_name == NULL)) {
33605#if CYTHON_COMPILING_IN_LIMITED_API
33606 const char *name = op->func_methoddef->ml_name;
33607#else
33608 const char *name = ((PyCFunctionObject*)op)->m_ml->ml_name;
33609#endif
33610 op->func_name = PyUnicode_InternFromString(name);
33611 if (unlikely(op->func_name == NULL))
33612 return NULL;
33613 }
33614 Py_INCREF(op->func_name);
33615 return op->func_name;
33616}
33617static PyObject *
33618__Pyx_CyFunction_get_name(PyObject *op, void *context)
33619{
33620 PyObject *result = NULL;
33621 CYTHON_UNUSED_VAR(context);
33622 __Pyx_BEGIN_CRITICAL_SECTION(op);
33623 result = __Pyx_CyFunction_get_name_locked(__Pyx_as_CyFunctionObject(op));
33624 __Pyx_END_CRITICAL_SECTION();
33625 return result;
33626}
33627static int
33628__Pyx_CyFunction_set_name(PyObject *op_in, PyObject *value, void *context)
33629{
33630 CYTHON_UNUSED_VAR(context);
33631 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
33632 PyErr_SetString(PyExc_TypeError,
33633 "__name__ must be set to a string object");
33634 return -1;
33635 }
33636 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
33637 Py_INCREF(value);
33638 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
33639 __Pyx_Py_XDECREF_SET(op->func_name, value);
33640 __Pyx_END_CRITICAL_SECTION();
33641 return 0;
33642}
33643static PyObject *
33644__Pyx_CyFunction_get_qualname(PyObject *op_in, void *context)
33645{
33646 CYTHON_UNUSED_VAR(context);
33647 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
33648 PyObject *result;
33649 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
33650 Py_INCREF(op->func_qualname);
33651 result = op->func_qualname;
33652 __Pyx_END_CRITICAL_SECTION();
33653 return result;
33654}
33655static int
33656__Pyx_CyFunction_set_qualname(PyObject *op_in, PyObject *value, void *context)
33657{
33658 CYTHON_UNUSED_VAR(context);
33659 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
33660 PyErr_SetString(PyExc_TypeError,
33661 "__qualname__ must be set to a string object");
33662 return -1;
33663 }
33664 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
33665 Py_INCREF(value);
33666 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
33667 __Pyx_Py_XDECREF_SET(op->func_qualname, value);
33668 __Pyx_END_CRITICAL_SECTION();
33669 return 0;
33670}
33671#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
33672static PyObject *
33673__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
33674{
33675 CYTHON_UNUSED_VAR(context);
33676 if (unlikely(op->func_dict == NULL)) {
33677 op->func_dict = PyDict_New();
33678 if (unlikely(op->func_dict == NULL))
33679 return NULL;
33680 }
33681 Py_INCREF(op->func_dict);
33682 return op->func_dict;
33683}
33684#endif
33685static PyObject *
33686__Pyx_CyFunction_get_globals(PyObject *op_in, void *context)
33687{
33688 CYTHON_UNUSED_VAR(context);
33689 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
33690 Py_INCREF(op->func_globals);
33691 return op->func_globals;
33692}
33693static PyObject *
33694__Pyx_CyFunction_get_closure(PyObject *op, void *context)
33695{
33696 CYTHON_UNUSED_VAR(op);
33697 CYTHON_UNUSED_VAR(context);
33698 Py_INCREF(Py_None);
33699 return Py_None;
33700}
33701static PyObject *
33702__Pyx_CyFunction_get_code(PyObject *op_in, void *context)
33703{
33704 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
33705 PyObject* result = (op->func_code) ? op->func_code : Py_None;
33706 CYTHON_UNUSED_VAR(context);
33707 Py_INCREF(result);
33708 return result;
33709}
33710static int
33711__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op, PyObject *op_obj) {
33712 int result = 0;
33713 PyObject *res = op->defaults_getter(op_obj);
33714 if (unlikely(!res))
33715 return -1;
33716 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
33717 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
33718 Py_INCREF(op->defaults_tuple);
33719 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
33720 Py_INCREF(op->defaults_kwdict);
33721 #else
33722 op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
33723 if (unlikely(!op->defaults_tuple)) result = -1;
33724 else {
33725 op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
33726 if (unlikely(!op->defaults_kwdict)) result = -1;
33727 }
33728 #endif
33729 Py_DECREF(res);
33730 return result;
33731}
33732static int
33733__Pyx_CyFunction_set_defaults(PyObject *op_in, PyObject* value, void *context) {
33734 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
33735 CYTHON_UNUSED_VAR(context);
33736 if (!value) {
33737 value = Py_None;
33738 } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
33739 PyErr_SetString(PyExc_TypeError,
33740 "__defaults__ must be set to a tuple object");
33741 return -1;
33742 }
33743 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
33744 "currently affect the values used in function calls", 1);
33745 Py_INCREF(value);
33746 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
33747 __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
33748 __Pyx_END_CRITICAL_SECTION();
33749 return 0;
33750}
33751static PyObject *
33752__Pyx_CyFunction_get_defaults_locked(PyObject *op_in) {
33753 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
33754 PyObject* result = op->defaults_tuple;
33755 if (unlikely(!result)) {
33756 if (op->defaults_getter) {
33757 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0)) return NULL;
33758 result = op->defaults_tuple;
33759 } else {
33760 result = Py_None;
33761 }
33762 }
33763 Py_INCREF(result);
33764 return result;
33765}
33766static PyObject *
33767__Pyx_CyFunction_get_defaults(PyObject *op, void *context) {
33768 PyObject* result = NULL;
33769 CYTHON_UNUSED_VAR(context);
33770 __Pyx_BEGIN_CRITICAL_SECTION(op);
33771 result = __Pyx_CyFunction_get_defaults_locked(op);
33772 __Pyx_END_CRITICAL_SECTION();
33773 return result;
33774}
33775static int
33776__Pyx_CyFunction_set_kwdefaults(PyObject *op_in, PyObject* value, void *context) {
33777 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
33778 CYTHON_UNUSED_VAR(context);
33779 if (!value) {
33780 value = Py_None;
33781 } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
33782 PyErr_SetString(PyExc_TypeError,
33783 "__kwdefaults__ must be set to a dict object");
33784 return -1;
33785 }
33786 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
33787 "currently affect the values used in function calls", 1);
33788 Py_INCREF(value);
33789 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
33790 __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
33791 __Pyx_END_CRITICAL_SECTION();
33792 return 0;
33793}
33794static PyObject *
33795__Pyx_CyFunction_get_kwdefaults_locked(PyObject *op_in) {
33796 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
33797 PyObject* result = op->defaults_kwdict;
33798 if (unlikely(!result)) {
33799 if (op->defaults_getter) {
33800 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0)) return NULL;
33801 result = op->defaults_kwdict;
33802 } else {
33803 result = Py_None;
33804 }
33805 }
33806 Py_INCREF(result);
33807 return result;
33808}
33809static PyObject *
33810__Pyx_CyFunction_get_kwdefaults(PyObject *op, void *context) {
33811 PyObject* result;
33812 CYTHON_UNUSED_VAR(context);
33813 __Pyx_BEGIN_CRITICAL_SECTION(op);
33814 result = __Pyx_CyFunction_get_kwdefaults_locked(op);
33815 __Pyx_END_CRITICAL_SECTION();
33816 return result;
33817}
33818static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value);
33819static int
33820__Pyx_CyFunction_set_annotations(PyObject *op_in, PyObject* value, void *context) {
33821 CYTHON_UNUSED_VAR(context);
33822 if (!value || value == Py_None) {
33823 value = NULL;
33824 } else if (unlikely(!PyDict_Check(value))) {
33825 PyErr_SetString(PyExc_TypeError,
33826 "__annotations__ must be set to a dict object");
33827 return -1;
33828 }
33829 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
33830 Py_XINCREF(value);
33831 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
33832 __Pyx_Py_XDECREF_SET(op->func_annotations, value);
33833 __Pyx_END_CRITICAL_SECTION();
33834 if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, Py_None) < 0)) return -1;
33835 return 0;
33836}
33837static int
33838__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) {
33839 /* Return 1 if the function dict exists, 0 otherwise. This cannot fail:
33840 * _PyObject_GetDictPtr() may clear errors internally, but never reports them. */
33841#if CYTHON_COMPILING_IN_PYPY
33842 *dict = PyObject_GenericGetDict(op_in, NULL);
33843#elif CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030C0000
33844 *dict = __Pyx_as_CyFunctionObject(op_in)->func_dict;
33845#else
33846 PyObject **dictptr = _PyObject_GetDictPtr(op_in);
33847 *dict = likely(dictptr) ? *dictptr : NULL;
33848#endif
33849 return *dict ? 1 : 0;
33850}
33851static int
33852__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) {
33853 PyObject *dict;
33854 int dict_found;
33855 *annotate = NULL;
33856 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
33857 if (!dict_found) return 0;
33858 return __Pyx_PyDict_GetItemRef(dict, __pyx_mstate_global->__pyx_n_u_annotate, annotate);
33859}
33860static int
33861__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) {
33862 PyObject *dict;
33863 int dict_found;
33864 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
33865 if (!dict_found) return 0;
33866 if (value) {
33867 return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
33868 } else {
33869#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
33870 return PyDict_Pop(dict, __pyx_mstate_global->__pyx_n_u_annotate, NULL);
33871#else
33872 int result = PyDict_Contains(dict, __pyx_mstate_global->__pyx_n_u_annotate);
33873 if (result == 1) {
33874 result = PyDict_DelItem(dict, __pyx_mstate_global->__pyx_n_u_annotate);
33875 }
33876 return result;
33877#endif
33878 }
33879}
33880static int
33881__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) {
33882 PyObject *dict;
33883 int result;
33884#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
33885 dict = __Pyx_CyFunction_get_dict(__Pyx_as_CyFunctionObject(op_in), NULL);
33886#else
33887 dict = PyObject_GenericGetDict(op_in, NULL);
33888#endif
33889 if (unlikely(!dict)) return -1;
33890 result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
33891 Py_DECREF(dict);
33892 return result;
33893}
33894static PyObject *
33895__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
33896 PyObject* result = op->func_annotations;
33897 if (unlikely(!result)) {
33898 result = PyDict_New();
33899 if (unlikely(!result)) return NULL;
33900 op->func_annotations = result;
33901 }
33902 Py_INCREF(result);
33903 return result;
33904}
33905static PyObject *
33906__Pyx_CyFunction_get_annotations(PyObject *op_in, void *context) {
33907 PyObject *annotate = NULL;
33908 PyObject *result = NULL;
33909 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
33910 CYTHON_UNUSED_VAR(context);
33911 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
33912 result = __Pyx_XNewRef(op->func_annotations);
33913 __Pyx_END_CRITICAL_SECTION();
33914 if (result) return result;
33915 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL;
33916 if (!annotate || annotate == Py_None) {
33917 Py_XDECREF(annotate);
33918 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
33919 result = __Pyx_CyFunction_get_annotations_locked(op);
33920 __Pyx_END_CRITICAL_SECTION();
33921 return result;
33922 }
33923 PyObject *format = PyLong_FromLong(1L); // annotationlib.Format.VALUE
33924 if (likely(format)) {
33925 if (!Py_EnterRecursiveCall(" cyfunction __annotations__.__get__")) {
33926 result = __Pyx_PyObject_CallOneArg(annotate, format);
33927 Py_LeaveRecursiveCall();
33928 Py_DECREF(format);
33929 }
33930 }
33931 Py_DECREF(annotate);
33932 if (unlikely(!result)) return NULL;
33933 if (unlikely(!PyDict_Check(result))) {
33934 PyErr_SetString(PyExc_TypeError, "__annotate__ must return a dict");
33935 Py_DECREF(result);
33936 return NULL;
33937 }
33938 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
33939 __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result));
33940 __Pyx_END_CRITICAL_SECTION();
33941 return result;
33942}
33943static PyObject *__Pyx_CyFunction_annotate_impl(PyObject *self, PyObject *arg) {
33944 CYTHON_UNUSED_VAR(arg);
33945 if (unlikely(!self)) {
33946 PyErr_SetString(PyExc_SystemError, "cython __annotate__ called without 'self' argument");
33947 return NULL;
33948 }
33949 PyObject *result;
33950 if (Py_EnterRecursiveCall(" in cyfunction annotate")) {
33951 return NULL;
33952 }
33953 result = __Pyx_CyFunction_get_annotations(self, NULL);
33954 Py_LeaveRecursiveCall();
33955 return result;
33956}
33957static PyObject *
33958__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context);
33959static int
33960__Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value, void *context) {
33961 CYTHON_UNUSED_VAR(context);
33962 if (value == NULL) {
33963 PyErr_SetString(PyExc_TypeError, "__annotate__ cannot be deleted");
33964 return -1;
33965 }
33966 if (unlikely(value != Py_None && !PyCallable_Check(value))) {
33967 PyErr_SetString(PyExc_TypeError, "__annotate__ must be callable or None");
33968 return -1;
33969 }
33970 if (unlikely(__Pyx_TypeCheck(value, &PyCFunction_Type))) {
33971#if !CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_PYPY
33972 PyCFunction cfunction = PyCFunction_GetFunction(value);
33973 if (unlikely(!cfunction)) return -1;
33974 PyObject *value_self = PyCFunction_GetSelf(value);
33975 if (unlikely(!value_self && PyErr_Occurred())) return -1;
33976#else
33977 PyCFunction cfunction = PyCFunction_GET_FUNCTION(value);
33978 PyObject *value_self = PyCFunction_GET_SELF(value);
33979#endif
33980 if (cfunction == __Pyx_CyFunction_annotate_impl && value_self == op_in) {
33981 return __Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, NULL);
33982 }
33983 }
33984 if (value != Py_None) {
33985 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
33986 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
33987 Py_CLEAR(op->func_annotations);
33988 __Pyx_END_CRITICAL_SECTION();
33989 }
33990 return __Pyx_CyFunction_set_annotate_in_dict(op_in, value);
33991}
33992#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
33993static PyObject *
33994__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
33995 int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
33996 if (is_coroutine) {
33997 PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
33998 fromlist = PyList_New(1);
33999 if (unlikely(!fromlist)) return NULL;
34000 Py_INCREF(marker);
34001#if CYTHON_ASSUME_SAFE_MACROS
34002 PyList_SET_ITEM(fromlist, 0, marker);
34003#else
34004 if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
34005 Py_DECREF(fromlist);
34006 return NULL;
34007 }
34008#endif
34009 module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
34010 Py_DECREF(fromlist);
34011 if (unlikely(!module)) {
34012 goto ignore_or_error;
34013 }
34014 is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
34015 Py_DECREF(module);
34016 if (likely(is_coroutine_value)) {
34017 return is_coroutine_value;
34018 }
34019ignore_or_error:
34020 if (!__Pyx_IgnoreException(PyExc_Exception)) {
34021 return NULL;
34022 }
34023 }
34024 return __Pyx_PyBool_FromLong(is_coroutine);
34025}
34026static PyObject *
34027__Pyx_CyFunction_get_is_coroutine(PyObject *op_in, void *context) {
34028 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34029 PyObject *result;
34030 CYTHON_UNUSED_VAR(context);
34031 if (op->func_is_coroutine) {
34032 return __Pyx_NewRef(op->func_is_coroutine);
34033 }
34034 result = __Pyx_CyFunction_get_is_coroutine_value(op);
34035 if (unlikely(!result))
34036 return NULL;
34037 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34038 if (op->func_is_coroutine) {
34039 Py_DECREF(result);
34040 result = __Pyx_NewRef(op->func_is_coroutine);
34041 } else {
34042 op->func_is_coroutine = __Pyx_NewRef(result);
34043 }
34044 __Pyx_END_CRITICAL_SECTION();
34045 return result;
34046}
34047#endif
34048static void __Pyx_CyFunction_raise_argument_count_error(PyObject *func, const char* message, Py_ssize_t size) {
34049#if CYTHON_COMPILING_IN_LIMITED_API
34050 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
34051 if (!py_name) return;
34052 PyErr_Format(PyExc_TypeError,
34053 "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
34054 py_name, message, size);
34055 Py_DECREF(py_name);
34056#else
34057 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
34058 PyErr_Format(PyExc_TypeError,
34059 "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
34060 name, message, size);
34061#endif
34062}
34063static void __Pyx_CyFunction_raise_type_error(PyObject *func, const char* message) {
34064#if CYTHON_COMPILING_IN_LIMITED_API
34065 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
34066 if (!py_name) return;
34067 PyErr_Format(PyExc_TypeError,
34068 "%.200S() %s",
34069 py_name, message);
34070 Py_DECREF(py_name);
34071#else
34072 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
34073 PyErr_Format(PyExc_TypeError,
34074 "%.200s() %s",
34075 name, message);
34076#endif
34077}
34078#if CYTHON_COMPILING_IN_LIMITED_API
34079static PyObject *
34080__Pyx_CyFunction_get_module(PyObject *op_in, void *context) {
34081 CYTHON_UNUSED_VAR(context);
34082 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34083 Py_INCREF(op->func_module);
34084 return op->func_module;
34085}
34086static int
34087__Pyx_CyFunction_set_module(PyObject *op_in, PyObject* value, void *context) {
34088 CYTHON_UNUSED_VAR(context);
34089 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34090 if (value == NULL) {
34091 value = Py_None;
34092 }
34093 Py_INCREF(value);
34094 PyObject *old = op->func_module;
34095 op->func_module = value;
34096 Py_DECREF(old);
34097 return 0;
34098}
34099#endif
34100static PyGetSetDef __pyx_CyFunction_getsets[] = {
34101 {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
34102 {"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
34103 {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
34104 {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
34105 {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
34106#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
34107 {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
34108 {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
34109#else
34110 {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
34111 {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
34112#endif
34113 {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
34114 {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
34115 {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
34116 {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
34117 {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
34118 {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
34119 {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
34120 {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
34121 {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
34122 {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
34123 {"__annotate__", (getter)__Pyx_CyFunction_get_annotate, (setter)__Pyx_CyFunction_set_annotate, 0, 0},
34124#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
34125 {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
34126#endif
34127#if CYTHON_COMPILING_IN_LIMITED_API
34128 {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
34129#endif
34130 {0, 0, 0, 0, 0}
34131};
34132static PyMemberDef __pyx_CyFunction_members[] = {
34133#if !CYTHON_COMPILING_IN_LIMITED_API
34134 {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
34135#endif
34136#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
34137 {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict),
34138 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
34139#endif
34140#if CYTHON_VECTORCALL
34141#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
34142 {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall),
34143 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
34144#else
34145 {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
34146#endif
34147#if CYTHON_COMPILING_IN_LIMITED_API
34148 {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist),
34149 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
34150#else
34151 {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
34152#endif
34153#endif
34154 {0, 0, 0, 0, 0}
34155};
34156static PyObject *
34157__Pyx_CyFunction_reduce(PyObject *m_in, PyObject *args)
34158{
34159 PyObject *result = NULL;
34160 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
34161 CYTHON_UNUSED_VAR(args);
34162 __Pyx_BEGIN_CRITICAL_SECTION(m_in);
34163 Py_INCREF(m->func_qualname);
34164 result = m->func_qualname;
34165 __Pyx_END_CRITICAL_SECTION();
34166 return result;
34167}
34168static PyMethodDef __pyx_CyFunction_methods[] = {
34169 {"__annotate_cython__", __Pyx_CyFunction_annotate_impl, METH_O,
34170 "Placeholder __annotate__ function to allow 'functools.wraps' to work "
34171 "on Cython functions."},
34172 {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_NOARGS, 0},
34173 {0, 0, 0, 0}
34174};
34175static PyObject *
34176__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context) {
34177 PyObject *annotate = NULL;
34178 CYTHON_UNUSED_VAR(context);
34179 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL;
34180 if (annotate) return annotate;
34181 PyObject *method = PyCFunction_New(
34182 &__pyx_CyFunction_methods[0],
34183 op_in);
34184 return method;
34185}
34186#if CYTHON_COMPILING_IN_LIMITED_API
34187#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
34188#else
34189#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
34190#endif
34191static PyObject *__Pyx_CyFunction_Init(PyObject *op_in,
34192 PyMethodDef *ml, int flags, PyObject* qualname,
34193 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
34194 __pyx_CyFunctionObject* op = __Pyx_as_CyFunctionObject(op_in);
34195#if !CYTHON_COMPILING_IN_LIMITED_API
34196 PyCFunctionObject *cf = (PyCFunctionObject*) op;
34197#endif
34198 if (unlikely(op == NULL))
34199 return NULL;
34200#if CYTHON_COMPILING_IN_LIMITED_API
34201 op->func_methoddef = ml;
34202 Py_INCREF(module);
34203 op->func_module = module;
34204#endif
34205 op->flags = flags;
34206 __Pyx_CyFunction_weakreflist(op) = NULL;
34207#if !CYTHON_COMPILING_IN_LIMITED_API
34208 cf->m_ml = ml;
34209 cf->m_self = (PyObject *) op;
34210#endif
34211 Py_XINCREF(closure);
34212 op->func_closure = closure;
34213#if !CYTHON_COMPILING_IN_LIMITED_API
34214 Py_XINCREF(module);
34215 cf->m_module = module;
34216#endif
34217#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
34218 op->func_dict = NULL;
34219#endif
34220 op->func_name = NULL;
34221 Py_INCREF(qualname);
34222 op->func_qualname = qualname;
34223 op->func_doc = NULL;
34224#if CYTHON_COMPILING_IN_LIMITED_API
34225 op->func_classobj = NULL;
34226#else
34227 ((PyCMethodObject*)op)->mm_class = NULL;
34228#endif
34229 op->func_globals = globals;
34230 Py_INCREF(op->func_globals);
34231 Py_XINCREF(code);
34232 op->func_code = code;
34233 op->defaults = NULL;
34234 op->defaults_tuple = NULL;
34235 op->defaults_kwdict = NULL;
34236 op->defaults_getter = NULL;
34237 op->func_annotations = NULL;
34238#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
34239 op->func_is_coroutine = NULL;
34240#endif
34241#if CYTHON_VECTORCALL
34242 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
34243 case METH_NOARGS:
34244 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
34245 break;
34246 case METH_O:
34247 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
34248 break;
34249 case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
34250 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
34251 break;
34252 case METH_FASTCALL | METH_KEYWORDS:
34253 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
34254 break;
34255 case METH_VARARGS | METH_KEYWORDS:
34256 __Pyx_CyFunction_func_vectorcall(op) = NULL;
34257 break;
34258 default:
34259 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
34260 Py_DECREF(op_in);
34261 return NULL;
34262 }
34263#endif
34264 return op_in;
34265}
34266static int __Pyx__CyFunction_clear(__pyx_CyFunctionObject *m)
34267{
34268 Py_CLEAR(m->func_closure);
34269#if CYTHON_COMPILING_IN_LIMITED_API
34270 Py_CLEAR(m->func_module);
34271#else
34272 Py_CLEAR(((PyCFunctionObject*)m)->m_module);
34273#endif
34274#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
34275 Py_CLEAR(m->func_dict);
34276#elif PY_VERSION_HEX < 0x030d0000
34277 _PyObject_ClearManagedDict((PyObject*)m);
34278#else
34279 PyObject_ClearManagedDict((PyObject*)m);
34280#endif
34281 Py_CLEAR(m->func_name);
34282 Py_CLEAR(m->func_qualname);
34283 Py_CLEAR(m->func_doc);
34284 Py_CLEAR(m->func_globals);
34285 Py_CLEAR(m->func_code);
34286#if CYTHON_COMPILING_IN_LIMITED_API
34287 Py_CLEAR(m->func_classobj);
34288#else
34289 {
34290 PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
34291 ((PyCMethodObject *) (m))->mm_class = NULL;
34292 Py_XDECREF(cls);
34293 }
34294#endif
34295 Py_CLEAR(m->defaults_tuple);
34296 Py_CLEAR(m->defaults_kwdict);
34297 Py_CLEAR(m->func_annotations);
34298#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
34299 Py_CLEAR(m->func_is_coroutine);
34300#endif
34301 Py_CLEAR(m->defaults);
34302 return 0;
34303}
34304static int
34305__Pyx_CyFunction_clear(PyObject *m)
34306{
34307 return __Pyx__CyFunction_clear(__Pyx_as_CyFunctionObject(m));
34308}
34309static void __Pyx__CyFunction_dealloc(PyObject *m)
34310{
34311 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(m);
34312 if (__Pyx_CyFunction_weakreflist(cyfunc) != NULL)
34313 PyObject_ClearWeakRefs(m);
34314 __Pyx__CyFunction_clear(cyfunc);
34315 __Pyx_PyHeapTypeObject_GC_Del(m);
34316}
34317static void __Pyx_CyFunction_dealloc(PyObject *m)
34318{
34319 PyObject_GC_UnTrack(m);
34320 __Pyx__CyFunction_dealloc(m);
34321}
34322static int __Pyx_CyFunction_traverse(PyObject *m_in, visitproc visit, void *arg)
34323{
34324 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
34325 {
34326 int e = __Pyx_call_type_traverse(m_in, 1, visit, arg);
34327 if (e) return e;
34328 }
34329 Py_VISIT(m->func_closure);
34330#if CYTHON_COMPILING_IN_LIMITED_API
34331 Py_VISIT(m->func_module);
34332#else
34333 Py_VISIT(((PyCFunctionObject*)m)->m_module);
34334#endif
34335#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
34336 Py_VISIT(m->func_dict);
34337#else
34338 {
34339 int e =
34340#if PY_VERSION_HEX < 0x030d0000
34341 _PyObject_VisitManagedDict
34342#else
34343 PyObject_VisitManagedDict
34344#endif
34345 ((PyObject*)m, visit, arg);
34346 if (e != 0) return e;
34347 }
34348#endif
34349 __Pyx_VISIT_CONST(m->func_name);
34350 __Pyx_VISIT_CONST(m->func_qualname);
34351 Py_VISIT(m->func_doc);
34352 Py_VISIT(m->func_globals);
34353 __Pyx_VISIT_CONST(m->func_code);
34354 Py_VISIT(__Pyx__CyFunction_GetClassObj(m));
34355 Py_VISIT(m->defaults_tuple);
34356 Py_VISIT(m->defaults_kwdict);
34357 Py_VISIT(m->func_annotations);
34358#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
34359 Py_VISIT(m->func_is_coroutine);
34360#endif
34361 Py_VISIT(m->defaults);
34362 return 0;
34363}
34364static PyObject*
34365__Pyx_CyFunction_repr(PyObject *op_in)
34366{
34367 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34368 PyObject *repr;
34369 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34370 repr = PyUnicode_FromFormat("<cyfunction %U at %p>",
34371 op->func_qualname, (void *)op);
34372 __Pyx_END_CRITICAL_SECTION();
34373 return repr;
34374}
34375static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
34376#if CYTHON_COMPILING_IN_LIMITED_API
34377 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
34378 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
34379 int flags = cyfunc->func_methoddef->ml_flags;
34380#else
34381 PyCFunctionObject* f = (PyCFunctionObject*)func;
34382 PyCFunction meth = f->m_ml->ml_meth;
34383 int flags = f->m_ml->ml_flags;
34384#endif
34385 Py_ssize_t size;
34386 switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
34387 case METH_VARARGS:
34388 if (likely(kw == NULL || PyDict_Size(kw) == 0))
34389 return (*meth)(self, arg);
34390 break;
34391 case METH_VARARGS | METH_KEYWORDS:
34392 return (*(PyCFunctionWithKeywords)(void(*)(void))meth)(self, arg, kw);
34393 case METH_NOARGS:
34394 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
34395#if CYTHON_ASSUME_SAFE_SIZE
34396 size = PyTuple_GET_SIZE(arg);
34397#else
34398 size = PyTuple_Size(arg);
34399 if (unlikely(size < 0)) return NULL;
34400#endif
34401 if (likely(size == 0))
34402 return (*meth)(self, NULL);
34403 __Pyx_CyFunction_raise_argument_count_error(
34404 func,
34405 "takes no arguments", size);
34406 return NULL;
34407 }
34408 break;
34409 case METH_O:
34410 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
34411#if CYTHON_ASSUME_SAFE_SIZE
34412 size = PyTuple_GET_SIZE(arg);
34413#else
34414 size = PyTuple_Size(arg);
34415 if (unlikely(size < 0)) return NULL;
34416#endif
34417 if (likely(size == 1)) {
34418 PyObject *result, *arg0;
34419 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
34420 arg0 = PyTuple_GET_ITEM(arg, 0);
34421 #else
34422 arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
34423 #endif
34424 result = (*meth)(self, arg0);
34425 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
34426 Py_DECREF(arg0);
34427 #endif
34428 return result;
34429 }
34430 __Pyx_CyFunction_raise_argument_count_error(
34431 func,
34432 "takes exactly one argument", size);
34433 return NULL;
34434 }
34435 break;
34436 default:
34437 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
34438 return NULL;
34439 }
34440 __Pyx_CyFunction_raise_type_error(
34441 func, "takes no keyword arguments");
34442 return NULL;
34443}
34444static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
34445 PyObject *result;
34446 result = __Pyx_CyFunction_CallMethod(func, func, arg, kw);
34447 return result;
34448}
34449static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
34450 PyObject *result;
34451 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
34452#if CYTHON_VECTORCALL
34453 __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
34454 if (vc) {
34455#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
34456 return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
34457#else
34458 (void) &__Pyx_PyVectorcall_FastCallDict;
34459 return PyVectorcall_Call(func, args, kw);
34460#endif
34461 }
34462#endif
34463 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
34464 Py_ssize_t argc;
34465 PyObject *new_args;
34466 PyObject *self;
34467#if CYTHON_ASSUME_SAFE_SIZE
34468 argc = PyTuple_GET_SIZE(args);
34469#else
34470 argc = PyTuple_Size(args);
34471 if (unlikely(argc < 0)) return NULL;
34472#endif
34473 new_args = PyTuple_GetSlice(args, 1, argc);
34474 if (unlikely(!new_args))
34475 return NULL;
34476 self = PyTuple_GetItem(args, 0);
34477 if (unlikely(!self)) {
34478 Py_DECREF(new_args);
34479 PyErr_Format(PyExc_TypeError,
34480 "unbound method %.200S() needs an argument",
34481 cyfunc->func_qualname);
34482 return NULL;
34483 }
34484 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
34485 Py_DECREF(new_args);
34486 } else {
34487 result = __Pyx_CyFunction_Call(func, args, kw);
34488 }
34489 return result;
34490}
34491#if CYTHON_VECTORCALL
34492static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(PyObject *func, __pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
34493{
34494 int ret = 0;
34495 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
34496 if (unlikely(nargs < 1)) {
34497 __Pyx_CyFunction_raise_type_error(
34498 func, "needs an argument");
34499 return -1;
34500 }
34501 ret = 1;
34502 }
34503 if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
34504 __Pyx_CyFunction_raise_type_error(
34505 func, "takes no keyword arguments");
34506 return -1;
34507 }
34508 return ret;
34509}
34510static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
34511{
34512 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
34513 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
34514 PyObject *self;
34515#if CYTHON_COMPILING_IN_LIMITED_API
34516 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
34517 if (unlikely(!meth)) return NULL;
34518#else
34519 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
34520#endif
34521 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
34522 case 1:
34523 self = args[0];
34524 args += 1;
34525 nargs -= 1;
34526 break;
34527 case 0:
34528 self = func;
34529 break;
34530 default:
34531 return NULL;
34532 }
34533 if (unlikely(nargs != 0)) {
34534 __Pyx_CyFunction_raise_argument_count_error(
34535 func, "takes no arguments", nargs);
34536 return NULL;
34537 }
34538 return meth(self, NULL);
34539}
34540static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
34541{
34542 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
34543 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
34544 PyObject *self;
34545#if CYTHON_COMPILING_IN_LIMITED_API
34546 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
34547 if (unlikely(!meth)) return NULL;
34548#else
34549 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
34550#endif
34551 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
34552 case 1:
34553 self = args[0];
34554 args += 1;
34555 nargs -= 1;
34556 break;
34557 case 0:
34558 self = func;
34559 break;
34560 default:
34561 return NULL;
34562 }
34563 if (unlikely(nargs != 1)) {
34564 __Pyx_CyFunction_raise_argument_count_error(
34565 func, "takes exactly one argument", nargs);
34566 return NULL;
34567 }
34568 return meth(self, args[0]);
34569}
34570static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
34571{
34572 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
34573 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
34574 PyObject *self;
34575#if CYTHON_COMPILING_IN_LIMITED_API
34576 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
34577 if (unlikely(!meth)) return NULL;
34578#else
34579 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
34580#endif
34581 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
34582 case 1:
34583 self = args[0];
34584 args += 1;
34585 nargs -= 1;
34586 break;
34587 case 0:
34588 self = func;
34589 break;
34590 default:
34591 return NULL;
34592 }
34593 return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames);
34594}
34595static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
34596{
34597 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
34598 PyTypeObject *cls = (PyTypeObject *) __Pyx__CyFunction_GetClassObj(cyfunc);
34599 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
34600 PyObject *self;
34601#if CYTHON_COMPILING_IN_LIMITED_API
34602 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
34603 if (unlikely(!meth)) return NULL;
34604#else
34605 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
34606#endif
34607 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
34608 case 1:
34609 self = args[0];
34610 args += 1;
34611 nargs -= 1;
34612 break;
34613 case 0:
34614 self = func;
34615 break;
34616 default:
34617 return NULL;
34618 }
34619 #if PY_VERSION_HEX < 0x030e00A6
34620 size_t nargs_value = (size_t) nargs;
34621 #else
34622 Py_ssize_t nargs_value = nargs;
34623 #endif
34624 return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames);
34625}
34626#endif
34627static PyType_Slot __pyx_CyFunctionType_slots[] = {
34628 {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
34629 {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
34630 {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
34631 {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
34632 {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
34633 {Py_tp_methods, (void *)__pyx_CyFunction_methods},
34634 {Py_tp_members, (void *)__pyx_CyFunction_members},
34635 {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
34636 {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
34637 {0, 0},
34638};
34639static PyType_Spec __pyx_CyFunctionType_spec = {
34640 __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
34641 __PYX_SHARED_SIZEOF(__pyx_CyFunctionObject),
34642 0,
34643#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
34644 Py_TPFLAGS_METHOD_DESCRIPTOR |
34645#endif
34646#if CYTHON_VECTORCALL
34647#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
34648 Py_TPFLAGS_HAVE_VECTORCALL |
34649#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
34650 _Py_TPFLAGS_HAVE_VECTORCALL |
34651#endif
34652#endif // CYTHON_VECTORCALL
34653#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
34654 Py_TPFLAGS_MANAGED_DICT |
34655#endif
34656 Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
34657 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
34658 __pyx_CyFunctionType_slots
34659};
34660static int __pyx_CyFunction_init(PyObject *module) {
34661 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
34662 mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
34663 mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
34664 if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
34665 return -1;
34666 }
34667 return 0;
34668}
34669
34670/* CythonFunction */
34671static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
34672 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
34673 (void)&__Pyx_Get_CyFunction_Type;
34674 PyObject *op = __Pyx_CyFunction_Init(
34675 PyObject_GC_New(PyObject, __pyx_mstate_global->__pyx_CyFunctionType),
34676 ml, flags, qualname, closure, module, globals, code
34677 );
34678 if (likely(op)) {
34679 PyObject_GC_Track(op);
34680 }
34681 return op;
34682}
34683static PyTypeObject *__Pyx_Get_CyFunction_Type(void) {
34684 PyTypeObject *tp = __pyx_mstate_global->__pyx_CyFunctionType;
34685 Py_INCREF((PyObject*)tp);
34686 return tp;
34687}
34688
34689/* CLineInTraceback (used by AddTraceback) */
34690#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
34691#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
34692#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
34693#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
34694#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
34695#else
34696PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
34697 PyObject **dict_ptr = _PyObject_GetDictPtr(o);
34698 return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
34699}
34700#endif
34701static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
34702 PyObject *use_cline = NULL;
34703 PyObject *ptype, *pvalue, *ptraceback;
34704 PyObject *cython_runtime_dict;
34705 CYTHON_MAYBE_UNUSED_VAR(tstate);
34706 if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
34707 return c_line;
34708 }
34709 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
34710 cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
34711 if (likely(cython_runtime_dict)) {
34712 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
34713 use_cline, cython_runtime_dict,
34714 __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
34715 }
34716 if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
34717 c_line = 0;
34718 }
34719 Py_XDECREF(use_cline);
34720 Py_XDECREF(cython_runtime_dict);
34721 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
34722 return c_line;
34723}
34724#endif
34725
34726/* CodeObjectCache (used by AddTraceback) */
34727static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
34728 int start = 0, mid = 0, end = count - 1;
34729 if (end >= 0 && code_line > entries[end].code_line) {
34730 return count;
34731 }
34732 while (start < end) {
34733 mid = start + (end - start) / 2;
34734 if (code_line < entries[mid].code_line) {
34735 end = mid;
34736 } else if (code_line > entries[mid].code_line) {
34737 start = mid + 1;
34738 } else {
34739 return mid;
34740 }
34741 }
34742 if (code_line <= entries[mid].code_line) {
34743 return mid;
34744 } else {
34745 return mid + 1;
34746 }
34747}
34748static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) {
34749 __Pyx_CachedCodeObjectType* code_object;
34750 int pos;
34751 if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
34752 return NULL;
34753 }
34754 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
34755 if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
34756 return NULL;
34757 }
34758 code_object = code_cache->entries[pos].code_object;
34759 Py_INCREF(code_object);
34760 return code_object;
34761}
34762static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) {
34763#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
34764 (void)__pyx__find_code_object;
34765 return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss.
34766#else
34767 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
34768#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
34769 __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
34770 if (old_count < 0) {
34771 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
34772 return NULL;
34773 }
34774#endif
34775 __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
34776#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
34777 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
34778#endif
34779 return result;
34780#endif
34781}
34782static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object)
34783{
34784 int pos, i;
34785 __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
34786 if (unlikely(!code_line)) {
34787 return;
34788 }
34789 if (unlikely(!entries)) {
34790 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
34791 if (likely(entries)) {
34792 code_cache->entries = entries;
34793 code_cache->max_count = 64;
34794 code_cache->count = 1;
34795 entries[0].code_line = code_line;
34796 entries[0].code_object = code_object;
34797 Py_INCREF(code_object);
34798 }
34799 return;
34800 }
34801 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
34802 if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
34803 __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
34804 entries[pos].code_object = code_object;
34805 Py_INCREF(code_object);
34806 Py_DECREF(tmp);
34807 return;
34808 }
34809 if (code_cache->count == code_cache->max_count) {
34810 int new_max = code_cache->max_count + 64;
34811 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
34812 code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
34813 if (unlikely(!entries)) {
34814 return;
34815 }
34816 code_cache->entries = entries;
34817 code_cache->max_count = new_max;
34818 }
34819 for (i=code_cache->count; i>pos; i--) {
34820 entries[i] = entries[i-1];
34821 }
34822 entries[pos].code_line = code_line;
34823 entries[pos].code_object = code_object;
34824 code_cache->count++;
34825 Py_INCREF(code_object);
34826}
34827static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) {
34828#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
34829 (void)__pyx__insert_code_object;
34830 return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail.
34831#else
34832 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
34833#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
34834 __pyx_nonatomic_int_type expected = 0;
34835 if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
34836 return;
34837 }
34838#endif
34839 __pyx__insert_code_object(code_cache, code_line, code_object);
34840#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
34841 __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
34842#endif
34843#endif
34844}
34845
34846/* AddTraceback */
34847#include "compile.h"
34848#include "frameobject.h"
34849#include "traceback.h"
34850#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
34851 #ifndef Py_BUILD_CORE
34852 #define Py_BUILD_CORE 1
34853 #endif
34854 #include "internal/pycore_frame.h"
34855#endif
34856#if CYTHON_COMPILING_IN_LIMITED_API
34857static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
34858 PyObject *firstlineno, PyObject *name) {
34859 PyObject *replace = NULL;
34860 if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
34861 if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
34862 replace = PyObject_GetAttrString(code, "replace");
34863 if (likely(replace)) {
34864 PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
34865 Py_DECREF(replace);
34866 return result;
34867 }
34868 return NULL;
34869}
34870static void __Pyx_AddTraceback(const char *funcname, int c_line,
34871 int py_line, const char *filename) {
34872 PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
34873 PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
34874 PyObject *exc_type, *exc_value, *exc_traceback;
34875 int success = 0;
34876 if (c_line) {
34877 c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
34878 }
34879 __Pyx_PyErr_FetchException(&exc_type, &exc_value, &exc_traceback);
34880 code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
34881 if (!code_object) {
34882 code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
34883 if (unlikely(!code_object)) goto bad;
34884 py_py_line = PyLong_FromLong(py_line);
34885 if (unlikely(!py_py_line)) goto bad;
34886 if (c_line) {
34887 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
34888 } else {
34889 py_funcname = PyUnicode_FromString(funcname);
34890 }
34891 if (unlikely(!py_funcname)) goto bad;
34892 dict = PyDict_New();
34893 if (unlikely(!dict)) goto bad;
34894 {
34895 PyObject *old_code_object = code_object;
34896 code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
34897 Py_DECREF(old_code_object);
34898 }
34899 if (unlikely(!code_object)) goto bad;
34900 __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
34901 } else {
34902 dict = PyDict_New();
34903 }
34904 getframe = PySys_GetObject("_getframe");
34905 if (unlikely(!getframe)) goto bad;
34906 if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
34907 frame = PyEval_EvalCode(code_object, dict, dict);
34908 if (unlikely(!frame) || frame == Py_None) goto bad;
34909 success = 1;
34910 bad:
34911 __Pyx_PyErr_RestoreException(exc_type, exc_value, exc_traceback);
34912 Py_XDECREF(code_object);
34913 Py_XDECREF(py_py_line);
34914 Py_XDECREF(py_funcname);
34915 Py_XDECREF(dict);
34916 Py_XDECREF(replace);
34917 if (success) {
34918 PyTraceBack_Here(
34919 (struct _frame*)frame);
34920 }
34921 Py_XDECREF(frame);
34922}
34923#else
34924static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
34925 const char *funcname, int c_line,
34926 int py_line, const char *filename) {
34927 PyCodeObject *py_code = NULL;
34928 PyObject *py_funcname = NULL;
34929 if (c_line) {
34930 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
34931 if (!py_funcname) goto bad;
34932 funcname = PyUnicode_AsUTF8(py_funcname);
34933 if (!funcname) goto bad;
34934 }
34935 py_code = PyCode_NewEmpty(filename, funcname, py_line);
34936 Py_XDECREF(py_funcname);
34937 return py_code;
34938bad:
34939 Py_XDECREF(py_funcname);
34940 return NULL;
34941}
34942static void __Pyx_AddTraceback(const char *funcname, int c_line,
34943 int py_line, const char *filename) {
34944 PyCodeObject *py_code = 0;
34945 PyFrameObject *py_frame = 0;
34946 PyThreadState *tstate = __Pyx_PyThreadState_Current;
34947 PyObject *ptype, *pvalue, *ptraceback;
34948 if (c_line) {
34949 c_line = __Pyx_CLineForTraceback(tstate, c_line);
34950 }
34951 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
34952 if (!py_code) {
34953 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
34954 py_code = __Pyx_CreateCodeObjectForTraceback(
34955 funcname, c_line, py_line, filename);
34956 if (!py_code) {
34957 /* If the code object creation fails, then we should clear the
34958 fetched exception references and propagate the new exception */
34959 Py_XDECREF(ptype);
34960 Py_XDECREF(pvalue);
34961 Py_XDECREF(ptraceback);
34962 goto bad;
34963 }
34964 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
34965 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
34966 }
34967 py_frame = PyFrame_New(
34968 tstate, /*PyThreadState *tstate,*/
34969 py_code, /*PyCodeObject *code,*/
34970 __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/
34971 0 /*PyObject *locals*/
34972 );
34973 if (!py_frame) goto bad;
34974 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
34975 PyTraceBack_Here(py_frame);
34976bad:
34977 Py_XDECREF(py_code);
34978 Py_XDECREF(py_frame);
34979}
34980#endif
34981
34982/* CIntFromPyVerify */
34983#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
34984 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
34985#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
34986 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
34987#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
34988 {\
34989 func_type value = func_value;\
34990 if (sizeof(target_type) < sizeof(func_type)) {\
34991 if (unlikely(value != (func_type) (target_type) value)) {\
34992 func_type zero = 0;\
34993 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
34994 return (target_type) -1;\
34995 if (is_unsigned && unlikely(value < zero))\
34996 goto raise_neg_overflow;\
34997 else\
34998 goto raise_overflow;\
34999 }\
35000 }\
35001 return (target_type) value;\
35002 }
35003
35004/* MemviewDtypeToObject */
35005static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp) {
35006 return (PyObject *) PyFloat_FromDouble(*(double const *) itemp);
35007}
35008static CYTHON_INLINE int __pyx_memview_set_double(char *itemp, PyObject *obj) {
35009 double value = __Pyx_PyFloat_AsDouble(obj);
35010 if (unlikely((value == (double)-1) && PyErr_Occurred()))
35011 return 0;
35012 *(double *) itemp = value;
35013 return 1;
35014}
35015
35016/* Declarations */
35017#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
35018 #ifdef __cplusplus
35019 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
35020 return ::std::complex< float >(x, y);
35021 }
35022 #else
35023 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
35024 return x + y*(__pyx_t_float_complex)_Complex_I;
35025 }
35026 #endif
35027#else
35028 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
35029 __pyx_t_float_complex z;
35030 z.real = x;
35031 z.imag = y;
35032 return z;
35033 }
35034#endif
35035
35036/* Arithmetic */
35037#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
35038#else
35039 static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
35040 return (a.real == b.real) && (a.imag == b.imag);
35041 }
35042 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
35043 __pyx_t_float_complex z;
35044 z.real = a.real + b.real;
35045 z.imag = a.imag + b.imag;
35046 return z;
35047 }
35048 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
35049 __pyx_t_float_complex z;
35050 z.real = a.real - b.real;
35051 z.imag = a.imag - b.imag;
35052 return z;
35053 }
35054 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
35055 __pyx_t_float_complex z;
35056 z.real = a.real * b.real - a.imag * b.imag;
35057 z.imag = a.real * b.imag + a.imag * b.real;
35058 return z;
35059 }
35060 #if 1
35061 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
35062 if (b.imag == 0) {
35063 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
35064 } else if (fabsf(b.real) >= fabsf(b.imag)) {
35065 if (b.real == 0 && b.imag == 0) {
35066 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
35067 } else {
35068 float r = b.imag / b.real;
35069 float s = (float)(1.0) / (b.real + b.imag * r);
35070 return __pyx_t_float_complex_from_parts(
35071 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
35072 }
35073 } else {
35074 float r = b.real / b.imag;
35075 float s = (float)(1.0) / (b.imag + b.real * r);
35076 return __pyx_t_float_complex_from_parts(
35077 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
35078 }
35079 }
35080 #else
35081 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
35082 if (b.imag == 0) {
35083 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
35084 } else {
35085 float denom = b.real * b.real + b.imag * b.imag;
35086 return __pyx_t_float_complex_from_parts(
35087 (a.real * b.real + a.imag * b.imag) / denom,
35088 (a.imag * b.real - a.real * b.imag) / denom);
35089 }
35090 }
35091 #endif
35092 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
35093 __pyx_t_float_complex z;
35094 z.real = -a.real;
35095 z.imag = -a.imag;
35096 return z;
35097 }
35098 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
35099 return (a.real == 0) && (a.imag == 0);
35100 }
35101 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
35102 __pyx_t_float_complex z;
35103 z.real = a.real;
35104 z.imag = -a.imag;
35105 return z;
35106 }
35107 #if 1
35108 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
35109 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
35110 return sqrtf(z.real*z.real + z.imag*z.imag);
35111 #else
35112 return hypotf(z.real, z.imag);
35113 #endif
35114 }
35115 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
35116 __pyx_t_float_complex z;
35117 float r, lnr, theta, z_r, z_theta;
35118 if (b.imag == 0 && b.real == (int)b.real) {
35119 if (b.real < 0) {
35120 float denom = a.real * a.real + a.imag * a.imag;
35121 a.real = a.real / denom;
35122 a.imag = -a.imag / denom;
35123 b.real = -b.real;
35124 }
35125 switch ((int)b.real) {
35126 case 0:
35127 z.real = 1;
35128 z.imag = 0;
35129 return z;
35130 case 1:
35131 return a;
35132 case 2:
35133 return __Pyx_c_prod_float(a, a);
35134 case 3:
35135 z = __Pyx_c_prod_float(a, a);
35136 return __Pyx_c_prod_float(z, a);
35137 case 4:
35138 z = __Pyx_c_prod_float(a, a);
35139 return __Pyx_c_prod_float(z, z);
35140 }
35141 }
35142 if (a.imag == 0) {
35143 if (a.real == 0) {
35144 return a;
35145 } else if ((b.imag == 0) && (a.real >= 0)) {
35146 z.real = powf(a.real, b.real);
35147 z.imag = 0;
35148 return z;
35149 } else if (a.real > 0) {
35150 r = a.real;
35151 theta = 0;
35152 } else {
35153 r = -a.real;
35154 theta = atan2f(0.0, -1.0);
35155 }
35156 } else {
35157 r = __Pyx_c_abs_float(a);
35158 theta = atan2f(a.imag, a.real);
35159 }
35160 lnr = logf(r);
35161 z_r = expf(lnr * b.real - theta * b.imag);
35162 z_theta = theta * b.real + lnr * b.imag;
35163 z.real = z_r * cosf(z_theta);
35164 z.imag = z_r * sinf(z_theta);
35165 return z;
35166 }
35167 #endif
35168#endif
35169
35170/* Declarations */
35171#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
35172 #ifdef __cplusplus
35173 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
35174 return ::std::complex< double >(x, y);
35175 }
35176 #else
35177 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
35178 return x + y*(__pyx_t_double_complex)_Complex_I;
35179 }
35180 #endif
35181#else
35182 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
35183 __pyx_t_double_complex z;
35184 z.real = x;
35185 z.imag = y;
35186 return z;
35187 }
35188#endif
35189
35190/* Arithmetic */
35191#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
35192#else
35193 static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
35194 return (a.real == b.real) && (a.imag == b.imag);
35195 }
35196 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
35197 __pyx_t_double_complex z;
35198 z.real = a.real + b.real;
35199 z.imag = a.imag + b.imag;
35200 return z;
35201 }
35202 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
35203 __pyx_t_double_complex z;
35204 z.real = a.real - b.real;
35205 z.imag = a.imag - b.imag;
35206 return z;
35207 }
35208 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
35209 __pyx_t_double_complex z;
35210 z.real = a.real * b.real - a.imag * b.imag;
35211 z.imag = a.real * b.imag + a.imag * b.real;
35212 return z;
35213 }
35214 #if 1
35215 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
35216 if (b.imag == 0) {
35217 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
35218 } else if (fabs(b.real) >= fabs(b.imag)) {
35219 if (b.real == 0 && b.imag == 0) {
35220 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
35221 } else {
35222 double r = b.imag / b.real;
35223 double s = (double)(1.0) / (b.real + b.imag * r);
35224 return __pyx_t_double_complex_from_parts(
35225 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
35226 }
35227 } else {
35228 double r = b.real / b.imag;
35229 double s = (double)(1.0) / (b.imag + b.real * r);
35230 return __pyx_t_double_complex_from_parts(
35231 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
35232 }
35233 }
35234 #else
35235 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
35236 if (b.imag == 0) {
35237 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
35238 } else {
35239 double denom = b.real * b.real + b.imag * b.imag;
35240 return __pyx_t_double_complex_from_parts(
35241 (a.real * b.real + a.imag * b.imag) / denom,
35242 (a.imag * b.real - a.real * b.imag) / denom);
35243 }
35244 }
35245 #endif
35246 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
35247 __pyx_t_double_complex z;
35248 z.real = -a.real;
35249 z.imag = -a.imag;
35250 return z;
35251 }
35252 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
35253 return (a.real == 0) && (a.imag == 0);
35254 }
35255 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
35256 __pyx_t_double_complex z;
35257 z.real = a.real;
35258 z.imag = -a.imag;
35259 return z;
35260 }
35261 #if 1
35262 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
35263 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
35264 return sqrt(z.real*z.real + z.imag*z.imag);
35265 #else
35266 return hypot(z.real, z.imag);
35267 #endif
35268 }
35269 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
35270 __pyx_t_double_complex z;
35271 double r, lnr, theta, z_r, z_theta;
35272 if (b.imag == 0 && b.real == (int)b.real) {
35273 if (b.real < 0) {
35274 double denom = a.real * a.real + a.imag * a.imag;
35275 a.real = a.real / denom;
35276 a.imag = -a.imag / denom;
35277 b.real = -b.real;
35278 }
35279 switch ((int)b.real) {
35280 case 0:
35281 z.real = 1;
35282 z.imag = 0;
35283 return z;
35284 case 1:
35285 return a;
35286 case 2:
35287 return __Pyx_c_prod_double(a, a);
35288 case 3:
35289 z = __Pyx_c_prod_double(a, a);
35290 return __Pyx_c_prod_double(z, a);
35291 case 4:
35292 z = __Pyx_c_prod_double(a, a);
35293 return __Pyx_c_prod_double(z, z);
35294 }
35295 }
35296 if (a.imag == 0) {
35297 if (a.real == 0) {
35298 return a;
35299 } else if ((b.imag == 0) && (a.real >= 0)) {
35300 z.real = pow(a.real, b.real);
35301 z.imag = 0;
35302 return z;
35303 } else if (a.real > 0) {
35304 r = a.real;
35305 theta = 0;
35306 } else {
35307 r = -a.real;
35308 theta = atan2(0.0, -1.0);
35309 }
35310 } else {
35311 r = __Pyx_c_abs_double(a);
35312 theta = atan2(a.imag, a.real);
35313 }
35314 lnr = log(r);
35315 z_r = exp(lnr * b.real - theta * b.imag);
35316 z_theta = theta * b.real + lnr * b.imag;
35317 z.real = z_r * cos(z_theta);
35318 z.imag = z_r * sin(z_theta);
35319 return z;
35320 }
35321 #endif
35322#endif
35323
35324/* Declarations */
35325#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
35326 #ifdef __cplusplus
35327 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
35328 return ::std::complex< long double >(x, y);
35329 }
35330 #else
35331 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
35332 return x + y*(__pyx_t_long_double_complex)_Complex_I;
35333 }
35334 #endif
35335#else
35336 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
35337 __pyx_t_long_double_complex z;
35338 z.real = x;
35339 z.imag = y;
35340 return z;
35341 }
35342#endif
35343
35344/* Arithmetic */
35345#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
35346#else
35347 static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
35348 return (a.real == b.real) && (a.imag == b.imag);
35349 }
35350 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) {
35351 __pyx_t_long_double_complex z;
35352 z.real = a.real + b.real;
35353 z.imag = a.imag + b.imag;
35354 return z;
35355 }
35356 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) {
35357 __pyx_t_long_double_complex z;
35358 z.real = a.real - b.real;
35359 z.imag = a.imag - b.imag;
35360 return z;
35361 }
35362 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) {
35363 __pyx_t_long_double_complex z;
35364 z.real = a.real * b.real - a.imag * b.imag;
35365 z.imag = a.real * b.imag + a.imag * b.real;
35366 return z;
35367 }
35368 #if 1
35369 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) {
35370 if (b.imag == 0) {
35371 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
35372 } else if (fabsl(b.real) >= fabsl(b.imag)) {
35373 if (b.real == 0 && b.imag == 0) {
35374 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
35375 } else {
35376 long double r = b.imag / b.real;
35377 long double s = (long double)(1.0) / (b.real + b.imag * r);
35378 return __pyx_t_long_double_complex_from_parts(
35379 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
35380 }
35381 } else {
35382 long double r = b.real / b.imag;
35383 long double s = (long double)(1.0) / (b.imag + b.real * r);
35384 return __pyx_t_long_double_complex_from_parts(
35385 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
35386 }
35387 }
35388 #else
35389 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) {
35390 if (b.imag == 0) {
35391 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
35392 } else {
35393 long double denom = b.real * b.real + b.imag * b.imag;
35394 return __pyx_t_long_double_complex_from_parts(
35395 (a.real * b.real + a.imag * b.imag) / denom,
35396 (a.imag * b.real - a.real * b.imag) / denom);
35397 }
35398 }
35399 #endif
35400 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
35401 __pyx_t_long_double_complex z;
35402 z.real = -a.real;
35403 z.imag = -a.imag;
35404 return z;
35405 }
35406 static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
35407 return (a.real == 0) && (a.imag == 0);
35408 }
35409 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
35410 __pyx_t_long_double_complex z;
35411 z.real = a.real;
35412 z.imag = -a.imag;
35413 return z;
35414 }
35415 #if 1
35416 static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex z) {
35417 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
35418 return sqrtl(z.real*z.real + z.imag*z.imag);
35419 #else
35420 return hypotl(z.real, z.imag);
35421 #endif
35422 }
35423 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) {
35424 __pyx_t_long_double_complex z;
35425 long double r, lnr, theta, z_r, z_theta;
35426 if (b.imag == 0 && b.real == (int)b.real) {
35427 if (b.real < 0) {
35428 long double denom = a.real * a.real + a.imag * a.imag;
35429 a.real = a.real / denom;
35430 a.imag = -a.imag / denom;
35431 b.real = -b.real;
35432 }
35433 switch ((int)b.real) {
35434 case 0:
35435 z.real = 1;
35436 z.imag = 0;
35437 return z;
35438 case 1:
35439 return a;
35440 case 2:
35441 return __Pyx_c_prod_long__double(a, a);
35442 case 3:
35443 z = __Pyx_c_prod_long__double(a, a);
35444 return __Pyx_c_prod_long__double(z, a);
35445 case 4:
35446 z = __Pyx_c_prod_long__double(a, a);
35447 return __Pyx_c_prod_long__double(z, z);
35448 }
35449 }
35450 if (a.imag == 0) {
35451 if (a.real == 0) {
35452 return a;
35453 } else if ((b.imag == 0) && (a.real >= 0)) {
35454 z.real = powl(a.real, b.real);
35455 z.imag = 0;
35456 return z;
35457 } else if (a.real > 0) {
35458 r = a.real;
35459 theta = 0;
35460 } else {
35461 r = -a.real;
35462 theta = atan2l(0.0, -1.0);
35463 }
35464 } else {
35465 r = __Pyx_c_abs_long__double(a);
35466 theta = atan2l(a.imag, a.real);
35467 }
35468 lnr = logl(r);
35469 z_r = expl(lnr * b.real - theta * b.imag);
35470 z_theta = theta * b.real + lnr * b.imag;
35471 z.real = z_r * cosl(z_theta);
35472 z.imag = z_r * sinl(z_theta);
35473 return z;
35474 }
35475 #endif
35476#endif
35477
35478/* MemviewRefcount */
35479#include <stdio.h>
35480#ifndef _Py_NO_RETURN
35481#define _Py_NO_RETURN
35482#endif
35483_Py_NO_RETURN
35484static void __pyx_fatalerror(const char *fmt, ...) {
35485 va_list vargs;
35486 char msg[200];
35487#if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
35488 va_start(vargs, fmt);
35489#else
35490 va_start(vargs);
35491#endif
35492 vsnprintf(msg, 200, fmt, vargs);
35493 va_end(vargs);
35494 Py_FatalError(msg);
35495}
35496static CYTHON_INLINE int
35497__pyx_add_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
35498 PyThread_type_lock lock)
35499{
35500 int result;
35501 PyThread_acquire_lock(lock, 1);
35502 result = (*acquisition_count)++;
35503 PyThread_release_lock(lock);
35504 return result;
35505}
35506static CYTHON_INLINE int
35507__pyx_sub_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
35508 PyThread_type_lock lock)
35509{
35510 int result;
35511 PyThread_acquire_lock(lock, 1);
35512 result = (*acquisition_count)--;
35513 PyThread_release_lock(lock);
35514 return result;
35515}
35516static CYTHON_INLINE void
35517__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
35518{
35519 __pyx_nonatomic_int_type old_acquisition_count;
35520 struct __pyx_memoryview_obj *memview = memslice->memview;
35521 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
35522 return;
35523 }
35524 old_acquisition_count = __pyx_add_acquisition_count(memview);
35525 if (unlikely(old_acquisition_count <= 0)) {
35526 if (likely(old_acquisition_count == 0)) {
35527 if (have_gil) {
35528 Py_INCREF((PyObject *) memview);
35529 } else {
35530 PyGILState_STATE _gilstate = PyGILState_Ensure();
35531 Py_INCREF((PyObject *) memview);
35532 PyGILState_Release(_gilstate);
35533 }
35534 } else {
35535 __pyx_fatalerror("Acquisition count is %d (line %d)",
35536 old_acquisition_count+1, lineno);
35537 }
35538 }
35539}
35540static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice,
35541 int have_gil, int lineno) {
35542 __pyx_nonatomic_int_type old_acquisition_count;
35543 struct __pyx_memoryview_obj *memview = memslice->memview;
35544 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
35545 memslice->memview = NULL;
35546 return;
35547 }
35548 old_acquisition_count = __pyx_sub_acquisition_count(memview);
35549 memslice->data = NULL;
35550 if (likely(old_acquisition_count > 1)) {
35551 memslice->memview = NULL;
35552 } else if (likely(old_acquisition_count == 1)) {
35553 if (have_gil) {
35554 Py_CLEAR(memslice->memview);
35555 } else {
35556 PyGILState_STATE _gilstate = PyGILState_Ensure();
35557 Py_CLEAR(memslice->memview);
35558 PyGILState_Release(_gilstate);
35559 }
35560 } else {
35561 __pyx_fatalerror("Acquisition count is %d (line %d)",
35562 old_acquisition_count-1, lineno);
35563 }
35564}
35565
35566/* MemviewSliceIsContig */
35567static int
35568__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
35569{
35570 int i, index, step, start;
35571 Py_ssize_t itemsize = mvs.memview->view.itemsize;
35572 if (order == 'F') {
35573 step = 1;
35574 start = 0;
35575 } else {
35576 step = -1;
35577 start = ndim - 1;
35578 }
35579 for (i = 0; i < ndim; i++) {
35580 index = start + step * i;
35581 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
35582 return 0;
35583 itemsize *= mvs.shape[index];
35584 }
35585 return 1;
35586}
35587
35588/* OverlappingSlices */
35589static void
35590__pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
35591 void **out_start, void **out_end,
35592 int ndim, size_t itemsize)
35593{
35594 char *start, *end;
35595 int i;
35596 start = end = slice->data;
35597 for (i = 0; i < ndim; i++) {
35598 Py_ssize_t stride = slice->strides[i];
35599 Py_ssize_t extent = slice->shape[i];
35600 if (extent == 0) {
35601 *out_start = *out_end = start;
35602 return;
35603 } else {
35604 if (stride > 0)
35605 end += stride * (extent - 1);
35606 else
35607 start += stride * (extent - 1);
35608 }
35609 }
35610 *out_start = start;
35611 *out_end = end + itemsize;
35612}
35613static int
35614__pyx_slices_overlap(__Pyx_memviewslice *slice1,
35615 __Pyx_memviewslice *slice2,
35616 int ndim, size_t itemsize)
35617{
35618 void *start1, *end1, *start2, *end2;
35619 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
35620 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
35621 return (start1 < end2) && (start2 < end1);
35622}
35623
35624/* MemviewSliceInit */
35625static int
35626__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
35627 int ndim,
35628 __Pyx_memviewslice *memviewslice,
35629 int memview_is_new_reference)
35630{
35631 __Pyx_RefNannyDeclarations
35632 int i, retval=-1;
35633 Py_buffer *buf = &memview->view;
35634 __Pyx_RefNannySetupContext("init_memviewslice", 0);
35635 if (unlikely(memviewslice->memview || memviewslice->data)) {
35636 PyErr_SetString(PyExc_ValueError,
35637 "memviewslice is already initialized!");
35638 goto fail;
35639 }
35640 if (buf->strides) {
35641 for (i = 0; i < ndim; i++) {
35642 memviewslice->strides[i] = buf->strides[i];
35643 }
35644 } else {
35645 Py_ssize_t stride = buf->itemsize;
35646 for (i = ndim - 1; i >= 0; i--) {
35647 memviewslice->strides[i] = stride;
35648 stride *= buf->shape[i];
35649 }
35650 }
35651 for (i = 0; i < ndim; i++) {
35652 memviewslice->shape[i] = buf->shape[i];
35653 if (buf->suboffsets) {
35654 memviewslice->suboffsets[i] = buf->suboffsets[i];
35655 } else {
35656 memviewslice->suboffsets[i] = -1;
35657 }
35658 }
35659 memviewslice->memview = memview;
35660 memviewslice->data = (char *)buf->buf;
35661 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
35662 Py_INCREF((PyObject*)memview);
35663 }
35664 retval = 0;
35665 goto no_fail;
35666fail:
35667 memviewslice->memview = 0;
35668 memviewslice->data = 0;
35669 retval = -1;
35670no_fail:
35671 __Pyx_RefNannyFinishContext();
35672 return retval;
35673}
35674
35675/* SliceMemoryviewSlice */
35676static void __pyx_memoryview_slice_memviewslice_err_dim(PyObject *error, const char* msg, int dim) {
35677 PyGILState_STATE gilstate = PyGILState_Ensure();
35678 PyErr_Format(error, msg, dim);
35679 PyGILState_Release(gilstate);
35680}
35681static CYTHON_INLINE int __pyx_memoryview_slice_memviewslice(
35682 __Pyx_memviewslice *dst,
35683 Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
35684 int dim, int new_ndim, int *suboffset_dim,
35685 Py_ssize_t start, Py_ssize_t stop, Py_ssize_t step,
35686 int have_start, int have_stop, int have_step,
35687 int is_slice) {
35688 if (!is_slice) {
35689 if (start < 0) {
35690 start += shape;
35691 }
35692 if (unlikely(!(0 <= start && start < shape))) {
35693 __pyx_memoryview_slice_memviewslice_err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim);
35694 return -1;
35695 }
35696 } else {
35697 int negative_step;
35698 if (have_step) {
35699 negative_step = step < 0;
35700 if (unlikely(step == 0)) {
35701 __pyx_memoryview_slice_memviewslice_err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim);
35702 return -1;
35703 }
35704 } else {
35705 negative_step = 0;
35706 step = 1;
35707 }
35708 if (have_start) {
35709 if (start < 0) {
35710 start += shape;
35711 if (start < 0) {
35712 start = 0;
35713 }
35714 } else if (start >= shape) {
35715 start = negative_step ? (shape - 1) : shape;
35716 }
35717 } else {
35718 start = negative_step ? (shape - 1) : 0;
35719 }
35720 if (have_stop) {
35721 if (stop < 0) {
35722 stop += shape;
35723 if (stop < 0) {
35724 stop = 0;
35725 }
35726 } else if (stop > shape) {
35727 stop = shape;
35728 }
35729 } else {
35730 stop = negative_step ? -1 : shape;
35731 }
35732 Py_ssize_t new_shape = (stop - start) / step;
35733 if ((stop - start) - step * new_shape) {
35734 ++new_shape;
35735 }
35736 if (new_shape < 0) {
35737 new_shape = 0;
35738 }
35739 dst->strides[new_ndim] = stride * step;
35740 dst->shape[new_ndim] = new_shape;
35741 dst->suboffsets[new_ndim] = suboffset;
35742 }
35743 if (suboffset_dim[0] < 0) {
35744 dst->data += start * stride;
35745 } else {
35746 dst->suboffsets[suboffset_dim[0]] += start * stride;
35747 }
35748 if (suboffset >= 0) {
35749 if (!is_slice) {
35750 if (likely(new_ndim == 0)) {
35751 dst->data = ((char **)(dst->data))[0] + suboffset;
35752 } else {
35753 __pyx_memoryview_slice_memviewslice_err_dim(
35754 PyExc_IndexError,
35755 "All dimensions preceding dimension %d must be indexed and not sliced",
35756 dim);
35757 return -1;
35758 }
35759 } else {
35760 suboffset_dim[0] = new_ndim;
35761 }
35762 }
35763 return 0;
35764}
35765
35766/* CIntFromPy */
35767static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x);
35768static int __Pyx_raise_neg_overflow___Pyx_PyLong_As_int(void) {
35769 const char* type_name = "int";
35770 PyErr_Format(PyExc_OverflowError,
35771 "can't convert negative value to %.200s", type_name);
35772 return (int) -1;
35773}
35774static int __Pyx_raise_overflow___Pyx_PyLong_As_int(void) {
35775 const char* type_name = "int";
35776 PyErr_Format(PyExc_OverflowError,
35777 "value too large to convert to %.200s", type_name);
35778 return (int) -1;
35779}
35780static CYTHON_INLINE int __Pyx_PyULong___Pyx_PyLong_As_int(PyObject *x) {
35781 const int is_unsigned = 1;
35782#if CYTHON_USE_PYLONG_INTERNALS
35783 {
35784 const digit* digits = __Pyx_PyLong_Digits(x);
35785 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
35786 if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
35787 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35788 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35789 } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
35790 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
35791 }
35792 } else
35793 if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
35794 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35795 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35796 } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
35797 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
35798 }
35799 } else
35800 if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
35801 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35802 __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])))
35803 } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
35804 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
35805 }
35806 } else
35807 {}
35808 }
35809#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
35810 if (unlikely(Py_SIZE(x) < 0)) {
35811 goto raise_neg_overflow;
35812 }
35813#else
35814 {
35815 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
35816 if (unlikely(result < 0))
35817 return (int) -1;
35818 if (unlikely(result == 1))
35819 goto raise_neg_overflow;
35820 }
35821#endif
35822 if ((sizeof(int) <= sizeof(unsigned long))) {
35823 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
35824 } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
35825 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
35826 }
35827 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
35828raise_neg_overflow:
35829 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
35830raise_overflow:
35831 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
35832}
35833static CYTHON_INLINE int __Pyx_PySLong___Pyx_PyLong_As_int(PyObject *x) {
35834 const int is_unsigned = 0;
35835#if CYTHON_USE_PYLONG_INTERNALS
35836 if (__Pyx_PyLong_IsNeg(x)) {
35837 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
35838 const digit* digits = __Pyx_PyLong_Digits(x);
35839 if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
35840 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
35841 long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35842 __PYX_VERIFY_RETURN_INT(int, long, ival)
35843 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
35844 return (int) (((int) -1) * (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35845 }
35846 } else
35847 if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
35848 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
35849 long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35850 __PYX_VERIFY_RETURN_INT(int, long, ival)
35851 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
35852 return (int) (((int) -1) * (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35853 }
35854 } else
35855 if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
35856 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
35857 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]));
35858 __PYX_VERIFY_RETURN_INT(int, long, ival)
35859 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
35860 return (int) (((int) -1) * (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35861 }
35862 } else
35863 {}
35864 } else {
35865 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
35866 const digit* digits = __Pyx_PyLong_Digits(x);
35867 if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
35868 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
35869 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35870 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
35871 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
35872 }
35873 } else
35874 if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
35875 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
35876 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35877 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
35878 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
35879 }
35880 } else
35881 if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
35882 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
35883 __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])))
35884 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
35885 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
35886 }
35887 } else
35888 {}
35889 }
35890#endif
35891 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
35892 if ((sizeof(int) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
35893 __PYX_VERIFY_RETURN_INT_EXC(int, int, PyLong_AsInt(x))
35894 } else
35895 #endif
35896 if ((sizeof(int) <= sizeof(long))) {
35897 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
35898 } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
35899 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
35900 }
35901 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
35902raise_neg_overflow:
35903 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
35904raise_overflow:
35905 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
35906}
35907static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x) {
35908#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35909#pragma GCC diagnostic push
35910#pragma GCC diagnostic ignored "-Wconversion"
35911#endif
35912 const int neg_one = (int) -1, const_zero = (int) 0;
35913#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35914#pragma GCC diagnostic pop
35915#endif
35916 const int is_unsigned = neg_one > const_zero;
35917 int val;
35918 int ret = -1;
35919#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
35920 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
35921 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
35922 if (unlikely(bytes_copied == -1)) {
35923 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
35924 goto raise_overflow;
35925 } else {
35926 ret = 0;
35927 }
35928#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
35929 int one = 1; int is_little = (int)*(unsigned char *)&one;
35930 unsigned char *bytes = (unsigned char *)&val;
35931 ret = _PyLong_AsByteArray((PyLongObject *)x,
35932 bytes, sizeof(val),
35933 is_little, !is_unsigned);
35934 if ((0)) goto raise_overflow;
35935#else
35936 PyObject *v;
35937 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
35938 int bits, remaining_bits, is_negative = 0;
35939 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
35940 if (likely(PyLong_CheckExact(x))) {
35941 v = __Pyx_NewRef(x);
35942 } else {
35943 v = PyNumber_Long(x);
35944 if (unlikely(!v)) return (int) -1;
35945 assert(PyLong_CheckExact(v));
35946 }
35947 {
35948 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
35949 if (unlikely(result < 0)) {
35950 Py_DECREF(v);
35951 return (int) -1;
35952 }
35953 is_negative = result == 1;
35954 }
35955 if (is_unsigned && unlikely(is_negative)) {
35956 Py_DECREF(v);
35957 PyErr_SetString(PyExc_OverflowError,
35958 "can't convert negative value to int");
35959 return (int) -1;
35960 } else if (is_negative) {
35961 stepval = PyNumber_Invert(v);
35962 Py_DECREF(v);
35963 if (unlikely(!stepval))
35964 return (int) -1;
35965 } else {
35966 stepval = v;
35967 }
35968 v = NULL;
35969 val = (int) 0;
35970 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
35971 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
35972 for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
35973 PyObject *tmp, *digit;
35974 long idigit;
35975 digit = PyNumber_And(stepval, mask);
35976 if (unlikely(!digit)) goto done;
35977 idigit = PyLong_AsLong(digit);
35978 Py_DECREF(digit);
35979 if (unlikely(idigit < 0)) goto done;
35980 val |= ((int) idigit) << bits;
35981 tmp = PyNumber_Rshift(stepval, shift);
35982 if (unlikely(!tmp)) goto done;
35983 Py_DECREF(stepval); stepval = tmp;
35984 }
35985 Py_DECREF(shift); shift = NULL;
35986 Py_DECREF(mask); mask = NULL;
35987 {
35988 long idigit = PyLong_AsLong(stepval);
35989 if (unlikely(idigit < 0)) goto done;
35990 remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
35991 if (unlikely(idigit >= (1L << remaining_bits)))
35992 goto raise_overflow;
35993 val |= ((int) idigit) << bits;
35994 }
35995 if (!is_unsigned) {
35996 if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
35997 goto raise_overflow;
35998 if (is_negative)
35999 val = ~val;
36000 }
36001 ret = 0;
36002done:
36003 Py_XDECREF(shift);
36004 Py_XDECREF(mask);
36005 Py_XDECREF(stepval);
36006#endif
36007 if (unlikely(ret))
36008 return (int) -1;
36009 return val;
36010raise_overflow:
36011 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
36012}
36013static CYTHON_INLINE int __Pyx_PyLong___Pyx_PyLong_As_int(PyObject *x) {
36014#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
36015#pragma GCC diagnostic push
36016#pragma GCC diagnostic ignored "-Wconversion"
36017#endif
36018 const int neg_one = (int) -1, const_zero = (int) 0;
36019#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
36020#pragma GCC diagnostic pop
36021#endif
36022 const int is_unsigned = neg_one > const_zero;
36023 if (is_unsigned) {
36024 #if CYTHON_USE_PYLONG_INTERNALS
36025 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
36026 goto raise_neg_overflow;
36027 } else if (__Pyx_PyLong_IsCompact(x)) {
36028 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
36029 } else
36030 #endif
36031 {
36032 return __Pyx_PyULong___Pyx_PyLong_As_int(x);
36033 }
36034 } else {
36035 #if CYTHON_USE_PYLONG_INTERNALS
36036 if (__Pyx_PyLong_IsCompact(x)) {
36037 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
36038 } else
36039 #endif
36040 {
36041 return __Pyx_PySLong___Pyx_PyLong_As_int(x);
36042 }
36043 }
36044#if CYTHON_USE_PYLONG_INTERNALS
36045raise_neg_overflow:
36046 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
36047raise_overflow:
36048 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
36049#endif
36050}
36051static int __Pyx_NonPyLong___Pyx_PyLong_As_int(PyObject *x) {
36052 int val;
36053 PyObject *tmp = __Pyx_PyNumber_Long(x);
36054 if (!tmp) return (int) -1;
36055 val = __Pyx_PyLong_As_int(tmp);
36056 Py_DECREF(tmp);
36057 return val;
36058}
36059static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) {
36060 if (likely(PyLong_Check(x))) {
36061 return __Pyx_PyLong___Pyx_PyLong_As_int(x);
36062 } else {
36063 return __Pyx_NonPyLong___Pyx_PyLong_As_int(x);
36064 }
36065}
36066
36067/* PyObjectVectorcallKwds (used by PyObjectVectorcallMethodKwds) */
36068#if CYTHON_VECTORCALL
36069CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i) {
36070 PyObject *key = __Pyx_PyTuple_GET_ITEM(kwnames, i);
36071#if !CYTHON_ASSUME_SAFE_MACROS
36072 if (unlikely(!key)) return -1;
36073#endif
36074 if (unlikely(!PyUnicode_Check(key))) {
36075 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
36076 return -1;
36077 }
36078 return 0;
36079}
36080#else
36081CYTHON_UNUSED static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t n) {
36082 PyObject *out = PyDict_New();
36083 if (unlikely(!out)) return NULL;
36084 for (Py_ssize_t i=0; i<n; ++i) {
36085 if (unlikely(PyDict_SetItem(out, keys[i], values[i]) < 0)) {
36086 Py_DECREF(out);
36087 return NULL;
36088 }
36089 }
36090 return out;
36091}
36092CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i) {
36093 PyObject *key = kwnames[i];
36094 if (unlikely(!PyUnicode_Check(key))) {
36095 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
36096 return -1;
36097 }
36098 return 0;
36099}
36100#endif
36101
36102/* PyObjectVectorcallMethodKwds (used by CIntToPy) */
36103#if !CYTHON_VECTORCALL
36104static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
36105 PyObject *result;
36106 PyObject *obj = PyObject_GetAttr(args[0], name);
36107 if (unlikely(!obj))
36108 return NULL;
36109 result = __Pyx_Object_VectorcallKwds(obj, args+1, nargsf-1, kwnames);
36110 Py_DECREF(obj);
36111 return result;
36112}
36113#endif
36114
36115/* CIntToPy */
36116static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value) {
36117#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
36118#pragma GCC diagnostic push
36119#pragma GCC diagnostic ignored "-Wconversion"
36120#endif
36121 const int neg_one = (int) -1, const_zero = (int) 0;
36122#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
36123#pragma GCC diagnostic pop
36124#endif
36125 const int is_unsigned = neg_one > const_zero;
36126 if (is_unsigned) {
36127 if (sizeof(int) < sizeof(long)) {
36128 return PyLong_FromLong((long) value);
36129 } else if (sizeof(int) <= sizeof(unsigned long)) {
36130 return PyLong_FromUnsignedLong((unsigned long) value);
36131#if !CYTHON_COMPILING_IN_PYPY
36132 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
36133 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
36134#endif
36135 }
36136 } else {
36137 if (sizeof(int) <= sizeof(long)) {
36138 return PyLong_FromLong((long) value);
36139 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
36140 return PyLong_FromLongLong((PY_LONG_LONG) value);
36141 }
36142 }
36143 {
36144 unsigned char *bytes = (unsigned char *)&value;
36145#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
36146 if (is_unsigned) {
36147 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
36148 } else {
36149 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
36150 }
36151#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
36152 int one = 1; int little = (int)*(unsigned char *)&one;
36153 return _PyLong_FromByteArray(bytes, sizeof(int),
36154 little, !is_unsigned);
36155#else
36156 int one = 1; int little = (int)*(unsigned char *)&one;
36157 PyObject *result = NULL, *kwds = NULL;
36158 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
36159 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
36160 if (!py_bytes) goto limited_bad;
36161 from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
36162 if (!from_bytes_str) goto limited_bad;
36163 order_str = PyUnicode_FromString(little ? "little" : "big");
36164 if (!order_str) goto limited_bad;
36165 {
36166 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
36167 if (!is_unsigned) {
36168 PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
36169 if (!signed_str) goto limited_bad;
36170#if CYTHON_VECTORCALL
36171 kwds = PyTuple_Pack(1, signed_str);
36172#else
36173 {
36174 PyObject *keys[] = {signed_str};
36175 PyObject *values[] = {Py_True};
36176 kwds = __Pyx_MakeKwargDict(keys, values, 1);
36177 }
36178#endif
36179 Py_DECREF(signed_str);
36180 if (unlikely(!kwds)) goto limited_bad;
36181 }
36182 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
36183 }
36184 limited_bad:
36185 Py_XDECREF(kwds);
36186 Py_XDECREF(order_str);
36187 Py_XDECREF(py_bytes);
36188 Py_XDECREF(from_bytes_str);
36189 return result;
36190#endif
36191 }
36192}
36193
36194/* CIntToPy */
36195static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) {
36196#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
36197#pragma GCC diagnostic push
36198#pragma GCC diagnostic ignored "-Wconversion"
36199#endif
36200 const long neg_one = (long) -1, const_zero = (long) 0;
36201#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
36202#pragma GCC diagnostic pop
36203#endif
36204 const int is_unsigned = neg_one > const_zero;
36205 if (is_unsigned) {
36206 if (sizeof(long) < sizeof(long)) {
36207 return PyLong_FromLong((long) value);
36208 } else if (sizeof(long) <= sizeof(unsigned long)) {
36209 return PyLong_FromUnsignedLong((unsigned long) value);
36210#if !CYTHON_COMPILING_IN_PYPY
36211 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
36212 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
36213#endif
36214 }
36215 } else {
36216 if (sizeof(long) <= sizeof(long)) {
36217 return PyLong_FromLong((long) value);
36218 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
36219 return PyLong_FromLongLong((PY_LONG_LONG) value);
36220 }
36221 }
36222 {
36223 unsigned char *bytes = (unsigned char *)&value;
36224#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
36225 if (is_unsigned) {
36226 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
36227 } else {
36228 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
36229 }
36230#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
36231 int one = 1; int little = (int)*(unsigned char *)&one;
36232 return _PyLong_FromByteArray(bytes, sizeof(long),
36233 little, !is_unsigned);
36234#else
36235 int one = 1; int little = (int)*(unsigned char *)&one;
36236 PyObject *result = NULL, *kwds = NULL;
36237 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
36238 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
36239 if (!py_bytes) goto limited_bad;
36240 from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
36241 if (!from_bytes_str) goto limited_bad;
36242 order_str = PyUnicode_FromString(little ? "little" : "big");
36243 if (!order_str) goto limited_bad;
36244 {
36245 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
36246 if (!is_unsigned) {
36247 PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
36248 if (!signed_str) goto limited_bad;
36249#if CYTHON_VECTORCALL
36250 kwds = PyTuple_Pack(1, signed_str);
36251#else
36252 {
36253 PyObject *keys[] = {signed_str};
36254 PyObject *values[] = {Py_True};
36255 kwds = __Pyx_MakeKwargDict(keys, values, 1);
36256 }
36257#endif
36258 Py_DECREF(signed_str);
36259 if (unlikely(!kwds)) goto limited_bad;
36260 }
36261 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
36262 }
36263 limited_bad:
36264 Py_XDECREF(kwds);
36265 Py_XDECREF(order_str);
36266 Py_XDECREF(py_bytes);
36267 Py_XDECREF(from_bytes_str);
36268 return result;
36269#endif
36270 }
36271}
36272
36273/* TypeInfoToFormat */
36274static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(const __Pyx_TypeInfo *type) {
36275 struct __pyx_typeinfo_string result = { {0} };
36276 char *buf = (char *) result.string;
36277 size_t size = type->size;
36278 switch (type->typegroup) {
36279 case 'H':
36280 *buf = 'c';
36281 break;
36282 case 'I':
36283 case 'U':
36284 if (size == 1)
36285 *buf = (type->is_unsigned) ? 'B' : 'b';
36286 else if (size == 2)
36287 *buf = (type->is_unsigned) ? 'H' : 'h';
36288 else if (size == 4)
36289 *buf = (type->is_unsigned) ? 'I' : 'i';
36290 else if (size == 8)
36291 *buf = (type->is_unsigned) ? 'Q' : 'q';
36292 break;
36293 case 'P':
36294 *buf = 'P';
36295 break;
36296 case 'C':
36297 {
36298 __Pyx_TypeInfo complex_type = *type;
36299 complex_type.typegroup = 'R';
36300 complex_type.size /= 2;
36301 *buf++ = 'Z';
36302 *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0];
36303 break;
36304 }
36305 case 'R':
36306 if (size == 4)
36307 *buf = 'f';
36308 else if (size == 8)
36309 *buf = 'd';
36310 else
36311 *buf = 'g';
36312 break;
36313 }
36314 return result;
36315}
36316
36317/* MemviewSliceCopy */
36318static __Pyx_memviewslice
36319__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
36320 const char *mode, int ndim,
36321 Py_ssize_t sizeof_dtype, int contig_flag,
36322 int dtype_is_object)
36323{
36324 __Pyx_RefNannyDeclarations
36325 int i;
36326 __Pyx_memviewslice new_mvs = __Pyx_MEMSLICE_INIT;
36327 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
36328 Py_buffer *buf = &from_memview->view;
36329 PyObject *shape_tuple = NULL;
36330 struct __pyx_array_obj *array_obj = NULL;
36331 struct __pyx_memoryview_obj *memview_obj = NULL;
36332 __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
36333 for (i = 0; i < ndim; i++) {
36334 if (unlikely(from_mvs->suboffsets[i] >= 0)) {
36335 PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
36336 "indirect dimensions (axis %d)", i);
36337 goto fail;
36338 }
36339 }
36340 shape_tuple = PyTuple_New(ndim);
36341 if (unlikely(!shape_tuple)) {
36342 goto fail;
36343 }
36344 __Pyx_GOTREF(shape_tuple);
36345 for(i = 0; i < ndim; i++) {
36346 PyObject *temp_int = PyLong_FromSsize_t(from_mvs->shape[i]);
36347 if(unlikely(!temp_int)) {
36348 goto fail;
36349 } else {
36350#if CYTHON_ASSUME_SAFE_MACROS
36351 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
36352#else
36353 if (PyTuple_SetItem(shape_tuple, i, temp_int) < 0) {
36354 goto fail;
36355 }
36356#endif
36357 }
36358 }
36359 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, mode, NULL);
36360 if (unlikely(!array_obj)) {
36361 goto fail;
36362 }
36363 __Pyx_GOTREF(array_obj);
36364 memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
36365 (PyObject *) array_obj, contig_flag,
36366 dtype_is_object,
36367 from_mvs->memview->typeinfo);
36368 if (unlikely(!memview_obj))
36369 goto fail;
36370 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
36371 goto fail;
36372 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
36373 dtype_is_object) < 0))
36374 goto fail;
36375 goto no_fail;
36376fail:
36377 __Pyx_XDECREF((PyObject *) new_mvs.memview);
36378 new_mvs.memview = NULL;
36379 new_mvs.data = NULL;
36380no_fail:
36381 __Pyx_XDECREF(shape_tuple);
36382 __Pyx_XDECREF((PyObject *) array_obj);
36383 __Pyx_RefNannyFinishContext();
36384 return new_mvs;
36385}
36386
36387/* UpdateUnpickledDict */
36388static int __Pyx__UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
36389 PyObject *state_dict = __Pyx_PySequence_ITEM(state, index);
36390 if (unlikely(!state_dict)) {
36391 return -1;
36392 }
36393 int non_empty = PyObject_IsTrue(state_dict);
36394 if (non_empty == 0) {
36395 Py_DECREF(state_dict);
36396 return 0;
36397 } else if (unlikely(non_empty == -1)) {
36398 return -1;
36399 }
36400 PyObject *dict;
36401 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
36402 dict = PyObject_GetAttrString(obj, "__dict__");
36403 #else
36404 dict = PyObject_GenericGetDict(obj, NULL);
36405 #endif
36406 if (unlikely(!dict)) {
36407 Py_DECREF(state_dict);
36408 return -1;
36409 }
36410 int result;
36411 if (likely(PyDict_CheckExact(dict))) {
36412 result = PyDict_Update(dict, state_dict);
36413 } else {
36414 PyObject *obj_result = __Pyx_PyObject_CallMethod1(dict, __pyx_mstate_global->__pyx_n_u_update, state_dict);
36415 if (likely(obj_result)) {
36416 Py_DECREF(obj_result);
36417 result = 0;
36418 } else {
36419 result = -1;
36420 }
36421 }
36422 Py_DECREF(state_dict);
36423 Py_DECREF(dict);
36424 return result;
36425}
36426static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
36427 Py_ssize_t state_size = __Pyx_PyTuple_GET_SIZE(state);
36428 #if !CYTHON_ASSUME_SAFE_SIZE
36429 if (unlikely(state_size == -1)) return -1;
36430 #endif
36431 if (state_size <= index) {
36432 return 0;
36433 }
36434 return __Pyx__UpdateUnpickledDict(obj, state, index);
36435}
36436
36437/* CheckUnpickleChecksumError (used by CheckUnpickleChecksum) */
36438static void __Pyx_RaiseUnpickleChecksumError(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
36439 PyObject *pickle_module = PyImport_ImportModule("pickle");
36440 if (unlikely(!pickle_module)) return;
36441 PyObject *pickle_error = PyObject_GetAttrString(pickle_module, "PickleError");
36442 Py_DECREF(pickle_module);
36443 if (unlikely(!pickle_error)) return;
36444 if (checksum2 == checksum1) {
36445 PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x) = (%s))",
36446 checksum, checksum1, members);
36447 } else if (checksum3 == checksum2) {
36448 PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x) = (%s))",
36449 checksum, checksum1, checksum2, members);
36450 } else {
36451 PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x, 0x%x) = (%s))",
36452 checksum, checksum1, checksum2, checksum3, members);
36453 }
36454 Py_DECREF(pickle_error);
36455}
36456
36457/* CheckUnpickleChecksum */
36458static int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
36459 int found = 0;
36460 found |= checksum1 == checksum;
36461 found |= checksum2 == checksum;
36462 found |= checksum3 == checksum;
36463 if (likely(found))
36464 return 0;
36465 __Pyx_RaiseUnpickleChecksumError(checksum, checksum1, checksum2, checksum3, members);
36466 return -1;
36467}
36468
36469/* CIntFromPy */
36470static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x);
36471static long __Pyx_raise_neg_overflow___Pyx_PyLong_As_long(void) {
36472 const char* type_name = "long";
36473 PyErr_Format(PyExc_OverflowError,
36474 "can't convert negative value to %.200s", type_name);
36475 return (long) -1;
36476}
36477static long __Pyx_raise_overflow___Pyx_PyLong_As_long(void) {
36478 const char* type_name = "long";
36479 PyErr_Format(PyExc_OverflowError,
36480 "value too large to convert to %.200s", type_name);
36481 return (long) -1;
36482}
36483static CYTHON_INLINE long __Pyx_PyULong___Pyx_PyLong_As_long(PyObject *x) {
36484 const int is_unsigned = 1;
36485#if CYTHON_USE_PYLONG_INTERNALS
36486 {
36487 const digit* digits = __Pyx_PyLong_Digits(x);
36488 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
36489 if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
36490 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
36491 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36492 } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
36493 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
36494 }
36495 } else
36496 if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
36497 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
36498 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36499 } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
36500 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
36501 }
36502 } else
36503 if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
36504 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
36505 __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])))
36506 } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
36507 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
36508 }
36509 } else
36510 {}
36511 }
36512#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
36513 if (unlikely(Py_SIZE(x) < 0)) {
36514 goto raise_neg_overflow;
36515 }
36516#else
36517 {
36518 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
36519 if (unlikely(result < 0))
36520 return (long) -1;
36521 if (unlikely(result == 1))
36522 goto raise_neg_overflow;
36523 }
36524#endif
36525 if ((sizeof(long) <= sizeof(unsigned long))) {
36526 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
36527 } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
36528 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
36529 }
36530 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
36531raise_neg_overflow:
36532 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
36533raise_overflow:
36534 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
36535}
36536static CYTHON_INLINE long __Pyx_PySLong___Pyx_PyLong_As_long(PyObject *x) {
36537 const int is_unsigned = 0;
36538#if CYTHON_USE_PYLONG_INTERNALS
36539 if (__Pyx_PyLong_IsNeg(x)) {
36540 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
36541 const digit* digits = __Pyx_PyLong_Digits(x);
36542 if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
36543 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
36544 long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
36545 __PYX_VERIFY_RETURN_INT(long, long, ival)
36546 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
36547 return (long) (((long) -1) * (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
36548 }
36549 } else
36550 if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
36551 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
36552 long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
36553 __PYX_VERIFY_RETURN_INT(long, long, ival)
36554 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
36555 return (long) (((long) -1) * (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
36556 }
36557 } else
36558 if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
36559 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
36560 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]));
36561 __PYX_VERIFY_RETURN_INT(long, long, ival)
36562 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
36563 return (long) (((long) -1) * (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
36564 }
36565 } else
36566 {}
36567 } else {
36568 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
36569 const digit* digits = __Pyx_PyLong_Digits(x);
36570 if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
36571 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
36572 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36573 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
36574 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
36575 }
36576 } else
36577 if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
36578 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
36579 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36580 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
36581 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
36582 }
36583 } else
36584 if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
36585 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
36586 __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])))
36587 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
36588 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
36589 }
36590 } else
36591 {}
36592 }
36593#endif
36594 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
36595 if ((sizeof(long) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
36596 __PYX_VERIFY_RETURN_INT_EXC(long, int, PyLong_AsInt(x))
36597 } else
36598 #endif
36599 if ((sizeof(long) <= sizeof(long))) {
36600 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
36601 } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
36602 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
36603 }
36604 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
36605raise_neg_overflow:
36606 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
36607raise_overflow:
36608 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
36609}
36610static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x) {
36611#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
36612#pragma GCC diagnostic push
36613#pragma GCC diagnostic ignored "-Wconversion"
36614#endif
36615 const long neg_one = (long) -1, const_zero = (long) 0;
36616#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
36617#pragma GCC diagnostic pop
36618#endif
36619 const int is_unsigned = neg_one > const_zero;
36620 long val;
36621 int ret = -1;
36622#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
36623 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
36624 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
36625 if (unlikely(bytes_copied == -1)) {
36626 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
36627 goto raise_overflow;
36628 } else {
36629 ret = 0;
36630 }
36631#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
36632 int one = 1; int is_little = (int)*(unsigned char *)&one;
36633 unsigned char *bytes = (unsigned char *)&val;
36634 ret = _PyLong_AsByteArray((PyLongObject *)x,
36635 bytes, sizeof(val),
36636 is_little, !is_unsigned);
36637 if ((0)) goto raise_overflow;
36638#else
36639 PyObject *v;
36640 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
36641 int bits, remaining_bits, is_negative = 0;
36642 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
36643 if (likely(PyLong_CheckExact(x))) {
36644 v = __Pyx_NewRef(x);
36645 } else {
36646 v = PyNumber_Long(x);
36647 if (unlikely(!v)) return (long) -1;
36648 assert(PyLong_CheckExact(v));
36649 }
36650 {
36651 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
36652 if (unlikely(result < 0)) {
36653 Py_DECREF(v);
36654 return (long) -1;
36655 }
36656 is_negative = result == 1;
36657 }
36658 if (is_unsigned && unlikely(is_negative)) {
36659 Py_DECREF(v);
36660 PyErr_SetString(PyExc_OverflowError,
36661 "can't convert negative value to long");
36662 return (long) -1;
36663 } else if (is_negative) {
36664 stepval = PyNumber_Invert(v);
36665 Py_DECREF(v);
36666 if (unlikely(!stepval))
36667 return (long) -1;
36668 } else {
36669 stepval = v;
36670 }
36671 v = NULL;
36672 val = (long) 0;
36673 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
36674 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
36675 for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
36676 PyObject *tmp, *digit;
36677 long idigit;
36678 digit = PyNumber_And(stepval, mask);
36679 if (unlikely(!digit)) goto done;
36680 idigit = PyLong_AsLong(digit);
36681 Py_DECREF(digit);
36682 if (unlikely(idigit < 0)) goto done;
36683 val |= ((long) idigit) << bits;
36684 tmp = PyNumber_Rshift(stepval, shift);
36685 if (unlikely(!tmp)) goto done;
36686 Py_DECREF(stepval); stepval = tmp;
36687 }
36688 Py_DECREF(shift); shift = NULL;
36689 Py_DECREF(mask); mask = NULL;
36690 {
36691 long idigit = PyLong_AsLong(stepval);
36692 if (unlikely(idigit < 0)) goto done;
36693 remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
36694 if (unlikely(idigit >= (1L << remaining_bits)))
36695 goto raise_overflow;
36696 val |= ((long) idigit) << bits;
36697 }
36698 if (!is_unsigned) {
36699 if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
36700 goto raise_overflow;
36701 if (is_negative)
36702 val = ~val;
36703 }
36704 ret = 0;
36705done:
36706 Py_XDECREF(shift);
36707 Py_XDECREF(mask);
36708 Py_XDECREF(stepval);
36709#endif
36710 if (unlikely(ret))
36711 return (long) -1;
36712 return val;
36713raise_overflow:
36714 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
36715}
36716static CYTHON_INLINE long __Pyx_PyLong___Pyx_PyLong_As_long(PyObject *x) {
36717#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
36718#pragma GCC diagnostic push
36719#pragma GCC diagnostic ignored "-Wconversion"
36720#endif
36721 const long neg_one = (long) -1, const_zero = (long) 0;
36722#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
36723#pragma GCC diagnostic pop
36724#endif
36725 const int is_unsigned = neg_one > const_zero;
36726 if (is_unsigned) {
36727 #if CYTHON_USE_PYLONG_INTERNALS
36728 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
36729 goto raise_neg_overflow;
36730 } else if (__Pyx_PyLong_IsCompact(x)) {
36731 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
36732 } else
36733 #endif
36734 {
36735 return __Pyx_PyULong___Pyx_PyLong_As_long(x);
36736 }
36737 } else {
36738 #if CYTHON_USE_PYLONG_INTERNALS
36739 if (__Pyx_PyLong_IsCompact(x)) {
36740 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
36741 } else
36742 #endif
36743 {
36744 return __Pyx_PySLong___Pyx_PyLong_As_long(x);
36745 }
36746 }
36747#if CYTHON_USE_PYLONG_INTERNALS
36748raise_neg_overflow:
36749 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
36750raise_overflow:
36751 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
36752#endif
36753}
36754static long __Pyx_NonPyLong___Pyx_PyLong_As_long(PyObject *x) {
36755 long val;
36756 PyObject *tmp = __Pyx_PyNumber_Long(x);
36757 if (!tmp) return (long) -1;
36758 val = __Pyx_PyLong_As_long(tmp);
36759 Py_DECREF(tmp);
36760 return val;
36761}
36762static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) {
36763 if (likely(PyLong_Check(x))) {
36764 return __Pyx_PyLong___Pyx_PyLong_As_long(x);
36765 } else {
36766 return __Pyx_NonPyLong___Pyx_PyLong_As_long(x);
36767 }
36768}
36769
36770/* CIntFromPy */
36771static char __Pyx_LargePyLong___Pyx_PyLong_As_char(PyObject *x);
36772static char __Pyx_raise_neg_overflow___Pyx_PyLong_As_char(void) {
36773 const char* type_name = "char";
36774 PyErr_Format(PyExc_OverflowError,
36775 "can't convert negative value to %.200s", type_name);
36776 return (char) -1;
36777}
36778static char __Pyx_raise_overflow___Pyx_PyLong_As_char(void) {
36779 const char* type_name = "char";
36780 PyErr_Format(PyExc_OverflowError,
36781 "value too large to convert to %.200s", type_name);
36782 return (char) -1;
36783}
36784static CYTHON_INLINE char __Pyx_PyULong___Pyx_PyLong_As_char(PyObject *x) {
36785 const int is_unsigned = 1;
36786#if CYTHON_USE_PYLONG_INTERNALS
36787 {
36788 const digit* digits = __Pyx_PyLong_Digits(x);
36789 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
36790 if (size == 2 && (8 * sizeof(char) > 1 * PyLong_SHIFT)) {
36791 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
36792 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36793 } else if ((8 * sizeof(char) >= 2 * PyLong_SHIFT)) {
36794 return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
36795 }
36796 } else
36797 if (size == 3 && (8 * sizeof(char) > 2 * PyLong_SHIFT)) {
36798 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
36799 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36800 } else if ((8 * sizeof(char) >= 3 * PyLong_SHIFT)) {
36801 return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
36802 }
36803 } else
36804 if (size == 4 && (8 * sizeof(char) > 3 * PyLong_SHIFT)) {
36805 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
36806 __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])))
36807 } else if ((8 * sizeof(char) >= 4 * PyLong_SHIFT)) {
36808 return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
36809 }
36810 } else
36811 {}
36812 }
36813#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
36814 if (unlikely(Py_SIZE(x) < 0)) {
36815 goto raise_neg_overflow;
36816 }
36817#else
36818 {
36819 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
36820 if (unlikely(result < 0))
36821 return (char) -1;
36822 if (unlikely(result == 1))
36823 goto raise_neg_overflow;
36824 }
36825#endif
36826 if ((sizeof(char) <= sizeof(unsigned long))) {
36827 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
36828 } else if ((sizeof(char) <= sizeof(unsigned PY_LONG_LONG))) {
36829 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
36830 }
36831 return __Pyx_LargePyLong___Pyx_PyLong_As_char(x);
36832raise_neg_overflow:
36833 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
36834raise_overflow:
36835 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
36836}
36837static CYTHON_INLINE char __Pyx_PySLong___Pyx_PyLong_As_char(PyObject *x) {
36838 const int is_unsigned = 0;
36839#if CYTHON_USE_PYLONG_INTERNALS
36840 if (__Pyx_PyLong_IsNeg(x)) {
36841 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
36842 const digit* digits = __Pyx_PyLong_Digits(x);
36843 if (size == 2 && (8 * sizeof(char) > 1 * PyLong_SHIFT)) {
36844 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
36845 long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
36846 __PYX_VERIFY_RETURN_INT(char, long, ival)
36847 } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
36848 return (char) (((char) -1) * (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
36849 }
36850 } else
36851 if (size == 3 && (8 * sizeof(char) > 2 * PyLong_SHIFT)) {
36852 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
36853 long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
36854 __PYX_VERIFY_RETURN_INT(char, long, ival)
36855 } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
36856 return (char) (((char) -1) * (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
36857 }
36858 } else
36859 if (size == 4 && (8 * sizeof(char) > 3 * PyLong_SHIFT)) {
36860 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
36861 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]));
36862 __PYX_VERIFY_RETURN_INT(char, long, ival)
36863 } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) {
36864 return (char) (((char) -1) * (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
36865 }
36866 } else
36867 {}
36868 } else {
36869 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
36870 const digit* digits = __Pyx_PyLong_Digits(x);
36871 if (size == 2 && (8 * sizeof(char) > 1 * PyLong_SHIFT)) {
36872 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
36873 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36874 } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
36875 return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
36876 }
36877 } else
36878 if (size == 3 && (8 * sizeof(char) > 2 * PyLong_SHIFT)) {
36879 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
36880 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36881 } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
36882 return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
36883 }
36884 } else
36885 if (size == 4 && (8 * sizeof(char) > 3 * PyLong_SHIFT)) {
36886 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
36887 __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])))
36888 } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) {
36889 return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
36890 }
36891 } else
36892 {}
36893 }
36894#endif
36895 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
36896 if ((sizeof(char) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
36897 __PYX_VERIFY_RETURN_INT_EXC(char, int, PyLong_AsInt(x))
36898 } else
36899 #endif
36900 if ((sizeof(char) <= sizeof(long))) {
36901 __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
36902 } else if ((sizeof(char) <= sizeof(PY_LONG_LONG))) {
36903 __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
36904 }
36905 return __Pyx_LargePyLong___Pyx_PyLong_As_char(x);
36906raise_neg_overflow:
36907 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
36908raise_overflow:
36909 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
36910}
36911static char __Pyx_LargePyLong___Pyx_PyLong_As_char(PyObject *x) {
36912#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
36913#pragma GCC diagnostic push
36914#pragma GCC diagnostic ignored "-Wconversion"
36915#endif
36916 const char neg_one = (char) -1, const_zero = (char) 0;
36917#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
36918#pragma GCC diagnostic pop
36919#endif
36920 const int is_unsigned = neg_one > const_zero;
36921 char val;
36922 int ret = -1;
36923#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
36924 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
36925 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
36926 if (unlikely(bytes_copied == -1)) {
36927 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
36928 goto raise_overflow;
36929 } else {
36930 ret = 0;
36931 }
36932#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
36933 int one = 1; int is_little = (int)*(unsigned char *)&one;
36934 unsigned char *bytes = (unsigned char *)&val;
36935 ret = _PyLong_AsByteArray((PyLongObject *)x,
36936 bytes, sizeof(val),
36937 is_little, !is_unsigned);
36938 if ((0)) goto raise_overflow;
36939#else
36940 PyObject *v;
36941 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
36942 int bits, remaining_bits, is_negative = 0;
36943 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
36944 if (likely(PyLong_CheckExact(x))) {
36945 v = __Pyx_NewRef(x);
36946 } else {
36947 v = PyNumber_Long(x);
36948 if (unlikely(!v)) return (char) -1;
36949 assert(PyLong_CheckExact(v));
36950 }
36951 {
36952 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
36953 if (unlikely(result < 0)) {
36954 Py_DECREF(v);
36955 return (char) -1;
36956 }
36957 is_negative = result == 1;
36958 }
36959 if (is_unsigned && unlikely(is_negative)) {
36960 Py_DECREF(v);
36961 PyErr_SetString(PyExc_OverflowError,
36962 "can't convert negative value to char");
36963 return (char) -1;
36964 } else if (is_negative) {
36965 stepval = PyNumber_Invert(v);
36966 Py_DECREF(v);
36967 if (unlikely(!stepval))
36968 return (char) -1;
36969 } else {
36970 stepval = v;
36971 }
36972 v = NULL;
36973 val = (char) 0;
36974 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
36975 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
36976 for (bits = 0; bits < (int) sizeof(char) * 8 - chunk_size; bits += chunk_size) {
36977 PyObject *tmp, *digit;
36978 long idigit;
36979 digit = PyNumber_And(stepval, mask);
36980 if (unlikely(!digit)) goto done;
36981 idigit = PyLong_AsLong(digit);
36982 Py_DECREF(digit);
36983 if (unlikely(idigit < 0)) goto done;
36984 val |= ((char) idigit) << bits;
36985 tmp = PyNumber_Rshift(stepval, shift);
36986 if (unlikely(!tmp)) goto done;
36987 Py_DECREF(stepval); stepval = tmp;
36988 }
36989 Py_DECREF(shift); shift = NULL;
36990 Py_DECREF(mask); mask = NULL;
36991 {
36992 long idigit = PyLong_AsLong(stepval);
36993 if (unlikely(idigit < 0)) goto done;
36994 remaining_bits = ((int) sizeof(char) * 8) - bits - (is_unsigned ? 0 : 1);
36995 if (unlikely(idigit >= (1L << remaining_bits)))
36996 goto raise_overflow;
36997 val |= ((char) idigit) << bits;
36998 }
36999 if (!is_unsigned) {
37000 if (unlikely(val & (((char) 1) << (sizeof(char) * 8 - 1))))
37001 goto raise_overflow;
37002 if (is_negative)
37003 val = ~val;
37004 }
37005 ret = 0;
37006done:
37007 Py_XDECREF(shift);
37008 Py_XDECREF(mask);
37009 Py_XDECREF(stepval);
37010#endif
37011 if (unlikely(ret))
37012 return (char) -1;
37013 return val;
37014raise_overflow:
37015 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
37016}
37017static CYTHON_INLINE char __Pyx_PyLong___Pyx_PyLong_As_char(PyObject *x) {
37018#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37019#pragma GCC diagnostic push
37020#pragma GCC diagnostic ignored "-Wconversion"
37021#endif
37022 const char neg_one = (char) -1, const_zero = (char) 0;
37023#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37024#pragma GCC diagnostic pop
37025#endif
37026 const int is_unsigned = neg_one > const_zero;
37027 if (is_unsigned) {
37028 #if CYTHON_USE_PYLONG_INTERNALS
37029 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
37030 goto raise_neg_overflow;
37031 } else if (__Pyx_PyLong_IsCompact(x)) {
37032 __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
37033 } else
37034 #endif
37035 {
37036 return __Pyx_PyULong___Pyx_PyLong_As_char(x);
37037 }
37038 } else {
37039 #if CYTHON_USE_PYLONG_INTERNALS
37040 if (__Pyx_PyLong_IsCompact(x)) {
37041 __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
37042 } else
37043 #endif
37044 {
37045 return __Pyx_PySLong___Pyx_PyLong_As_char(x);
37046 }
37047 }
37048#if CYTHON_USE_PYLONG_INTERNALS
37049raise_neg_overflow:
37050 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
37051raise_overflow:
37052 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
37053#endif
37054}
37055static char __Pyx_NonPyLong___Pyx_PyLong_As_char(PyObject *x) {
37056 char val;
37057 PyObject *tmp = __Pyx_PyNumber_Long(x);
37058 if (!tmp) return (char) -1;
37059 val = __Pyx_PyLong_As_char(tmp);
37060 Py_DECREF(tmp);
37061 return val;
37062}
37063static CYTHON_INLINE char __Pyx_PyLong_As_char(PyObject *x) {
37064 if (likely(PyLong_Check(x))) {
37065 return __Pyx_PyLong___Pyx_PyLong_As_char(x);
37066 } else {
37067 return __Pyx_NonPyLong___Pyx_PyLong_As_char(x);
37068 }
37069}
37070
37071/* GetRuntimeVersion */
37072#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
37073void __Pyx_init_runtime_version(void) {
37074 if (__Pyx_cached_runtime_version == 0) {
37075 const char* rt_version = Py_GetVersion();
37076 unsigned long version = 0;
37077 unsigned long factor = 0x01000000UL;
37078 unsigned int digit = 0;
37079 int i = 0;
37080 while (factor) {
37081 while ('0' <= rt_version[i] && rt_version[i] <= '9') {
37082 digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
37083 ++i;
37084 }
37085 version += factor * digit;
37086 if (rt_version[i] != '.')
37087 break;
37088 digit = 0;
37089 factor >>= 8;
37090 ++i;
37091 }
37092 __Pyx_cached_runtime_version = version;
37093 }
37094}
37095#endif
37096static unsigned long __Pyx_get_runtime_version(void) {
37097#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
37098 return Py_Version & ~0xFFUL;
37099#else
37100 return __Pyx_cached_runtime_version;
37101#endif
37102}
37103
37104/* CheckBinaryVersion */
37105static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
37106 const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
37107 if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
37108 return 0;
37109 if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
37110 return 1;
37111 {
37112 char message[200];
37113 PyOS_snprintf(message, sizeof(message),
37114 "compile time Python version %d.%d "
37115 "of module '%.100s' "
37116 "%s "
37117 "runtime version %d.%d",
37118 (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
37119 __Pyx_MODULE_NAME,
37120 (allow_newer) ? "was newer than" : "does not match",
37121 (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
37122 );
37123 return PyErr_WarnEx(NULL, message, 1);
37124 }
37125}
37126
37127/* NewCodeObj */
37128#if CYTHON_COMPILING_IN_LIMITED_API
37129 static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
37130 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
37131 PyObject *fv, PyObject *cell, PyObject* fn,
37132 PyObject *name, int fline, PyObject *lnos) {
37133 PyObject *exception_table = NULL;
37134 PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
37135 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
37136 PyObject *version_info;
37137 PyObject *py_minor_version = NULL;
37138 #endif
37139 long minor_version = 0;
37140 #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
37141 minor_version = 11;
37142 #else
37143 if (!(version_info = PySys_GetObject("version_info"))) goto end;
37144 if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
37145 minor_version = PyLong_AsLong(py_minor_version);
37146 Py_DECREF(py_minor_version);
37147 if (minor_version == -1 && PyErr_Occurred()) goto end;
37148 #endif
37149 if (!(types_module = PyImport_ImportModule("types"))) goto end;
37150 if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
37151 if (minor_version <= 10) {
37152 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code,
37153 c, n, v, fn, name, fline, lnos, fv, cell);
37154 } else {
37155 if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
37156 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code,
37157 c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
37158 }
37159 end:
37160 Py_XDECREF(code_type);
37161 Py_XDECREF(exception_table);
37162 Py_XDECREF(types_module);
37163 if (!result) {
37164 PyObject *exc_type, *exc_value, *exc_tb;
37165 PyErr_Fetch(&exc_type, &exc_value, &exc_tb);
37166 if (PyErr_WarnFormat(
37167 PyExc_RuntimeWarning, 1,
37168 "Code object creation failed in Cython module: %S\nTry recompiling with a more recent version of Cython.",
37169 exc_value ? exc_value : exc_type) == 0) {
37170 result = Py_None;
37171 Py_INCREF(result);
37172 }
37173 Py_DECREF(exc_type);
37174 Py_XDECREF(exc_value);
37175 Py_XDECREF(exc_tb);
37176 }
37177 return result;
37178 }
37179#elif PY_VERSION_HEX >= 0x030B0000
37180 static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
37181 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
37182 PyObject *fv, PyObject *cell, PyObject* fn,
37183 PyObject *name, int fline, PyObject *lnos) {
37184 PyCodeObject *result;
37185 result =
37186 #if PY_VERSION_HEX >= 0x030C0000
37187 PyUnstable_Code_NewWithPosOnlyArgs
37188 #else
37189 PyCode_NewWithPosOnlyArgs
37190 #endif
37191 (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
37192 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
37193 if (likely(result))
37194 result->_co_firsttraceable = 0;
37195 #endif
37196 return result;
37197 }
37198#elif !CYTHON_COMPILING_IN_PYPY
37199 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
37200 PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
37201#else
37202 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
37203 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
37204#endif
37205static PyObject* __Pyx_PyCode_New(
37206 const __Pyx_PyCode_New_function_description descr,
37207 PyObject * const *varnames,
37208 PyObject *filename,
37209 PyObject *funcname,
37210 PyObject *line_table,
37211 PyObject *tuple_dedup_map
37212) {
37213 PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL;
37214 Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
37215 PyObject *varnames_tuple = PyTuple_New(var_count);
37216 if (unlikely(!varnames_tuple)) return NULL;
37217 for (Py_ssize_t i=0; i < var_count; i++) {
37218 Py_INCREF(varnames[i]);
37219 if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done;
37220 }
37221 #if CYTHON_COMPILING_IN_LIMITED_API
37222 varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
37223 if (!varnames_tuple_dedup) {
37224 if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done;
37225 varnames_tuple_dedup = varnames_tuple;
37226 }
37227 #else
37228 varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
37229 if (unlikely(!varnames_tuple_dedup)) goto done;
37230 #endif
37231 #if CYTHON_AVOID_BORROWED_REFS
37232 Py_INCREF(varnames_tuple_dedup);
37233 #endif
37234 if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) {
37235 Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
37236 #if !CYTHON_ASSUME_SAFE_SIZE
37237 if (unlikely(line_table_length == -1)) goto done;
37238 #endif
37239 Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
37240 code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
37241 if (unlikely(!code_bytes)) goto done;
37242 char* c_code_bytes = PyBytes_AsString(code_bytes);
37243 if (unlikely(!c_code_bytes)) goto done;
37244 memset(c_code_bytes, 0, (size_t) code_len);
37245 }
37246 code_obj = (PyObject*) __Pyx__PyCode_New(
37247 (int) descr.argcount,
37248 (int) descr.num_posonly_args,
37249 (int) descr.num_kwonly_args,
37250 (int) descr.nlocals,
37251 0,
37252 (int) descr.flags,
37253 code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
37254 __pyx_mstate_global->__pyx_empty_tuple,
37255 __pyx_mstate_global->__pyx_empty_tuple,
37256 varnames_tuple_dedup,
37257 __pyx_mstate_global->__pyx_empty_tuple,
37258 __pyx_mstate_global->__pyx_empty_tuple,
37259 filename,
37260 funcname,
37261 (int) descr.first_line,
37262 (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
37263 );
37264done:
37265 Py_XDECREF(code_bytes);
37266 #if CYTHON_AVOID_BORROWED_REFS
37267 Py_XDECREF(varnames_tuple_dedup);
37268 #endif
37269 Py_DECREF(varnames_tuple);
37270 return code_obj;
37271}
37272
37273/* DecompressString */
37274CYTHON_UNUSED
37275static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) {
37276#ifdef __Pyx_DecompressString_UNUSED
37277 CYTHON_UNUSED_VAR(s);
37278 CYTHON_UNUSED_VAR(length);
37279 CYTHON_UNUSED_VAR(algo);
37280 return NULL;
37281#else
37282 PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
37283 const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib";
37284 PyObject *methodname = PyUnicode_FromString("decompress");
37285 if (unlikely(!methodname)) return NULL;
37286 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
37287 if (algo == 3) {
37288 PyObject *fromlist = Py_BuildValue("[O]", methodname);
37289 if (unlikely(!fromlist)) goto bad;
37290 module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
37291 Py_DECREF(fromlist);
37292 } else
37293 #endif
37294 module = PyImport_ImportModule(module_name);
37295 if (unlikely(!module)) goto import_failed;
37296 decompress = PyObject_GetAttr(module, methodname);
37297 if (unlikely(!decompress)) goto import_failed;
37298 {
37299 #ifdef __cplusplus
37300 char *memview_bytes = const_cast<char*>(s);
37301 #else
37302 #if defined(__clang__)
37303 #pragma clang diagnostic push
37304 #pragma clang diagnostic ignored "-Wcast-qual"
37305 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
37306 #pragma GCC diagnostic push
37307 #pragma GCC diagnostic ignored "-Wcast-qual"
37308 #endif
37309 char *memview_bytes = (char*) s;
37310 #if defined(__clang__)
37311 #pragma clang diagnostic pop
37312 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
37313 #pragma GCC diagnostic pop
37314 #endif
37315 #endif
37316 #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
37317 int memview_flags = 0x100;
37318 #else
37319 int memview_flags = PyBUF_READ;
37320 #endif
37321 compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
37322 }
37323 if (unlikely(!compressed_bytes)) {
37324 Py_DECREF(decompress);
37325 goto bad;
37326 }
37327 decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
37328 Py_DECREF(compressed_bytes);
37329 Py_DECREF(decompress);
37330 Py_DECREF(module);
37331 Py_DECREF(methodname);
37332 return decompressed;
37333import_failed:
37334 PyErr_Format(PyExc_ImportError,
37335 "Failed to import '%.20s.decompress' - cannot initialise module strings. "
37336 "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
37337 module_name, algo);
37338bad:
37339 Py_XDECREF(module);
37340 Py_DECREF(methodname);
37341 return NULL;
37342#endif
37343}
37344
37345/* DecompressString_LZSS */
37346#ifndef __Pyx_DecompressString_LZSS_UNUSED
37347CYTHON_UNUSED
37348static CYTHON_SMALL_CODE size_t __pyx_lzss_decompress(const uint8_t* src, uint8_t* dst, size_t dst_len) {
37349 size_t pos = 0, out_pos = 0;
37350 while (1) {
37351 uint32_t flags = src[pos++] | 0xFF00;
37352 while (flags & 0x100) {
37353 if (flags & 1) {
37354 dst[out_pos++] = src[pos++];
37355 } else {
37356 uint32_t lo = src[pos++], hi = src[pos++];
37357 uint32_t end_offset_of_last_occurrence, match_length;
37358 if (!(lo & 0x80)) {
37359 end_offset_of_last_occurrence = lo;
37360 match_length = hi;
37361 } else if (!(hi & 0x80)) {
37362 end_offset_of_last_occurrence = 0x80 + (((hi << 2) & 0x180) | (lo & 0x7F));
37363 match_length = hi & 0x1F;
37364 } else {
37365 end_offset_of_last_occurrence = 0x80 + ((hi & 0x7F) << 7 | (lo & 0x7F));
37366 match_length = src[pos++];
37367 }
37368 match_length += 3;
37369 size_t ref_pos = out_pos - end_offset_of_last_occurrence - match_length;
37370 memcpy(dst + out_pos, dst + ref_pos, match_length);
37371 out_pos += match_length;
37372 }
37373 if (out_pos >= dst_len) return pos;
37374 flags >>= 1;
37375 }
37376 }
37377}
37378#endif
37379static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString_LZSS(const char *s, size_t compressed_length, size_t uncompressed_length) {
37380#ifdef __Pyx_DecompressString_LZSS_UNUSED
37381 CYTHON_UNUSED_VAR(s);
37382 CYTHON_UNUSED_VAR(compressed_length);
37383 CYTHON_UNUSED_VAR(uncompressed_length);
37384 return NULL;
37385#else
37386 PyObject *result;
37387 unsigned char *result_data;
37388 size_t src_length;
37389 result = PyBytes_FromStringAndSize(NULL, (Py_ssize_t) uncompressed_length);
37390 if (unlikely(!result)) return NULL;
37391 result_data = __Pyx_PyBytes_AsWritableUString(result);
37392 if (unlikely(!result_data)) goto bad;
37393 src_length = __pyx_lzss_decompress((const uint8_t*) s, result_data, uncompressed_length);
37394 if (unlikely(src_length != compressed_length)) goto decompression_failed;
37395 return result;
37396decompression_failed:
37397 PyErr_SetString(PyExc_RuntimeError, "LZSS string data decompression failed");
37398bad:
37399 Py_DECREF(result);
37400 return NULL;
37401#endif
37402}
37403
37404#include <string.h>
37405static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
37406 size_t len = strlen(s);
37407 if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
37408 PyErr_SetString(PyExc_OverflowError, "byte string is too long");
37409 return -1;
37410 }
37411 return (Py_ssize_t) len;
37412}
37413static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
37414 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
37415 if (unlikely(len < 0)) return NULL;
37416 return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
37417}
37418static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
37419 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
37420 if (unlikely(len < 0)) return NULL;
37421 return PyByteArray_FromStringAndSize(c_str, len);
37422}
37423static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
37424 Py_ssize_t ignore;
37425 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
37426}
37427#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
37428static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
37429 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
37430#if CYTHON_COMPILING_IN_LIMITED_API
37431 {
37432 const char* result;
37433 Py_ssize_t unicode_length;
37434 CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
37435 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
37436 if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL;
37437 #else
37438 result = PyUnicode_AsUTF8AndSize(o, length);
37439 #endif
37440 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
37441 unicode_length = PyUnicode_GetLength(o);
37442 if (unlikely(unicode_length < 0)) return NULL;
37443 if (unlikely(unicode_length != *length)) {
37444 PyUnicode_AsASCIIString(o);
37445 return NULL;
37446 }
37447 #endif
37448 return result;
37449 }
37450#else
37451#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
37452 if (likely(PyUnicode_IS_ASCII(o))) {
37453 *length = PyUnicode_GET_LENGTH(o);
37454 return PyUnicode_AsUTF8(o);
37455 } else {
37456 PyUnicode_AsASCIIString(o);
37457 return NULL;
37458 }
37459#else
37460 return PyUnicode_AsUTF8AndSize(o, length);
37461#endif
37462#endif
37463}
37464#endif
37465static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
37466#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
37467 if (PyUnicode_Check(o)) {
37468 return __Pyx_PyUnicode_AsStringAndSize(o, length);
37469 } else
37470#endif
37471 if (PyByteArray_Check(o)) {
37472#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
37473 *length = PyByteArray_GET_SIZE(o);
37474 return PyByteArray_AS_STRING(o);
37475#else
37476 *length = PyByteArray_Size(o);
37477 if (*length == -1) return NULL;
37478 return PyByteArray_AsString(o);
37479#endif
37480 } else
37481 {
37482 char* result;
37483 int r = PyBytes_AsStringAndSize(o, &result, length);
37484 if (unlikely(r < 0)) {
37485 return NULL;
37486 } else {
37487 return result;
37488 }
37489 }
37490}
37491static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
37492 int is_true = x == Py_True;
37493 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
37494 else return PyObject_IsTrue(x);
37495}
37496static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
37497 int retval;
37498 if (unlikely(!x)) return -1;
37499 retval = __Pyx_PyObject_IsTrue(x);
37500 Py_DECREF(x);
37501 return retval;
37502}
37503static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) {
37504 __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
37505 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
37506 if (unlikely(!result_type_name)) goto bad;
37507 #endif
37508 if (PyLong_Check(result)) {
37509 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
37510 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). "
37511 "The ability to return an instance of a strict subclass of int is deprecated, "
37512 "and may be removed in a future version of Python.",
37513 result_type_name)) {
37514 __Pyx_DECREF_TypeName(result_type_name);
37515 goto bad;
37516 }
37517 __Pyx_DECREF_TypeName(result_type_name);
37518 return result;
37519 }
37520 PyErr_Format(PyExc_TypeError,
37521 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")",
37522 result_type_name);
37523 __Pyx_DECREF_TypeName(result_type_name);
37524bad:
37525 Py_DECREF(result);
37526 return NULL;
37527}
37528static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
37529#if CYTHON_USE_TYPE_SLOTS
37530 PyNumberMethods *m;
37531#endif
37532 PyObject *res = NULL;
37533 if (likely(PyLong_Check(x)))
37534 return __Pyx_NewRef(x);
37535#if CYTHON_USE_TYPE_SLOTS
37536 m = Py_TYPE(x)->tp_as_number;
37537 if (likely(m && m->nb_int)) {
37538 res = m->nb_int(x);
37539 }
37540#else
37541 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
37542 res = PyNumber_Long(x);
37543 }
37544#endif
37545 if (likely(res)) {
37546 if (unlikely(!PyLong_CheckExact(res))) {
37547 return __Pyx_PyNumber_LongWrongResultType(res);
37548 }
37549 }
37550 else if (!PyErr_Occurred()) {
37551 PyErr_SetString(PyExc_TypeError,
37552 "an integer is required");
37553 }
37554 return res;
37555}
37556static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_AsSsize_t(PyObject* b) {
37557 #if CYTHON_USE_PYLONG_INTERNALS
37558 Py_ssize_t ival;
37559 const Py_ssize_t size = __Pyx_PyLong_DigitCount(b);
37560 const int is_neg = __Pyx_PyLong_IsNeg(b);
37561 const digit* digits = __Pyx_PyLong_Digits(b);
37562 if (size == 0) return 0;
37563 #if SIZEOF_SIZE_T * 8 > 1 * PyLong_SHIFT
37564 if (size == 1) {
37565 ival = (Py_ssize_t) (((size_t)digits[0]));
37566 } else
37567 #endif
37568 #if SIZEOF_SIZE_T * 8 > 2 * PyLong_SHIFT
37569 if (size == 2) {
37570 ival = (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
37571 } else
37572 #endif
37573 #if SIZEOF_SIZE_T * 8 > 3 * PyLong_SHIFT
37574 if (size == 3) {
37575 ival = (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
37576 } else
37577 #endif
37578 #if SIZEOF_SIZE_T * 8 > 4 * PyLong_SHIFT
37579 if (size == 4) {
37580 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]));
37581 } else
37582 #endif
37583 return PyLong_AsSsize_t(b);
37584 return is_neg ? -ival : ival;
37585 #else
37586 return PyLong_AsSsize_t(b);
37587 #endif
37588}
37589static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
37590 if (likely(PyLong_Check(b))) {
37591 return __Pyx_PyLong_AsSsize_t(b);
37592 } else {
37593 Py_ssize_t ival;
37594 PyObject *x = PyNumber_Index(b);
37595 if (unlikely(!x)) return -1;
37596 ival = __Pyx_PyLong_AsSsize_t(x);
37597 Py_DECREF(x);
37598 return ival;
37599 }
37600}
37601static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
37602 if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
37603 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
37604 } else {
37605 Py_ssize_t ival;
37606 PyObject *x;
37607 x = PyNumber_Index(o);
37608 if (!x) return -1;
37609 ival = PyLong_AsLong(x);
37610 Py_DECREF(x);
37611 return ival;
37612 }
37613}
37614static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) {
37615 CYTHON_UNUSED_VAR(b);
37616 return __Pyx_NewRef(Py_None);
37617}
37618static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
37619 return __Pyx_NewRef(b ? Py_True: Py_False);
37620}
37621static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) {
37622 return PyLong_FromSize_t(ival);
37623}
37624
37625
37626/* MultiPhaseInitModuleState */
37627#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
37628#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
37629#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
37630 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
37631#else
37632 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
37633#endif
37634#endif
37635#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
37636#error "Module state with PEP489 requires atomics. Currently that's one of\
37637 C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
37638#endif
37639#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
37640#define __Pyx_ModuleStateLookup_Lock()
37641#define __Pyx_ModuleStateLookup_Unlock()
37642#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
37643static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
37644#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
37645#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
37646#elif defined(__cplusplus) && __cplusplus >= 201103L
37647#include <mutex>
37648static std::mutex __Pyx_ModuleStateLookup_mutex;
37649#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
37650#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
37651#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
37652#include <threads.h>
37653static mtx_t __Pyx_ModuleStateLookup_mutex;
37654static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
37655static void __Pyx_ModuleStateLookup_initialize_mutex(void) {
37656 mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
37657}
37658#define __Pyx_ModuleStateLookup_Lock()\
37659 call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
37660 mtx_lock(&__Pyx_ModuleStateLookup_mutex)
37661#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
37662#elif defined(HAVE_PTHREAD_H)
37663#include <pthread.h>
37664static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
37665#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
37666#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
37667#elif defined(_WIN32)
37668#include <Windows.h> // synchapi.h on its own doesn't work
37669static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
37670#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
37671#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
37672#else
37673#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
37674 Requires C standard >= C11, or C++ standard >= C++11,\
37675 or pthreads, or the Windows 32 API, or Python >= 3.13."
37676#endif
37677typedef struct {
37678 int64_t id;
37679 PyObject *module;
37680} __Pyx_InterpreterIdAndModule;
37681typedef struct {
37682 char interpreter_id_as_index;
37683 Py_ssize_t count;
37684 Py_ssize_t allocated;
37685 __Pyx_InterpreterIdAndModule table[1];
37686} __Pyx_ModuleStateLookupData;
37687#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
37688#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
37689static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
37690#endif
37691#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
37692static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
37693#else
37694static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
37695#endif
37696static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
37697 __Pyx_InterpreterIdAndModule* table,
37698 Py_ssize_t count,
37699 int64_t interpreterId) {
37700 __Pyx_InterpreterIdAndModule* begin = table;
37701 __Pyx_InterpreterIdAndModule* end = begin + count;
37702 if (begin->id == interpreterId) {
37703 return begin;
37704 }
37705 while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
37706 __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
37707 if (halfway->id == interpreterId) {
37708 return halfway;
37709 }
37710 if (halfway->id < interpreterId) {
37711 begin = halfway;
37712 } else {
37713 end = halfway;
37714 }
37715 }
37716 for (; begin < end; ++begin) {
37717 if (begin->id >= interpreterId) return begin;
37718 }
37719 return begin;
37720}
37721static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) {
37722 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
37723 if (interpreter_id == -1) return NULL;
37724#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
37725 __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
37726 {
37727 __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
37728 if (likely(data)) {
37729 __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
37730 if (likely(data == new_data)) {
37731 goto read_finished;
37732 }
37733 }
37734 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
37735 __Pyx_ModuleStateLookup_Lock();
37736 __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
37737 data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
37738 __Pyx_ModuleStateLookup_Unlock();
37739 }
37740 read_finished:;
37741#else
37742 __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
37743#endif
37744 __Pyx_InterpreterIdAndModule* found = NULL;
37745 if (unlikely(!data)) goto end;
37746 if (data->interpreter_id_as_index) {
37747 if (interpreter_id < data->count) {
37748 found = data->table+interpreter_id;
37749 }
37750 } else {
37751 found = __Pyx_State_FindModuleStateLookupTableLowerBound(
37752 data->table, data->count, interpreter_id);
37753 }
37754 end:
37755 {
37756 PyObject *result=NULL;
37757 if (found && found->id == interpreter_id) {
37758 result = found->module;
37759 }
37760#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
37761 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
37762#endif
37763 return result;
37764 }
37765}
37766#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
37767static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) {
37768 while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
37769}
37770#else
37771#define __Pyx_ModuleStateLookup_wait_until_no_readers()
37772#endif
37773static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
37774 Py_ssize_t to_allocate = (*old_data)->allocated;
37775 while (to_allocate <= interpreter_id) {
37776 if (to_allocate == 0) to_allocate = 1;
37777 else to_allocate *= 2;
37778 }
37779 __Pyx_ModuleStateLookupData *new_data = *old_data;
37780 if (to_allocate != (*old_data)->allocated) {
37781 new_data = (__Pyx_ModuleStateLookupData *)realloc(
37782 *old_data,
37783 sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
37784 if (!new_data) {
37785 PyErr_NoMemory();
37786 return -1;
37787 }
37788 for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
37789 new_data->table[i].id = i;
37790 new_data->table[i].module = NULL;
37791 }
37792 new_data->allocated = to_allocate;
37793 }
37794 new_data->table[interpreter_id].module = module;
37795 if (new_data->count < interpreter_id+1) {
37796 new_data->count = interpreter_id+1;
37797 }
37798 *old_data = new_data;
37799 return 0;
37800}
37801static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
37802 __Pyx_InterpreterIdAndModule *read = data->table;
37803 __Pyx_InterpreterIdAndModule *write = data->table;
37804 __Pyx_InterpreterIdAndModule *end = read + data->count;
37805 for (; read<end; ++read) {
37806 if (read->module) {
37807 write->id = read->id;
37808 write->module = read->module;
37809 ++write;
37810 }
37811 }
37812 data->count = write - data->table;
37813 for (; write<end; ++write) {
37814 write->id = 0;
37815 write->module = NULL;
37816 }
37817 data->interpreter_id_as_index = 0;
37818}
37819static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) {
37820 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
37821 if (interpreter_id == -1) return -1;
37822 int result = 0;
37823 __Pyx_ModuleStateLookup_Lock();
37824#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
37825 __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
37826 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
37827#else
37828 __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
37829#endif
37830 __Pyx_ModuleStateLookupData *new_data = old_data;
37831 if (!new_data) {
37832 new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData));
37833 if (!new_data) {
37834 result = -1;
37835 PyErr_NoMemory();
37836 goto end;
37837 }
37838 new_data->allocated = 1;
37839 new_data->interpreter_id_as_index = 1;
37840 }
37841 __Pyx_ModuleStateLookup_wait_until_no_readers();
37842 if (new_data->interpreter_id_as_index) {
37843 if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
37844 result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
37845 goto end;
37846 }
37847 __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
37848 }
37849 {
37850 Py_ssize_t insert_at = 0;
37851 {
37852 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
37853 new_data->table, new_data->count, interpreter_id);
37854 assert(lower_bound);
37855 insert_at = lower_bound - new_data->table;
37856 if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
37857 lower_bound->module = module;
37858 goto end; // already in table, nothing more to do
37859 }
37860 }
37861 if (new_data->count+1 >= new_data->allocated) {
37862 Py_ssize_t to_allocate = (new_data->count+1)*2;
37863 new_data =
37864 (__Pyx_ModuleStateLookupData*)realloc(
37865 new_data,
37866 sizeof(__Pyx_ModuleStateLookupData) +
37867 (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
37868 if (!new_data) {
37869 result = -1;
37870 new_data = old_data;
37871 PyErr_NoMemory();
37872 goto end;
37873 }
37874 new_data->allocated = to_allocate;
37875 }
37876 ++new_data->count;
37877 int64_t last_id = interpreter_id;
37878 PyObject *last_module = module;
37879 for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
37880 int64_t current_id = new_data->table[i].id;
37881 new_data->table[i].id = last_id;
37882 last_id = current_id;
37883 PyObject *current_module = new_data->table[i].module;
37884 new_data->table[i].module = last_module;
37885 last_module = current_module;
37886 }
37887 }
37888 end:
37889#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
37890 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
37891#else
37892 __Pyx_ModuleStateLookup_data = new_data;
37893#endif
37894 __Pyx_ModuleStateLookup_Unlock();
37895 return result;
37896}
37897static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) {
37898 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
37899 if (interpreter_id == -1) return -1;
37900 __Pyx_ModuleStateLookup_Lock();
37901#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
37902 __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
37903 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
37904#else
37905 __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
37906#endif
37907 if (data->interpreter_id_as_index) {
37908 if (interpreter_id < data->count) {
37909 data->table[interpreter_id].module = NULL;
37910 }
37911 goto done;
37912 }
37913 {
37914 __Pyx_ModuleStateLookup_wait_until_no_readers();
37915 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
37916 data->table, data->count, interpreter_id);
37917 if (!lower_bound) goto done;
37918 if (lower_bound->id != interpreter_id) goto done;
37919 __Pyx_InterpreterIdAndModule *end = data->table+data->count;
37920 for (;lower_bound<end-1; ++lower_bound) {
37921 lower_bound->id = (lower_bound+1)->id;
37922 lower_bound->module = (lower_bound+1)->module;
37923 }
37924 }
37925 --data->count;
37926 if (data->count == 0) {
37927 free(data);
37928 data = NULL;
37929 }
37930 done:
37931#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
37932 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
37933#else
37934 __Pyx_ModuleStateLookup_data = data;
37935#endif
37936 __Pyx_ModuleStateLookup_Unlock();
37937 return 0;
37938}
37939#endif
37940
37941/* #### Code section: utility_code_pragmas_end ### */
37942#ifdef _MSC_VER
37943#pragma warning( pop )
37944#endif
37945
37946
37947
37948/* #### Code section: end ### */
37949#endif /* Py_PYTHON_H */
Int n
Definition Headers.h:28
Double q
Definition Headers.h:81
Double T
Definition Headers.h:87
Double L
Definition Headers.h:72
Double r
Definition Headers.h:83
Double U
Definition Headers.h:88
Double f
Definition Headers.h:64
Double s
Definition Headers.h:84
Double * z
Definition Headers.h:49
Double v
Definition Headers.h:95
#define sign(x, y)
Definition jf.h:44
#define c(i)
Definition jf.h:21
double evaluate_edge_poly(const double C[nP+1], double t)
void calculate_edge_H(double phi0, double phi1, double C_H[nP+1])