1 /* Generated by Cython 0.29.23 */
2 
3 /* BEGIN: Cython Metadata
4 {
5     "distutils": {
6         "depends": [
7             "/tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h",
8             "/tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/core/include/numpy/ufuncobject.h"
9         ],
10         "extra_compile_args": [
11             "-w",
12             "-O3",
13             "-funroll-loops"
14         ],
15         "include_dirs": [
16             "/tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/core/include"
17         ],
18         "language": "c++",
19         "name": "qutip.cy.cqobjevo_factor",
20         "sources": [
21             "qutip/cy/cqobjevo_factor.pyx"
22         ]
23     },
24     "module_name": "qutip.cy.cqobjevo_factor"
25 }
26 END: Cython Metadata */
27 
28 #ifndef PY_SSIZE_T_CLEAN
29 #define PY_SSIZE_T_CLEAN
30 #endif /* PY_SSIZE_T_CLEAN */
31 #include "Python.h"
32 #ifndef Py_PYTHON_H
33     #error Python headers needed to compile C extensions, please install development version of Python.
34 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
35     #error Cython requires Python 2.6+ or Python 3.3+.
36 #else
37 #define CYTHON_ABI "0_29_23"
38 #define CYTHON_HEX_VERSION 0x001D17F0
39 #define CYTHON_FUTURE_DIVISION 1
40 #include <stddef.h>
41 #ifndef offsetof
42   #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
43 #endif
44 #if !defined(WIN32) && !defined(MS_WINDOWS)
45   #ifndef __stdcall
46     #define __stdcall
47   #endif
48   #ifndef __cdecl
49     #define __cdecl
50   #endif
51   #ifndef __fastcall
52     #define __fastcall
53   #endif
54 #endif
55 #ifndef DL_IMPORT
56   #define DL_IMPORT(t) t
57 #endif
58 #ifndef DL_EXPORT
59   #define DL_EXPORT(t) t
60 #endif
61 #define __PYX_COMMA ,
62 #ifndef HAVE_LONG_LONG
63   #if PY_VERSION_HEX >= 0x02070000
64     #define HAVE_LONG_LONG
65   #endif
66 #endif
67 #ifndef PY_LONG_LONG
68   #define PY_LONG_LONG LONG_LONG
69 #endif
70 #ifndef Py_HUGE_VAL
71   #define Py_HUGE_VAL HUGE_VAL
72 #endif
73 #ifdef PYPY_VERSION
74   #define CYTHON_COMPILING_IN_PYPY 1
75   #define CYTHON_COMPILING_IN_PYSTON 0
76   #define CYTHON_COMPILING_IN_CPYTHON 0
77   #undef CYTHON_USE_TYPE_SLOTS
78   #define CYTHON_USE_TYPE_SLOTS 0
79   #undef CYTHON_USE_PYTYPE_LOOKUP
80   #define CYTHON_USE_PYTYPE_LOOKUP 0
81   #if PY_VERSION_HEX < 0x03050000
82     #undef CYTHON_USE_ASYNC_SLOTS
83     #define CYTHON_USE_ASYNC_SLOTS 0
84   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
85     #define CYTHON_USE_ASYNC_SLOTS 1
86   #endif
87   #undef CYTHON_USE_PYLIST_INTERNALS
88   #define CYTHON_USE_PYLIST_INTERNALS 0
89   #undef CYTHON_USE_UNICODE_INTERNALS
90   #define CYTHON_USE_UNICODE_INTERNALS 0
91   #undef CYTHON_USE_UNICODE_WRITER
92   #define CYTHON_USE_UNICODE_WRITER 0
93   #undef CYTHON_USE_PYLONG_INTERNALS
94   #define CYTHON_USE_PYLONG_INTERNALS 0
95   #undef CYTHON_AVOID_BORROWED_REFS
96   #define CYTHON_AVOID_BORROWED_REFS 1
97   #undef CYTHON_ASSUME_SAFE_MACROS
98   #define CYTHON_ASSUME_SAFE_MACROS 0
99   #undef CYTHON_UNPACK_METHODS
100   #define CYTHON_UNPACK_METHODS 0
101   #undef CYTHON_FAST_THREAD_STATE
102   #define CYTHON_FAST_THREAD_STATE 0
103   #undef CYTHON_FAST_PYCALL
104   #define CYTHON_FAST_PYCALL 0
105   #undef CYTHON_PEP489_MULTI_PHASE_INIT
106   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
107   #undef CYTHON_USE_TP_FINALIZE
108   #define CYTHON_USE_TP_FINALIZE 0
109   #undef CYTHON_USE_DICT_VERSIONS
110   #define CYTHON_USE_DICT_VERSIONS 0
111   #undef CYTHON_USE_EXC_INFO_STACK
112   #define CYTHON_USE_EXC_INFO_STACK 0
113 #elif defined(PYSTON_VERSION)
114   #define CYTHON_COMPILING_IN_PYPY 0
115   #define CYTHON_COMPILING_IN_PYSTON 1
116   #define CYTHON_COMPILING_IN_CPYTHON 0
117   #ifndef CYTHON_USE_TYPE_SLOTS
118     #define CYTHON_USE_TYPE_SLOTS 1
119   #endif
120   #undef CYTHON_USE_PYTYPE_LOOKUP
121   #define CYTHON_USE_PYTYPE_LOOKUP 0
122   #undef CYTHON_USE_ASYNC_SLOTS
123   #define CYTHON_USE_ASYNC_SLOTS 0
124   #undef CYTHON_USE_PYLIST_INTERNALS
125   #define CYTHON_USE_PYLIST_INTERNALS 0
126   #ifndef CYTHON_USE_UNICODE_INTERNALS
127     #define CYTHON_USE_UNICODE_INTERNALS 1
128   #endif
129   #undef CYTHON_USE_UNICODE_WRITER
130   #define CYTHON_USE_UNICODE_WRITER 0
131   #undef CYTHON_USE_PYLONG_INTERNALS
132   #define CYTHON_USE_PYLONG_INTERNALS 0
133   #ifndef CYTHON_AVOID_BORROWED_REFS
134     #define CYTHON_AVOID_BORROWED_REFS 0
135   #endif
136   #ifndef CYTHON_ASSUME_SAFE_MACROS
137     #define CYTHON_ASSUME_SAFE_MACROS 1
138   #endif
139   #ifndef CYTHON_UNPACK_METHODS
140     #define CYTHON_UNPACK_METHODS 1
141   #endif
142   #undef CYTHON_FAST_THREAD_STATE
143   #define CYTHON_FAST_THREAD_STATE 0
144   #undef CYTHON_FAST_PYCALL
145   #define CYTHON_FAST_PYCALL 0
146   #undef CYTHON_PEP489_MULTI_PHASE_INIT
147   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
148   #undef CYTHON_USE_TP_FINALIZE
149   #define CYTHON_USE_TP_FINALIZE 0
150   #undef CYTHON_USE_DICT_VERSIONS
151   #define CYTHON_USE_DICT_VERSIONS 0
152   #undef CYTHON_USE_EXC_INFO_STACK
153   #define CYTHON_USE_EXC_INFO_STACK 0
154 #else
155   #define CYTHON_COMPILING_IN_PYPY 0
156   #define CYTHON_COMPILING_IN_PYSTON 0
157   #define CYTHON_COMPILING_IN_CPYTHON 1
158   #ifndef CYTHON_USE_TYPE_SLOTS
159     #define CYTHON_USE_TYPE_SLOTS 1
160   #endif
161   #if PY_VERSION_HEX < 0x02070000
162     #undef CYTHON_USE_PYTYPE_LOOKUP
163     #define CYTHON_USE_PYTYPE_LOOKUP 0
164   #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
165     #define CYTHON_USE_PYTYPE_LOOKUP 1
166   #endif
167   #if PY_MAJOR_VERSION < 3
168     #undef CYTHON_USE_ASYNC_SLOTS
169     #define CYTHON_USE_ASYNC_SLOTS 0
170   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
171     #define CYTHON_USE_ASYNC_SLOTS 1
172   #endif
173   #if PY_VERSION_HEX < 0x02070000
174     #undef CYTHON_USE_PYLONG_INTERNALS
175     #define CYTHON_USE_PYLONG_INTERNALS 0
176   #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
177     #define CYTHON_USE_PYLONG_INTERNALS 1
178   #endif
179   #ifndef CYTHON_USE_PYLIST_INTERNALS
180     #define CYTHON_USE_PYLIST_INTERNALS 1
181   #endif
182   #ifndef CYTHON_USE_UNICODE_INTERNALS
183     #define CYTHON_USE_UNICODE_INTERNALS 1
184   #endif
185   #if PY_VERSION_HEX < 0x030300F0
186     #undef CYTHON_USE_UNICODE_WRITER
187     #define CYTHON_USE_UNICODE_WRITER 0
188   #elif !defined(CYTHON_USE_UNICODE_WRITER)
189     #define CYTHON_USE_UNICODE_WRITER 1
190   #endif
191   #ifndef CYTHON_AVOID_BORROWED_REFS
192     #define CYTHON_AVOID_BORROWED_REFS 0
193   #endif
194   #ifndef CYTHON_ASSUME_SAFE_MACROS
195     #define CYTHON_ASSUME_SAFE_MACROS 1
196   #endif
197   #ifndef CYTHON_UNPACK_METHODS
198     #define CYTHON_UNPACK_METHODS 1
199   #endif
200   #ifndef CYTHON_FAST_THREAD_STATE
201     #define CYTHON_FAST_THREAD_STATE 1
202   #endif
203   #ifndef CYTHON_FAST_PYCALL
204     #define CYTHON_FAST_PYCALL 1
205   #endif
206   #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
207     #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
208   #endif
209   #ifndef CYTHON_USE_TP_FINALIZE
210     #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
211   #endif
212   #ifndef CYTHON_USE_DICT_VERSIONS
213     #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
214   #endif
215   #ifndef CYTHON_USE_EXC_INFO_STACK
216     #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
217   #endif
218 #endif
219 #if !defined(CYTHON_FAST_PYCCALL)
220 #define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
221 #endif
222 #if CYTHON_USE_PYLONG_INTERNALS
223   #include "longintrepr.h"
224   #undef SHIFT
225   #undef BASE
226   #undef MASK
227   #ifdef SIZEOF_VOID_P
228     enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
229   #endif
230 #endif
231 #ifndef __has_attribute
232   #define __has_attribute(x) 0
233 #endif
234 #ifndef __has_cpp_attribute
235   #define __has_cpp_attribute(x) 0
236 #endif
237 #ifndef CYTHON_RESTRICT
238   #if defined(__GNUC__)
239     #define CYTHON_RESTRICT __restrict__
240   #elif defined(_MSC_VER) && _MSC_VER >= 1400
241     #define CYTHON_RESTRICT __restrict
242   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
243     #define CYTHON_RESTRICT restrict
244   #else
245     #define CYTHON_RESTRICT
246   #endif
247 #endif
248 #ifndef CYTHON_UNUSED
249 # if defined(__GNUC__)
250 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
251 #     define CYTHON_UNUSED __attribute__ ((__unused__))
252 #   else
253 #     define CYTHON_UNUSED
254 #   endif
255 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
256 #   define CYTHON_UNUSED __attribute__ ((__unused__))
257 # else
258 #   define CYTHON_UNUSED
259 # endif
260 #endif
261 #ifndef CYTHON_MAYBE_UNUSED_VAR
262 #  if defined(__cplusplus)
CYTHON_MAYBE_UNUSED_VAR(const T &)263      template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
264 #  else
265 #    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
266 #  endif
267 #endif
268 #ifndef CYTHON_NCP_UNUSED
269 # if CYTHON_COMPILING_IN_CPYTHON
270 #  define CYTHON_NCP_UNUSED
271 # else
272 #  define CYTHON_NCP_UNUSED CYTHON_UNUSED
273 # endif
274 #endif
275 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
276 #ifdef _MSC_VER
277     #ifndef _MSC_STDINT_H_
278         #if _MSC_VER < 1300
279            typedef unsigned char     uint8_t;
280            typedef unsigned int      uint32_t;
281         #else
282            typedef unsigned __int8   uint8_t;
283            typedef unsigned __int32  uint32_t;
284         #endif
285     #endif
286 #else
287    #include <stdint.h>
288 #endif
289 #ifndef CYTHON_FALLTHROUGH
290   #if defined(__cplusplus) && __cplusplus >= 201103L
291     #if __has_cpp_attribute(fallthrough)
292       #define CYTHON_FALLTHROUGH [[fallthrough]]
293     #elif __has_cpp_attribute(clang::fallthrough)
294       #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
295     #elif __has_cpp_attribute(gnu::fallthrough)
296       #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
297     #endif
298   #endif
299   #ifndef CYTHON_FALLTHROUGH
300     #if __has_attribute(fallthrough)
301       #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
302     #else
303       #define CYTHON_FALLTHROUGH
304     #endif
305   #endif
306   #if defined(__clang__ ) && defined(__apple_build_version__)
307     #if __apple_build_version__ < 7000000
308       #undef  CYTHON_FALLTHROUGH
309       #define CYTHON_FALLTHROUGH
310     #endif
311   #endif
312 #endif
313 
314 #ifndef __cplusplus
315   #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
316 #endif
317 #ifndef CYTHON_INLINE
318   #if defined(__clang__)
319     #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
320   #else
321     #define CYTHON_INLINE inline
322   #endif
323 #endif
324 template<typename T>
__Pyx_call_destructor(T & x)325 void __Pyx_call_destructor(T& x) {
326     x.~T();
327 }
328 template<typename T>
329 class __Pyx_FakeReference {
330   public:
__Pyx_FakeReference()331     __Pyx_FakeReference() : ptr(NULL) { }
__Pyx_FakeReference(const T & ref)332     __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
operator ->()333     T *operator->() { return ptr; }
operator &()334     T *operator&() { return ptr; }
operator T&()335     operator T&() { return *ptr; }
operator ==(U other)336     template<typename U> bool operator ==(U other) { return *ptr == other; }
operator !=(U other)337     template<typename U> bool operator !=(U other) { return *ptr != other; }
338   private:
339     T *ptr;
340 };
341 
342 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
343   #define Py_OptimizeFlag 0
344 #endif
345 #define __PYX_BUILD_PY_SSIZE_T "n"
346 #define CYTHON_FORMAT_SSIZE_T "z"
347 #if PY_MAJOR_VERSION < 3
348   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
349   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
350           PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
351   #define __Pyx_DefaultClassType PyClass_Type
352 #else
353   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
354 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
355   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
356           PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
357 #else
358   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
359           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
360 #endif
361   #define __Pyx_DefaultClassType PyType_Type
362 #endif
363 #ifndef Py_TPFLAGS_CHECKTYPES
364   #define Py_TPFLAGS_CHECKTYPES 0
365 #endif
366 #ifndef Py_TPFLAGS_HAVE_INDEX
367   #define Py_TPFLAGS_HAVE_INDEX 0
368 #endif
369 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
370   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
371 #endif
372 #ifndef Py_TPFLAGS_HAVE_FINALIZE
373   #define Py_TPFLAGS_HAVE_FINALIZE 0
374 #endif
375 #ifndef METH_STACKLESS
376   #define METH_STACKLESS 0
377 #endif
378 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
379   #ifndef METH_FASTCALL
380      #define METH_FASTCALL 0x80
381   #endif
382   typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
383   typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
384                                                           Py_ssize_t nargs, PyObject *kwnames);
385 #else
386   #define __Pyx_PyCFunctionFast _PyCFunctionFast
387   #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
388 #endif
389 #if CYTHON_FAST_PYCCALL
390 #define __Pyx_PyFastCFunction_Check(func)\
391     ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
392 #else
393 #define __Pyx_PyFastCFunction_Check(func) 0
394 #endif
395 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
396   #define PyObject_Malloc(s)   PyMem_Malloc(s)
397   #define PyObject_Free(p)     PyMem_Free(p)
398   #define PyObject_Realloc(p)  PyMem_Realloc(p)
399 #endif
400 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
401   #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
402   #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
403   #define PyMem_RawFree(p)             PyMem_Free(p)
404 #endif
405 #if CYTHON_COMPILING_IN_PYSTON
406   #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
407   #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
408 #else
409   #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
410   #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
411 #endif
412 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
413   #define __Pyx_PyThreadState_Current PyThreadState_GET()
414 #elif PY_VERSION_HEX >= 0x03060000
415   #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
416 #elif PY_VERSION_HEX >= 0x03000000
417   #define __Pyx_PyThreadState_Current PyThreadState_GET()
418 #else
419   #define __Pyx_PyThreadState_Current _PyThreadState_Current
420 #endif
421 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
422 #include "pythread.h"
423 #define Py_tss_NEEDS_INIT 0
424 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)425 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
426   *key = PyThread_create_key();
427   return 0;
428 }
PyThread_tss_alloc(void)429 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
430   Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
431   *key = Py_tss_NEEDS_INIT;
432   return key;
433 }
PyThread_tss_free(Py_tss_t * key)434 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
435   PyObject_Free(key);
436 }
PyThread_tss_is_created(Py_tss_t * key)437 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
438   return *key != Py_tss_NEEDS_INIT;
439 }
PyThread_tss_delete(Py_tss_t * key)440 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
441   PyThread_delete_key(*key);
442   *key = Py_tss_NEEDS_INIT;
443 }
PyThread_tss_set(Py_tss_t * key,void * value)444 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
445   return PyThread_set_key_value(*key, value);
446 }
PyThread_tss_get(Py_tss_t * key)447 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
448   return PyThread_get_key_value(*key);
449 }
450 #endif
451 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
452 #define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
453 #else
454 #define __Pyx_PyDict_NewPresized(n)  PyDict_New()
455 #endif
456 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
457   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
458   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
459 #else
460   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
461   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
462 #endif
463 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
464 #define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
465 #else
466 #define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
467 #endif
468 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
469   #define CYTHON_PEP393_ENABLED 1
470   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
471                                               0 : _PyUnicode_Ready((PyObject *)(op)))
472   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
473   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
474   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
475   #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
476   #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
477   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
478   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
479   #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
480   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
481   #else
482   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
483   #endif
484 #else
485   #define CYTHON_PEP393_ENABLED 0
486   #define PyUnicode_1BYTE_KIND  1
487   #define PyUnicode_2BYTE_KIND  2
488   #define PyUnicode_4BYTE_KIND  4
489   #define __Pyx_PyUnicode_READY(op)       (0)
490   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
491   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
492   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
493   #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
494   #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
495   #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
496   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
497   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
498 #endif
499 #if CYTHON_COMPILING_IN_PYPY
500   #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
501   #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
502 #else
503   #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
504   #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
505       PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
506 #endif
507 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
508   #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
509 #endif
510 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
511   #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
512 #endif
513 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
514   #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
515 #endif
516 #define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
517 #define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
518 #if PY_MAJOR_VERSION >= 3
519   #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
520 #else
521   #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
522 #endif
523 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
524   #define PyObject_ASCII(o)            PyObject_Repr(o)
525 #endif
526 #if PY_MAJOR_VERSION >= 3
527   #define PyBaseString_Type            PyUnicode_Type
528   #define PyStringObject               PyUnicodeObject
529   #define PyString_Type                PyUnicode_Type
530   #define PyString_Check               PyUnicode_Check
531   #define PyString_CheckExact          PyUnicode_CheckExact
532 #ifndef PyObject_Unicode
533   #define PyObject_Unicode             PyObject_Str
534 #endif
535 #endif
536 #if PY_MAJOR_VERSION >= 3
537   #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
538   #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
539 #else
540   #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
541   #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
542 #endif
543 #ifndef PySet_CheckExact
544   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
545 #endif
546 #if PY_VERSION_HEX >= 0x030900A4
547   #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
548   #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
549 #else
550   #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
551   #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
552 #endif
553 #if CYTHON_ASSUME_SAFE_MACROS
554   #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
555 #else
556   #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
557 #endif
558 #if PY_MAJOR_VERSION >= 3
559   #define PyIntObject                  PyLongObject
560   #define PyInt_Type                   PyLong_Type
561   #define PyInt_Check(op)              PyLong_Check(op)
562   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
563   #define PyInt_FromString             PyLong_FromString
564   #define PyInt_FromUnicode            PyLong_FromUnicode
565   #define PyInt_FromLong               PyLong_FromLong
566   #define PyInt_FromSize_t             PyLong_FromSize_t
567   #define PyInt_FromSsize_t            PyLong_FromSsize_t
568   #define PyInt_AsLong                 PyLong_AsLong
569   #define PyInt_AS_LONG                PyLong_AS_LONG
570   #define PyInt_AsSsize_t              PyLong_AsSsize_t
571   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
572   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
573   #define PyNumber_Int                 PyNumber_Long
574 #endif
575 #if PY_MAJOR_VERSION >= 3
576   #define PyBoolObject                 PyLongObject
577 #endif
578 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
579   #ifndef PyUnicode_InternFromString
580     #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
581   #endif
582 #endif
583 #if PY_VERSION_HEX < 0x030200A4
584   typedef long Py_hash_t;
585   #define __Pyx_PyInt_FromHash_t PyInt_FromLong
586   #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
587 #else
588   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
589   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
590 #endif
591 #if PY_MAJOR_VERSION >= 3
592   #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
593 #else
594   #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
595 #endif
596 #if CYTHON_USE_ASYNC_SLOTS
597   #if PY_VERSION_HEX >= 0x030500B1
598     #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
599     #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
600   #else
601     #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
602   #endif
603 #else
604   #define __Pyx_PyType_AsAsync(obj) NULL
605 #endif
606 #ifndef __Pyx_PyAsyncMethodsStruct
607     typedef struct {
608         unaryfunc am_await;
609         unaryfunc am_aiter;
610         unaryfunc am_anext;
611     } __Pyx_PyAsyncMethodsStruct;
612 #endif
613 
614 #if defined(WIN32) || defined(MS_WINDOWS)
615   #define _USE_MATH_DEFINES
616 #endif
617 #include <math.h>
618 #ifdef NAN
619 #define __PYX_NAN() ((float) NAN)
620 #else
__PYX_NAN()621 static CYTHON_INLINE float __PYX_NAN() {
622   float value;
623   memset(&value, 0xFF, sizeof(value));
624   return value;
625 }
626 #endif
627 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
628 #define __Pyx_truncl trunc
629 #else
630 #define __Pyx_truncl truncl
631 #endif
632 
633 #define __PYX_MARK_ERR_POS(f_index, lineno) \
634     { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
635 #define __PYX_ERR(f_index, lineno, Ln_error) \
636     { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
637 
638 #ifndef __PYX_EXTERN_C
639   #ifdef __cplusplus
640     #define __PYX_EXTERN_C extern "C"
641   #else
642     #define __PYX_EXTERN_C extern
643   #endif
644 #endif
645 
646 #define __PYX_HAVE__qutip__cy__cqobjevo_factor
647 #define __PYX_HAVE_API__qutip__cy__cqobjevo_factor
648 /* Early includes */
649 #include <string.h>
650 #include <stdio.h>
651 #include "numpy/arrayobject.h"
652 #include "numpy/ufuncobject.h"
653 
654     /* NumPy API declarations from "numpy/__init__.pxd" */
655 
656 #include <math.h>
657 #include <complex>
658 #include "pythread.h"
659 #include <stdlib.h>
660 #include "pystate.h"
661 #ifdef _OPENMP
662 #include <omp.h>
663 #endif /* _OPENMP */
664 
665 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
666 #define CYTHON_WITHOUT_ASSERTIONS
667 #endif
668 
669 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
670                 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
671 
672 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
673 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
674 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
675 #define __PYX_DEFAULT_STRING_ENCODING ""
676 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
677 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
678 #define __Pyx_uchar_cast(c) ((unsigned char)c)
679 #define __Pyx_long_cast(x) ((long)x)
680 #define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
681     (sizeof(type) < sizeof(Py_ssize_t))  ||\
682     (sizeof(type) > sizeof(Py_ssize_t) &&\
683           likely(v < (type)PY_SSIZE_T_MAX ||\
684                  v == (type)PY_SSIZE_T_MAX)  &&\
685           (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
686                                 v == (type)PY_SSIZE_T_MIN)))  ||\
687     (sizeof(type) == sizeof(Py_ssize_t) &&\
688           (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
689                                v == (type)PY_SSIZE_T_MAX)))  )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)690 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
691     return (size_t) i < (size_t) limit;
692 }
693 #if defined (__cplusplus) && __cplusplus >= 201103L
694     #include <cstdlib>
695     #define __Pyx_sst_abs(value) std::abs(value)
696 #elif SIZEOF_INT >= SIZEOF_SIZE_T
697     #define __Pyx_sst_abs(value) abs(value)
698 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
699     #define __Pyx_sst_abs(value) labs(value)
700 #elif defined (_MSC_VER)
701     #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
702 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
703     #define __Pyx_sst_abs(value) llabs(value)
704 #elif defined (__GNUC__)
705     #define __Pyx_sst_abs(value) __builtin_llabs(value)
706 #else
707     #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
708 #endif
709 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
710 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
711 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
712 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
713 #define __Pyx_PyBytes_FromString        PyBytes_FromString
714 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
715 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
716 #if PY_MAJOR_VERSION < 3
717     #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
718     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
719 #else
720     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
721     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
722 #endif
723 #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
724 #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
725 #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
726 #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
727 #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
728 #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
729 #define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
730 #define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
731 #define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
732 #define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
733 #define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
734 #define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
735 #define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
736 #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
737 #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
738 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)739 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
740     const Py_UNICODE *u_end = u;
741     while (*u_end++) ;
742     return (size_t)(u_end - u - 1);
743 }
744 #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
745 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
746 #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
747 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
748 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
749 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
750 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
751 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
752 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
753 #define __Pyx_PySequence_Tuple(obj)\
754     (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
755 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
756 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
757 #if CYTHON_ASSUME_SAFE_MACROS
758 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
759 #else
760 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
761 #endif
762 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
763 #if PY_MAJOR_VERSION >= 3
764 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
765 #else
766 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
767 #endif
768 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
769 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
770 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)771 static int __Pyx_init_sys_getdefaultencoding_params(void) {
772     PyObject* sys;
773     PyObject* default_encoding = NULL;
774     PyObject* ascii_chars_u = NULL;
775     PyObject* ascii_chars_b = NULL;
776     const char* default_encoding_c;
777     sys = PyImport_ImportModule("sys");
778     if (!sys) goto bad;
779     default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
780     Py_DECREF(sys);
781     if (!default_encoding) goto bad;
782     default_encoding_c = PyBytes_AsString(default_encoding);
783     if (!default_encoding_c) goto bad;
784     if (strcmp(default_encoding_c, "ascii") == 0) {
785         __Pyx_sys_getdefaultencoding_not_ascii = 0;
786     } else {
787         char ascii_chars[128];
788         int c;
789         for (c = 0; c < 128; c++) {
790             ascii_chars[c] = c;
791         }
792         __Pyx_sys_getdefaultencoding_not_ascii = 1;
793         ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
794         if (!ascii_chars_u) goto bad;
795         ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
796         if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
797             PyErr_Format(
798                 PyExc_ValueError,
799                 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
800                 default_encoding_c);
801             goto bad;
802         }
803         Py_DECREF(ascii_chars_u);
804         Py_DECREF(ascii_chars_b);
805     }
806     Py_DECREF(default_encoding);
807     return 0;
808 bad:
809     Py_XDECREF(default_encoding);
810     Py_XDECREF(ascii_chars_u);
811     Py_XDECREF(ascii_chars_b);
812     return -1;
813 }
814 #endif
815 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
816 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
817 #else
818 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
819 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
820 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)821 static int __Pyx_init_sys_getdefaultencoding_params(void) {
822     PyObject* sys;
823     PyObject* default_encoding = NULL;
824     char* default_encoding_c;
825     sys = PyImport_ImportModule("sys");
826     if (!sys) goto bad;
827     default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
828     Py_DECREF(sys);
829     if (!default_encoding) goto bad;
830     default_encoding_c = PyBytes_AsString(default_encoding);
831     if (!default_encoding_c) goto bad;
832     __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
833     if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
834     strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
835     Py_DECREF(default_encoding);
836     return 0;
837 bad:
838     Py_XDECREF(default_encoding);
839     return -1;
840 }
841 #endif
842 #endif
843 
844 
845 /* Test for GCC > 2.95 */
846 #if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
847   #define likely(x)   __builtin_expect(!!(x), 1)
848   #define unlikely(x) __builtin_expect(!!(x), 0)
849 #else /* !__GNUC__ or GCC < 2.95 */
850   #define likely(x)   (x)
851   #define unlikely(x) (x)
852 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)853 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
854 
855 static PyObject *__pyx_m = NULL;
856 static PyObject *__pyx_d;
857 static PyObject *__pyx_b;
858 static PyObject *__pyx_cython_runtime = NULL;
859 static PyObject *__pyx_empty_tuple;
860 static PyObject *__pyx_empty_bytes;
861 static PyObject *__pyx_empty_unicode;
862 static int __pyx_lineno;
863 static int __pyx_clineno = 0;
864 static const char * __pyx_cfilenm= __FILE__;
865 static const char *__pyx_filename;
866 
867 /* Header.proto */
868 #if !defined(CYTHON_CCOMPLEX)
869   #if defined(__cplusplus)
870     #define CYTHON_CCOMPLEX 1
871   #elif defined(_Complex_I)
872     #define CYTHON_CCOMPLEX 1
873   #else
874     #define CYTHON_CCOMPLEX 0
875   #endif
876 #endif
877 #if CYTHON_CCOMPLEX
878   #ifdef __cplusplus
879     #include <complex>
880   #else
881     #include <complex.h>
882   #endif
883 #endif
884 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
885   #undef _Complex_I
886   #define _Complex_I 1.0fj
887 #endif
888 
889 
890 static const char *__pyx_f[] = {
891   "qutip/cy/cqobjevo_factor.pyx",
892   "stringsource",
893   "__init__.pxd",
894   "type.pxd",
895   "qutip/cy/cqobjevo.pxd",
896 };
897 /* BufferFormatStructs.proto */
898 #define IS_UNSIGNED(type) (((type) -1) > 0)
899 struct __Pyx_StructField_;
900 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
901 typedef struct {
902   const char* name;
903   struct __Pyx_StructField_* fields;
904   size_t size;
905   size_t arraysize[8];
906   int ndim;
907   char typegroup;
908   char is_unsigned;
909   int flags;
910 } __Pyx_TypeInfo;
911 typedef struct __Pyx_StructField_ {
912   __Pyx_TypeInfo* type;
913   const char* name;
914   size_t offset;
915 } __Pyx_StructField;
916 typedef struct {
917   __Pyx_StructField* field;
918   size_t parent_offset;
919 } __Pyx_BufFmt_StackElem;
920 typedef struct {
921   __Pyx_StructField root;
922   __Pyx_BufFmt_StackElem* head;
923   size_t fmt_offset;
924   size_t new_count, enc_count;
925   size_t struct_alignment;
926   int is_complex;
927   char enc_type;
928   char new_packmode;
929   char enc_packmode;
930   char is_valid_array;
931 } __Pyx_BufFmt_Context;
932 
933 /* MemviewSliceStruct.proto */
934 struct __pyx_memoryview_obj;
935 typedef struct {
936   struct __pyx_memoryview_obj *memview;
937   char *data;
938   Py_ssize_t shape[8];
939   Py_ssize_t strides[8];
940   Py_ssize_t suboffsets[8];
941 } __Pyx_memviewslice;
942 #define __Pyx_MemoryView_Len(m)  (m.shape[0])
943 
944 /* Atomics.proto */
945 #include <pythread.h>
946 #ifndef CYTHON_ATOMICS
947     #define CYTHON_ATOMICS 1
948 #endif
949 #define __pyx_atomic_int_type int
950 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
951                     (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
952                     !defined(__i386__)
953     #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
954     #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
955     #ifdef __PYX_DEBUG_ATOMICS
956         #warning "Using GNU atomics"
957     #endif
958 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
959     #include <Windows.h>
960     #undef __pyx_atomic_int_type
961     #define __pyx_atomic_int_type LONG
962     #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
963     #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
964     #ifdef __PYX_DEBUG_ATOMICS
965         #pragma message ("Using MSVC atomics")
966     #endif
967 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
968     #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
969     #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
970     #ifdef __PYX_DEBUG_ATOMICS
971         #warning "Using Intel atomics"
972     #endif
973 #else
974     #undef CYTHON_ATOMICS
975     #define CYTHON_ATOMICS 0
976     #ifdef __PYX_DEBUG_ATOMICS
977         #warning "Not using atomics"
978     #endif
979 #endif
980 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
981 #if CYTHON_ATOMICS
982     #define __pyx_add_acquisition_count(memview)\
983              __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
984     #define __pyx_sub_acquisition_count(memview)\
985             __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
986 #else
987     #define __pyx_add_acquisition_count(memview)\
988             __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
989     #define __pyx_sub_acquisition_count(memview)\
990             __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
991 #endif
992 
993 /* ForceInitThreads.proto */
994 #ifndef __PYX_FORCE_INIT_THREADS
995   #define __PYX_FORCE_INIT_THREADS 0
996 #endif
997 
998 /* NoFastGil.proto */
999 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1000 #define __Pyx_PyGILState_Release PyGILState_Release
1001 #define __Pyx_FastGIL_Remember()
1002 #define __Pyx_FastGIL_Forget()
1003 #define __Pyx_FastGilFuncInit()
1004 
1005 
1006 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":689
1007  * # in Cython to enable them only on the right systems.
1008  *
1009  * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
1010  * ctypedef npy_int16      int16_t
1011  * ctypedef npy_int32      int32_t
1012  */
1013 typedef npy_int8 __pyx_t_5numpy_int8_t;
1014 
1015 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":690
1016  *
1017  * ctypedef npy_int8       int8_t
1018  * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
1019  * ctypedef npy_int32      int32_t
1020  * ctypedef npy_int64      int64_t
1021  */
1022 typedef npy_int16 __pyx_t_5numpy_int16_t;
1023 
1024 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":691
1025  * ctypedef npy_int8       int8_t
1026  * ctypedef npy_int16      int16_t
1027  * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
1028  * ctypedef npy_int64      int64_t
1029  * #ctypedef npy_int96      int96_t
1030  */
1031 typedef npy_int32 __pyx_t_5numpy_int32_t;
1032 
1033 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":692
1034  * ctypedef npy_int16      int16_t
1035  * ctypedef npy_int32      int32_t
1036  * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
1037  * #ctypedef npy_int96      int96_t
1038  * #ctypedef npy_int128     int128_t
1039  */
1040 typedef npy_int64 __pyx_t_5numpy_int64_t;
1041 
1042 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":696
1043  * #ctypedef npy_int128     int128_t
1044  *
1045  * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
1046  * ctypedef npy_uint16     uint16_t
1047  * ctypedef npy_uint32     uint32_t
1048  */
1049 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1050 
1051 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":697
1052  *
1053  * ctypedef npy_uint8      uint8_t
1054  * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
1055  * ctypedef npy_uint32     uint32_t
1056  * ctypedef npy_uint64     uint64_t
1057  */
1058 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1059 
1060 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":698
1061  * ctypedef npy_uint8      uint8_t
1062  * ctypedef npy_uint16     uint16_t
1063  * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
1064  * ctypedef npy_uint64     uint64_t
1065  * #ctypedef npy_uint96     uint96_t
1066  */
1067 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1068 
1069 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":699
1070  * ctypedef npy_uint16     uint16_t
1071  * ctypedef npy_uint32     uint32_t
1072  * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
1073  * #ctypedef npy_uint96     uint96_t
1074  * #ctypedef npy_uint128    uint128_t
1075  */
1076 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1077 
1078 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":703
1079  * #ctypedef npy_uint128    uint128_t
1080  *
1081  * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
1082  * ctypedef npy_float64    float64_t
1083  * #ctypedef npy_float80    float80_t
1084  */
1085 typedef npy_float32 __pyx_t_5numpy_float32_t;
1086 
1087 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":704
1088  *
1089  * ctypedef npy_float32    float32_t
1090  * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
1091  * #ctypedef npy_float80    float80_t
1092  * #ctypedef npy_float128   float128_t
1093  */
1094 typedef npy_float64 __pyx_t_5numpy_float64_t;
1095 
1096 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":713
1097  * # The int types are mapped a bit surprising --
1098  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1099  * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
1100  * ctypedef npy_longlong   long_t
1101  * ctypedef npy_longlong   longlong_t
1102  */
1103 typedef npy_long __pyx_t_5numpy_int_t;
1104 
1105 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":714
1106  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1107  * ctypedef npy_long       int_t
1108  * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
1109  * ctypedef npy_longlong   longlong_t
1110  *
1111  */
1112 typedef npy_longlong __pyx_t_5numpy_long_t;
1113 
1114 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":715
1115  * ctypedef npy_long       int_t
1116  * ctypedef npy_longlong   long_t
1117  * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
1118  *
1119  * ctypedef npy_ulong      uint_t
1120  */
1121 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1122 
1123 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":717
1124  * ctypedef npy_longlong   longlong_t
1125  *
1126  * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
1127  * ctypedef npy_ulonglong  ulong_t
1128  * ctypedef npy_ulonglong  ulonglong_t
1129  */
1130 typedef npy_ulong __pyx_t_5numpy_uint_t;
1131 
1132 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":718
1133  *
1134  * ctypedef npy_ulong      uint_t
1135  * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
1136  * ctypedef npy_ulonglong  ulonglong_t
1137  *
1138  */
1139 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1140 
1141 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":719
1142  * ctypedef npy_ulong      uint_t
1143  * ctypedef npy_ulonglong  ulong_t
1144  * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
1145  *
1146  * ctypedef npy_intp       intp_t
1147  */
1148 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1149 
1150 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":721
1151  * ctypedef npy_ulonglong  ulonglong_t
1152  *
1153  * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
1154  * ctypedef npy_uintp      uintp_t
1155  *
1156  */
1157 typedef npy_intp __pyx_t_5numpy_intp_t;
1158 
1159 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":722
1160  *
1161  * ctypedef npy_intp       intp_t
1162  * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
1163  *
1164  * ctypedef npy_double     float_t
1165  */
1166 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1167 
1168 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":724
1169  * ctypedef npy_uintp      uintp_t
1170  *
1171  * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
1172  * ctypedef npy_double     double_t
1173  * ctypedef npy_longdouble longdouble_t
1174  */
1175 typedef npy_double __pyx_t_5numpy_float_t;
1176 
1177 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":725
1178  *
1179  * ctypedef npy_double     float_t
1180  * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
1181  * ctypedef npy_longdouble longdouble_t
1182  *
1183  */
1184 typedef npy_double __pyx_t_5numpy_double_t;
1185 
1186 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":726
1187  * ctypedef npy_double     float_t
1188  * ctypedef npy_double     double_t
1189  * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
1190  *
1191  * ctypedef npy_cfloat      cfloat_t
1192  */
1193 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1194 /* Declarations.proto */
1195 #if CYTHON_CCOMPLEX
1196   #ifdef __cplusplus
1197     typedef ::std::complex< double > __pyx_t_double_complex;
1198   #else
1199     typedef double _Complex __pyx_t_double_complex;
1200   #endif
1201 #else
1202     typedef struct { double real, imag; } __pyx_t_double_complex;
1203 #endif
1204 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1205 
1206 /* Declarations.proto */
1207 #if CYTHON_CCOMPLEX
1208   #ifdef __cplusplus
1209     typedef ::std::complex< float > __pyx_t_float_complex;
1210   #else
1211     typedef float _Complex __pyx_t_float_complex;
1212   #endif
1213 #else
1214     typedef struct { float real, imag; } __pyx_t_float_complex;
1215 #endif
1216 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1217 
1218 
1219 /*--- Type declarations ---*/
1220 struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvo;
1221 struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjCte;
1222 struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjCteDense;
1223 struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvoTd;
1224 struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvoTdDense;
1225 struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvoTdMatched;
1226 struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc;
1227 struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff;
1228 struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff;
1229 struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte;
1230 struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT;
1231 struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff;
1232 struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffT;
1233 struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffCte;
1234 struct __pyx_array_obj;
1235 struct __pyx_MemviewEnum_obj;
1236 struct __pyx_memoryview_obj;
1237 struct __pyx_memoryviewslice_obj;
1238 
1239 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":728
1240  * ctypedef npy_longdouble longdouble_t
1241  *
1242  * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
1243  * ctypedef npy_cdouble     cdouble_t
1244  * ctypedef npy_clongdouble clongdouble_t
1245  */
1246 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1247 
1248 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":729
1249  *
1250  * ctypedef npy_cfloat      cfloat_t
1251  * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
1252  * ctypedef npy_clongdouble clongdouble_t
1253  *
1254  */
1255 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1256 
1257 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":730
1258  * ctypedef npy_cfloat      cfloat_t
1259  * ctypedef npy_cdouble     cdouble_t
1260  * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
1261  *
1262  * ctypedef npy_cdouble     complex_t
1263  */
1264 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1265 
1266 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":732
1267  * ctypedef npy_clongdouble clongdouble_t
1268  *
1269  * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
1270  *
1271  * cdef inline object PyArray_MultiIterNew1(a):
1272  */
1273 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1274 struct __pyx_t_5qutip_2cy_14sparse_structs__csr_mat;
1275 struct __pyx_t_5qutip_2cy_14sparse_structs__coo_mat;
1276 
1277 /* "qutip/cy/sparse_structs.pxd":35
1278  * ###############################################################################
1279  *
1280  * cdef struct _csr_mat:             # <<<<<<<<<<<<<<
1281  *     double complex * data
1282  *     int * indices
1283  */
1284 struct __pyx_t_5qutip_2cy_14sparse_structs__csr_mat {
1285   __pyx_t_double_complex *data;
1286   int *indices;
1287   int *indptr;
1288   int nnz;
1289   int nrows;
1290   int ncols;
1291   int is_set;
1292   int max_length;
1293   int numpy_lock;
1294 };
1295 
1296 /* "qutip/cy/sparse_structs.pxd":46
1297  *     int numpy_lock
1298  *
1299  * cdef struct _coo_mat:             # <<<<<<<<<<<<<<
1300  *     double complex * data
1301  *     int * rows
1302  */
1303 struct __pyx_t_5qutip_2cy_14sparse_structs__coo_mat {
1304   __pyx_t_double_complex *data;
1305   int *rows;
1306   int *cols;
1307   int nnz;
1308   int nrows;
1309   int ncols;
1310   int is_set;
1311   int max_length;
1312   int numpy_lock;
1313 };
1314 
1315 /* "qutip/cy/sparse_structs.pxd":57
1316  *     int numpy_lock
1317  *
1318  * ctypedef _csr_mat CSR_Matrix             # <<<<<<<<<<<<<<
1319  * ctypedef _coo_mat COO_Matrix
1320  */
1321 typedef struct __pyx_t_5qutip_2cy_14sparse_structs__csr_mat __pyx_t_5qutip_2cy_14sparse_structs_CSR_Matrix;
1322 
1323 /* "qutip/cy/sparse_structs.pxd":58
1324  *
1325  * ctypedef _csr_mat CSR_Matrix
1326  * ctypedef _coo_mat COO_Matrix             # <<<<<<<<<<<<<<
1327  */
1328 typedef struct __pyx_t_5qutip_2cy_14sparse_structs__coo_mat __pyx_t_5qutip_2cy_14sparse_structs_COO_Matrix;
1329 
1330 /* "qutip/cy/cqobjevo.pxd":38
1331  * from qutip.cy.cqobjevo_factor cimport CoeffFunc
1332  *
1333  * cdef class CQobjEvo:             # <<<<<<<<<<<<<<
1334  *     cdef int shape0, shape1
1335  *     cdef object dims
1336  */
1337 struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvo {
1338   PyObject_HEAD
1339   struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjEvo *__pyx_vtab;
1340   int shape0;
1341   int shape1;
1342   PyObject *dims;
1343   int super;
1344   int num_ops;
1345   int dyn_args;
1346   PyObject *factor_func;
1347   struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *factor_cobj;
1348   int factor_use_cobj;
1349   __Pyx_memviewslice coeff;
1350   __pyx_t_double_complex *coeff_ptr;
1351 };
1352 
1353 
1354 /* "qutip/cy/cqobjevo.pxd":67
1355  *
1356  *
1357  * cdef class CQobjCte(CQobjEvo):             # <<<<<<<<<<<<<<
1358  *     cdef int total_elem
1359  *     # pointer to data
1360  */
1361 struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjCte {
1362   struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvo __pyx_base;
1363   int total_elem;
1364   __pyx_t_5qutip_2cy_14sparse_structs_CSR_Matrix cte;
1365 };
1366 
1367 
1368 /* "qutip/cy/cqobjevo.pxd":73
1369  *
1370  *
1371  * cdef class CQobjCteDense(CQobjEvo):             # <<<<<<<<<<<<<<
1372  *     # pointer to data
1373  *     cdef complex[:, ::1] cte
1374  */
1375 struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjCteDense {
1376   struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvo __pyx_base;
1377   __Pyx_memviewslice cte;
1378 };
1379 
1380 
1381 /* "qutip/cy/cqobjevo.pxd":78
1382  *
1383  *
1384  * cdef class CQobjEvoTd(CQobjEvo):             # <<<<<<<<<<<<<<
1385  *     cdef long total_elem
1386  *     # pointer to data
1387  */
1388 struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvoTd {
1389   struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvo __pyx_base;
1390   long total_elem;
1391   __pyx_t_5qutip_2cy_14sparse_structs_CSR_Matrix cte;
1392   __pyx_t_5qutip_2cy_14sparse_structs_CSR_Matrix **ops;
1393   __Pyx_memviewslice sum_elem;
1394 };
1395 
1396 
1397 /* "qutip/cy/cqobjevo.pxd":87
1398  *
1399  *
1400  * cdef class CQobjEvoTdDense(CQobjEvo):             # <<<<<<<<<<<<<<
1401  *     # data as array
1402  *     cdef complex[:, ::1] cte
1403  */
1404 struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvoTdDense {
1405   struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvo __pyx_base;
1406   __Pyx_memviewslice cte;
1407   __Pyx_memviewslice ops;
1408   __Pyx_memviewslice data_t;
1409   __pyx_t_double_complex *data_ptr;
1410 };
1411 
1412 
1413 /* "qutip/cy/cqobjevo.pxd":100
1414  *
1415  *
1416  * cdef class CQobjEvoTdMatched(CQobjEvo):             # <<<<<<<<<<<<<<
1417  *     cdef int nnz
1418  *     # data as array
1419  */
1420 struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvoTdMatched {
1421   struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvo __pyx_base;
1422   int nnz;
1423   __Pyx_memviewslice indptr;
1424   __Pyx_memviewslice indices;
1425   __Pyx_memviewslice cte;
1426   __Pyx_memviewslice ops;
1427   __Pyx_memviewslice data_t;
1428   __pyx_t_double_complex *data_ptr;
1429 };
1430 
1431 
1432 /* "qutip/cy/cqobjevo_factor.pxd":10
1433  * cdef np.ndarray[int, ndim=1] iprt2array(int* ptr, int N)
1434  *
1435  * cdef class CoeffFunc:             # <<<<<<<<<<<<<<
1436  *     cdef dict _args
1437  *     cdef int _num_ops
1438  */
1439 struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc {
1440   PyObject_HEAD
1441   struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_CoeffFunc *__pyx_vtab;
1442   PyObject *_args;
1443   int _num_ops;
1444 };
1445 
1446 
1447 /* "qutip/cy/cqobjevo_factor.pxd":16
1448  *     cdef void _dyn_args(self, double t, complex* state, int[::1] shape)
1449  *
1450  * cdef class StrCoeff(CoeffFunc):             # <<<<<<<<<<<<<<
1451  *     cdef list _dyn_args_list
1452  *     cdef int _num_expect
1453  */
1454 struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff {
1455   struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc __pyx_base;
1456   PyObject *_dyn_args_list;
1457   int _num_expect;
1458   int _mat_shape[2];
1459   PyObject *_expect_op;
1460   __Pyx_memviewslice _expect_vec;
1461   __Pyx_memviewslice _vec;
1462 };
1463 
1464 
1465 /* "qutip/cy/cqobjevo_factor.pyx":100
1466  *
1467  *
1468  * cdef class InterpolateCoeff(CoeffFunc):             # <<<<<<<<<<<<<<
1469  *     cdef double a, b
1470  *     cdef complex[:,::1] c
1471  */
1472 struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff {
1473   struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc __pyx_base;
1474   double a;
1475   double b;
1476   __Pyx_memviewslice c;
1477 };
1478 
1479 
1480 /* "qutip/cy/cqobjevo_factor.pyx":140
1481  *
1482  *
1483  * cdef class InterCoeffCte(CoeffFunc):             # <<<<<<<<<<<<<<
1484  *     cdef int n_t
1485  *     cdef double dt
1486  */
1487 struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte {
1488   struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc __pyx_base;
1489   int n_t;
1490   double dt;
1491   __Pyx_memviewslice tlist;
1492   __Pyx_memviewslice y;
1493   __Pyx_memviewslice M;
1494 };
1495 
1496 
1497 /* "qutip/cy/cqobjevo_factor.pyx":186
1498  *
1499  *
1500  * cdef class InterCoeffT(CoeffFunc):             # <<<<<<<<<<<<<<
1501  *     cdef int n_t
1502  *     cdef double dt
1503  */
1504 struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT {
1505   struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc __pyx_base;
1506   int n_t;
1507   double dt;
1508   __Pyx_memviewslice tlist;
1509   __Pyx_memviewslice y;
1510   __Pyx_memviewslice M;
1511 };
1512 
1513 
1514 /* "qutip/cy/cqobjevo_factor.pyx":229
1515  *
1516  *
1517  * cdef class StepCoeff(CoeffFunc):             # <<<<<<<<<<<<<<
1518  *     cdef int n_t
1519  *     cdef double[::1] tlist
1520  */
1521 struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff {
1522   struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc __pyx_base;
1523   int n_t;
1524   __Pyx_memviewslice tlist;
1525   __Pyx_memviewslice y;
1526 };
1527 
1528 
1529 /* "qutip/cy/cqobjevo_factor.pyx":259
1530  *
1531  *
1532  * cdef class StepCoeffT(StepCoeff):             # <<<<<<<<<<<<<<
1533  *     cdef void _call_core(self, double t, complex* coeff):
1534  *         cdef int i
1535  */
1536 struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffT {
1537   struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff __pyx_base;
1538 };
1539 
1540 
1541 /* "qutip/cy/cqobjevo_factor.pyx":266
1542  *
1543  *
1544  * cdef class StepCoeffCte(StepCoeff):             # <<<<<<<<<<<<<<
1545  *     cdef void _call_core(self, double t, complex* coeff):
1546  *         cdef int i
1547  */
1548 struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffCte {
1549   struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff __pyx_base;
1550 };
1551 
1552 
1553 /* "View.MemoryView":105
1554  *
1555  * @cname("__pyx_array")
1556  * cdef class array:             # <<<<<<<<<<<<<<
1557  *
1558  *     cdef:
1559  */
1560 struct __pyx_array_obj {
1561   PyObject_HEAD
1562   struct __pyx_vtabstruct_array *__pyx_vtab;
1563   char *data;
1564   Py_ssize_t len;
1565   char *format;
1566   int ndim;
1567   Py_ssize_t *_shape;
1568   Py_ssize_t *_strides;
1569   Py_ssize_t itemsize;
1570   PyObject *mode;
1571   PyObject *_format;
1572   void (*callback_free_data)(void *);
1573   int free_data;
1574   int dtype_is_object;
1575 };
1576 
1577 
1578 /* "View.MemoryView":279
1579  *
1580  * @cname('__pyx_MemviewEnum')
1581  * cdef class Enum(object):             # <<<<<<<<<<<<<<
1582  *     cdef object name
1583  *     def __init__(self, name):
1584  */
1585 struct __pyx_MemviewEnum_obj {
1586   PyObject_HEAD
1587   PyObject *name;
1588 };
1589 
1590 
1591 /* "View.MemoryView":330
1592  *
1593  * @cname('__pyx_memoryview')
1594  * cdef class memoryview(object):             # <<<<<<<<<<<<<<
1595  *
1596  *     cdef object obj
1597  */
1598 struct __pyx_memoryview_obj {
1599   PyObject_HEAD
1600   struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1601   PyObject *obj;
1602   PyObject *_size;
1603   PyObject *_array_interface;
1604   PyThread_type_lock lock;
1605   __pyx_atomic_int acquisition_count[2];
1606   __pyx_atomic_int *acquisition_count_aligned_p;
1607   Py_buffer view;
1608   int flags;
1609   int dtype_is_object;
1610   __Pyx_TypeInfo *typeinfo;
1611 };
1612 
1613 
1614 /* "View.MemoryView":965
1615  *
1616  * @cname('__pyx_memoryviewslice')
1617  * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
1618  *     "Internal class for passing memoryview slices to Python"
1619  *
1620  */
1621 struct __pyx_memoryviewslice_obj {
1622   struct __pyx_memoryview_obj __pyx_base;
1623   __Pyx_memviewslice from_slice;
1624   PyObject *from_object;
1625   PyObject *(*to_object_func)(char *);
1626   int (*to_dtype_func)(char *, PyObject *);
1627 };
1628 
1629 
1630 
1631 /* "qutip/cy/cqobjevo.pxd":38
1632  * from qutip.cy.cqobjevo_factor cimport CoeffFunc
1633  *
1634  * cdef class CQobjEvo:             # <<<<<<<<<<<<<<
1635  *     cdef int shape0, shape1
1636  *     cdef object dims
1637  */
1638 
1639 struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjEvo {
1640   int (*_factor)(struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvo *, double);
1641   int (*_factor_dyn)(struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvo *, double, __pyx_t_double_complex *, __Pyx_memviewslice);
1642   int (*_mul_vec)(struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvo *, double, __pyx_t_double_complex *, __pyx_t_double_complex *);
1643   int (*_mul_matf)(struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvo *, double, __pyx_t_double_complex *, __pyx_t_double_complex *, int, int);
1644   int (*_mul_matc)(struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvo *, double, __pyx_t_double_complex *, __pyx_t_double_complex *, int, int);
1645   __pyx_t_double_complex (*expect)(struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvo *, double, __Pyx_memviewslice, int __pyx_skip_dispatch);
1646   __pyx_t_double_complex (*_expect)(struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvo *, double, __pyx_t_double_complex *);
1647   __pyx_t_double_complex (*_expect_super)(struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvo *, double, __pyx_t_double_complex *);
1648   __pyx_t_double_complex (*_overlapse)(struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvo *, double, __pyx_t_double_complex *);
1649 };
1650 static struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjEvo *__pyx_vtabptr_5qutip_2cy_8cqobjevo_CQobjEvo;
1651 
1652 
1653 /* "qutip/cy/cqobjevo.pxd":67
1654  *
1655  *
1656  * cdef class CQobjCte(CQobjEvo):             # <<<<<<<<<<<<<<
1657  *     cdef int total_elem
1658  *     # pointer to data
1659  */
1660 
1661 struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjCte {
1662   struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjEvo __pyx_base;
1663 };
1664 static struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjCte *__pyx_vtabptr_5qutip_2cy_8cqobjevo_CQobjCte;
1665 
1666 
1667 /* "qutip/cy/cqobjevo.pxd":73
1668  *
1669  *
1670  * cdef class CQobjCteDense(CQobjEvo):             # <<<<<<<<<<<<<<
1671  *     # pointer to data
1672  *     cdef complex[:, ::1] cte
1673  */
1674 
1675 struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjCteDense {
1676   struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjEvo __pyx_base;
1677 };
1678 static struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjCteDense *__pyx_vtabptr_5qutip_2cy_8cqobjevo_CQobjCteDense;
1679 
1680 
1681 /* "qutip/cy/cqobjevo.pxd":78
1682  *
1683  *
1684  * cdef class CQobjEvoTd(CQobjEvo):             # <<<<<<<<<<<<<<
1685  *     cdef long total_elem
1686  *     # pointer to data
1687  */
1688 
1689 struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjEvoTd {
1690   struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjEvo __pyx_base;
1691   void (*_call_core)(struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvoTd *, __pyx_t_5qutip_2cy_14sparse_structs_CSR_Matrix *, __pyx_t_double_complex *);
1692 };
1693 static struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjEvoTd *__pyx_vtabptr_5qutip_2cy_8cqobjevo_CQobjEvoTd;
1694 
1695 
1696 /* "qutip/cy/cqobjevo.pxd":87
1697  *
1698  *
1699  * cdef class CQobjEvoTdDense(CQobjEvo):             # <<<<<<<<<<<<<<
1700  *     # data as array
1701  *     cdef complex[:, ::1] cte
1702  */
1703 
1704 struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjEvoTdDense {
1705   struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjEvo __pyx_base;
1706   void (*_call_core)(struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvoTdDense *, __Pyx_memviewslice, __pyx_t_double_complex *);
1707 };
1708 static struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjEvoTdDense *__pyx_vtabptr_5qutip_2cy_8cqobjevo_CQobjEvoTdDense;
1709 
1710 
1711 /* "qutip/cy/cqobjevo.pxd":100
1712  *
1713  *
1714  * cdef class CQobjEvoTdMatched(CQobjEvo):             # <<<<<<<<<<<<<<
1715  *     cdef int nnz
1716  *     # data as array
1717  */
1718 
1719 struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjEvoTdMatched {
1720   struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjEvo __pyx_base;
1721   void (*_call_core)(struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvoTdMatched *, __Pyx_memviewslice, __pyx_t_double_complex *);
1722 };
1723 static struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjEvoTdMatched *__pyx_vtabptr_5qutip_2cy_8cqobjevo_CQobjEvoTdMatched;
1724 
1725 
1726 /* "qutip/cy/cqobjevo_factor.pyx":71
1727  *     return np.PyArray_SimpleNewFromData(1, Ns, np.NPY_INT32, ptr)
1728  *
1729  * cdef class CoeffFunc:             # <<<<<<<<<<<<<<
1730  *     def __init__(self, ops, args, tlist):
1731  *         self._args = {}
1732  */
1733 
1734 struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_CoeffFunc {
1735   void (*_call_core)(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *, double, __pyx_t_double_complex *);
1736   void (*_dyn_args)(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *, double, __pyx_t_double_complex *, __Pyx_memviewslice);
1737 };
1738 static struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_CoeffFunc *__pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_CoeffFunc;
1739 
1740 
1741 /* "qutip/cy/cqobjevo_factor.pyx":273
1742  *
1743  *
1744  * cdef class StrCoeff(CoeffFunc):             # <<<<<<<<<<<<<<
1745  *     def __init__(self, ops, args, tlist, dyn_args=[]):
1746  *         self._num_ops = len(ops)
1747  */
1748 
1749 struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_StrCoeff {
1750   struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_CoeffFunc __pyx_base;
1751 };
1752 static struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_StrCoeff *__pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_StrCoeff;
1753 
1754 
1755 /* "qutip/cy/cqobjevo_factor.pyx":100
1756  *
1757  *
1758  * cdef class InterpolateCoeff(CoeffFunc):             # <<<<<<<<<<<<<<
1759  *     cdef double a, b
1760  *     cdef complex[:,::1] c
1761  */
1762 
1763 struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff {
1764   struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_CoeffFunc __pyx_base;
1765 };
1766 static struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *__pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff;
1767 
1768 
1769 /* "qutip/cy/cqobjevo_factor.pyx":140
1770  *
1771  *
1772  * cdef class InterCoeffCte(CoeffFunc):             # <<<<<<<<<<<<<<
1773  *     cdef int n_t
1774  *     cdef double dt
1775  */
1776 
1777 struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_InterCoeffCte {
1778   struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_CoeffFunc __pyx_base;
1779 };
1780 static struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *__pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_InterCoeffCte;
1781 
1782 
1783 /* "qutip/cy/cqobjevo_factor.pyx":186
1784  *
1785  *
1786  * cdef class InterCoeffT(CoeffFunc):             # <<<<<<<<<<<<<<
1787  *     cdef int n_t
1788  *     cdef double dt
1789  */
1790 
1791 struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_InterCoeffT {
1792   struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_CoeffFunc __pyx_base;
1793 };
1794 static struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_InterCoeffT *__pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_InterCoeffT;
1795 
1796 
1797 /* "qutip/cy/cqobjevo_factor.pyx":229
1798  *
1799  *
1800  * cdef class StepCoeff(CoeffFunc):             # <<<<<<<<<<<<<<
1801  *     cdef int n_t
1802  *     cdef double[::1] tlist
1803  */
1804 
1805 struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_StepCoeff {
1806   struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_CoeffFunc __pyx_base;
1807 };
1808 static struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_StepCoeff *__pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_StepCoeff;
1809 
1810 
1811 /* "qutip/cy/cqobjevo_factor.pyx":259
1812  *
1813  *
1814  * cdef class StepCoeffT(StepCoeff):             # <<<<<<<<<<<<<<
1815  *     cdef void _call_core(self, double t, complex* coeff):
1816  *         cdef int i
1817  */
1818 
1819 struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_StepCoeffT {
1820   struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_StepCoeff __pyx_base;
1821 };
1822 static struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_StepCoeffT *__pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_StepCoeffT;
1823 
1824 
1825 /* "qutip/cy/cqobjevo_factor.pyx":266
1826  *
1827  *
1828  * cdef class StepCoeffCte(StepCoeff):             # <<<<<<<<<<<<<<
1829  *     cdef void _call_core(self, double t, complex* coeff):
1830  *         cdef int i
1831  */
1832 
1833 struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_StepCoeffCte {
1834   struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_StepCoeff __pyx_base;
1835 };
1836 static struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_StepCoeffCte *__pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_StepCoeffCte;
1837 
1838 
1839 /* "View.MemoryView":105
1840  *
1841  * @cname("__pyx_array")
1842  * cdef class array:             # <<<<<<<<<<<<<<
1843  *
1844  *     cdef:
1845  */
1846 
1847 struct __pyx_vtabstruct_array {
1848   PyObject *(*get_memview)(struct __pyx_array_obj *);
1849 };
1850 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1851 
1852 
1853 /* "View.MemoryView":330
1854  *
1855  * @cname('__pyx_memoryview')
1856  * cdef class memoryview(object):             # <<<<<<<<<<<<<<
1857  *
1858  *     cdef object obj
1859  */
1860 
1861 struct __pyx_vtabstruct_memoryview {
1862   char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1863   PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1864   PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1865   PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1866   PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1867   PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1868   PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1869 };
1870 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1871 
1872 
1873 /* "View.MemoryView":965
1874  *
1875  * @cname('__pyx_memoryviewslice')
1876  * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
1877  *     "Internal class for passing memoryview slices to Python"
1878  *
1879  */
1880 
1881 struct __pyx_vtabstruct__memoryviewslice {
1882   struct __pyx_vtabstruct_memoryview __pyx_base;
1883 };
1884 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1885 
1886 /* --- Runtime support code (head) --- */
1887 /* Refnanny.proto */
1888 #ifndef CYTHON_REFNANNY
1889   #define CYTHON_REFNANNY 0
1890 #endif
1891 #if CYTHON_REFNANNY
1892   typedef struct {
1893     void (*INCREF)(void*, PyObject*, int);
1894     void (*DECREF)(void*, PyObject*, int);
1895     void (*GOTREF)(void*, PyObject*, int);
1896     void (*GIVEREF)(void*, PyObject*, int);
1897     void* (*SetupContext)(const char*, int, const char*);
1898     void (*FinishContext)(void**);
1899   } __Pyx_RefNannyAPIStruct;
1900   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1901   static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1902   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1903 #ifdef WITH_THREAD
1904   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1905           if (acquire_gil) {\
1906               PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1907               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1908               PyGILState_Release(__pyx_gilstate_save);\
1909           } else {\
1910               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1911           }
1912 #else
1913   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1914           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1915 #endif
1916   #define __Pyx_RefNannyFinishContext()\
1917           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1918   #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1919   #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1920   #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1921   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1922   #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1923   #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1924   #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1925   #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1926 #else
1927   #define __Pyx_RefNannyDeclarations
1928   #define __Pyx_RefNannySetupContext(name, acquire_gil)
1929   #define __Pyx_RefNannyFinishContext()
1930   #define __Pyx_INCREF(r) Py_INCREF(r)
1931   #define __Pyx_DECREF(r) Py_DECREF(r)
1932   #define __Pyx_GOTREF(r)
1933   #define __Pyx_GIVEREF(r)
1934   #define __Pyx_XINCREF(r) Py_XINCREF(r)
1935   #define __Pyx_XDECREF(r) Py_XDECREF(r)
1936   #define __Pyx_XGOTREF(r)
1937   #define __Pyx_XGIVEREF(r)
1938 #endif
1939 #define __Pyx_XDECREF_SET(r, v) do {\
1940         PyObject *tmp = (PyObject *) r;\
1941         r = v; __Pyx_XDECREF(tmp);\
1942     } while (0)
1943 #define __Pyx_DECREF_SET(r, v) do {\
1944         PyObject *tmp = (PyObject *) r;\
1945         r = v; __Pyx_DECREF(tmp);\
1946     } while (0)
1947 #define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1948 #define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1949 
1950 /* PyObjectGetAttrStr.proto */
1951 #if CYTHON_USE_TYPE_SLOTS
1952 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1953 #else
1954 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1955 #endif
1956 
1957 /* GetBuiltinName.proto */
1958 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1959 
1960 /* ExtTypeTest.proto */
1961 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1962 
1963 /* RaiseArgTupleInvalid.proto */
1964 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1965     Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1966 
1967 /* RaiseDoubleKeywords.proto */
1968 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1969 
1970 /* ParseKeywords.proto */
1971 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1972     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1973     const char* function_name);
1974 
1975 /* PyDictVersioning.proto */
1976 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1977 #define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
1978 #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
1979 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1980     (version_var) = __PYX_GET_DICT_VERSION(dict);\
1981     (cache_var) = (value);
1982 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1983     static PY_UINT64_T __pyx_dict_version = 0;\
1984     static PyObject *__pyx_dict_cached_value = NULL;\
1985     if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1986         (VAR) = __pyx_dict_cached_value;\
1987     } else {\
1988         (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1989         __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1990     }\
1991 }
1992 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1993 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1994 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1995 #else
1996 #define __PYX_GET_DICT_VERSION(dict)  (0)
1997 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1998 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
1999 #endif
2000 
2001 /* GetModuleGlobalName.proto */
2002 #if CYTHON_USE_DICT_VERSIONS
2003 #define __Pyx_GetModuleGlobalName(var, name)  {\
2004     static PY_UINT64_T __pyx_dict_version = 0;\
2005     static PyObject *__pyx_dict_cached_value = NULL;\
2006     (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
2007         (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
2008         __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2009 }
2010 #define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
2011     PY_UINT64_T __pyx_dict_version;\
2012     PyObject *__pyx_dict_cached_value;\
2013     (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2014 }
2015 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
2016 #else
2017 #define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
2018 #define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
2019 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
2020 #endif
2021 
2022 /* PyObjectCall.proto */
2023 #if CYTHON_COMPILING_IN_CPYTHON
2024 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2025 #else
2026 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2027 #endif
2028 
2029 /* IsLittleEndian.proto */
2030 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2031 
2032 /* BufferFormatCheck.proto */
2033 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2034 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2035                               __Pyx_BufFmt_StackElem* stack,
2036                               __Pyx_TypeInfo* type);
2037 
2038 /* BufferGetAndValidate.proto */
2039 #define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
2040     ((obj == Py_None || obj == NULL) ?\
2041     (__Pyx_ZeroBuffer(buf), 0) :\
2042     __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
2043 static int  __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
2044     __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
2045 static void __Pyx_ZeroBuffer(Py_buffer* buf);
2046 static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
2047 static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
2048 static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
2049 
2050 /* BufferIndexError.proto */
2051 static void __Pyx_RaiseBufferIndexError(int axis);
2052 
2053 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
2054 /* PyThreadStateGet.proto */
2055 #if CYTHON_FAST_THREAD_STATE
2056 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
2057 #define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
2058 #define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
2059 #else
2060 #define __Pyx_PyThreadState_declare
2061 #define __Pyx_PyThreadState_assign
2062 #define __Pyx_PyErr_Occurred()  PyErr_Occurred()
2063 #endif
2064 
2065 /* PyErrFetchRestore.proto */
2066 #if CYTHON_FAST_THREAD_STATE
2067 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2068 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2069 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2070 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2071 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2072 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2073 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2074 #if CYTHON_COMPILING_IN_CPYTHON
2075 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2076 #else
2077 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2078 #endif
2079 #else
2080 #define __Pyx_PyErr_Clear() PyErr_Clear()
2081 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2082 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
2083 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
2084 #define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
2085 #define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
2086 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
2087 #define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
2088 #endif
2089 
2090 /* PyErrExceptionMatches.proto */
2091 #if CYTHON_FAST_THREAD_STATE
2092 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2093 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2094 #else
2095 #define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
2096 #endif
2097 
2098 /* GetAttr.proto */
2099 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2100 
2101 /* GetAttr3.proto */
2102 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2103 
2104 /* GetItemInt.proto */
2105 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2106     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2107     __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
2108     (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
2109                __Pyx_GetItemInt_Generic(o, to_py_func(i))))
2110 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2111     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2112     __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2113     (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2114 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2115                                                               int wraparound, int boundscheck);
2116 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2117     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2118     __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2119     (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2120 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2121                                                               int wraparound, int boundscheck);
2122 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2123 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2124                                                      int is_list, int wraparound, int boundscheck);
2125 
2126 /* MemviewSliceInit.proto */
2127 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
2128 #define __Pyx_MEMVIEW_DIRECT   1
2129 #define __Pyx_MEMVIEW_PTR      2
2130 #define __Pyx_MEMVIEW_FULL     4
2131 #define __Pyx_MEMVIEW_CONTIG   8
2132 #define __Pyx_MEMVIEW_STRIDED  16
2133 #define __Pyx_MEMVIEW_FOLLOW   32
2134 #define __Pyx_IS_C_CONTIG 1
2135 #define __Pyx_IS_F_CONTIG 2
2136 static int __Pyx_init_memviewslice(
2137                 struct __pyx_memoryview_obj *memview,
2138                 int ndim,
2139                 __Pyx_memviewslice *memviewslice,
2140                 int memview_is_new_reference);
2141 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
2142     __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2143 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
2144     __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2145 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
2146 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
2147 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
2148 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
2149 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
2150 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
2151 
2152 /* WriteUnraisableException.proto */
2153 static void __Pyx_WriteUnraisable(const char *name, int clineno,
2154                                   int lineno, const char *filename,
2155                                   int full_traceback, int nogil);
2156 
2157 /* PyCFunctionFastCall.proto */
2158 #if CYTHON_FAST_PYCCALL
2159 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
2160 #else
2161 #define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
2162 #endif
2163 
2164 /* PyFunctionFastCall.proto */
2165 #if CYTHON_FAST_PYCALL
2166 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
2167     __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
2168 #if 1 || PY_VERSION_HEX < 0x030600B1
2169 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
2170 #else
2171 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
2172 #endif
2173 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
2174     (sizeof(char [1 - 2*!(cond)]) - 1)
2175 #ifndef Py_MEMBER_SIZE
2176 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
2177 #endif
2178   static size_t __pyx_pyframe_localsplus_offset = 0;
2179   #include "frameobject.h"
2180   #define __Pxy_PyFrame_Initialize_Offsets()\
2181     ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
2182      (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
2183   #define __Pyx_PyFrame_GetLocalsplus(frame)\
2184     (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
2185 #endif
2186 
2187 /* PyObjectCall2Args.proto */
2188 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
2189 
2190 /* PyObjectCallMethO.proto */
2191 #if CYTHON_COMPILING_IN_CPYTHON
2192 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2193 #endif
2194 
2195 /* PyObjectCallOneArg.proto */
2196 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2197 
2198 /* RaiseTooManyValuesToUnpack.proto */
2199 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2200 
2201 /* RaiseNeedMoreValuesToUnpack.proto */
2202 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2203 
2204 /* IterFinish.proto */
2205 static CYTHON_INLINE int __Pyx_IterFinish(void);
2206 
2207 /* UnpackItemEndCheck.proto */
2208 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
2209 
2210 /* RaiseException.proto */
2211 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2212 
2213 /* IncludeStringH.proto */
2214 #include <string.h>
2215 
2216 /* BytesEquals.proto */
2217 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
2218 
2219 /* UnicodeEquals.proto */
2220 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2221 
2222 /* ListAppend.proto */
2223 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_PyList_Append(PyObject * list,PyObject * x)2224 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2225     PyListObject* L = (PyListObject*) list;
2226     Py_ssize_t len = Py_SIZE(list);
2227     if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2228         Py_INCREF(x);
2229         PyList_SET_ITEM(list, len, x);
2230         __Pyx_SET_SIZE(list, len + 1);
2231         return 0;
2232     }
2233     return PyList_Append(list, x);
2234 }
2235 #else
2236 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2237 #endif
2238 
2239 /* DictGetItem.proto */
2240 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
2241 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
2242 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
2243     (likely(PyDict_CheckExact(obj)) ?\
2244      __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
2245 #else
2246 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
2247 #define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
2248 #endif
2249 
2250 /* PyObjectCallNoArg.proto */
2251 #if CYTHON_COMPILING_IN_CPYTHON
2252 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
2253 #else
2254 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
2255 #endif
2256 
2257 /* Import.proto */
2258 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2259 
2260 /* ImportFrom.proto */
2261 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2262 
2263 /* HasAttr.proto */
2264 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2265 
2266 /* GetTopmostException.proto */
2267 #if CYTHON_USE_EXC_INFO_STACK
2268 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2269 #endif
2270 
2271 /* SaveResetException.proto */
2272 #if CYTHON_FAST_THREAD_STATE
2273 #define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2274 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2275 #define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2276 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2277 #else
2278 #define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
2279 #define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
2280 #endif
2281 
2282 /* GetException.proto */
2283 #if CYTHON_FAST_THREAD_STATE
2284 #define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
2285 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2286 #else
2287 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2288 #endif
2289 
2290 /* ArgTypeTest.proto */
2291 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2292     ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2293         __Pyx__ArgTypeTest(obj, type, name, exact))
2294 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2295 
2296 /* StrEquals.proto */
2297 #if PY_MAJOR_VERSION >= 3
2298 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2299 #else
2300 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2301 #endif
2302 
2303 /* None.proto */
2304 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
2305 
2306 /* UnaryNegOverflows.proto */
2307 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2308         (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2309 
2310 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2311 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2312 /* ObjectGetItem.proto */
2313 #if CYTHON_USE_TYPE_SLOTS
2314 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
2315 #else
2316 #define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
2317 #endif
2318 
2319 /* decode_c_string_utf16.proto */
__Pyx_PyUnicode_DecodeUTF16(const char * s,Py_ssize_t size,const char * errors)2320 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
2321     int byteorder = 0;
2322     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2323 }
__Pyx_PyUnicode_DecodeUTF16LE(const char * s,Py_ssize_t size,const char * errors)2324 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
2325     int byteorder = -1;
2326     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2327 }
__Pyx_PyUnicode_DecodeUTF16BE(const char * s,Py_ssize_t size,const char * errors)2328 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
2329     int byteorder = 1;
2330     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2331 }
2332 
2333 /* decode_c_string.proto */
2334 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2335          const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2336          const char* encoding, const char* errors,
2337          PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
2338 
2339 /* RaiseNoneIterError.proto */
2340 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2341 
2342 /* SwapException.proto */
2343 #if CYTHON_FAST_THREAD_STATE
2344 #define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2345 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2346 #else
2347 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2348 #endif
2349 
2350 /* FastTypeChecks.proto */
2351 #if CYTHON_COMPILING_IN_CPYTHON
2352 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2353 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2354 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2355 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2356 #else
2357 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2358 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2359 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2360 #endif
2361 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2362 
2363 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2364 /* ListCompAppend.proto */
2365 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_ListComp_Append(PyObject * list,PyObject * x)2366 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2367     PyListObject* L = (PyListObject*) list;
2368     Py_ssize_t len = Py_SIZE(list);
2369     if (likely(L->allocated > len)) {
2370         Py_INCREF(x);
2371         PyList_SET_ITEM(list, len, x);
2372         __Pyx_SET_SIZE(list, len + 1);
2373         return 0;
2374     }
2375     return PyList_Append(list, x);
2376 }
2377 #else
2378 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2379 #endif
2380 
2381 /* PyIntBinop.proto */
2382 #if !CYTHON_COMPILING_IN_PYPY
2383 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2384 #else
2385 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2386     (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2387 #endif
2388 
2389 /* ListExtend.proto */
__Pyx_PyList_Extend(PyObject * L,PyObject * v)2390 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2391 #if CYTHON_COMPILING_IN_CPYTHON
2392     PyObject* none = _PyList_Extend((PyListObject*)L, v);
2393     if (unlikely(!none))
2394         return -1;
2395     Py_DECREF(none);
2396     return 0;
2397 #else
2398     return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2399 #endif
2400 }
2401 
2402 /* None.proto */
2403 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2404 
2405 /* None.proto */
2406 static CYTHON_INLINE long __Pyx_div_long(long, long);
2407 
2408 /* StringJoin.proto */
2409 #if PY_MAJOR_VERSION < 3
2410 #define __Pyx_PyString_Join __Pyx_PyBytes_Join
2411 #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
2412 #else
2413 #define __Pyx_PyString_Join PyUnicode_Join
2414 #define __Pyx_PyBaseString_Join PyUnicode_Join
2415 #endif
2416 #if CYTHON_COMPILING_IN_CPYTHON
2417     #if PY_MAJOR_VERSION < 3
2418     #define __Pyx_PyBytes_Join _PyString_Join
2419     #else
2420     #define __Pyx_PyBytes_Join _PyBytes_Join
2421     #endif
2422 #else
2423 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
2424 #endif
2425 
2426 /* PyObject_Unicode.proto */
2427 #if PY_MAJOR_VERSION >= 3
2428 #define __Pyx_PyObject_Unicode(obj)\
2429     (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
2430 #else
2431 #define __Pyx_PyObject_Unicode(obj)\
2432     (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
2433 #endif
2434 
2435 /* PyObject_GenericGetAttrNoDict.proto */
2436 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2437 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2438 #else
2439 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2440 #endif
2441 
2442 /* PyObject_GenericGetAttr.proto */
2443 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2444 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2445 #else
2446 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2447 #endif
2448 
2449 /* SetVTable.proto */
2450 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2451 
2452 /* PyObjectGetAttrStrNoError.proto */
2453 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2454 
2455 /* SetupReduce.proto */
2456 static int __Pyx_setup_reduce(PyObject* type_obj);
2457 
2458 /* TypeImport.proto */
2459 #ifndef __PYX_HAVE_RT_ImportType_proto
2460 #define __PYX_HAVE_RT_ImportType_proto
2461 enum __Pyx_ImportType_CheckSize {
2462    __Pyx_ImportType_CheckSize_Error = 0,
2463    __Pyx_ImportType_CheckSize_Warn = 1,
2464    __Pyx_ImportType_CheckSize_Ignore = 2
2465 };
2466 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2467 #endif
2468 
2469 /* GetVTable.proto */
2470 static void* __Pyx_GetVtable(PyObject *dict);
2471 
2472 /* CLineInTraceback.proto */
2473 #ifdef CYTHON_CLINE_IN_TRACEBACK
2474 #define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2475 #else
2476 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2477 #endif
2478 
2479 /* CodeObjectCache.proto */
2480 typedef struct {
2481     PyCodeObject* code_object;
2482     int code_line;
2483 } __Pyx_CodeObjectCacheEntry;
2484 struct __Pyx_CodeObjectCache {
2485     int count;
2486     int max_count;
2487     __Pyx_CodeObjectCacheEntry* entries;
2488 };
2489 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2490 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2491 static PyCodeObject *__pyx_find_code_object(int code_line);
2492 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2493 
2494 /* AddTraceback.proto */
2495 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2496                                int py_line, const char *filename);
2497 
2498 /* RealImag.proto */
2499 #if CYTHON_CCOMPLEX
2500   #ifdef __cplusplus
2501     #define __Pyx_CREAL(z) ((z).real())
2502     #define __Pyx_CIMAG(z) ((z).imag())
2503   #else
2504     #define __Pyx_CREAL(z) (__real__(z))
2505     #define __Pyx_CIMAG(z) (__imag__(z))
2506   #endif
2507 #else
2508     #define __Pyx_CREAL(z) ((z).real)
2509     #define __Pyx_CIMAG(z) ((z).imag)
2510 #endif
2511 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2512         && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2513     #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2514     #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2515 #else
2516     #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2517     #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2518 #endif
2519 
2520 /* Arithmetic.proto */
2521 #if CYTHON_CCOMPLEX
2522     #define __Pyx_c_eq_double(a, b)   ((a)==(b))
2523     #define __Pyx_c_sum_double(a, b)  ((a)+(b))
2524     #define __Pyx_c_diff_double(a, b) ((a)-(b))
2525     #define __Pyx_c_prod_double(a, b) ((a)*(b))
2526     #define __Pyx_c_quot_double(a, b) ((a)/(b))
2527     #define __Pyx_c_neg_double(a)     (-(a))
2528   #ifdef __cplusplus
2529     #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2530     #define __Pyx_c_conj_double(z)    (::std::conj(z))
2531     #if 1
2532         #define __Pyx_c_abs_double(z)     (::std::abs(z))
2533         #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
2534     #endif
2535   #else
2536     #define __Pyx_c_is_zero_double(z) ((z)==0)
2537     #define __Pyx_c_conj_double(z)    (conj(z))
2538     #if 1
2539         #define __Pyx_c_abs_double(z)     (cabs(z))
2540         #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
2541     #endif
2542  #endif
2543 #else
2544     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2545     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2546     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2547     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2548     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2549     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2550     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2551     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2552     #if 1
2553         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2554         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2555     #endif
2556 #endif
2557 
2558 #if PY_MAJOR_VERSION < 3
2559     static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2560     static void __Pyx_ReleaseBuffer(Py_buffer *view);
2561 #else
2562     #define __Pyx_GetBuffer PyObject_GetBuffer
2563     #define __Pyx_ReleaseBuffer PyBuffer_Release
2564 #endif
2565 
2566 
2567 /* BufferStructDeclare.proto */
2568 typedef struct {
2569   Py_ssize_t shape, strides, suboffsets;
2570 } __Pyx_Buf_DimInfo;
2571 typedef struct {
2572   size_t refcount;
2573   Py_buffer pybuffer;
2574 } __Pyx_Buffer;
2575 typedef struct {
2576   __Pyx_Buffer *rcbuffer;
2577   char *data;
2578   __Pyx_Buf_DimInfo diminfo[8];
2579 } __Pyx_LocalBuf_ND;
2580 
2581 /* MemviewSliceIsContig.proto */
2582 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2583 
2584 /* OverlappingSlices.proto */
2585 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2586                                 __Pyx_memviewslice *slice2,
2587                                 int ndim, size_t itemsize);
2588 
2589 /* Capsule.proto */
2590 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2591 
2592 /* GCCDiagnostics.proto */
2593 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2594 #define __Pyx_HAS_GCC_DIAGNOSTIC
2595 #endif
2596 
2597 /* ToPy.proto */
2598 #define __pyx_PyComplex_FromComplex(z)\
2599         PyComplex_FromDoubles((double)__Pyx_CREAL(z),\
2600                               (double)__Pyx_CIMAG(z))
2601 
2602 /* FromPy.proto */
2603 static __pyx_t_double_complex __Pyx_PyComplex_As___pyx_t_double_complex(PyObject*);
2604 
2605 /* MemviewDtypeToObject.proto */
2606 static CYTHON_INLINE PyObject *__pyx_memview_get___pyx_t_double_complex(const char *itemp);
2607 static CYTHON_INLINE int __pyx_memview_set___pyx_t_double_complex(const char *itemp, PyObject *obj);
2608 
2609 /* TypeInfoCompare.proto */
2610 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2611 
2612 /* MemviewSliceValidateAndInit.proto */
2613 static int __Pyx_ValidateAndInit_memviewslice(
2614                 int *axes_specs,
2615                 int c_or_f_flag,
2616                 int buf_flags,
2617                 int ndim,
2618                 __Pyx_TypeInfo *dtype,
2619                 __Pyx_BufFmt_StackElem stack[],
2620                 __Pyx_memviewslice *memviewslice,
2621                 PyObject *original_obj);
2622 
2623 /* ObjectToMemviewSlice.proto */
2624 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(PyObject *, int writable_flag);
2625 
2626 /* MemviewDtypeToObject.proto */
2627 static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp);
2628 static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj);
2629 
2630 /* ObjectToMemviewSlice.proto */
2631 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *, int writable_flag);
2632 
2633 /* ObjectToMemviewSlice.proto */
2634 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(PyObject *, int writable_flag);
2635 
2636 /* Arithmetic.proto */
2637 #if CYTHON_CCOMPLEX
2638     #define __Pyx_c_eq_float(a, b)   ((a)==(b))
2639     #define __Pyx_c_sum_float(a, b)  ((a)+(b))
2640     #define __Pyx_c_diff_float(a, b) ((a)-(b))
2641     #define __Pyx_c_prod_float(a, b) ((a)*(b))
2642     #define __Pyx_c_quot_float(a, b) ((a)/(b))
2643     #define __Pyx_c_neg_float(a)     (-(a))
2644   #ifdef __cplusplus
2645     #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2646     #define __Pyx_c_conj_float(z)    (::std::conj(z))
2647     #if 1
2648         #define __Pyx_c_abs_float(z)     (::std::abs(z))
2649         #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
2650     #endif
2651   #else
2652     #define __Pyx_c_is_zero_float(z) ((z)==0)
2653     #define __Pyx_c_conj_float(z)    (conjf(z))
2654     #if 1
2655         #define __Pyx_c_abs_float(z)     (cabsf(z))
2656         #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
2657     #endif
2658  #endif
2659 #else
2660     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2661     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2662     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2663     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2664     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2665     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2666     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2667     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2668     #if 1
2669         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2670         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2671     #endif
2672 #endif
2673 
2674 /* MemviewSliceCopyTemplate.proto */
2675 static __Pyx_memviewslice
2676 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2677                                  const char *mode, int ndim,
2678                                  size_t sizeof_dtype, int contig_flag,
2679                                  int dtype_is_object);
2680 
2681 /* CIntToPy.proto */
2682 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2683 
2684 /* CIntFromPy.proto */
2685 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2686 
2687 /* TypeInfoToFormat.proto */
2688 struct __pyx_typeinfo_string {
2689     char string[3];
2690 };
2691 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type);
2692 
2693 /* CIntFromPy.proto */
2694 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2695 
2696 /* CIntToPy.proto */
2697 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2698 
2699 /* CIntFromPy.proto */
2700 static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);
2701 
2702 /* CIntFromPy.proto */
2703 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2704 
2705 /* ObjectToMemviewSlice.proto */
2706 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_int(PyObject *, int writable_flag);
2707 
2708 /* CheckBinaryVersion.proto */
2709 static int __Pyx_check_binary_version(void);
2710 
2711 /* FunctionExport.proto */
2712 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);
2713 
2714 /* FunctionImport.proto */
2715 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig);
2716 
2717 /* InitStrings.proto */
2718 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2719 
2720 static void __pyx_f_5qutip_2cy_15cqobjevo_factor_9CoeffFunc__call_core(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *__pyx_v_self, CYTHON_UNUSED double __pyx_v_t, CYTHON_UNUSED __pyx_t_double_complex *__pyx_v_coeff); /* proto*/
2721 static void __pyx_f_5qutip_2cy_15cqobjevo_factor_9CoeffFunc__dyn_args(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *__pyx_v_self, CYTHON_UNUSED double __pyx_v_t, CYTHON_UNUSED __pyx_t_double_complex *__pyx_v_state, CYTHON_UNUSED __Pyx_memviewslice __pyx_v_shape); /* proto*/
2722 static void __pyx_f_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff__call_core(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *__pyx_v_self, double __pyx_v_t, __pyx_t_double_complex *__pyx_v_coeff); /* proto*/
2723 static void __pyx_f_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte__call_core(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *__pyx_v_self, double __pyx_v_t, __pyx_t_double_complex *__pyx_v_coeff); /* proto*/
2724 static void __pyx_f_5qutip_2cy_15cqobjevo_factor_11InterCoeffT__call_core(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *__pyx_v_self, double __pyx_v_t, __pyx_t_double_complex *__pyx_v_coeff); /* proto*/
2725 static void __pyx_f_5qutip_2cy_15cqobjevo_factor_10StepCoeffT__call_core(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffT *__pyx_v_self, double __pyx_v_t, __pyx_t_double_complex *__pyx_v_coeff); /* proto*/
2726 static void __pyx_f_5qutip_2cy_15cqobjevo_factor_12StepCoeffCte__call_core(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffCte *__pyx_v_self, double __pyx_v_t, __pyx_t_double_complex *__pyx_v_coeff); /* proto*/
2727 static void __pyx_f_5qutip_2cy_15cqobjevo_factor_8StrCoeff__dyn_args(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *__pyx_v_self, double __pyx_v_t, __pyx_t_double_complex *__pyx_v_state, __Pyx_memviewslice __pyx_v_shape); /* proto*/
2728 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2729 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2730 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2731 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2732 static 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*/
2733 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2734 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2735 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2736 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2737 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2738 
2739 /* Module declarations from 'cpython.buffer' */
2740 
2741 /* Module declarations from 'libc.string' */
2742 
2743 /* Module declarations from 'libc.stdio' */
2744 
2745 /* Module declarations from '__builtin__' */
2746 
2747 /* Module declarations from 'cpython.type' */
2748 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2749 
2750 /* Module declarations from 'cpython' */
2751 
2752 /* Module declarations from 'cpython.object' */
2753 
2754 /* Module declarations from 'cpython.ref' */
2755 
2756 /* Module declarations from 'cpython.mem' */
2757 
2758 /* Module declarations from 'numpy' */
2759 
2760 /* Module declarations from 'numpy' */
2761 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2762 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2763 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2764 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2765 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2766 
2767 /* Module declarations from 'cython.view' */
2768 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2769 
2770 /* Module declarations from 'cython' */
2771 
2772 /* Module declarations from 'libc.math' */
2773 
2774 /* Module declarations from 'libc' */
2775 
2776 /* Module declarations from 'qutip.cy.inter' */
2777 static __pyx_t_double_complex (*__pyx_f_5qutip_2cy_5inter__spline_complex_t_second)(double, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
2778 static __pyx_t_double_complex (*__pyx_f_5qutip_2cy_5inter__spline_complex_cte_second)(double, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, double); /*proto*/
2779 static __pyx_t_double_complex (*__pyx_f_5qutip_2cy_5inter__step_complex_cte)(double, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
2780 static __pyx_t_double_complex (*__pyx_f_5qutip_2cy_5inter__step_complex_t)(double, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
2781 
2782 /* Module declarations from 'qutip.cy.interpolate' */
2783 static double (*__pyx_f_5qutip_2cy_11interpolate_interp)(double, double, double, __Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/
2784 static __pyx_t_double_complex (*__pyx_f_5qutip_2cy_11interpolate_zinterp)(double, double, double, __Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/
2785 
2786 /* Module declarations from 'qutip.cy.sparse_structs' */
2787 
2788 /* Module declarations from 'qutip.cy.cqobjevo' */
2789 static PyTypeObject *__pyx_ptype_5qutip_2cy_8cqobjevo_CQobjEvo = 0;
2790 static PyTypeObject *__pyx_ptype_5qutip_2cy_8cqobjevo_CQobjCte = 0;
2791 static PyTypeObject *__pyx_ptype_5qutip_2cy_8cqobjevo_CQobjCteDense = 0;
2792 static PyTypeObject *__pyx_ptype_5qutip_2cy_8cqobjevo_CQobjEvoTd = 0;
2793 static PyTypeObject *__pyx_ptype_5qutip_2cy_8cqobjevo_CQobjEvoTdDense = 0;
2794 static PyTypeObject *__pyx_ptype_5qutip_2cy_8cqobjevo_CQobjEvoTdMatched = 0;
2795 
2796 /* Module declarations from 'qutip.cy.cqobjevo_factor' */
2797 static PyTypeObject *__pyx_ptype_5qutip_2cy_15cqobjevo_factor_CoeffFunc = 0;
2798 static PyTypeObject *__pyx_ptype_5qutip_2cy_15cqobjevo_factor_StrCoeff = 0;
2799 static PyTypeObject *__pyx_ptype_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff = 0;
2800 static PyTypeObject *__pyx_ptype_5qutip_2cy_15cqobjevo_factor_InterCoeffCte = 0;
2801 static PyTypeObject *__pyx_ptype_5qutip_2cy_15cqobjevo_factor_InterCoeffT = 0;
2802 static PyTypeObject *__pyx_ptype_5qutip_2cy_15cqobjevo_factor_StepCoeff = 0;
2803 static PyTypeObject *__pyx_ptype_5qutip_2cy_15cqobjevo_factor_StepCoeffT = 0;
2804 static PyTypeObject *__pyx_ptype_5qutip_2cy_15cqobjevo_factor_StepCoeffCte = 0;
2805 static PyTypeObject *__pyx_array_type = 0;
2806 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2807 static PyTypeObject *__pyx_memoryview_type = 0;
2808 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2809 static PyObject *generic = 0;
2810 static PyObject *strided = 0;
2811 static PyObject *indirect = 0;
2812 static PyObject *contiguous = 0;
2813 static PyObject *indirect_contiguous = 0;
2814 static int __pyx_memoryview_thread_locks_used;
2815 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2816 static PyObject *__pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_CoeffFunc__set_state(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *, PyObject *); /*proto*/
2817 static PyObject *__pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_InterpolateCoeff__set_state(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *, PyObject *); /*proto*/
2818 static PyObject *__pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_InterCoeffCte__set_state(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *, PyObject *); /*proto*/
2819 static PyObject *__pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_InterCoeffT__set_state(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *, PyObject *); /*proto*/
2820 static PyObject *__pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_StepCoeff__set_state(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff *, PyObject *); /*proto*/
2821 static PyObject *__pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_StepCoeffT__set_state(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffT *, PyObject *); /*proto*/
2822 static PyObject *__pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_StepCoeffCte__set_state(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffCte *, PyObject *); /*proto*/
2823 static PyObject *__pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_StrCoeff__set_state(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *, PyObject *); /*proto*/
2824 static CYTHON_INLINE PyObject *__Pyx_carray_to_py_int(int *, Py_ssize_t); /*proto*/
2825 static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_int(int *, Py_ssize_t); /*proto*/
2826 static int __Pyx_carray_from_py_int(PyObject *, int *, Py_ssize_t); /*proto*/
2827 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2828 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2829 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2830 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2831 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2832 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2833 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2834 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2835 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2836 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2837 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2838 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2839 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2840 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2841 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2842 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2843 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2844 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2845 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2846 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2847 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2848 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2849 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2850 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2851 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2852 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2853 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2854 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2855 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2856 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2857 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2858 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2859 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2860 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *); /*proto*/
2861 static __Pyx_TypeInfo __Pyx_TypeInfo___pyx_t_double_complex = { "double complex", NULL, sizeof(__pyx_t_double_complex), { 0 }, 0, 'C', 0, 0 };
2862 static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
2863 static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
2864 #define __Pyx_MODULE_NAME "qutip.cy.cqobjevo_factor"
2865 extern int __pyx_module_is_main_qutip__cy__cqobjevo_factor;
2866 int __pyx_module_is_main_qutip__cy__cqobjevo_factor = 0;
2867 
2868 /* Implementation of 'qutip.cy.cqobjevo_factor' */
2869 static PyObject *__pyx_builtin_range;
2870 static PyObject *__pyx_builtin_print;
2871 static PyObject *__pyx_builtin_ImportError;
2872 static PyObject *__pyx_builtin_TypeError;
2873 static PyObject *__pyx_builtin_OverflowError;
2874 static PyObject *__pyx_builtin_enumerate;
2875 static PyObject *__pyx_builtin_IndexError;
2876 static PyObject *__pyx_builtin_ValueError;
2877 static PyObject *__pyx_builtin_MemoryError;
2878 static PyObject *__pyx_builtin_Ellipsis;
2879 static PyObject *__pyx_builtin_id;
2880 static const char __pyx_k_F[] = "F";
2881 static const char __pyx_k_O[] = "O";
2882 static const char __pyx_k_T[] = "T{";
2883   static const char __pyx_k_a[] = "a";
2884   static const char __pyx_k_b[] = "b";
2885   static const char __pyx_k_c[] = "c";
2886   static const char __pyx_k_s[] = "(%s)";
2887   static const char __pyx_k_t[] = "t";
2888   static const char __pyx_k_id[] = "id";
2889   static const char __pyx_k_np[] = "np";
2890   static const char __pyx_k__27[] = "^";
2891   static const char __pyx_k__28[] = "";
2892   static const char __pyx_k__29[] = ":";
2893 static const char __pyx_k__30[] = "}";
2894 static const char __pyx_k__31[] = ",";
2895 static const char __pyx_k_mat[] = "mat";
2896 static const char __pyx_k_new[] = "__new__";
2897 static const char __pyx_k_obj[] = "obj";
2898 static const char __pyx_k_ops[] = "ops";
2899 static const char __pyx_k_vec[] = "vec";
2900 static const char __pyx_k_Qobj[] = "Qobj";
2901 static const char __pyx_k_args[] = "args";
2902 static const char __pyx_k_base[] = "base";
2903 static const char __pyx_k_copy[] = "copy";
2904 static const char __pyx_k_dict[] = "__dict__";
2905 static const char __pyx_k_full[] = "full";
2906 static const char __pyx_k_join[] = "join";
2907 static const char __pyx_k_main[] = "__main__";
2908 static const char __pyx_k_mode[] = "mode";
2909 static const char __pyx_k_name[] = "name";
2910 static const char __pyx_k_ndim[] = "ndim";
2911 static const char __pyx_k_pack[] = "pack";
2912 static const char __pyx_k_size[] = "size";
2913 static const char __pyx_k_step[] = "step";
2914 static const char __pyx_k_stop[] = "stop";
2915 static const char __pyx_k_test[] = "__test__";
2916 static const char __pyx_k_ASCII[] = "ASCII";
2917 static const char __pyx_k_array[] = "array";
2918 static const char __pyx_k_class[] = "__class__";
2919 static const char __pyx_k_dtype[] = "dtype";
2920 static const char __pyx_k_error[] = "error";
2921 static const char __pyx_k_flags[] = "flags";
2922 static const char __pyx_k_numpy[] = "numpy";
2923 static const char __pyx_k_print[] = "print";
2924 static const char __pyx_k_range[] = "range";
2925 static const char __pyx_k_ravel[] = "ravel";
2926 static const char __pyx_k_shape[] = "shape";
2927 static const char __pyx_k_start[] = "start";
2928 static const char __pyx_k_tlist[] = "tlist";
2929 static const char __pyx_k_zeros[] = "zeros";
2930 static const char __pyx_k_coeffs[] = "coeffs";
2931 static const char __pyx_k_encode[] = "encode";
2932 static const char __pyx_k_expect[] = "expect";
2933 static const char __pyx_k_format[] = "format";
2934 static const char __pyx_k_import[] = "__import__";
2935 static const char __pyx_k_name_2[] = "__name__";
2936 static const char __pyx_k_pickle[] = "pickle";
2937 static const char __pyx_k_reduce[] = "__reduce__";
2938 static const char __pyx_k_struct[] = "struct";
2939 static const char __pyx_k_unpack[] = "unpack";
2940 static const char __pyx_k_update[] = "update";
2941 static const char __pyx_k_fortran[] = "fortran";
2942 static const char __pyx_k_memview[] = "memview";
2943 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2944 static const char __pyx_k_StrCoeff[] = "StrCoeff";
2945 static const char __pyx_k_dyn_args[] = "dyn_args";
2946 static const char __pyx_k_getstate[] = "__getstate__";
2947 static const char __pyx_k_itemsize[] = "itemsize";
2948 static const char __pyx_k_pyx_type[] = "__pyx_type";
2949 static const char __pyx_k_set_args[] = "set_args";
2950 static const char __pyx_k_setstate[] = "__setstate__";
2951 static const char __pyx_k_CoeffFunc[] = "CoeffFunc";
2952 static const char __pyx_k_StepCoeff[] = "StepCoeff";
2953 static const char __pyx_k_TypeError[] = "TypeError";
2954 static const char __pyx_k_enumerate[] = "enumerate";
2955 static const char __pyx_k_pyx_state[] = "__pyx_state";
2956 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2957 static const char __pyx_k_IndexError[] = "IndexError";
2958 static const char __pyx_k_StepCoeffT[] = "StepCoeffT";
2959 static const char __pyx_k_ValueError[] = "ValueError";
2960 static const char __pyx_k_pyx_result[] = "__pyx_result";
2961 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2962 static const char __pyx_k_ImportError[] = "ImportError";
2963 static const char __pyx_k_InterCoeffT[] = "InterCoeffT";
2964 static const char __pyx_k_MemoryError[] = "MemoryError";
2965 static const char __pyx_k_PickleError[] = "PickleError";
2966 static const char __pyx_k_StepCoeffCte[] = "StepCoeffCte";
2967 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2968 static const char __pyx_k_set_dyn_args[] = "_set_dyn_args";
2969 static const char __pyx_k_stringsource[] = "stringsource";
2970 static const char __pyx_k_InterCoeffCte[] = "InterCoeffCte";
2971 static const char __pyx_k_OverflowError[] = "OverflowError";
2972 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2973 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2974 static const char __pyx_k_qutip_cy_inter[] = "qutip.cy.inter";
2975 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2976 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2977 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2978 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2979 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2980 static const char __pyx_k_InterpolateCoeff[] = "InterpolateCoeff";
2981 static const char __pyx_k_compiled_qobjevo[] = "compiled_qobjevo";
2982 static const char __pyx_k_prep_cubic_spline[] = "_prep_cubic_spline";
2983 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2984 static const char __pyx_k_tlist_not_uniform[] = "tlist not uniform?";
2985 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2986 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2987 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2988 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2989 static const char __pyx_k_pyx_unpickle_StrCoeff[] = "__pyx_unpickle_StrCoeff";
2990 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2991 static const char __pyx_k_pyx_unpickle_CoeffFunc[] = "__pyx_unpickle_CoeffFunc";
2992 static const char __pyx_k_pyx_unpickle_StepCoeff[] = "__pyx_unpickle_StepCoeff";
2993 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2994 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2995 static const char __pyx_k_pyx_unpickle_StepCoeffT[] = "__pyx_unpickle_StepCoeffT";
2996 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2997 static const char __pyx_k_pyx_unpickle_InterCoeffT[] = "__pyx_unpickle_InterCoeffT";
2998 static const char __pyx_k_qutip_cy_cqobjevo_factor[] = "qutip.cy.cqobjevo_factor";
2999 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
3000 static const char __pyx_k_pyx_unpickle_StepCoeffCte[] = "__pyx_unpickle_StepCoeffCte";
3001 static const char __pyx_k_pyx_unpickle_InterCoeffCte[] = "__pyx_unpickle_InterCoeffCte";
3002 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
3003 static const char __pyx_k_tlist_not_sampled_uniformly[] = "tlist not sampled uniformly";
3004 static const char __pyx_k_pyx_unpickle_InterpolateCoeff[] = "__pyx_unpickle_InterpolateCoeff";
3005 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
3006 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
3007 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
3008 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
3009 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
3010 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
3011 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
3012 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
3013 static const char __pyx_k_Incompatible_checksums_s_vs_0x77[] = "Incompatible checksums (%s vs 0x778091c = (_args, _num_ops, n_t, tlist, y))";
3014 static const char __pyx_k_Incompatible_checksums_s_vs_0x94[] = "Incompatible checksums (%s vs 0x94db4ad = (M, _args, _num_ops, dt, n_t, tlist, y))";
3015 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
3016 static const char __pyx_k_Incompatible_checksums_s_vs_0xc4[] = "Incompatible checksums (%s vs 0xc4a3121 = (_args, _num_ops))";
3017 static const char __pyx_k_Incompatible_checksums_s_vs_0xc6[] = "Incompatible checksums (%s vs 0xc6a92cd = (_args, _num_ops, a, b, c))";
3018 static const char __pyx_k_Incompatible_checksums_s_vs_0xea[] = "Incompatible checksums (%s vs 0xea1f18a = (_args, _dyn_args_list, _expect_op, _expect_vec, _mat_shape, _num_expect, _num_ops, _vec))";
3019 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
3020 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
3021 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
3022 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
3023 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
3024 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
3025 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
3026 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
3027 static PyObject *__pyx_n_s_ASCII;
3028 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
3029 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
3030 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
3031 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
3032 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
3033 static PyObject *__pyx_n_s_CoeffFunc;
3034 static PyObject *__pyx_n_s_Ellipsis;
3035 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
3036 static PyObject *__pyx_n_u_F;
3037 static PyObject *__pyx_n_s_ImportError;
3038 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x77;
3039 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x94;
3040 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
3041 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xc4;
3042 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xc6;
3043 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xea;
3044 static PyObject *__pyx_n_s_IndexError;
3045 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
3046 static PyObject *__pyx_n_s_InterCoeffCte;
3047 static PyObject *__pyx_n_s_InterCoeffT;
3048 static PyObject *__pyx_n_s_InterpolateCoeff;
3049 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
3050 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
3051 static PyObject *__pyx_n_s_MemoryError;
3052 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
3053 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
3054 static PyObject *__pyx_n_b_O;
3055 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
3056 static PyObject *__pyx_n_s_OverflowError;
3057 static PyObject *__pyx_n_s_PickleError;
3058 static PyObject *__pyx_n_u_Qobj;
3059 static PyObject *__pyx_n_s_StepCoeff;
3060 static PyObject *__pyx_n_s_StepCoeffCte;
3061 static PyObject *__pyx_n_s_StepCoeffT;
3062 static PyObject *__pyx_n_s_StrCoeff;
3063 static PyObject *__pyx_kp_b_T;
3064 static PyObject *__pyx_n_s_TypeError;
3065 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
3066 static PyObject *__pyx_n_s_ValueError;
3067 static PyObject *__pyx_n_s_View_MemoryView;
3068 static PyObject *__pyx_kp_b__27;
3069 static PyObject *__pyx_kp_b__28;
3070 static PyObject *__pyx_kp_b__29;
3071 static PyObject *__pyx_kp_b__30;
3072 static PyObject *__pyx_kp_u__31;
3073 static PyObject *__pyx_n_s_a;
3074 static PyObject *__pyx_n_s_allocate_buffer;
3075 static PyObject *__pyx_n_s_args;
3076 static PyObject *__pyx_n_s_array;
3077 static PyObject *__pyx_n_s_b;
3078 static PyObject *__pyx_n_s_base;
3079 static PyObject *__pyx_n_s_c;
3080 static PyObject *__pyx_n_u_c;
3081 static PyObject *__pyx_n_s_class;
3082 static PyObject *__pyx_n_s_cline_in_traceback;
3083 static PyObject *__pyx_n_s_coeffs;
3084 static PyObject *__pyx_n_s_compiled_qobjevo;
3085 static PyObject *__pyx_kp_s_contiguous_and_direct;
3086 static PyObject *__pyx_kp_s_contiguous_and_indirect;
3087 static PyObject *__pyx_n_s_copy;
3088 static PyObject *__pyx_n_s_dict;
3089 static PyObject *__pyx_n_s_dtype;
3090 static PyObject *__pyx_n_s_dtype_is_object;
3091 static PyObject *__pyx_n_s_dyn_args;
3092 static PyObject *__pyx_n_s_encode;
3093 static PyObject *__pyx_n_s_enumerate;
3094 static PyObject *__pyx_n_s_error;
3095 static PyObject *__pyx_n_u_expect;
3096 static PyObject *__pyx_n_s_flags;
3097 static PyObject *__pyx_n_s_format;
3098 static PyObject *__pyx_n_s_fortran;
3099 static PyObject *__pyx_n_u_fortran;
3100 static PyObject *__pyx_n_s_full;
3101 static PyObject *__pyx_n_s_getstate;
3102 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
3103 static PyObject *__pyx_n_s_id;
3104 static PyObject *__pyx_n_s_import;
3105 static PyObject *__pyx_n_s_itemsize;
3106 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
3107 static PyObject *__pyx_n_s_join;
3108 static PyObject *__pyx_n_s_main;
3109 static PyObject *__pyx_n_u_mat;
3110 static PyObject *__pyx_n_s_memview;
3111 static PyObject *__pyx_n_s_mode;
3112 static PyObject *__pyx_n_s_name;
3113 static PyObject *__pyx_n_s_name_2;
3114 static PyObject *__pyx_n_s_ndim;
3115 static PyObject *__pyx_n_s_new;
3116 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
3117 static PyObject *__pyx_n_s_np;
3118 static PyObject *__pyx_n_s_numpy;
3119 static PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to;
3120 static PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor;
3121 static PyObject *__pyx_n_s_obj;
3122 static PyObject *__pyx_n_s_ops;
3123 static PyObject *__pyx_n_s_pack;
3124 static PyObject *__pyx_n_s_pickle;
3125 static PyObject *__pyx_n_s_prep_cubic_spline;
3126 static PyObject *__pyx_n_s_print;
3127 static PyObject *__pyx_n_s_pyx_PickleError;
3128 static PyObject *__pyx_n_s_pyx_checksum;
3129 static PyObject *__pyx_n_s_pyx_getbuffer;
3130 static PyObject *__pyx_n_s_pyx_result;
3131 static PyObject *__pyx_n_s_pyx_state;
3132 static PyObject *__pyx_n_s_pyx_type;
3133 static PyObject *__pyx_n_s_pyx_unpickle_CoeffFunc;
3134 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
3135 static PyObject *__pyx_n_s_pyx_unpickle_InterCoeffCte;
3136 static PyObject *__pyx_n_s_pyx_unpickle_InterCoeffT;
3137 static PyObject *__pyx_n_s_pyx_unpickle_InterpolateCoeff;
3138 static PyObject *__pyx_n_s_pyx_unpickle_StepCoeff;
3139 static PyObject *__pyx_n_s_pyx_unpickle_StepCoeffCte;
3140 static PyObject *__pyx_n_s_pyx_unpickle_StepCoeffT;
3141 static PyObject *__pyx_n_s_pyx_unpickle_StrCoeff;
3142 static PyObject *__pyx_n_s_pyx_vtable;
3143 static PyObject *__pyx_n_s_qutip_cy_cqobjevo_factor;
3144 static PyObject *__pyx_n_s_qutip_cy_inter;
3145 static PyObject *__pyx_n_s_range;
3146 static PyObject *__pyx_n_s_ravel;
3147 static PyObject *__pyx_n_s_reduce;
3148 static PyObject *__pyx_n_s_reduce_cython;
3149 static PyObject *__pyx_n_s_reduce_ex;
3150 static PyObject *__pyx_kp_u_s;
3151 static PyObject *__pyx_n_s_set_args;
3152 static PyObject *__pyx_n_s_set_dyn_args;
3153 static PyObject *__pyx_n_s_setstate;
3154 static PyObject *__pyx_n_s_setstate_cython;
3155 static PyObject *__pyx_n_s_shape;
3156 static PyObject *__pyx_n_s_size;
3157 static PyObject *__pyx_n_s_start;
3158 static PyObject *__pyx_n_s_step;
3159 static PyObject *__pyx_n_s_stop;
3160 static PyObject *__pyx_kp_s_strided_and_direct;
3161 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
3162 static PyObject *__pyx_kp_s_strided_and_indirect;
3163 static PyObject *__pyx_kp_s_stringsource;
3164 static PyObject *__pyx_n_s_struct;
3165 static PyObject *__pyx_n_s_t;
3166 static PyObject *__pyx_n_s_test;
3167 static PyObject *__pyx_n_s_tlist;
3168 static PyObject *__pyx_kp_u_tlist_not_sampled_uniformly;
3169 static PyObject *__pyx_kp_u_tlist_not_uniform;
3170 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
3171 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
3172 static PyObject *__pyx_n_s_unpack;
3173 static PyObject *__pyx_n_s_update;
3174 static PyObject *__pyx_n_s_vec;
3175 static PyObject *__pyx_n_u_vec;
3176 static PyObject *__pyx_n_s_zeros;
3177 static int __pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc___init__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_ops, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_tlist); /* proto */
3178 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_2__call__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *__pyx_v_self, double __pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_args); /* proto */
3179 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_4set_args(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args); /* proto */
3180 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_6__getstate__(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *__pyx_v_self); /* proto */
3181 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_8__setstate__(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_state); /* proto */
3182 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_10get_args(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *__pyx_v_self); /* proto */
3183 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_12__reduce_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *__pyx_v_self); /* proto */
3184 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_14__setstate_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3185 static int __pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff___init__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *__pyx_v_self, PyObject *__pyx_v_ops, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_tlist); /* proto */
3186 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_2__call__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *__pyx_v_self, PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_args); /* proto */
3187 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_4set_args(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args); /* proto */
3188 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_6__getstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *__pyx_v_self); /* proto */
3189 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_8__setstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
3190 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_10__reduce_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *__pyx_v_self); /* proto */
3191 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_12__setstate_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3192 static int __pyx_pf_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte___init__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *__pyx_v_self, PyObject *__pyx_v_ops, CYTHON_UNUSED PyObject *__pyx_v_args, PyObject *__pyx_v_tlist); /* proto */
3193 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_2set_args(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args); /* proto */
3194 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_4__getstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *__pyx_v_self); /* proto */
3195 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_6__setstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
3196 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_8__reduce_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *__pyx_v_self); /* proto */
3197 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_10__setstate_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3198 static int __pyx_pf_5qutip_2cy_15cqobjevo_factor_11InterCoeffT___init__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *__pyx_v_self, PyObject *__pyx_v_ops, CYTHON_UNUSED PyObject *__pyx_v_args, PyObject *__pyx_v_tlist); /* proto */
3199 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_2set_args(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args); /* proto */
3200 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_4__getstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *__pyx_v_self); /* proto */
3201 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_6__setstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
3202 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_8__reduce_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *__pyx_v_self); /* proto */
3203 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_10__setstate_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3204 static int __pyx_pf_5qutip_2cy_15cqobjevo_factor_9StepCoeff___init__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff *__pyx_v_self, PyObject *__pyx_v_ops, CYTHON_UNUSED PyObject *__pyx_v_args, PyObject *__pyx_v_tlist); /* proto */
3205 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_9StepCoeff_2set_arg(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args); /* proto */
3206 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_9StepCoeff_4__getstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff *__pyx_v_self); /* proto */
3207 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_9StepCoeff_6__setstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
3208 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_9StepCoeff_8__reduce_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff *__pyx_v_self); /* proto */
3209 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_9StepCoeff_10__setstate_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3210 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_10StepCoeffT___reduce_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffT *__pyx_v_self); /* proto */
3211 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_10StepCoeffT_2__setstate_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffT *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3212 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_12StepCoeffCte___reduce_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffCte *__pyx_v_self); /* proto */
3213 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_12StepCoeffCte_2__setstate_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffCte *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3214 static int __pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff___init__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *__pyx_v_self, PyObject *__pyx_v_ops, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_tlist, PyObject *__pyx_v_dyn_args); /* proto */
3215 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff_2_set_dyn_args(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *__pyx_v_self, PyObject *__pyx_v_dyn_args); /* proto */
3216 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff_4__call__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *__pyx_v_self, double __pyx_v_t, PyObject *__pyx_v_args, PyObject *__pyx_v_vec); /* proto */
3217 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff_6__getstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *__pyx_v_self); /* proto */
3218 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff_8__setstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
3219 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff_10__reduce_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *__pyx_v_self); /* proto */
3220 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff_12__setstate_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3221 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_CoeffFunc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
3222 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_2__pyx_unpickle_InterpolateCoeff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
3223 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_4__pyx_unpickle_InterCoeffCte(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
3224 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_6__pyx_unpickle_InterCoeffT(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
3225 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_8__pyx_unpickle_StepCoeff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
3226 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_10__pyx_unpickle_StepCoeffT(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
3227 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_12__pyx_unpickle_StepCoeffCte(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
3228 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_14__pyx_unpickle_StrCoeff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
3229 static 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 */
3230 static 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 */
3231 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3232 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3233 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3234 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
3235 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
3236 static 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 */
3237 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
3238 static 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 */
3239 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
3240 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3241 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3242 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3243 static 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 */
3244 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3245 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
3246 static 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 */
3247 static 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 */
3248 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3249 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3250 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3251 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3252 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3253 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3254 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3255 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3256 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3257 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3258 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3259 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3260 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3261 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3262 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3263 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3264 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3265 static 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 */
3266 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3267 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3268 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3269 static 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 */
3270 static 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 */
3271 static PyObject *__pyx_tp_new_5qutip_2cy_15cqobjevo_factor_CoeffFunc(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3272 static PyObject *__pyx_tp_new_5qutip_2cy_15cqobjevo_factor_StrCoeff(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3273 static PyObject *__pyx_tp_new_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3274 static PyObject *__pyx_tp_new_5qutip_2cy_15cqobjevo_factor_InterCoeffCte(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3275 static PyObject *__pyx_tp_new_5qutip_2cy_15cqobjevo_factor_InterCoeffT(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3276 static PyObject *__pyx_tp_new_5qutip_2cy_15cqobjevo_factor_StepCoeff(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3277 static PyObject *__pyx_tp_new_5qutip_2cy_15cqobjevo_factor_StepCoeffT(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3278 static PyObject *__pyx_tp_new_5qutip_2cy_15cqobjevo_factor_StepCoeffCte(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3279 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3280 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3281 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3282 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3283 static PyObject *__pyx_int_0;
3284 static PyObject *__pyx_int_1;
3285 static PyObject *__pyx_int_125307164;
3286 static PyObject *__pyx_int_156087469;
3287 static PyObject *__pyx_int_184977713;
3288 static PyObject *__pyx_int_206188833;
3289 static PyObject *__pyx_int_208310989;
3290 static PyObject *__pyx_int_245494154;
3291 static PyObject *__pyx_int_neg_1;
3292 static PyObject *__pyx_k_;
3293 static PyObject *__pyx_k__2;
3294 static PyObject *__pyx_k__5;
3295 static PyObject *__pyx_k__6;
3296 static PyObject *__pyx_tuple__3;
3297 static PyObject *__pyx_tuple__4;
3298 static PyObject *__pyx_tuple__7;
3299 static PyObject *__pyx_tuple__8;
3300 static PyObject *__pyx_tuple__9;
3301 static PyObject *__pyx_slice__23;
3302 static PyObject *__pyx_tuple__10;
3303 static PyObject *__pyx_tuple__11;
3304 static PyObject *__pyx_tuple__12;
3305 static PyObject *__pyx_tuple__13;
3306 static PyObject *__pyx_tuple__14;
3307 static PyObject *__pyx_tuple__15;
3308 static PyObject *__pyx_tuple__16;
3309 static PyObject *__pyx_tuple__17;
3310 static PyObject *__pyx_tuple__18;
3311 static PyObject *__pyx_tuple__19;
3312 static PyObject *__pyx_tuple__20;
3313 static PyObject *__pyx_tuple__21;
3314 static PyObject *__pyx_tuple__22;
3315 static PyObject *__pyx_tuple__24;
3316 static PyObject *__pyx_tuple__25;
3317 static PyObject *__pyx_tuple__26;
3318 static PyObject *__pyx_tuple__32;
3319 static PyObject *__pyx_tuple__34;
3320 static PyObject *__pyx_tuple__36;
3321 static PyObject *__pyx_tuple__38;
3322 static PyObject *__pyx_tuple__40;
3323 static PyObject *__pyx_tuple__42;
3324 static PyObject *__pyx_tuple__44;
3325 static PyObject *__pyx_tuple__46;
3326 static PyObject *__pyx_tuple__48;
3327 static PyObject *__pyx_tuple__49;
3328 static PyObject *__pyx_tuple__50;
3329 static PyObject *__pyx_tuple__51;
3330 static PyObject *__pyx_tuple__52;
3331 static PyObject *__pyx_tuple__53;
3332 static PyObject *__pyx_codeobj__33;
3333 static PyObject *__pyx_codeobj__35;
3334 static PyObject *__pyx_codeobj__37;
3335 static PyObject *__pyx_codeobj__39;
3336 static PyObject *__pyx_codeobj__41;
3337 static PyObject *__pyx_codeobj__43;
3338 static PyObject *__pyx_codeobj__45;
3339 static PyObject *__pyx_codeobj__47;
3340 static PyObject *__pyx_codeobj__54;
3341 /* Late includes */
3342 
3343 /* "qutip/cy/cqobjevo_factor.pyx":55
3344  * """
3345  *
3346  * cdef np.ndarray[complex, ndim=1] zptr2array1d(complex* ptr, int N):             # <<<<<<<<<<<<<<
3347  *     cdef np.npy_intp Ns[1]
3348  *     Ns[0] = N
3349  */
3350 
__pyx_f_5qutip_2cy_15cqobjevo_factor_zptr2array1d(__pyx_t_double_complex * __pyx_v_ptr,int __pyx_v_N)3351 static PyArrayObject *__pyx_f_5qutip_2cy_15cqobjevo_factor_zptr2array1d(__pyx_t_double_complex *__pyx_v_ptr, int __pyx_v_N) {
3352   npy_intp __pyx_v_Ns[1];
3353   PyArrayObject *__pyx_r = NULL;
3354   __Pyx_RefNannyDeclarations
3355   PyObject *__pyx_t_1 = NULL;
3356   int __pyx_lineno = 0;
3357   const char *__pyx_filename = NULL;
3358   int __pyx_clineno = 0;
3359   __Pyx_RefNannySetupContext("zptr2array1d", 0);
3360 
3361   /* "qutip/cy/cqobjevo_factor.pyx":57
3362  * cdef np.ndarray[complex, ndim=1] zptr2array1d(complex* ptr, int N):
3363  *     cdef np.npy_intp Ns[1]
3364  *     Ns[0] = N             # <<<<<<<<<<<<<<
3365  *     return np.PyArray_SimpleNewFromData(1, Ns, np.NPY_COMPLEX128, ptr)
3366  *
3367  */
3368   (__pyx_v_Ns[0]) = __pyx_v_N;
3369 
3370   /* "qutip/cy/cqobjevo_factor.pyx":58
3371  *     cdef np.npy_intp Ns[1]
3372  *     Ns[0] = N
3373  *     return np.PyArray_SimpleNewFromData(1, Ns, np.NPY_COMPLEX128, ptr)             # <<<<<<<<<<<<<<
3374  *
3375  * cdef np.ndarray[complex, ndim=2] zptr2array2d(complex* ptr, int R, int C):
3376  */
3377   __Pyx_XDECREF(((PyObject *)__pyx_r));
3378   __pyx_t_1 = PyArray_SimpleNewFromData(1, __pyx_v_Ns, NPY_COMPLEX128, __pyx_v_ptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error)
3379   __Pyx_GOTREF(__pyx_t_1);
3380   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 58, __pyx_L1_error)
3381   __pyx_r = ((PyArrayObject *)__pyx_t_1);
3382   __pyx_t_1 = 0;
3383   goto __pyx_L0;
3384 
3385   /* "qutip/cy/cqobjevo_factor.pyx":55
3386  * """
3387  *
3388  * cdef np.ndarray[complex, ndim=1] zptr2array1d(complex* ptr, int N):             # <<<<<<<<<<<<<<
3389  *     cdef np.npy_intp Ns[1]
3390  *     Ns[0] = N
3391  */
3392 
3393   /* function exit code */
3394   __pyx_L1_error:;
3395   __Pyx_XDECREF(__pyx_t_1);
3396   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.zptr2array1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
3397   __pyx_r = 0;
3398   __pyx_L0:;
3399   __Pyx_XGIVEREF((PyObject *)__pyx_r);
3400   __Pyx_RefNannyFinishContext();
3401   return __pyx_r;
3402 }
3403 
3404 /* "qutip/cy/cqobjevo_factor.pyx":60
3405  *     return np.PyArray_SimpleNewFromData(1, Ns, np.NPY_COMPLEX128, ptr)
3406  *
3407  * cdef np.ndarray[complex, ndim=2] zptr2array2d(complex* ptr, int R, int C):             # <<<<<<<<<<<<<<
3408  *     cdef np.npy_intp Ns[2]
3409  *     Ns[0] = R
3410  */
3411 
__pyx_f_5qutip_2cy_15cqobjevo_factor_zptr2array2d(__pyx_t_double_complex * __pyx_v_ptr,int __pyx_v_R,int __pyx_v_C)3412 static PyArrayObject *__pyx_f_5qutip_2cy_15cqobjevo_factor_zptr2array2d(__pyx_t_double_complex *__pyx_v_ptr, int __pyx_v_R, int __pyx_v_C) {
3413   npy_intp __pyx_v_Ns[2];
3414   PyArrayObject *__pyx_r = NULL;
3415   __Pyx_RefNannyDeclarations
3416   PyObject *__pyx_t_1 = NULL;
3417   int __pyx_lineno = 0;
3418   const char *__pyx_filename = NULL;
3419   int __pyx_clineno = 0;
3420   __Pyx_RefNannySetupContext("zptr2array2d", 0);
3421 
3422   /* "qutip/cy/cqobjevo_factor.pyx":62
3423  * cdef np.ndarray[complex, ndim=2] zptr2array2d(complex* ptr, int R, int C):
3424  *     cdef np.npy_intp Ns[2]
3425  *     Ns[0] = R             # <<<<<<<<<<<<<<
3426  *     Ns[1] = C
3427  *     return np.PyArray_SimpleNewFromData(2, Ns, np.NPY_COMPLEX128, ptr)
3428  */
3429   (__pyx_v_Ns[0]) = __pyx_v_R;
3430 
3431   /* "qutip/cy/cqobjevo_factor.pyx":63
3432  *     cdef np.npy_intp Ns[2]
3433  *     Ns[0] = R
3434  *     Ns[1] = C             # <<<<<<<<<<<<<<
3435  *     return np.PyArray_SimpleNewFromData(2, Ns, np.NPY_COMPLEX128, ptr)
3436  *
3437  */
3438   (__pyx_v_Ns[1]) = __pyx_v_C;
3439 
3440   /* "qutip/cy/cqobjevo_factor.pyx":64
3441  *     Ns[0] = R
3442  *     Ns[1] = C
3443  *     return np.PyArray_SimpleNewFromData(2, Ns, np.NPY_COMPLEX128, ptr)             # <<<<<<<<<<<<<<
3444  *
3445  * cdef np.ndarray[int, ndim=1] iprt2array(int* ptr, int N):
3446  */
3447   __Pyx_XDECREF(((PyObject *)__pyx_r));
3448   __pyx_t_1 = PyArray_SimpleNewFromData(2, __pyx_v_Ns, NPY_COMPLEX128, __pyx_v_ptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
3449   __Pyx_GOTREF(__pyx_t_1);
3450   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 64, __pyx_L1_error)
3451   __pyx_r = ((PyArrayObject *)__pyx_t_1);
3452   __pyx_t_1 = 0;
3453   goto __pyx_L0;
3454 
3455   /* "qutip/cy/cqobjevo_factor.pyx":60
3456  *     return np.PyArray_SimpleNewFromData(1, Ns, np.NPY_COMPLEX128, ptr)
3457  *
3458  * cdef np.ndarray[complex, ndim=2] zptr2array2d(complex* ptr, int R, int C):             # <<<<<<<<<<<<<<
3459  *     cdef np.npy_intp Ns[2]
3460  *     Ns[0] = R
3461  */
3462 
3463   /* function exit code */
3464   __pyx_L1_error:;
3465   __Pyx_XDECREF(__pyx_t_1);
3466   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.zptr2array2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
3467   __pyx_r = 0;
3468   __pyx_L0:;
3469   __Pyx_XGIVEREF((PyObject *)__pyx_r);
3470   __Pyx_RefNannyFinishContext();
3471   return __pyx_r;
3472 }
3473 
3474 /* "qutip/cy/cqobjevo_factor.pyx":66
3475  *     return np.PyArray_SimpleNewFromData(2, Ns, np.NPY_COMPLEX128, ptr)
3476  *
3477  * cdef np.ndarray[int, ndim=1] iprt2array(int* ptr, int N):             # <<<<<<<<<<<<<<
3478  *     cdef np.npy_intp Ns[1]
3479  *     Ns[0] = N
3480  */
3481 
__pyx_f_5qutip_2cy_15cqobjevo_factor_iprt2array(int * __pyx_v_ptr,int __pyx_v_N)3482 static PyArrayObject *__pyx_f_5qutip_2cy_15cqobjevo_factor_iprt2array(int *__pyx_v_ptr, int __pyx_v_N) {
3483   npy_intp __pyx_v_Ns[1];
3484   PyArrayObject *__pyx_r = NULL;
3485   __Pyx_RefNannyDeclarations
3486   PyObject *__pyx_t_1 = NULL;
3487   int __pyx_lineno = 0;
3488   const char *__pyx_filename = NULL;
3489   int __pyx_clineno = 0;
3490   __Pyx_RefNannySetupContext("iprt2array", 0);
3491 
3492   /* "qutip/cy/cqobjevo_factor.pyx":68
3493  * cdef np.ndarray[int, ndim=1] iprt2array(int* ptr, int N):
3494  *     cdef np.npy_intp Ns[1]
3495  *     Ns[0] = N             # <<<<<<<<<<<<<<
3496  *     return np.PyArray_SimpleNewFromData(1, Ns, np.NPY_INT32, ptr)
3497  *
3498  */
3499   (__pyx_v_Ns[0]) = __pyx_v_N;
3500 
3501   /* "qutip/cy/cqobjevo_factor.pyx":69
3502  *     cdef np.npy_intp Ns[1]
3503  *     Ns[0] = N
3504  *     return np.PyArray_SimpleNewFromData(1, Ns, np.NPY_INT32, ptr)             # <<<<<<<<<<<<<<
3505  *
3506  * cdef class CoeffFunc:
3507  */
3508   __Pyx_XDECREF(((PyObject *)__pyx_r));
3509   __pyx_t_1 = PyArray_SimpleNewFromData(1, __pyx_v_Ns, NPY_INT32, __pyx_v_ptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
3510   __Pyx_GOTREF(__pyx_t_1);
3511   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 69, __pyx_L1_error)
3512   __pyx_r = ((PyArrayObject *)__pyx_t_1);
3513   __pyx_t_1 = 0;
3514   goto __pyx_L0;
3515 
3516   /* "qutip/cy/cqobjevo_factor.pyx":66
3517  *     return np.PyArray_SimpleNewFromData(2, Ns, np.NPY_COMPLEX128, ptr)
3518  *
3519  * cdef np.ndarray[int, ndim=1] iprt2array(int* ptr, int N):             # <<<<<<<<<<<<<<
3520  *     cdef np.npy_intp Ns[1]
3521  *     Ns[0] = N
3522  */
3523 
3524   /* function exit code */
3525   __pyx_L1_error:;
3526   __Pyx_XDECREF(__pyx_t_1);
3527   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.iprt2array", __pyx_clineno, __pyx_lineno, __pyx_filename);
3528   __pyx_r = 0;
3529   __pyx_L0:;
3530   __Pyx_XGIVEREF((PyObject *)__pyx_r);
3531   __Pyx_RefNannyFinishContext();
3532   return __pyx_r;
3533 }
3534 
3535 /* "qutip/cy/cqobjevo_factor.pyx":72
3536  *
3537  * cdef class CoeffFunc:
3538  *     def __init__(self, ops, args, tlist):             # <<<<<<<<<<<<<<
3539  *         self._args = {}
3540  *
3541  */
3542 
3543 /* Python wrapper */
3544 static int __pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3545 static int __pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3546   CYTHON_UNUSED PyObject *__pyx_v_ops = 0;
3547   CYTHON_UNUSED PyObject *__pyx_v_args = 0;
3548   CYTHON_UNUSED PyObject *__pyx_v_tlist = 0;
3549   int __pyx_lineno = 0;
3550   const char *__pyx_filename = NULL;
3551   int __pyx_clineno = 0;
3552   int __pyx_r;
3553   __Pyx_RefNannyDeclarations
3554   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
3555   {
3556     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ops,&__pyx_n_s_args,&__pyx_n_s_tlist,0};
3557     PyObject* values[3] = {0,0,0};
3558     if (unlikely(__pyx_kwds)) {
3559       Py_ssize_t kw_args;
3560       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3561       switch (pos_args) {
3562         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3563         CYTHON_FALLTHROUGH;
3564         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3565         CYTHON_FALLTHROUGH;
3566         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3567         CYTHON_FALLTHROUGH;
3568         case  0: break;
3569         default: goto __pyx_L5_argtuple_error;
3570       }
3571       kw_args = PyDict_Size(__pyx_kwds);
3572       switch (pos_args) {
3573         case  0:
3574         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ops)) != 0)) kw_args--;
3575         else goto __pyx_L5_argtuple_error;
3576         CYTHON_FALLTHROUGH;
3577         case  1:
3578         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
3579         else {
3580           __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 72, __pyx_L3_error)
3581         }
3582         CYTHON_FALLTHROUGH;
3583         case  2:
3584         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tlist)) != 0)) kw_args--;
3585         else {
3586           __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 72, __pyx_L3_error)
3587         }
3588       }
3589       if (unlikely(kw_args > 0)) {
3590         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 72, __pyx_L3_error)
3591       }
3592     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3593       goto __pyx_L5_argtuple_error;
3594     } else {
3595       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3596       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3597       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3598     }
3599     __pyx_v_ops = values[0];
3600     __pyx_v_args = values[1];
3601     __pyx_v_tlist = values[2];
3602   }
3603   goto __pyx_L4_argument_unpacking_done;
3604   __pyx_L5_argtuple_error:;
3605   __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 72, __pyx_L3_error)
3606   __pyx_L3_error:;
3607   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.CoeffFunc.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3608   __Pyx_RefNannyFinishContext();
3609   return -1;
3610   __pyx_L4_argument_unpacking_done:;
3611   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc___init__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *)__pyx_v_self), __pyx_v_ops, __pyx_v_args, __pyx_v_tlist);
3612 
3613   /* function exit code */
3614   __Pyx_RefNannyFinishContext();
3615   return __pyx_r;
3616 }
3617 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc___init__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v_ops,CYTHON_UNUSED PyObject * __pyx_v_args,CYTHON_UNUSED PyObject * __pyx_v_tlist)3618 static int __pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc___init__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_ops, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_tlist) {
3619   int __pyx_r;
3620   __Pyx_RefNannyDeclarations
3621   PyObject *__pyx_t_1 = NULL;
3622   int __pyx_lineno = 0;
3623   const char *__pyx_filename = NULL;
3624   int __pyx_clineno = 0;
3625   __Pyx_RefNannySetupContext("__init__", 0);
3626 
3627   /* "qutip/cy/cqobjevo_factor.pyx":73
3628  * cdef class CoeffFunc:
3629  *     def __init__(self, ops, args, tlist):
3630  *         self._args = {}             # <<<<<<<<<<<<<<
3631  *
3632  *     def __call__(self, double t, args={}):
3633  */
3634   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
3635   __Pyx_GOTREF(__pyx_t_1);
3636   __Pyx_GIVEREF(__pyx_t_1);
3637   __Pyx_GOTREF(__pyx_v_self->_args);
3638   __Pyx_DECREF(__pyx_v_self->_args);
3639   __pyx_v_self->_args = ((PyObject*)__pyx_t_1);
3640   __pyx_t_1 = 0;
3641 
3642   /* "qutip/cy/cqobjevo_factor.pyx":72
3643  *
3644  * cdef class CoeffFunc:
3645  *     def __init__(self, ops, args, tlist):             # <<<<<<<<<<<<<<
3646  *         self._args = {}
3647  *
3648  */
3649 
3650   /* function exit code */
3651   __pyx_r = 0;
3652   goto __pyx_L0;
3653   __pyx_L1_error:;
3654   __Pyx_XDECREF(__pyx_t_1);
3655   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.CoeffFunc.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3656   __pyx_r = -1;
3657   __pyx_L0:;
3658   __Pyx_RefNannyFinishContext();
3659   return __pyx_r;
3660 }
3661 
3662 /* "qutip/cy/cqobjevo_factor.pyx":75
3663  *         self._args = {}
3664  *
3665  *     def __call__(self, double t, args={}):             # <<<<<<<<<<<<<<
3666  *         cdef np.ndarray[ndim=1, dtype=complex] coeff = \
3667  *                                             np.zeros(self._num_ops, dtype=complex)
3668  */
3669 
3670 /* Python wrapper */
3671 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_3__call__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3672 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3673   double __pyx_v_t;
3674   CYTHON_UNUSED PyObject *__pyx_v_args = 0;
3675   int __pyx_lineno = 0;
3676   const char *__pyx_filename = NULL;
3677   int __pyx_clineno = 0;
3678   PyObject *__pyx_r = 0;
3679   __Pyx_RefNannyDeclarations
3680   __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
3681   {
3682     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_args,0};
3683     PyObject* values[2] = {0,0};
3684     values[1] = __pyx_k_;
3685     if (unlikely(__pyx_kwds)) {
3686       Py_ssize_t kw_args;
3687       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3688       switch (pos_args) {
3689         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3690         CYTHON_FALLTHROUGH;
3691         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3692         CYTHON_FALLTHROUGH;
3693         case  0: break;
3694         default: goto __pyx_L5_argtuple_error;
3695       }
3696       kw_args = PyDict_Size(__pyx_kwds);
3697       switch (pos_args) {
3698         case  0:
3699         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
3700         else goto __pyx_L5_argtuple_error;
3701         CYTHON_FALLTHROUGH;
3702         case  1:
3703         if (kw_args > 0) {
3704           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
3705           if (value) { values[1] = value; kw_args--; }
3706         }
3707       }
3708       if (unlikely(kw_args > 0)) {
3709         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 75, __pyx_L3_error)
3710       }
3711     } else {
3712       switch (PyTuple_GET_SIZE(__pyx_args)) {
3713         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3714         CYTHON_FALLTHROUGH;
3715         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3716         break;
3717         default: goto __pyx_L5_argtuple_error;
3718       }
3719     }
3720     __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L3_error)
3721     __pyx_v_args = values[1];
3722   }
3723   goto __pyx_L4_argument_unpacking_done;
3724   __pyx_L5_argtuple_error:;
3725   __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 75, __pyx_L3_error)
3726   __pyx_L3_error:;
3727   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.CoeffFunc.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3728   __Pyx_RefNannyFinishContext();
3729   return NULL;
3730   __pyx_L4_argument_unpacking_done:;
3731   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_2__call__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *)__pyx_v_self), __pyx_v_t, __pyx_v_args);
3732 
3733   /* function exit code */
3734   __Pyx_RefNannyFinishContext();
3735   return __pyx_r;
3736 }
3737 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_2__call__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc * __pyx_v_self,double __pyx_v_t,CYTHON_UNUSED PyObject * __pyx_v_args)3738 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_2__call__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *__pyx_v_self, double __pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_args) {
3739   PyArrayObject *__pyx_v_coeff = 0;
3740   __Pyx_LocalBuf_ND __pyx_pybuffernd_coeff;
3741   __Pyx_Buffer __pyx_pybuffer_coeff;
3742   PyObject *__pyx_r = NULL;
3743   __Pyx_RefNannyDeclarations
3744   PyObject *__pyx_t_1 = NULL;
3745   PyObject *__pyx_t_2 = NULL;
3746   PyObject *__pyx_t_3 = NULL;
3747   PyObject *__pyx_t_4 = NULL;
3748   PyArrayObject *__pyx_t_5 = NULL;
3749   Py_ssize_t __pyx_t_6;
3750   int __pyx_t_7;
3751   int __pyx_lineno = 0;
3752   const char *__pyx_filename = NULL;
3753   int __pyx_clineno = 0;
3754   __Pyx_RefNannySetupContext("__call__", 0);
3755   __pyx_pybuffer_coeff.pybuffer.buf = NULL;
3756   __pyx_pybuffer_coeff.refcount = 0;
3757   __pyx_pybuffernd_coeff.data = NULL;
3758   __pyx_pybuffernd_coeff.rcbuffer = &__pyx_pybuffer_coeff;
3759 
3760   /* "qutip/cy/cqobjevo_factor.pyx":77
3761  *     def __call__(self, double t, args={}):
3762  *         cdef np.ndarray[ndim=1, dtype=complex] coeff = \
3763  *                                             np.zeros(self._num_ops, dtype=complex)             # <<<<<<<<<<<<<<
3764  *         self._call_core(t, &coeff[0])
3765  *         return coeff
3766  */
3767   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
3768   __Pyx_GOTREF(__pyx_t_1);
3769   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error)
3770   __Pyx_GOTREF(__pyx_t_2);
3771   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3772   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_num_ops); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
3773   __Pyx_GOTREF(__pyx_t_1);
3774   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error)
3775   __Pyx_GOTREF(__pyx_t_3);
3776   __Pyx_GIVEREF(__pyx_t_1);
3777   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
3778   __pyx_t_1 = 0;
3779   __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
3780   __Pyx_GOTREF(__pyx_t_1);
3781   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)(&PyComplex_Type))) < 0) __PYX_ERR(0, 77, __pyx_L1_error)
3782   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error)
3783   __Pyx_GOTREF(__pyx_t_4);
3784   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3785   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3786   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3787   if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 77, __pyx_L1_error)
3788   __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
3789   {
3790     __Pyx_BufFmt_StackElem __pyx_stack[1];
3791     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_coeff.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
3792       __pyx_v_coeff = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_coeff.rcbuffer->pybuffer.buf = NULL;
3793       __PYX_ERR(0, 76, __pyx_L1_error)
3794     } else {__pyx_pybuffernd_coeff.diminfo[0].strides = __pyx_pybuffernd_coeff.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_coeff.diminfo[0].shape = __pyx_pybuffernd_coeff.rcbuffer->pybuffer.shape[0];
3795     }
3796   }
3797   __pyx_t_5 = 0;
3798   __pyx_v_coeff = ((PyArrayObject *)__pyx_t_4);
3799   __pyx_t_4 = 0;
3800 
3801   /* "qutip/cy/cqobjevo_factor.pyx":78
3802  *         cdef np.ndarray[ndim=1, dtype=complex] coeff = \
3803  *                                             np.zeros(self._num_ops, dtype=complex)
3804  *         self._call_core(t, &coeff[0])             # <<<<<<<<<<<<<<
3805  *         return coeff
3806  *
3807  */
3808   __pyx_t_6 = 0;
3809   __pyx_t_7 = -1;
3810   if (__pyx_t_6 < 0) {
3811     __pyx_t_6 += __pyx_pybuffernd_coeff.diminfo[0].shape;
3812     if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0;
3813   } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_coeff.diminfo[0].shape)) __pyx_t_7 = 0;
3814   if (unlikely(__pyx_t_7 != -1)) {
3815     __Pyx_RaiseBufferIndexError(__pyx_t_7);
3816     __PYX_ERR(0, 78, __pyx_L1_error)
3817   }
3818   ((struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_CoeffFunc *)__pyx_v_self->__pyx_vtab)->_call_core(__pyx_v_self, __pyx_v_t, (&(*__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_coeff.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_coeff.diminfo[0].strides))));
3819 
3820   /* "qutip/cy/cqobjevo_factor.pyx":79
3821  *                                             np.zeros(self._num_ops, dtype=complex)
3822  *         self._call_core(t, &coeff[0])
3823  *         return coeff             # <<<<<<<<<<<<<<
3824  *
3825  *     def set_args(self, args):
3826  */
3827   __Pyx_XDECREF(__pyx_r);
3828   __Pyx_INCREF(((PyObject *)__pyx_v_coeff));
3829   __pyx_r = ((PyObject *)__pyx_v_coeff);
3830   goto __pyx_L0;
3831 
3832   /* "qutip/cy/cqobjevo_factor.pyx":75
3833  *         self._args = {}
3834  *
3835  *     def __call__(self, double t, args={}):             # <<<<<<<<<<<<<<
3836  *         cdef np.ndarray[ndim=1, dtype=complex] coeff = \
3837  *                                             np.zeros(self._num_ops, dtype=complex)
3838  */
3839 
3840   /* function exit code */
3841   __pyx_L1_error:;
3842   __Pyx_XDECREF(__pyx_t_1);
3843   __Pyx_XDECREF(__pyx_t_2);
3844   __Pyx_XDECREF(__pyx_t_3);
3845   __Pyx_XDECREF(__pyx_t_4);
3846   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3847     __Pyx_PyThreadState_declare
3848     __Pyx_PyThreadState_assign
3849     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3850     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coeff.rcbuffer->pybuffer);
3851   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3852   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.CoeffFunc.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3853   __pyx_r = NULL;
3854   goto __pyx_L2;
3855   __pyx_L0:;
3856   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coeff.rcbuffer->pybuffer);
3857   __pyx_L2:;
3858   __Pyx_XDECREF((PyObject *)__pyx_v_coeff);
3859   __Pyx_XGIVEREF(__pyx_r);
3860   __Pyx_RefNannyFinishContext();
3861   return __pyx_r;
3862 }
3863 
3864 /* "qutip/cy/cqobjevo_factor.pyx":81
3865  *         return coeff
3866  *
3867  *     def set_args(self, args):             # <<<<<<<<<<<<<<
3868  *         pass
3869  *
3870  */
3871 
3872 /* Python wrapper */
3873 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_5set_args(PyObject *__pyx_v_self, PyObject *__pyx_v_args); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_5set_args(PyObject * __pyx_v_self,PyObject * __pyx_v_args)3874 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_5set_args(PyObject *__pyx_v_self, PyObject *__pyx_v_args) {
3875   PyObject *__pyx_r = 0;
3876   __Pyx_RefNannyDeclarations
3877   __Pyx_RefNannySetupContext("set_args (wrapper)", 0);
3878   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_4set_args(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *)__pyx_v_self), ((PyObject *)__pyx_v_args));
3879 
3880   /* function exit code */
3881   __Pyx_RefNannyFinishContext();
3882   return __pyx_r;
3883 }
3884 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_4set_args(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v_args)3885 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_4set_args(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args) {
3886   PyObject *__pyx_r = NULL;
3887   __Pyx_RefNannyDeclarations
3888   __Pyx_RefNannySetupContext("set_args", 0);
3889 
3890   /* function exit code */
3891   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3892   __Pyx_XGIVEREF(__pyx_r);
3893   __Pyx_RefNannyFinishContext();
3894   return __pyx_r;
3895 }
3896 
3897 /* "qutip/cy/cqobjevo_factor.pyx":84
3898  *         pass
3899  *
3900  *     cdef void _call_core(self, double t, complex* coeff):             # <<<<<<<<<<<<<<
3901  *         pass
3902  *
3903  */
3904 
__pyx_f_5qutip_2cy_15cqobjevo_factor_9CoeffFunc__call_core(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc * __pyx_v_self,CYTHON_UNUSED double __pyx_v_t,CYTHON_UNUSED __pyx_t_double_complex * __pyx_v_coeff)3905 static void __pyx_f_5qutip_2cy_15cqobjevo_factor_9CoeffFunc__call_core(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *__pyx_v_self, CYTHON_UNUSED double __pyx_v_t, CYTHON_UNUSED __pyx_t_double_complex *__pyx_v_coeff) {
3906   __Pyx_RefNannyDeclarations
3907   __Pyx_RefNannySetupContext("_call_core", 0);
3908 
3909   /* function exit code */
3910   __Pyx_RefNannyFinishContext();
3911 }
3912 
3913 /* "qutip/cy/cqobjevo_factor.pyx":87
3914  *         pass
3915  *
3916  *     cdef void _dyn_args(self, double t, complex* state, int[::1] shape):             # <<<<<<<<<<<<<<
3917  *         pass
3918  *
3919  */
3920 
__pyx_f_5qutip_2cy_15cqobjevo_factor_9CoeffFunc__dyn_args(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc * __pyx_v_self,CYTHON_UNUSED double __pyx_v_t,CYTHON_UNUSED __pyx_t_double_complex * __pyx_v_state,CYTHON_UNUSED __Pyx_memviewslice __pyx_v_shape)3921 static void __pyx_f_5qutip_2cy_15cqobjevo_factor_9CoeffFunc__dyn_args(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *__pyx_v_self, CYTHON_UNUSED double __pyx_v_t, CYTHON_UNUSED __pyx_t_double_complex *__pyx_v_state, CYTHON_UNUSED __Pyx_memviewslice __pyx_v_shape) {
3922   __Pyx_RefNannyDeclarations
3923   __Pyx_RefNannySetupContext("_dyn_args", 0);
3924 
3925   /* function exit code */
3926   __Pyx_RefNannyFinishContext();
3927 }
3928 
3929 /* "qutip/cy/cqobjevo_factor.pyx":90
3930  *         pass
3931  *
3932  *     def __getstate__(self):             # <<<<<<<<<<<<<<
3933  *         pass
3934  *
3935  */
3936 
3937 /* Python wrapper */
3938 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_7__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_7__getstate__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)3939 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_7__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3940   PyObject *__pyx_r = 0;
3941   __Pyx_RefNannyDeclarations
3942   __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
3943   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_6__getstate__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *)__pyx_v_self));
3944 
3945   /* function exit code */
3946   __Pyx_RefNannyFinishContext();
3947   return __pyx_r;
3948 }
3949 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_6__getstate__(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc * __pyx_v_self)3950 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_6__getstate__(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *__pyx_v_self) {
3951   PyObject *__pyx_r = NULL;
3952   __Pyx_RefNannyDeclarations
3953   __Pyx_RefNannySetupContext("__getstate__", 0);
3954 
3955   /* function exit code */
3956   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3957   __Pyx_XGIVEREF(__pyx_r);
3958   __Pyx_RefNannyFinishContext();
3959   return __pyx_r;
3960 }
3961 
3962 /* "qutip/cy/cqobjevo_factor.pyx":93
3963  *         pass
3964  *
3965  *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
3966  *         pass
3967  *
3968  */
3969 
3970 /* Python wrapper */
3971 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_9__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_9__setstate__(PyObject * __pyx_v_self,PyObject * __pyx_v_state)3972 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_9__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
3973   PyObject *__pyx_r = 0;
3974   __Pyx_RefNannyDeclarations
3975   __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0);
3976   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_8__setstate__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *)__pyx_v_self), ((PyObject *)__pyx_v_state));
3977 
3978   /* function exit code */
3979   __Pyx_RefNannyFinishContext();
3980   return __pyx_r;
3981 }
3982 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_8__setstate__(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v_state)3983 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_8__setstate__(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_state) {
3984   PyObject *__pyx_r = NULL;
3985   __Pyx_RefNannyDeclarations
3986   __Pyx_RefNannySetupContext("__setstate__", 0);
3987 
3988   /* function exit code */
3989   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3990   __Pyx_XGIVEREF(__pyx_r);
3991   __Pyx_RefNannyFinishContext();
3992   return __pyx_r;
3993 }
3994 
3995 /* "qutip/cy/cqobjevo_factor.pyx":96
3996  *         pass
3997  *
3998  *     def get_args(self):             # <<<<<<<<<<<<<<
3999  *         return self._args
4000  *
4001  */
4002 
4003 /* Python wrapper */
4004 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_11get_args(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_11get_args(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)4005 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_11get_args(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4006   PyObject *__pyx_r = 0;
4007   __Pyx_RefNannyDeclarations
4008   __Pyx_RefNannySetupContext("get_args (wrapper)", 0);
4009   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_10get_args(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *)__pyx_v_self));
4010 
4011   /* function exit code */
4012   __Pyx_RefNannyFinishContext();
4013   return __pyx_r;
4014 }
4015 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_10get_args(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc * __pyx_v_self)4016 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_10get_args(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *__pyx_v_self) {
4017   PyObject *__pyx_r = NULL;
4018   __Pyx_RefNannyDeclarations
4019   __Pyx_RefNannySetupContext("get_args", 0);
4020 
4021   /* "qutip/cy/cqobjevo_factor.pyx":97
4022  *
4023  *     def get_args(self):
4024  *         return self._args             # <<<<<<<<<<<<<<
4025  *
4026  *
4027  */
4028   __Pyx_XDECREF(__pyx_r);
4029   __Pyx_INCREF(__pyx_v_self->_args);
4030   __pyx_r = __pyx_v_self->_args;
4031   goto __pyx_L0;
4032 
4033   /* "qutip/cy/cqobjevo_factor.pyx":96
4034  *         pass
4035  *
4036  *     def get_args(self):             # <<<<<<<<<<<<<<
4037  *         return self._args
4038  *
4039  */
4040 
4041   /* function exit code */
4042   __pyx_L0:;
4043   __Pyx_XGIVEREF(__pyx_r);
4044   __Pyx_RefNannyFinishContext();
4045   return __pyx_r;
4046 }
4047 
4048 /* "(tree fragment)":1
4049  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
4050  *     cdef tuple state
4051  *     cdef object _dict
4052  */
4053 
4054 /* Python wrapper */
4055 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_13__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)4056 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4057   PyObject *__pyx_r = 0;
4058   __Pyx_RefNannyDeclarations
4059   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
4060   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_12__reduce_cython__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *)__pyx_v_self));
4061 
4062   /* function exit code */
4063   __Pyx_RefNannyFinishContext();
4064   return __pyx_r;
4065 }
4066 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_12__reduce_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc * __pyx_v_self)4067 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_12__reduce_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *__pyx_v_self) {
4068   PyObject *__pyx_v_state = 0;
4069   PyObject *__pyx_v__dict = 0;
4070   int __pyx_v_use_setstate;
4071   PyObject *__pyx_r = NULL;
4072   __Pyx_RefNannyDeclarations
4073   PyObject *__pyx_t_1 = NULL;
4074   PyObject *__pyx_t_2 = NULL;
4075   int __pyx_t_3;
4076   int __pyx_t_4;
4077   PyObject *__pyx_t_5 = NULL;
4078   int __pyx_lineno = 0;
4079   const char *__pyx_filename = NULL;
4080   int __pyx_clineno = 0;
4081   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
4082 
4083   /* "(tree fragment)":5
4084  *     cdef object _dict
4085  *     cdef bint use_setstate
4086  *     state = (self._args, self._num_ops)             # <<<<<<<<<<<<<<
4087  *     _dict = getattr(self, '__dict__', None)
4088  *     if _dict is not None:
4089  */
4090   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_num_ops); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
4091   __Pyx_GOTREF(__pyx_t_1);
4092   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
4093   __Pyx_GOTREF(__pyx_t_2);
4094   __Pyx_INCREF(__pyx_v_self->_args);
4095   __Pyx_GIVEREF(__pyx_v_self->_args);
4096   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->_args);
4097   __Pyx_GIVEREF(__pyx_t_1);
4098   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
4099   __pyx_t_1 = 0;
4100   __pyx_v_state = ((PyObject*)__pyx_t_2);
4101   __pyx_t_2 = 0;
4102 
4103   /* "(tree fragment)":6
4104  *     cdef bint use_setstate
4105  *     state = (self._args, self._num_ops)
4106  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
4107  *     if _dict is not None:
4108  *         state += (_dict,)
4109  */
4110   __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
4111   __Pyx_GOTREF(__pyx_t_2);
4112   __pyx_v__dict = __pyx_t_2;
4113   __pyx_t_2 = 0;
4114 
4115   /* "(tree fragment)":7
4116  *     state = (self._args, self._num_ops)
4117  *     _dict = getattr(self, '__dict__', None)
4118  *     if _dict is not None:             # <<<<<<<<<<<<<<
4119  *         state += (_dict,)
4120  *         use_setstate = True
4121  */
4122   __pyx_t_3 = (__pyx_v__dict != Py_None);
4123   __pyx_t_4 = (__pyx_t_3 != 0);
4124   if (__pyx_t_4) {
4125 
4126     /* "(tree fragment)":8
4127  *     _dict = getattr(self, '__dict__', None)
4128  *     if _dict is not None:
4129  *         state += (_dict,)             # <<<<<<<<<<<<<<
4130  *         use_setstate = True
4131  *     else:
4132  */
4133     __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error)
4134     __Pyx_GOTREF(__pyx_t_2);
4135     __Pyx_INCREF(__pyx_v__dict);
4136     __Pyx_GIVEREF(__pyx_v__dict);
4137     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v__dict);
4138     __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
4139     __Pyx_GOTREF(__pyx_t_1);
4140     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4141     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_1));
4142     __pyx_t_1 = 0;
4143 
4144     /* "(tree fragment)":9
4145  *     if _dict is not None:
4146  *         state += (_dict,)
4147  *         use_setstate = True             # <<<<<<<<<<<<<<
4148  *     else:
4149  *         use_setstate = self._args is not None
4150  */
4151     __pyx_v_use_setstate = 1;
4152 
4153     /* "(tree fragment)":7
4154  *     state = (self._args, self._num_ops)
4155  *     _dict = getattr(self, '__dict__', None)
4156  *     if _dict is not None:             # <<<<<<<<<<<<<<
4157  *         state += (_dict,)
4158  *         use_setstate = True
4159  */
4160     goto __pyx_L3;
4161   }
4162 
4163   /* "(tree fragment)":11
4164  *         use_setstate = True
4165  *     else:
4166  *         use_setstate = self._args is not None             # <<<<<<<<<<<<<<
4167  *     if use_setstate:
4168  *         return __pyx_unpickle_CoeffFunc, (type(self), 0xc4a3121, None), state
4169  */
4170   /*else*/ {
4171     __pyx_t_4 = (__pyx_v_self->_args != ((PyObject*)Py_None));
4172     __pyx_v_use_setstate = __pyx_t_4;
4173   }
4174   __pyx_L3:;
4175 
4176   /* "(tree fragment)":12
4177  *     else:
4178  *         use_setstate = self._args is not None
4179  *     if use_setstate:             # <<<<<<<<<<<<<<
4180  *         return __pyx_unpickle_CoeffFunc, (type(self), 0xc4a3121, None), state
4181  *     else:
4182  */
4183   __pyx_t_4 = (__pyx_v_use_setstate != 0);
4184   if (__pyx_t_4) {
4185 
4186     /* "(tree fragment)":13
4187  *         use_setstate = self._args is not None
4188  *     if use_setstate:
4189  *         return __pyx_unpickle_CoeffFunc, (type(self), 0xc4a3121, None), state             # <<<<<<<<<<<<<<
4190  *     else:
4191  *         return __pyx_unpickle_CoeffFunc, (type(self), 0xc4a3121, state)
4192  */
4193     __Pyx_XDECREF(__pyx_r);
4194     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_CoeffFunc); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
4195     __Pyx_GOTREF(__pyx_t_1);
4196     __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
4197     __Pyx_GOTREF(__pyx_t_2);
4198     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4199     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4200     PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4201     __Pyx_INCREF(__pyx_int_206188833);
4202     __Pyx_GIVEREF(__pyx_int_206188833);
4203     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_206188833);
4204     __Pyx_INCREF(Py_None);
4205     __Pyx_GIVEREF(Py_None);
4206     PyTuple_SET_ITEM(__pyx_t_2, 2, Py_None);
4207     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
4208     __Pyx_GOTREF(__pyx_t_5);
4209     __Pyx_GIVEREF(__pyx_t_1);
4210     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
4211     __Pyx_GIVEREF(__pyx_t_2);
4212     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
4213     __Pyx_INCREF(__pyx_v_state);
4214     __Pyx_GIVEREF(__pyx_v_state);
4215     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
4216     __pyx_t_1 = 0;
4217     __pyx_t_2 = 0;
4218     __pyx_r = __pyx_t_5;
4219     __pyx_t_5 = 0;
4220     goto __pyx_L0;
4221 
4222     /* "(tree fragment)":12
4223  *     else:
4224  *         use_setstate = self._args is not None
4225  *     if use_setstate:             # <<<<<<<<<<<<<<
4226  *         return __pyx_unpickle_CoeffFunc, (type(self), 0xc4a3121, None), state
4227  *     else:
4228  */
4229   }
4230 
4231   /* "(tree fragment)":15
4232  *         return __pyx_unpickle_CoeffFunc, (type(self), 0xc4a3121, None), state
4233  *     else:
4234  *         return __pyx_unpickle_CoeffFunc, (type(self), 0xc4a3121, state)             # <<<<<<<<<<<<<<
4235  * def __setstate_cython__(self, __pyx_state):
4236  *     __pyx_unpickle_CoeffFunc__set_state(self, __pyx_state)
4237  */
4238   /*else*/ {
4239     __Pyx_XDECREF(__pyx_r);
4240     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_CoeffFunc); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
4241     __Pyx_GOTREF(__pyx_t_5);
4242     __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
4243     __Pyx_GOTREF(__pyx_t_2);
4244     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4245     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4246     PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4247     __Pyx_INCREF(__pyx_int_206188833);
4248     __Pyx_GIVEREF(__pyx_int_206188833);
4249     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_206188833);
4250     __Pyx_INCREF(__pyx_v_state);
4251     __Pyx_GIVEREF(__pyx_v_state);
4252     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state);
4253     __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
4254     __Pyx_GOTREF(__pyx_t_1);
4255     __Pyx_GIVEREF(__pyx_t_5);
4256     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
4257     __Pyx_GIVEREF(__pyx_t_2);
4258     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
4259     __pyx_t_5 = 0;
4260     __pyx_t_2 = 0;
4261     __pyx_r = __pyx_t_1;
4262     __pyx_t_1 = 0;
4263     goto __pyx_L0;
4264   }
4265 
4266   /* "(tree fragment)":1
4267  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
4268  *     cdef tuple state
4269  *     cdef object _dict
4270  */
4271 
4272   /* function exit code */
4273   __pyx_L1_error:;
4274   __Pyx_XDECREF(__pyx_t_1);
4275   __Pyx_XDECREF(__pyx_t_2);
4276   __Pyx_XDECREF(__pyx_t_5);
4277   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.CoeffFunc.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4278   __pyx_r = NULL;
4279   __pyx_L0:;
4280   __Pyx_XDECREF(__pyx_v_state);
4281   __Pyx_XDECREF(__pyx_v__dict);
4282   __Pyx_XGIVEREF(__pyx_r);
4283   __Pyx_RefNannyFinishContext();
4284   return __pyx_r;
4285 }
4286 
4287 /* "(tree fragment)":16
4288  *     else:
4289  *         return __pyx_unpickle_CoeffFunc, (type(self), 0xc4a3121, state)
4290  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
4291  *     __pyx_unpickle_CoeffFunc__set_state(self, __pyx_state)
4292  */
4293 
4294 /* Python wrapper */
4295 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_15__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)4296 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4297   PyObject *__pyx_r = 0;
4298   __Pyx_RefNannyDeclarations
4299   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
4300   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_14__setstate_cython__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4301 
4302   /* function exit code */
4303   __Pyx_RefNannyFinishContext();
4304   return __pyx_r;
4305 }
4306 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_14__setstate_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc * __pyx_v_self,PyObject * __pyx_v___pyx_state)4307 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_14__setstate_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4308   PyObject *__pyx_r = NULL;
4309   __Pyx_RefNannyDeclarations
4310   PyObject *__pyx_t_1 = NULL;
4311   int __pyx_lineno = 0;
4312   const char *__pyx_filename = NULL;
4313   int __pyx_clineno = 0;
4314   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
4315 
4316   /* "(tree fragment)":17
4317  *         return __pyx_unpickle_CoeffFunc, (type(self), 0xc4a3121, state)
4318  * def __setstate_cython__(self, __pyx_state):
4319  *     __pyx_unpickle_CoeffFunc__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
4320  */
4321   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
4322   __pyx_t_1 = __pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_CoeffFunc__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
4323   __Pyx_GOTREF(__pyx_t_1);
4324   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4325 
4326   /* "(tree fragment)":16
4327  *     else:
4328  *         return __pyx_unpickle_CoeffFunc, (type(self), 0xc4a3121, state)
4329  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
4330  *     __pyx_unpickle_CoeffFunc__set_state(self, __pyx_state)
4331  */
4332 
4333   /* function exit code */
4334   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4335   goto __pyx_L0;
4336   __pyx_L1_error:;
4337   __Pyx_XDECREF(__pyx_t_1);
4338   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.CoeffFunc.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4339   __pyx_r = NULL;
4340   __pyx_L0:;
4341   __Pyx_XGIVEREF(__pyx_r);
4342   __Pyx_RefNannyFinishContext();
4343   return __pyx_r;
4344 }
4345 
4346 /* "qutip/cy/cqobjevo_factor.pyx":104
4347  *     cdef complex[:,::1] c
4348  *
4349  *     def __init__(self, ops, args, tlist):             # <<<<<<<<<<<<<<
4350  *         cdef int i, j, l
4351  *         self._args = {}
4352  */
4353 
4354 /* Python wrapper */
4355 static int __pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4356 static int __pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4357   PyObject *__pyx_v_ops = 0;
4358   CYTHON_UNUSED PyObject *__pyx_v_args = 0;
4359   CYTHON_UNUSED PyObject *__pyx_v_tlist = 0;
4360   int __pyx_lineno = 0;
4361   const char *__pyx_filename = NULL;
4362   int __pyx_clineno = 0;
4363   int __pyx_r;
4364   __Pyx_RefNannyDeclarations
4365   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
4366   {
4367     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ops,&__pyx_n_s_args,&__pyx_n_s_tlist,0};
4368     PyObject* values[3] = {0,0,0};
4369     if (unlikely(__pyx_kwds)) {
4370       Py_ssize_t kw_args;
4371       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4372       switch (pos_args) {
4373         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4374         CYTHON_FALLTHROUGH;
4375         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4376         CYTHON_FALLTHROUGH;
4377         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4378         CYTHON_FALLTHROUGH;
4379         case  0: break;
4380         default: goto __pyx_L5_argtuple_error;
4381       }
4382       kw_args = PyDict_Size(__pyx_kwds);
4383       switch (pos_args) {
4384         case  0:
4385         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ops)) != 0)) kw_args--;
4386         else goto __pyx_L5_argtuple_error;
4387         CYTHON_FALLTHROUGH;
4388         case  1:
4389         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
4390         else {
4391           __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 104, __pyx_L3_error)
4392         }
4393         CYTHON_FALLTHROUGH;
4394         case  2:
4395         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tlist)) != 0)) kw_args--;
4396         else {
4397           __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 104, __pyx_L3_error)
4398         }
4399       }
4400       if (unlikely(kw_args > 0)) {
4401         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 104, __pyx_L3_error)
4402       }
4403     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
4404       goto __pyx_L5_argtuple_error;
4405     } else {
4406       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4407       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4408       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4409     }
4410     __pyx_v_ops = values[0];
4411     __pyx_v_args = values[1];
4412     __pyx_v_tlist = values[2];
4413   }
4414   goto __pyx_L4_argument_unpacking_done;
4415   __pyx_L5_argtuple_error:;
4416   __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 104, __pyx_L3_error)
4417   __pyx_L3_error:;
4418   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.InterpolateCoeff.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4419   __Pyx_RefNannyFinishContext();
4420   return -1;
4421   __pyx_L4_argument_unpacking_done:;
4422   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff___init__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *)__pyx_v_self), __pyx_v_ops, __pyx_v_args, __pyx_v_tlist);
4423 
4424   /* function exit code */
4425   __Pyx_RefNannyFinishContext();
4426   return __pyx_r;
4427 }
4428 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff___init__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff * __pyx_v_self,PyObject * __pyx_v_ops,CYTHON_UNUSED PyObject * __pyx_v_args,CYTHON_UNUSED PyObject * __pyx_v_tlist)4429 static int __pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff___init__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *__pyx_v_self, PyObject *__pyx_v_ops, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_tlist) {
4430   int __pyx_v_i;
4431   int __pyx_v_j;
4432   int __pyx_v_l;
4433   int __pyx_r;
4434   __Pyx_RefNannyDeclarations
4435   PyObject *__pyx_t_1 = NULL;
4436   Py_ssize_t __pyx_t_2;
4437   PyObject *__pyx_t_3 = NULL;
4438   double __pyx_t_4;
4439   PyObject *__pyx_t_5 = NULL;
4440   PyObject *__pyx_t_6 = NULL;
4441   __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
4442   int __pyx_t_8;
4443   int __pyx_t_9;
4444   int __pyx_t_10;
4445   int __pyx_t_11;
4446   int __pyx_t_12;
4447   int __pyx_t_13;
4448   __pyx_t_double_complex __pyx_t_14;
4449   Py_ssize_t __pyx_t_15;
4450   Py_ssize_t __pyx_t_16;
4451   int __pyx_t_17;
4452   int __pyx_lineno = 0;
4453   const char *__pyx_filename = NULL;
4454   int __pyx_clineno = 0;
4455   __Pyx_RefNannySetupContext("__init__", 0);
4456 
4457   /* "qutip/cy/cqobjevo_factor.pyx":106
4458  *     def __init__(self, ops, args, tlist):
4459  *         cdef int i, j, l
4460  *         self._args = {}             # <<<<<<<<<<<<<<
4461  *         self._num_ops = len(ops)
4462  *         self.a = ops[0][2].a
4463  */
4464   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error)
4465   __Pyx_GOTREF(__pyx_t_1);
4466   __Pyx_GIVEREF(__pyx_t_1);
4467   __Pyx_GOTREF(__pyx_v_self->__pyx_base._args);
4468   __Pyx_DECREF(__pyx_v_self->__pyx_base._args);
4469   __pyx_v_self->__pyx_base._args = ((PyObject*)__pyx_t_1);
4470   __pyx_t_1 = 0;
4471 
4472   /* "qutip/cy/cqobjevo_factor.pyx":107
4473  *         cdef int i, j, l
4474  *         self._args = {}
4475  *         self._num_ops = len(ops)             # <<<<<<<<<<<<<<
4476  *         self.a = ops[0][2].a
4477  *         self.b = ops[0][2].b
4478  */
4479   __pyx_t_2 = PyObject_Length(__pyx_v_ops); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 107, __pyx_L1_error)
4480   __pyx_v_self->__pyx_base._num_ops = __pyx_t_2;
4481 
4482   /* "qutip/cy/cqobjevo_factor.pyx":108
4483  *         self._args = {}
4484  *         self._num_ops = len(ops)
4485  *         self.a = ops[0][2].a             # <<<<<<<<<<<<<<
4486  *         self.b = ops[0][2].b
4487  *         l = len(ops[0][2].coeffs)
4488  */
4489   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ops, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error)
4490   __Pyx_GOTREF(__pyx_t_1);
4491   __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error)
4492   __Pyx_GOTREF(__pyx_t_3);
4493   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4494   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_a); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error)
4495   __Pyx_GOTREF(__pyx_t_1);
4496   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4497   __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error)
4498   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4499   __pyx_v_self->a = __pyx_t_4;
4500 
4501   /* "qutip/cy/cqobjevo_factor.pyx":109
4502  *         self._num_ops = len(ops)
4503  *         self.a = ops[0][2].a
4504  *         self.b = ops[0][2].b             # <<<<<<<<<<<<<<
4505  *         l = len(ops[0][2].coeffs)
4506  *         self.c = np.zeros((self._num_ops, l), dtype=complex)
4507  */
4508   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ops, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
4509   __Pyx_GOTREF(__pyx_t_1);
4510   __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 109, __pyx_L1_error)
4511   __Pyx_GOTREF(__pyx_t_3);
4512   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4513   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
4514   __Pyx_GOTREF(__pyx_t_1);
4515   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4516   __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 109, __pyx_L1_error)
4517   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4518   __pyx_v_self->b = __pyx_t_4;
4519 
4520   /* "qutip/cy/cqobjevo_factor.pyx":110
4521  *         self.a = ops[0][2].a
4522  *         self.b = ops[0][2].b
4523  *         l = len(ops[0][2].coeffs)             # <<<<<<<<<<<<<<
4524  *         self.c = np.zeros((self._num_ops, l), dtype=complex)
4525  *         for i in range(self._num_ops):
4526  */
4527   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ops, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
4528   __Pyx_GOTREF(__pyx_t_1);
4529   __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 110, __pyx_L1_error)
4530   __Pyx_GOTREF(__pyx_t_3);
4531   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4532   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_coeffs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
4533   __Pyx_GOTREF(__pyx_t_1);
4534   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4535   __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 110, __pyx_L1_error)
4536   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4537   __pyx_v_l = __pyx_t_2;
4538 
4539   /* "qutip/cy/cqobjevo_factor.pyx":111
4540  *         self.b = ops[0][2].b
4541  *         l = len(ops[0][2].coeffs)
4542  *         self.c = np.zeros((self._num_ops, l), dtype=complex)             # <<<<<<<<<<<<<<
4543  *         for i in range(self._num_ops):
4544  *             for j in range(l):
4545  */
4546   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error)
4547   __Pyx_GOTREF(__pyx_t_1);
4548   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error)
4549   __Pyx_GOTREF(__pyx_t_3);
4550   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4551   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base._num_ops); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error)
4552   __Pyx_GOTREF(__pyx_t_1);
4553   __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_l); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 111, __pyx_L1_error)
4554   __Pyx_GOTREF(__pyx_t_5);
4555   __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 111, __pyx_L1_error)
4556   __Pyx_GOTREF(__pyx_t_6);
4557   __Pyx_GIVEREF(__pyx_t_1);
4558   PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
4559   __Pyx_GIVEREF(__pyx_t_5);
4560   PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
4561   __pyx_t_1 = 0;
4562   __pyx_t_5 = 0;
4563   __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 111, __pyx_L1_error)
4564   __Pyx_GOTREF(__pyx_t_5);
4565   __Pyx_GIVEREF(__pyx_t_6);
4566   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
4567   __pyx_t_6 = 0;
4568   __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 111, __pyx_L1_error)
4569   __Pyx_GOTREF(__pyx_t_6);
4570   if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, ((PyObject *)(&PyComplex_Type))) < 0) __PYX_ERR(0, 111, __pyx_L1_error)
4571   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error)
4572   __Pyx_GOTREF(__pyx_t_1);
4573   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4574   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4575   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4576   __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 111, __pyx_L1_error)
4577   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4578   __PYX_XDEC_MEMVIEW(&__pyx_v_self->c, 0);
4579   __pyx_v_self->c = __pyx_t_7;
4580   __pyx_t_7.memview = NULL;
4581   __pyx_t_7.data = NULL;
4582 
4583   /* "qutip/cy/cqobjevo_factor.pyx":112
4584  *         l = len(ops[0][2].coeffs)
4585  *         self.c = np.zeros((self._num_ops, l), dtype=complex)
4586  *         for i in range(self._num_ops):             # <<<<<<<<<<<<<<
4587  *             for j in range(l):
4588  *                 self.c[i,j] = ops[i][2].coeffs[j]
4589  */
4590   __pyx_t_8 = __pyx_v_self->__pyx_base._num_ops;
4591   __pyx_t_9 = __pyx_t_8;
4592   for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
4593     __pyx_v_i = __pyx_t_10;
4594 
4595     /* "qutip/cy/cqobjevo_factor.pyx":113
4596  *         self.c = np.zeros((self._num_ops, l), dtype=complex)
4597  *         for i in range(self._num_ops):
4598  *             for j in range(l):             # <<<<<<<<<<<<<<
4599  *                 self.c[i,j] = ops[i][2].coeffs[j]
4600  *
4601  */
4602     __pyx_t_11 = __pyx_v_l;
4603     __pyx_t_12 = __pyx_t_11;
4604     for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
4605       __pyx_v_j = __pyx_t_13;
4606 
4607       /* "qutip/cy/cqobjevo_factor.pyx":114
4608  *         for i in range(self._num_ops):
4609  *             for j in range(l):
4610  *                 self.c[i,j] = ops[i][2].coeffs[j]             # <<<<<<<<<<<<<<
4611  *
4612  *     def __call__(self, t, args={}):
4613  */
4614       __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ops, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
4615       __Pyx_GOTREF(__pyx_t_1);
4616       __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 114, __pyx_L1_error)
4617       __Pyx_GOTREF(__pyx_t_6);
4618       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4619       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_coeffs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
4620       __Pyx_GOTREF(__pyx_t_1);
4621       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4622       __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 114, __pyx_L1_error)
4623       __Pyx_GOTREF(__pyx_t_6);
4624       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4625       __pyx_t_14 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error)
4626       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4627       if (unlikely(!__pyx_v_self->c.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 114, __pyx_L1_error)}
4628       __pyx_t_15 = __pyx_v_i;
4629       __pyx_t_16 = __pyx_v_j;
4630       __pyx_t_17 = -1;
4631       if (__pyx_t_15 < 0) {
4632         __pyx_t_15 += __pyx_v_self->c.shape[0];
4633         if (unlikely(__pyx_t_15 < 0)) __pyx_t_17 = 0;
4634       } else if (unlikely(__pyx_t_15 >= __pyx_v_self->c.shape[0])) __pyx_t_17 = 0;
4635       if (__pyx_t_16 < 0) {
4636         __pyx_t_16 += __pyx_v_self->c.shape[1];
4637         if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 1;
4638       } else if (unlikely(__pyx_t_16 >= __pyx_v_self->c.shape[1])) __pyx_t_17 = 1;
4639       if (unlikely(__pyx_t_17 != -1)) {
4640         __Pyx_RaiseBufferIndexError(__pyx_t_17);
4641         __PYX_ERR(0, 114, __pyx_L1_error)
4642       }
4643       *((__pyx_t_double_complex *) ( /* dim=1 */ ((char *) (((__pyx_t_double_complex *) ( /* dim=0 */ (__pyx_v_self->c.data + __pyx_t_15 * __pyx_v_self->c.strides[0]) )) + __pyx_t_16)) )) = __pyx_t_14;
4644     }
4645   }
4646 
4647   /* "qutip/cy/cqobjevo_factor.pyx":104
4648  *     cdef complex[:,::1] c
4649  *
4650  *     def __init__(self, ops, args, tlist):             # <<<<<<<<<<<<<<
4651  *         cdef int i, j, l
4652  *         self._args = {}
4653  */
4654 
4655   /* function exit code */
4656   __pyx_r = 0;
4657   goto __pyx_L0;
4658   __pyx_L1_error:;
4659   __Pyx_XDECREF(__pyx_t_1);
4660   __Pyx_XDECREF(__pyx_t_3);
4661   __Pyx_XDECREF(__pyx_t_5);
4662   __Pyx_XDECREF(__pyx_t_6);
4663   __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
4664   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.InterpolateCoeff.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4665   __pyx_r = -1;
4666   __pyx_L0:;
4667   __Pyx_RefNannyFinishContext();
4668   return __pyx_r;
4669 }
4670 
4671 /* "qutip/cy/cqobjevo_factor.pyx":116
4672  *                 self.c[i,j] = ops[i][2].coeffs[j]
4673  *
4674  *     def __call__(self, t, args={}):             # <<<<<<<<<<<<<<
4675  *         cdef np.ndarray[ndim=1, dtype=complex] coeff = \
4676  *                                             np.zeros(self._num_ops, dtype=complex)
4677  */
4678 
4679 /* Python wrapper */
4680 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_3__call__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4681 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4682   PyObject *__pyx_v_t = 0;
4683   CYTHON_UNUSED PyObject *__pyx_v_args = 0;
4684   int __pyx_lineno = 0;
4685   const char *__pyx_filename = NULL;
4686   int __pyx_clineno = 0;
4687   PyObject *__pyx_r = 0;
4688   __Pyx_RefNannyDeclarations
4689   __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
4690   {
4691     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_args,0};
4692     PyObject* values[2] = {0,0};
4693     values[1] = __pyx_k__2;
4694     if (unlikely(__pyx_kwds)) {
4695       Py_ssize_t kw_args;
4696       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4697       switch (pos_args) {
4698         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4699         CYTHON_FALLTHROUGH;
4700         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4701         CYTHON_FALLTHROUGH;
4702         case  0: break;
4703         default: goto __pyx_L5_argtuple_error;
4704       }
4705       kw_args = PyDict_Size(__pyx_kwds);
4706       switch (pos_args) {
4707         case  0:
4708         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
4709         else goto __pyx_L5_argtuple_error;
4710         CYTHON_FALLTHROUGH;
4711         case  1:
4712         if (kw_args > 0) {
4713           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
4714           if (value) { values[1] = value; kw_args--; }
4715         }
4716       }
4717       if (unlikely(kw_args > 0)) {
4718         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 116, __pyx_L3_error)
4719       }
4720     } else {
4721       switch (PyTuple_GET_SIZE(__pyx_args)) {
4722         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4723         CYTHON_FALLTHROUGH;
4724         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4725         break;
4726         default: goto __pyx_L5_argtuple_error;
4727       }
4728     }
4729     __pyx_v_t = values[0];
4730     __pyx_v_args = values[1];
4731   }
4732   goto __pyx_L4_argument_unpacking_done;
4733   __pyx_L5_argtuple_error:;
4734   __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 116, __pyx_L3_error)
4735   __pyx_L3_error:;
4736   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.InterpolateCoeff.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4737   __Pyx_RefNannyFinishContext();
4738   return NULL;
4739   __pyx_L4_argument_unpacking_done:;
4740   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_2__call__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *)__pyx_v_self), __pyx_v_t, __pyx_v_args);
4741 
4742   /* function exit code */
4743   __Pyx_RefNannyFinishContext();
4744   return __pyx_r;
4745 }
4746 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_2__call__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff * __pyx_v_self,PyObject * __pyx_v_t,CYTHON_UNUSED PyObject * __pyx_v_args)4747 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_2__call__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *__pyx_v_self, PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_args) {
4748   PyArrayObject *__pyx_v_coeff = 0;
4749   __Pyx_LocalBuf_ND __pyx_pybuffernd_coeff;
4750   __Pyx_Buffer __pyx_pybuffer_coeff;
4751   PyObject *__pyx_r = NULL;
4752   __Pyx_RefNannyDeclarations
4753   PyObject *__pyx_t_1 = NULL;
4754   PyObject *__pyx_t_2 = NULL;
4755   PyObject *__pyx_t_3 = NULL;
4756   PyObject *__pyx_t_4 = NULL;
4757   PyArrayObject *__pyx_t_5 = NULL;
4758   double __pyx_t_6;
4759   Py_ssize_t __pyx_t_7;
4760   int __pyx_t_8;
4761   int __pyx_lineno = 0;
4762   const char *__pyx_filename = NULL;
4763   int __pyx_clineno = 0;
4764   __Pyx_RefNannySetupContext("__call__", 0);
4765   __pyx_pybuffer_coeff.pybuffer.buf = NULL;
4766   __pyx_pybuffer_coeff.refcount = 0;
4767   __pyx_pybuffernd_coeff.data = NULL;
4768   __pyx_pybuffernd_coeff.rcbuffer = &__pyx_pybuffer_coeff;
4769 
4770   /* "qutip/cy/cqobjevo_factor.pyx":118
4771  *     def __call__(self, t, args={}):
4772  *         cdef np.ndarray[ndim=1, dtype=complex] coeff = \
4773  *                                             np.zeros(self._num_ops, dtype=complex)             # <<<<<<<<<<<<<<
4774  *         self._call_core(t, &coeff[0])
4775  *         return coeff
4776  */
4777   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
4778   __Pyx_GOTREF(__pyx_t_1);
4779   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error)
4780   __Pyx_GOTREF(__pyx_t_2);
4781   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4782   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base._num_ops); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
4783   __Pyx_GOTREF(__pyx_t_1);
4784   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L1_error)
4785   __Pyx_GOTREF(__pyx_t_3);
4786   __Pyx_GIVEREF(__pyx_t_1);
4787   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
4788   __pyx_t_1 = 0;
4789   __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
4790   __Pyx_GOTREF(__pyx_t_1);
4791   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)(&PyComplex_Type))) < 0) __PYX_ERR(0, 118, __pyx_L1_error)
4792   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 118, __pyx_L1_error)
4793   __Pyx_GOTREF(__pyx_t_4);
4794   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4795   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4796   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4797   if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 118, __pyx_L1_error)
4798   __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
4799   {
4800     __Pyx_BufFmt_StackElem __pyx_stack[1];
4801     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_coeff.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
4802       __pyx_v_coeff = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_coeff.rcbuffer->pybuffer.buf = NULL;
4803       __PYX_ERR(0, 117, __pyx_L1_error)
4804     } else {__pyx_pybuffernd_coeff.diminfo[0].strides = __pyx_pybuffernd_coeff.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_coeff.diminfo[0].shape = __pyx_pybuffernd_coeff.rcbuffer->pybuffer.shape[0];
4805     }
4806   }
4807   __pyx_t_5 = 0;
4808   __pyx_v_coeff = ((PyArrayObject *)__pyx_t_4);
4809   __pyx_t_4 = 0;
4810 
4811   /* "qutip/cy/cqobjevo_factor.pyx":119
4812  *         cdef np.ndarray[ndim=1, dtype=complex] coeff = \
4813  *                                             np.zeros(self._num_ops, dtype=complex)
4814  *         self._call_core(t, &coeff[0])             # <<<<<<<<<<<<<<
4815  *         return coeff
4816  *
4817  */
4818   __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L1_error)
4819   __pyx_t_7 = 0;
4820   __pyx_t_8 = -1;
4821   if (__pyx_t_7 < 0) {
4822     __pyx_t_7 += __pyx_pybuffernd_coeff.diminfo[0].shape;
4823     if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0;
4824   } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_coeff.diminfo[0].shape)) __pyx_t_8 = 0;
4825   if (unlikely(__pyx_t_8 != -1)) {
4826     __Pyx_RaiseBufferIndexError(__pyx_t_8);
4827     __PYX_ERR(0, 119, __pyx_L1_error)
4828   }
4829   ((struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._call_core(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *)__pyx_v_self), __pyx_t_6, (&(*__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_coeff.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_coeff.diminfo[0].strides))));
4830 
4831   /* "qutip/cy/cqobjevo_factor.pyx":120
4832  *                                             np.zeros(self._num_ops, dtype=complex)
4833  *         self._call_core(t, &coeff[0])
4834  *         return coeff             # <<<<<<<<<<<<<<
4835  *
4836  *     cdef void _call_core(self, double t, complex* coeff):
4837  */
4838   __Pyx_XDECREF(__pyx_r);
4839   __Pyx_INCREF(((PyObject *)__pyx_v_coeff));
4840   __pyx_r = ((PyObject *)__pyx_v_coeff);
4841   goto __pyx_L0;
4842 
4843   /* "qutip/cy/cqobjevo_factor.pyx":116
4844  *                 self.c[i,j] = ops[i][2].coeffs[j]
4845  *
4846  *     def __call__(self, t, args={}):             # <<<<<<<<<<<<<<
4847  *         cdef np.ndarray[ndim=1, dtype=complex] coeff = \
4848  *                                             np.zeros(self._num_ops, dtype=complex)
4849  */
4850 
4851   /* function exit code */
4852   __pyx_L1_error:;
4853   __Pyx_XDECREF(__pyx_t_1);
4854   __Pyx_XDECREF(__pyx_t_2);
4855   __Pyx_XDECREF(__pyx_t_3);
4856   __Pyx_XDECREF(__pyx_t_4);
4857   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
4858     __Pyx_PyThreadState_declare
4859     __Pyx_PyThreadState_assign
4860     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
4861     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coeff.rcbuffer->pybuffer);
4862   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
4863   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.InterpolateCoeff.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4864   __pyx_r = NULL;
4865   goto __pyx_L2;
4866   __pyx_L0:;
4867   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coeff.rcbuffer->pybuffer);
4868   __pyx_L2:;
4869   __Pyx_XDECREF((PyObject *)__pyx_v_coeff);
4870   __Pyx_XGIVEREF(__pyx_r);
4871   __Pyx_RefNannyFinishContext();
4872   return __pyx_r;
4873 }
4874 
4875 /* "qutip/cy/cqobjevo_factor.pyx":122
4876  *         return coeff
4877  *
4878  *     cdef void _call_core(self, double t, complex* coeff):             # <<<<<<<<<<<<<<
4879  *         cdef int i
4880  *         for i in range(self._num_ops):
4881  */
4882 
__pyx_f_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff__call_core(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff * __pyx_v_self,double __pyx_v_t,__pyx_t_double_complex * __pyx_v_coeff)4883 static void __pyx_f_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff__call_core(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *__pyx_v_self, double __pyx_v_t, __pyx_t_double_complex *__pyx_v_coeff) {
4884   int __pyx_v_i;
4885   __Pyx_RefNannyDeclarations
4886   int __pyx_t_1;
4887   int __pyx_t_2;
4888   int __pyx_t_3;
4889   __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4890   int __pyx_lineno = 0;
4891   const char *__pyx_filename = NULL;
4892   int __pyx_clineno = 0;
4893   __Pyx_RefNannySetupContext("_call_core", 0);
4894 
4895   /* "qutip/cy/cqobjevo_factor.pyx":124
4896  *     cdef void _call_core(self, double t, complex* coeff):
4897  *         cdef int i
4898  *         for i in range(self._num_ops):             # <<<<<<<<<<<<<<
4899  *             coeff[i] = zinterp(t, self.a, self.b, self.c[i,:])
4900  *
4901  */
4902   __pyx_t_1 = __pyx_v_self->__pyx_base._num_ops;
4903   __pyx_t_2 = __pyx_t_1;
4904   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
4905     __pyx_v_i = __pyx_t_3;
4906 
4907     /* "qutip/cy/cqobjevo_factor.pyx":125
4908  *         cdef int i
4909  *         for i in range(self._num_ops):
4910  *             coeff[i] = zinterp(t, self.a, self.b, self.c[i,:])             # <<<<<<<<<<<<<<
4911  *
4912  *     def set_args(self, args):
4913  */
4914     if (unlikely(!__pyx_v_self->c.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 125, __pyx_L1_error)}
4915     __pyx_t_4.data = __pyx_v_self->c.data;
4916     __pyx_t_4.memview = __pyx_v_self->c.memview;
4917     __PYX_INC_MEMVIEW(&__pyx_t_4, 0);
4918     {
4919     Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
4920         Py_ssize_t __pyx_tmp_shape = __pyx_v_self->c.shape[0];
4921     Py_ssize_t __pyx_tmp_stride = __pyx_v_self->c.strides[0];
4922         if (__pyx_tmp_idx < 0)
4923             __pyx_tmp_idx += __pyx_tmp_shape;
4924         if (unlikely(!__Pyx_is_valid_index(__pyx_tmp_idx, __pyx_tmp_shape))) {
4925             PyErr_SetString(PyExc_IndexError,
4926                             "Index out of bounds (axis 0)");
4927             __PYX_ERR(0, 125, __pyx_L1_error)
4928         }
4929         __pyx_t_4.data += __pyx_tmp_idx * __pyx_tmp_stride;
4930 }
4931 
4932 __pyx_t_4.shape[0] = __pyx_v_self->c.shape[1];
4933 __pyx_t_4.strides[0] = __pyx_v_self->c.strides[1];
4934     __pyx_t_4.suboffsets[0] = -1;
4935 
4936 (__pyx_v_coeff[__pyx_v_i]) = __pyx_f_5qutip_2cy_11interpolate_zinterp(__pyx_v_t, __pyx_v_self->a, __pyx_v_self->b, __pyx_t_4, 0);
4937     __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4938     __pyx_t_4.memview = NULL;
4939     __pyx_t_4.data = NULL;
4940   }
4941 
4942   /* "qutip/cy/cqobjevo_factor.pyx":122
4943  *         return coeff
4944  *
4945  *     cdef void _call_core(self, double t, complex* coeff):             # <<<<<<<<<<<<<<
4946  *         cdef int i
4947  *         for i in range(self._num_ops):
4948  */
4949 
4950   /* function exit code */
4951   goto __pyx_L0;
4952   __pyx_L1_error:;
4953   __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4954   __Pyx_WriteUnraisable("qutip.cy.cqobjevo_factor.InterpolateCoeff._call_core", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4955   __pyx_L0:;
4956   __Pyx_RefNannyFinishContext();
4957 }
4958 
4959 /* "qutip/cy/cqobjevo_factor.pyx":127
4960  *             coeff[i] = zinterp(t, self.a, self.b, self.c[i,:])
4961  *
4962  *     def set_args(self, args):             # <<<<<<<<<<<<<<
4963  *         pass
4964  *
4965  */
4966 
4967 /* Python wrapper */
4968 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_5set_args(PyObject *__pyx_v_self, PyObject *__pyx_v_args); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_5set_args(PyObject * __pyx_v_self,PyObject * __pyx_v_args)4969 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_5set_args(PyObject *__pyx_v_self, PyObject *__pyx_v_args) {
4970   PyObject *__pyx_r = 0;
4971   __Pyx_RefNannyDeclarations
4972   __Pyx_RefNannySetupContext("set_args (wrapper)", 0);
4973   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_4set_args(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *)__pyx_v_self), ((PyObject *)__pyx_v_args));
4974 
4975   /* function exit code */
4976   __Pyx_RefNannyFinishContext();
4977   return __pyx_r;
4978 }
4979 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_4set_args(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v_args)4980 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_4set_args(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args) {
4981   PyObject *__pyx_r = NULL;
4982   __Pyx_RefNannyDeclarations
4983   __Pyx_RefNannySetupContext("set_args", 0);
4984 
4985   /* function exit code */
4986   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4987   __Pyx_XGIVEREF(__pyx_r);
4988   __Pyx_RefNannyFinishContext();
4989   return __pyx_r;
4990 }
4991 
4992 /* "qutip/cy/cqobjevo_factor.pyx":130
4993  *         pass
4994  *
4995  *     def __getstate__(self):             # <<<<<<<<<<<<<<
4996  *         return (self._num_ops, self.a, self.b, np.array(self.c))
4997  *
4998  */
4999 
5000 /* Python wrapper */
5001 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_7__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_7__getstate__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)5002 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_7__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5003   PyObject *__pyx_r = 0;
5004   __Pyx_RefNannyDeclarations
5005   __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
5006   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_6__getstate__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *)__pyx_v_self));
5007 
5008   /* function exit code */
5009   __Pyx_RefNannyFinishContext();
5010   return __pyx_r;
5011 }
5012 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_6__getstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff * __pyx_v_self)5013 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_6__getstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *__pyx_v_self) {
5014   PyObject *__pyx_r = NULL;
5015   __Pyx_RefNannyDeclarations
5016   PyObject *__pyx_t_1 = NULL;
5017   PyObject *__pyx_t_2 = NULL;
5018   PyObject *__pyx_t_3 = NULL;
5019   PyObject *__pyx_t_4 = NULL;
5020   PyObject *__pyx_t_5 = NULL;
5021   PyObject *__pyx_t_6 = NULL;
5022   PyObject *__pyx_t_7 = NULL;
5023   int __pyx_lineno = 0;
5024   const char *__pyx_filename = NULL;
5025   int __pyx_clineno = 0;
5026   __Pyx_RefNannySetupContext("__getstate__", 0);
5027 
5028   /* "qutip/cy/cqobjevo_factor.pyx":131
5029  *
5030  *     def __getstate__(self):
5031  *         return (self._num_ops, self.a, self.b, np.array(self.c))             # <<<<<<<<<<<<<<
5032  *
5033  *     def __setstate__(self, state):
5034  */
5035   __Pyx_XDECREF(__pyx_r);
5036   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base._num_ops); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
5037   __Pyx_GOTREF(__pyx_t_1);
5038   __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->a); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error)
5039   __Pyx_GOTREF(__pyx_t_2);
5040   __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error)
5041   __Pyx_GOTREF(__pyx_t_3);
5042   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 131, __pyx_L1_error)
5043   __Pyx_GOTREF(__pyx_t_5);
5044   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 131, __pyx_L1_error)
5045   __Pyx_GOTREF(__pyx_t_6);
5046   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5047   if (unlikely(!__pyx_v_self->c.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 131, __pyx_L1_error)}
5048   __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_self->c, 2, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 131, __pyx_L1_error)
5049   __Pyx_GOTREF(__pyx_t_5);
5050   __pyx_t_7 = NULL;
5051   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
5052     __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
5053     if (likely(__pyx_t_7)) {
5054       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
5055       __Pyx_INCREF(__pyx_t_7);
5056       __Pyx_INCREF(function);
5057       __Pyx_DECREF_SET(__pyx_t_6, function);
5058     }
5059   }
5060   __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5);
5061   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5062   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5063   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L1_error)
5064   __Pyx_GOTREF(__pyx_t_4);
5065   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5066   __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 131, __pyx_L1_error)
5067   __Pyx_GOTREF(__pyx_t_6);
5068   __Pyx_GIVEREF(__pyx_t_1);
5069   PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
5070   __Pyx_GIVEREF(__pyx_t_2);
5071   PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
5072   __Pyx_GIVEREF(__pyx_t_3);
5073   PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3);
5074   __Pyx_GIVEREF(__pyx_t_4);
5075   PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_4);
5076   __pyx_t_1 = 0;
5077   __pyx_t_2 = 0;
5078   __pyx_t_3 = 0;
5079   __pyx_t_4 = 0;
5080   __pyx_r = __pyx_t_6;
5081   __pyx_t_6 = 0;
5082   goto __pyx_L0;
5083 
5084   /* "qutip/cy/cqobjevo_factor.pyx":130
5085  *         pass
5086  *
5087  *     def __getstate__(self):             # <<<<<<<<<<<<<<
5088  *         return (self._num_ops, self.a, self.b, np.array(self.c))
5089  *
5090  */
5091 
5092   /* function exit code */
5093   __pyx_L1_error:;
5094   __Pyx_XDECREF(__pyx_t_1);
5095   __Pyx_XDECREF(__pyx_t_2);
5096   __Pyx_XDECREF(__pyx_t_3);
5097   __Pyx_XDECREF(__pyx_t_4);
5098   __Pyx_XDECREF(__pyx_t_5);
5099   __Pyx_XDECREF(__pyx_t_6);
5100   __Pyx_XDECREF(__pyx_t_7);
5101   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.InterpolateCoeff.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5102   __pyx_r = NULL;
5103   __pyx_L0:;
5104   __Pyx_XGIVEREF(__pyx_r);
5105   __Pyx_RefNannyFinishContext();
5106   return __pyx_r;
5107 }
5108 
5109 /* "qutip/cy/cqobjevo_factor.pyx":133
5110  *         return (self._num_ops, self.a, self.b, np.array(self.c))
5111  *
5112  *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
5113  *         self._num_ops = state[0]
5114  *         self.a = state[1]
5115  */
5116 
5117 /* Python wrapper */
5118 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_9__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_9__setstate__(PyObject * __pyx_v_self,PyObject * __pyx_v_state)5119 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_9__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
5120   PyObject *__pyx_r = 0;
5121   __Pyx_RefNannyDeclarations
5122   __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0);
5123   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_8__setstate__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *)__pyx_v_self), ((PyObject *)__pyx_v_state));
5124 
5125   /* function exit code */
5126   __Pyx_RefNannyFinishContext();
5127   return __pyx_r;
5128 }
5129 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_8__setstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff * __pyx_v_self,PyObject * __pyx_v_state)5130 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_8__setstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *__pyx_v_self, PyObject *__pyx_v_state) {
5131   PyObject *__pyx_r = NULL;
5132   __Pyx_RefNannyDeclarations
5133   PyObject *__pyx_t_1 = NULL;
5134   int __pyx_t_2;
5135   double __pyx_t_3;
5136   __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
5137   int __pyx_lineno = 0;
5138   const char *__pyx_filename = NULL;
5139   int __pyx_clineno = 0;
5140   __Pyx_RefNannySetupContext("__setstate__", 0);
5141 
5142   /* "qutip/cy/cqobjevo_factor.pyx":134
5143  *
5144  *     def __setstate__(self, state):
5145  *         self._num_ops = state[0]             # <<<<<<<<<<<<<<
5146  *         self.a = state[1]
5147  *         self.b = state[2]
5148  */
5149   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
5150   __Pyx_GOTREF(__pyx_t_1);
5151   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L1_error)
5152   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5153   __pyx_v_self->__pyx_base._num_ops = __pyx_t_2;
5154 
5155   /* "qutip/cy/cqobjevo_factor.pyx":135
5156  *     def __setstate__(self, state):
5157  *         self._num_ops = state[0]
5158  *         self.a = state[1]             # <<<<<<<<<<<<<<
5159  *         self.b = state[2]
5160  *         self.c = state[3]
5161  */
5162   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
5163   __Pyx_GOTREF(__pyx_t_1);
5164   __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L1_error)
5165   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5166   __pyx_v_self->a = __pyx_t_3;
5167 
5168   /* "qutip/cy/cqobjevo_factor.pyx":136
5169  *         self._num_ops = state[0]
5170  *         self.a = state[1]
5171  *         self.b = state[2]             # <<<<<<<<<<<<<<
5172  *         self.c = state[3]
5173  *
5174  */
5175   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error)
5176   __Pyx_GOTREF(__pyx_t_1);
5177   __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
5178   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5179   __pyx_v_self->b = __pyx_t_3;
5180 
5181   /* "qutip/cy/cqobjevo_factor.pyx":137
5182  *         self.a = state[1]
5183  *         self.b = state[2]
5184  *         self.c = state[3]             # <<<<<<<<<<<<<<
5185  *
5186  *
5187  */
5188   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
5189   __Pyx_GOTREF(__pyx_t_1);
5190   __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 137, __pyx_L1_error)
5191   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5192   __PYX_XDEC_MEMVIEW(&__pyx_v_self->c, 0);
5193   __pyx_v_self->c = __pyx_t_4;
5194   __pyx_t_4.memview = NULL;
5195   __pyx_t_4.data = NULL;
5196 
5197   /* "qutip/cy/cqobjevo_factor.pyx":133
5198  *         return (self._num_ops, self.a, self.b, np.array(self.c))
5199  *
5200  *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
5201  *         self._num_ops = state[0]
5202  *         self.a = state[1]
5203  */
5204 
5205   /* function exit code */
5206   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5207   goto __pyx_L0;
5208   __pyx_L1_error:;
5209   __Pyx_XDECREF(__pyx_t_1);
5210   __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
5211   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.InterpolateCoeff.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5212   __pyx_r = NULL;
5213   __pyx_L0:;
5214   __Pyx_XGIVEREF(__pyx_r);
5215   __Pyx_RefNannyFinishContext();
5216   return __pyx_r;
5217 }
5218 
5219 /* "(tree fragment)":1
5220  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
5221  *     cdef tuple state
5222  *     cdef object _dict
5223  */
5224 
5225 /* Python wrapper */
5226 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_11__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)5227 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5228   PyObject *__pyx_r = 0;
5229   __Pyx_RefNannyDeclarations
5230   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
5231   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_10__reduce_cython__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *)__pyx_v_self));
5232 
5233   /* function exit code */
5234   __Pyx_RefNannyFinishContext();
5235   return __pyx_r;
5236 }
5237 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_10__reduce_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff * __pyx_v_self)5238 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_10__reduce_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *__pyx_v_self) {
5239   PyObject *__pyx_v_state = 0;
5240   PyObject *__pyx_v__dict = 0;
5241   int __pyx_v_use_setstate;
5242   PyObject *__pyx_r = NULL;
5243   __Pyx_RefNannyDeclarations
5244   PyObject *__pyx_t_1 = NULL;
5245   PyObject *__pyx_t_2 = NULL;
5246   PyObject *__pyx_t_3 = NULL;
5247   PyObject *__pyx_t_4 = NULL;
5248   PyObject *__pyx_t_5 = NULL;
5249   int __pyx_t_6;
5250   int __pyx_t_7;
5251   int __pyx_lineno = 0;
5252   const char *__pyx_filename = NULL;
5253   int __pyx_clineno = 0;
5254   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
5255 
5256   /* "(tree fragment)":5
5257  *     cdef object _dict
5258  *     cdef bint use_setstate
5259  *     state = (self._args, self._num_ops, self.a, self.b, self.c)             # <<<<<<<<<<<<<<
5260  *     _dict = getattr(self, '__dict__', None)
5261  *     if _dict is not None:
5262  */
5263   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base._num_ops); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
5264   __Pyx_GOTREF(__pyx_t_1);
5265   __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->a); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
5266   __Pyx_GOTREF(__pyx_t_2);
5267   __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->b); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
5268   __Pyx_GOTREF(__pyx_t_3);
5269   if (unlikely(!__pyx_v_self->c.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 5, __pyx_L1_error)}
5270   __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_self->c, 2, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
5271   __Pyx_GOTREF(__pyx_t_4);
5272   __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error)
5273   __Pyx_GOTREF(__pyx_t_5);
5274   __Pyx_INCREF(__pyx_v_self->__pyx_base._args);
5275   __Pyx_GIVEREF(__pyx_v_self->__pyx_base._args);
5276   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->__pyx_base._args);
5277   __Pyx_GIVEREF(__pyx_t_1);
5278   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
5279   __Pyx_GIVEREF(__pyx_t_2);
5280   PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2);
5281   __Pyx_GIVEREF(__pyx_t_3);
5282   PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_3);
5283   __Pyx_GIVEREF(__pyx_t_4);
5284   PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_4);
5285   __pyx_t_1 = 0;
5286   __pyx_t_2 = 0;
5287   __pyx_t_3 = 0;
5288   __pyx_t_4 = 0;
5289   __pyx_v_state = ((PyObject*)__pyx_t_5);
5290   __pyx_t_5 = 0;
5291 
5292   /* "(tree fragment)":6
5293  *     cdef bint use_setstate
5294  *     state = (self._args, self._num_ops, self.a, self.b, self.c)
5295  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
5296  *     if _dict is not None:
5297  *         state += (_dict,)
5298  */
5299   __pyx_t_5 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
5300   __Pyx_GOTREF(__pyx_t_5);
5301   __pyx_v__dict = __pyx_t_5;
5302   __pyx_t_5 = 0;
5303 
5304   /* "(tree fragment)":7
5305  *     state = (self._args, self._num_ops, self.a, self.b, self.c)
5306  *     _dict = getattr(self, '__dict__', None)
5307  *     if _dict is not None:             # <<<<<<<<<<<<<<
5308  *         state += (_dict,)
5309  *         use_setstate = True
5310  */
5311   __pyx_t_6 = (__pyx_v__dict != Py_None);
5312   __pyx_t_7 = (__pyx_t_6 != 0);
5313   if (__pyx_t_7) {
5314 
5315     /* "(tree fragment)":8
5316  *     _dict = getattr(self, '__dict__', None)
5317  *     if _dict is not None:
5318  *         state += (_dict,)             # <<<<<<<<<<<<<<
5319  *         use_setstate = True
5320  *     else:
5321  */
5322     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 8, __pyx_L1_error)
5323     __Pyx_GOTREF(__pyx_t_5);
5324     __Pyx_INCREF(__pyx_v__dict);
5325     __Pyx_GIVEREF(__pyx_v__dict);
5326     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v__dict);
5327     __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
5328     __Pyx_GOTREF(__pyx_t_4);
5329     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5330     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
5331     __pyx_t_4 = 0;
5332 
5333     /* "(tree fragment)":9
5334  *     if _dict is not None:
5335  *         state += (_dict,)
5336  *         use_setstate = True             # <<<<<<<<<<<<<<
5337  *     else:
5338  *         use_setstate = self._args is not None
5339  */
5340     __pyx_v_use_setstate = 1;
5341 
5342     /* "(tree fragment)":7
5343  *     state = (self._args, self._num_ops, self.a, self.b, self.c)
5344  *     _dict = getattr(self, '__dict__', None)
5345  *     if _dict is not None:             # <<<<<<<<<<<<<<
5346  *         state += (_dict,)
5347  *         use_setstate = True
5348  */
5349     goto __pyx_L3;
5350   }
5351 
5352   /* "(tree fragment)":11
5353  *         use_setstate = True
5354  *     else:
5355  *         use_setstate = self._args is not None             # <<<<<<<<<<<<<<
5356  *     if use_setstate:
5357  *         return __pyx_unpickle_InterpolateCoeff, (type(self), 0xc6a92cd, None), state
5358  */
5359   /*else*/ {
5360     __pyx_t_7 = (__pyx_v_self->__pyx_base._args != ((PyObject*)Py_None));
5361     __pyx_v_use_setstate = __pyx_t_7;
5362   }
5363   __pyx_L3:;
5364 
5365   /* "(tree fragment)":12
5366  *     else:
5367  *         use_setstate = self._args is not None
5368  *     if use_setstate:             # <<<<<<<<<<<<<<
5369  *         return __pyx_unpickle_InterpolateCoeff, (type(self), 0xc6a92cd, None), state
5370  *     else:
5371  */
5372   __pyx_t_7 = (__pyx_v_use_setstate != 0);
5373   if (__pyx_t_7) {
5374 
5375     /* "(tree fragment)":13
5376  *         use_setstate = self._args is not None
5377  *     if use_setstate:
5378  *         return __pyx_unpickle_InterpolateCoeff, (type(self), 0xc6a92cd, None), state             # <<<<<<<<<<<<<<
5379  *     else:
5380  *         return __pyx_unpickle_InterpolateCoeff, (type(self), 0xc6a92cd, state)
5381  */
5382     __Pyx_XDECREF(__pyx_r);
5383     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_InterpolateCoeff); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
5384     __Pyx_GOTREF(__pyx_t_4);
5385     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
5386     __Pyx_GOTREF(__pyx_t_5);
5387     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
5388     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
5389     PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
5390     __Pyx_INCREF(__pyx_int_208310989);
5391     __Pyx_GIVEREF(__pyx_int_208310989);
5392     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_208310989);
5393     __Pyx_INCREF(Py_None);
5394     __Pyx_GIVEREF(Py_None);
5395     PyTuple_SET_ITEM(__pyx_t_5, 2, Py_None);
5396     __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
5397     __Pyx_GOTREF(__pyx_t_3);
5398     __Pyx_GIVEREF(__pyx_t_4);
5399     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
5400     __Pyx_GIVEREF(__pyx_t_5);
5401     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
5402     __Pyx_INCREF(__pyx_v_state);
5403     __Pyx_GIVEREF(__pyx_v_state);
5404     PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
5405     __pyx_t_4 = 0;
5406     __pyx_t_5 = 0;
5407     __pyx_r = __pyx_t_3;
5408     __pyx_t_3 = 0;
5409     goto __pyx_L0;
5410 
5411     /* "(tree fragment)":12
5412  *     else:
5413  *         use_setstate = self._args is not None
5414  *     if use_setstate:             # <<<<<<<<<<<<<<
5415  *         return __pyx_unpickle_InterpolateCoeff, (type(self), 0xc6a92cd, None), state
5416  *     else:
5417  */
5418   }
5419 
5420   /* "(tree fragment)":15
5421  *         return __pyx_unpickle_InterpolateCoeff, (type(self), 0xc6a92cd, None), state
5422  *     else:
5423  *         return __pyx_unpickle_InterpolateCoeff, (type(self), 0xc6a92cd, state)             # <<<<<<<<<<<<<<
5424  * def __setstate_cython__(self, __pyx_state):
5425  *     __pyx_unpickle_InterpolateCoeff__set_state(self, __pyx_state)
5426  */
5427   /*else*/ {
5428     __Pyx_XDECREF(__pyx_r);
5429     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_InterpolateCoeff); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
5430     __Pyx_GOTREF(__pyx_t_3);
5431     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
5432     __Pyx_GOTREF(__pyx_t_5);
5433     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
5434     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
5435     PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
5436     __Pyx_INCREF(__pyx_int_208310989);
5437     __Pyx_GIVEREF(__pyx_int_208310989);
5438     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_208310989);
5439     __Pyx_INCREF(__pyx_v_state);
5440     __Pyx_GIVEREF(__pyx_v_state);
5441     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
5442     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
5443     __Pyx_GOTREF(__pyx_t_4);
5444     __Pyx_GIVEREF(__pyx_t_3);
5445     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
5446     __Pyx_GIVEREF(__pyx_t_5);
5447     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
5448     __pyx_t_3 = 0;
5449     __pyx_t_5 = 0;
5450     __pyx_r = __pyx_t_4;
5451     __pyx_t_4 = 0;
5452     goto __pyx_L0;
5453   }
5454 
5455   /* "(tree fragment)":1
5456  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
5457  *     cdef tuple state
5458  *     cdef object _dict
5459  */
5460 
5461   /* function exit code */
5462   __pyx_L1_error:;
5463   __Pyx_XDECREF(__pyx_t_1);
5464   __Pyx_XDECREF(__pyx_t_2);
5465   __Pyx_XDECREF(__pyx_t_3);
5466   __Pyx_XDECREF(__pyx_t_4);
5467   __Pyx_XDECREF(__pyx_t_5);
5468   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.InterpolateCoeff.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5469   __pyx_r = NULL;
5470   __pyx_L0:;
5471   __Pyx_XDECREF(__pyx_v_state);
5472   __Pyx_XDECREF(__pyx_v__dict);
5473   __Pyx_XGIVEREF(__pyx_r);
5474   __Pyx_RefNannyFinishContext();
5475   return __pyx_r;
5476 }
5477 
5478 /* "(tree fragment)":16
5479  *     else:
5480  *         return __pyx_unpickle_InterpolateCoeff, (type(self), 0xc6a92cd, state)
5481  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
5482  *     __pyx_unpickle_InterpolateCoeff__set_state(self, __pyx_state)
5483  */
5484 
5485 /* Python wrapper */
5486 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_13__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)5487 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5488   PyObject *__pyx_r = 0;
5489   __Pyx_RefNannyDeclarations
5490   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
5491   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_12__setstate_cython__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5492 
5493   /* function exit code */
5494   __Pyx_RefNannyFinishContext();
5495   return __pyx_r;
5496 }
5497 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_12__setstate_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff * __pyx_v_self,PyObject * __pyx_v___pyx_state)5498 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_12__setstate_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5499   PyObject *__pyx_r = NULL;
5500   __Pyx_RefNannyDeclarations
5501   PyObject *__pyx_t_1 = NULL;
5502   int __pyx_lineno = 0;
5503   const char *__pyx_filename = NULL;
5504   int __pyx_clineno = 0;
5505   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
5506 
5507   /* "(tree fragment)":17
5508  *         return __pyx_unpickle_InterpolateCoeff, (type(self), 0xc6a92cd, state)
5509  * def __setstate_cython__(self, __pyx_state):
5510  *     __pyx_unpickle_InterpolateCoeff__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
5511  */
5512   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
5513   __pyx_t_1 = __pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_InterpolateCoeff__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
5514   __Pyx_GOTREF(__pyx_t_1);
5515   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5516 
5517   /* "(tree fragment)":16
5518  *     else:
5519  *         return __pyx_unpickle_InterpolateCoeff, (type(self), 0xc6a92cd, state)
5520  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
5521  *     __pyx_unpickle_InterpolateCoeff__set_state(self, __pyx_state)
5522  */
5523 
5524   /* function exit code */
5525   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5526   goto __pyx_L0;
5527   __pyx_L1_error:;
5528   __Pyx_XDECREF(__pyx_t_1);
5529   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.InterpolateCoeff.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5530   __pyx_r = NULL;
5531   __pyx_L0:;
5532   __Pyx_XGIVEREF(__pyx_r);
5533   __Pyx_RefNannyFinishContext();
5534   return __pyx_r;
5535 }
5536 
5537 /* "qutip/cy/cqobjevo_factor.pyx":146
5538  *     cdef complex[:,::1] y, M
5539  *
5540  *     def __init__(self, ops, args, tlist):             # <<<<<<<<<<<<<<
5541  *         cdef int i, j
5542  *         self._args = {}
5543  */
5544 
5545 /* Python wrapper */
5546 static int __pyx_pw_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)5547 static int __pyx_pw_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5548   PyObject *__pyx_v_ops = 0;
5549   CYTHON_UNUSED PyObject *__pyx_v_args = 0;
5550   PyObject *__pyx_v_tlist = 0;
5551   int __pyx_lineno = 0;
5552   const char *__pyx_filename = NULL;
5553   int __pyx_clineno = 0;
5554   int __pyx_r;
5555   __Pyx_RefNannyDeclarations
5556   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
5557   {
5558     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ops,&__pyx_n_s_args,&__pyx_n_s_tlist,0};
5559     PyObject* values[3] = {0,0,0};
5560     if (unlikely(__pyx_kwds)) {
5561       Py_ssize_t kw_args;
5562       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5563       switch (pos_args) {
5564         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5565         CYTHON_FALLTHROUGH;
5566         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5567         CYTHON_FALLTHROUGH;
5568         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5569         CYTHON_FALLTHROUGH;
5570         case  0: break;
5571         default: goto __pyx_L5_argtuple_error;
5572       }
5573       kw_args = PyDict_Size(__pyx_kwds);
5574       switch (pos_args) {
5575         case  0:
5576         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ops)) != 0)) kw_args--;
5577         else goto __pyx_L5_argtuple_error;
5578         CYTHON_FALLTHROUGH;
5579         case  1:
5580         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
5581         else {
5582           __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 146, __pyx_L3_error)
5583         }
5584         CYTHON_FALLTHROUGH;
5585         case  2:
5586         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tlist)) != 0)) kw_args--;
5587         else {
5588           __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 146, __pyx_L3_error)
5589         }
5590       }
5591       if (unlikely(kw_args > 0)) {
5592         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 146, __pyx_L3_error)
5593       }
5594     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
5595       goto __pyx_L5_argtuple_error;
5596     } else {
5597       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5598       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5599       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5600     }
5601     __pyx_v_ops = values[0];
5602     __pyx_v_args = values[1];
5603     __pyx_v_tlist = values[2];
5604   }
5605   goto __pyx_L4_argument_unpacking_done;
5606   __pyx_L5_argtuple_error:;
5607   __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 146, __pyx_L3_error)
5608   __pyx_L3_error:;
5609   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.InterCoeffCte.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5610   __Pyx_RefNannyFinishContext();
5611   return -1;
5612   __pyx_L4_argument_unpacking_done:;
5613   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte___init__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *)__pyx_v_self), __pyx_v_ops, __pyx_v_args, __pyx_v_tlist);
5614 
5615   /* function exit code */
5616   __Pyx_RefNannyFinishContext();
5617   return __pyx_r;
5618 }
5619 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte___init__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte * __pyx_v_self,PyObject * __pyx_v_ops,CYTHON_UNUSED PyObject * __pyx_v_args,PyObject * __pyx_v_tlist)5620 static int __pyx_pf_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte___init__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *__pyx_v_self, PyObject *__pyx_v_ops, CYTHON_UNUSED PyObject *__pyx_v_args, PyObject *__pyx_v_tlist) {
5621   int __pyx_v_i;
5622   int __pyx_v_j;
5623   PyObject *__pyx_v_m = NULL;
5624   PyObject *__pyx_v_cte = NULL;
5625   int __pyx_r;
5626   __Pyx_RefNannyDeclarations
5627   PyObject *__pyx_t_1 = NULL;
5628   Py_ssize_t __pyx_t_2;
5629   __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
5630   PyObject *__pyx_t_4 = NULL;
5631   PyObject *__pyx_t_5 = NULL;
5632   double __pyx_t_6;
5633   PyObject *__pyx_t_7 = NULL;
5634   __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
5635   int __pyx_t_9;
5636   int __pyx_t_10;
5637   int __pyx_t_11;
5638   int __pyx_t_12;
5639   PyObject *__pyx_t_13 = NULL;
5640   PyObject *(*__pyx_t_14)(PyObject *);
5641   int __pyx_t_15;
5642   int __pyx_t_16;
5643   int __pyx_t_17;
5644   int __pyx_t_18;
5645   __pyx_t_double_complex __pyx_t_19;
5646   Py_ssize_t __pyx_t_20;
5647   Py_ssize_t __pyx_t_21;
5648   int __pyx_t_22;
5649   int __pyx_lineno = 0;
5650   const char *__pyx_filename = NULL;
5651   int __pyx_clineno = 0;
5652   __Pyx_RefNannySetupContext("__init__", 0);
5653 
5654   /* "qutip/cy/cqobjevo_factor.pyx":148
5655  *     def __init__(self, ops, args, tlist):
5656  *         cdef int i, j
5657  *         self._args = {}             # <<<<<<<<<<<<<<
5658  *         self._num_ops = len(ops)
5659  *         self.tlist = tlist
5660  */
5661   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
5662   __Pyx_GOTREF(__pyx_t_1);
5663   __Pyx_GIVEREF(__pyx_t_1);
5664   __Pyx_GOTREF(__pyx_v_self->__pyx_base._args);
5665   __Pyx_DECREF(__pyx_v_self->__pyx_base._args);
5666   __pyx_v_self->__pyx_base._args = ((PyObject*)__pyx_t_1);
5667   __pyx_t_1 = 0;
5668 
5669   /* "qutip/cy/cqobjevo_factor.pyx":149
5670  *         cdef int i, j
5671  *         self._args = {}
5672  *         self._num_ops = len(ops)             # <<<<<<<<<<<<<<
5673  *         self.tlist = tlist
5674  *         self.n_t = len(tlist)
5675  */
5676   __pyx_t_2 = PyObject_Length(__pyx_v_ops); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 149, __pyx_L1_error)
5677   __pyx_v_self->__pyx_base._num_ops = __pyx_t_2;
5678 
5679   /* "qutip/cy/cqobjevo_factor.pyx":150
5680  *         self._args = {}
5681  *         self._num_ops = len(ops)
5682  *         self.tlist = tlist             # <<<<<<<<<<<<<<
5683  *         self.n_t = len(tlist)
5684  *         self.dt = tlist[1]-tlist[0]
5685  */
5686   __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_tlist, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 150, __pyx_L1_error)
5687   __PYX_XDEC_MEMVIEW(&__pyx_v_self->tlist, 0);
5688   __pyx_v_self->tlist = __pyx_t_3;
5689   __pyx_t_3.memview = NULL;
5690   __pyx_t_3.data = NULL;
5691 
5692   /* "qutip/cy/cqobjevo_factor.pyx":151
5693  *         self._num_ops = len(ops)
5694  *         self.tlist = tlist
5695  *         self.n_t = len(tlist)             # <<<<<<<<<<<<<<
5696  *         self.dt = tlist[1]-tlist[0]
5697  *         self.y = np.zeros((self._num_ops, self.n_t), dtype=complex)
5698  */
5699   __pyx_t_2 = PyObject_Length(__pyx_v_tlist); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 151, __pyx_L1_error)
5700   __pyx_v_self->n_t = __pyx_t_2;
5701 
5702   /* "qutip/cy/cqobjevo_factor.pyx":152
5703  *         self.tlist = tlist
5704  *         self.n_t = len(tlist)
5705  *         self.dt = tlist[1]-tlist[0]             # <<<<<<<<<<<<<<
5706  *         self.y = np.zeros((self._num_ops, self.n_t), dtype=complex)
5707  *         self.M = np.zeros((self._num_ops, self.n_t), dtype=complex)
5708  */
5709   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_tlist, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
5710   __Pyx_GOTREF(__pyx_t_1);
5711   __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_tlist, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error)
5712   __Pyx_GOTREF(__pyx_t_4);
5713   __pyx_t_5 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 152, __pyx_L1_error)
5714   __Pyx_GOTREF(__pyx_t_5);
5715   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5716   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5717   __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 152, __pyx_L1_error)
5718   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5719   __pyx_v_self->dt = __pyx_t_6;
5720 
5721   /* "qutip/cy/cqobjevo_factor.pyx":153
5722  *         self.n_t = len(tlist)
5723  *         self.dt = tlist[1]-tlist[0]
5724  *         self.y = np.zeros((self._num_ops, self.n_t), dtype=complex)             # <<<<<<<<<<<<<<
5725  *         self.M = np.zeros((self._num_ops, self.n_t), dtype=complex)
5726  *
5727  */
5728   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error)
5729   __Pyx_GOTREF(__pyx_t_5);
5730   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error)
5731   __Pyx_GOTREF(__pyx_t_4);
5732   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5733   __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base._num_ops); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error)
5734   __Pyx_GOTREF(__pyx_t_5);
5735   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->n_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error)
5736   __Pyx_GOTREF(__pyx_t_1);
5737   __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 153, __pyx_L1_error)
5738   __Pyx_GOTREF(__pyx_t_7);
5739   __Pyx_GIVEREF(__pyx_t_5);
5740   PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
5741   __Pyx_GIVEREF(__pyx_t_1);
5742   PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
5743   __pyx_t_5 = 0;
5744   __pyx_t_1 = 0;
5745   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error)
5746   __Pyx_GOTREF(__pyx_t_1);
5747   __Pyx_GIVEREF(__pyx_t_7);
5748   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7);
5749   __pyx_t_7 = 0;
5750   __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 153, __pyx_L1_error)
5751   __Pyx_GOTREF(__pyx_t_7);
5752   if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, ((PyObject *)(&PyComplex_Type))) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
5753   __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error)
5754   __Pyx_GOTREF(__pyx_t_5);
5755   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5756   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5757   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5758   __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 153, __pyx_L1_error)
5759   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5760   __PYX_XDEC_MEMVIEW(&__pyx_v_self->y, 0);
5761   __pyx_v_self->y = __pyx_t_8;
5762   __pyx_t_8.memview = NULL;
5763   __pyx_t_8.data = NULL;
5764 
5765   /* "qutip/cy/cqobjevo_factor.pyx":154
5766  *         self.dt = tlist[1]-tlist[0]
5767  *         self.y = np.zeros((self._num_ops, self.n_t), dtype=complex)
5768  *         self.M = np.zeros((self._num_ops, self.n_t), dtype=complex)             # <<<<<<<<<<<<<<
5769  *
5770  *         for i in range(self._num_ops):
5771  */
5772   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 154, __pyx_L1_error)
5773   __Pyx_GOTREF(__pyx_t_5);
5774   __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 154, __pyx_L1_error)
5775   __Pyx_GOTREF(__pyx_t_7);
5776   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5777   __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base._num_ops); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 154, __pyx_L1_error)
5778   __Pyx_GOTREF(__pyx_t_5);
5779   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->n_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error)
5780   __Pyx_GOTREF(__pyx_t_1);
5781   __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 154, __pyx_L1_error)
5782   __Pyx_GOTREF(__pyx_t_4);
5783   __Pyx_GIVEREF(__pyx_t_5);
5784   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
5785   __Pyx_GIVEREF(__pyx_t_1);
5786   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
5787   __pyx_t_5 = 0;
5788   __pyx_t_1 = 0;
5789   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error)
5790   __Pyx_GOTREF(__pyx_t_1);
5791   __Pyx_GIVEREF(__pyx_t_4);
5792   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
5793   __pyx_t_4 = 0;
5794   __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 154, __pyx_L1_error)
5795   __Pyx_GOTREF(__pyx_t_4);
5796   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, ((PyObject *)(&PyComplex_Type))) < 0) __PYX_ERR(0, 154, __pyx_L1_error)
5797   __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 154, __pyx_L1_error)
5798   __Pyx_GOTREF(__pyx_t_5);
5799   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5800   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5801   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5802   __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 154, __pyx_L1_error)
5803   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5804   __PYX_XDEC_MEMVIEW(&__pyx_v_self->M, 0);
5805   __pyx_v_self->M = __pyx_t_8;
5806   __pyx_t_8.memview = NULL;
5807   __pyx_t_8.data = NULL;
5808 
5809   /* "qutip/cy/cqobjevo_factor.pyx":156
5810  *         self.M = np.zeros((self._num_ops, self.n_t), dtype=complex)
5811  *
5812  *         for i in range(self._num_ops):             # <<<<<<<<<<<<<<
5813  *             m, cte = _prep_cubic_spline(ops[i][2], tlist)
5814  *             if not cte:
5815  */
5816   __pyx_t_9 = __pyx_v_self->__pyx_base._num_ops;
5817   __pyx_t_10 = __pyx_t_9;
5818   for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
5819     __pyx_v_i = __pyx_t_11;
5820 
5821     /* "qutip/cy/cqobjevo_factor.pyx":157
5822  *
5823  *         for i in range(self._num_ops):
5824  *             m, cte = _prep_cubic_spline(ops[i][2], tlist)             # <<<<<<<<<<<<<<
5825  *             if not cte:
5826  *                 raise Exception("tlist not sampled uniformly")
5827  */
5828     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_prep_cubic_spline); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
5829     __Pyx_GOTREF(__pyx_t_4);
5830     __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ops, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
5831     __Pyx_GOTREF(__pyx_t_1);
5832     __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 157, __pyx_L1_error)
5833     __Pyx_GOTREF(__pyx_t_7);
5834     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5835     __pyx_t_1 = NULL;
5836     __pyx_t_12 = 0;
5837     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5838       __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
5839       if (likely(__pyx_t_1)) {
5840         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5841         __Pyx_INCREF(__pyx_t_1);
5842         __Pyx_INCREF(function);
5843         __Pyx_DECREF_SET(__pyx_t_4, function);
5844         __pyx_t_12 = 1;
5845       }
5846     }
5847     #if CYTHON_FAST_PYCALL
5848     if (PyFunction_Check(__pyx_t_4)) {
5849       PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_7, __pyx_v_tlist};
5850       __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error)
5851       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5852       __Pyx_GOTREF(__pyx_t_5);
5853       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5854     } else
5855     #endif
5856     #if CYTHON_FAST_PYCCALL
5857     if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
5858       PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_7, __pyx_v_tlist};
5859       __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error)
5860       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5861       __Pyx_GOTREF(__pyx_t_5);
5862       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5863     } else
5864     #endif
5865     {
5866       __pyx_t_13 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 157, __pyx_L1_error)
5867       __Pyx_GOTREF(__pyx_t_13);
5868       if (__pyx_t_1) {
5869         __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1); __pyx_t_1 = NULL;
5870       }
5871       __Pyx_GIVEREF(__pyx_t_7);
5872       PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_t_7);
5873       __Pyx_INCREF(__pyx_v_tlist);
5874       __Pyx_GIVEREF(__pyx_v_tlist);
5875       PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_v_tlist);
5876       __pyx_t_7 = 0;
5877       __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error)
5878       __Pyx_GOTREF(__pyx_t_5);
5879       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5880     }
5881     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5882     if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
5883       PyObject* sequence = __pyx_t_5;
5884       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
5885       if (unlikely(size != 2)) {
5886         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
5887         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
5888         __PYX_ERR(0, 157, __pyx_L1_error)
5889       }
5890       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5891       if (likely(PyTuple_CheckExact(sequence))) {
5892         __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
5893         __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1);
5894       } else {
5895         __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
5896         __pyx_t_13 = PyList_GET_ITEM(sequence, 1);
5897       }
5898       __Pyx_INCREF(__pyx_t_4);
5899       __Pyx_INCREF(__pyx_t_13);
5900       #else
5901       __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
5902       __Pyx_GOTREF(__pyx_t_4);
5903       __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 157, __pyx_L1_error)
5904       __Pyx_GOTREF(__pyx_t_13);
5905       #endif
5906       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5907     } else {
5908       Py_ssize_t index = -1;
5909       __pyx_t_7 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 157, __pyx_L1_error)
5910       __Pyx_GOTREF(__pyx_t_7);
5911       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5912       __pyx_t_14 = Py_TYPE(__pyx_t_7)->tp_iternext;
5913       index = 0; __pyx_t_4 = __pyx_t_14(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
5914       __Pyx_GOTREF(__pyx_t_4);
5915       index = 1; __pyx_t_13 = __pyx_t_14(__pyx_t_7); if (unlikely(!__pyx_t_13)) goto __pyx_L5_unpacking_failed;
5916       __Pyx_GOTREF(__pyx_t_13);
5917       if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_7), 2) < 0) __PYX_ERR(0, 157, __pyx_L1_error)
5918       __pyx_t_14 = NULL;
5919       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5920       goto __pyx_L6_unpacking_done;
5921       __pyx_L5_unpacking_failed:;
5922       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5923       __pyx_t_14 = NULL;
5924       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
5925       __PYX_ERR(0, 157, __pyx_L1_error)
5926       __pyx_L6_unpacking_done:;
5927     }
5928     __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_4);
5929     __pyx_t_4 = 0;
5930     __Pyx_XDECREF_SET(__pyx_v_cte, __pyx_t_13);
5931     __pyx_t_13 = 0;
5932 
5933     /* "qutip/cy/cqobjevo_factor.pyx":158
5934  *         for i in range(self._num_ops):
5935  *             m, cte = _prep_cubic_spline(ops[i][2], tlist)
5936  *             if not cte:             # <<<<<<<<<<<<<<
5937  *                 raise Exception("tlist not sampled uniformly")
5938  *             for j in range(self.n_t):
5939  */
5940     __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_cte); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 158, __pyx_L1_error)
5941     __pyx_t_16 = ((!__pyx_t_15) != 0);
5942     if (unlikely(__pyx_t_16)) {
5943 
5944       /* "qutip/cy/cqobjevo_factor.pyx":159
5945  *             m, cte = _prep_cubic_spline(ops[i][2], tlist)
5946  *             if not cte:
5947  *                 raise Exception("tlist not sampled uniformly")             # <<<<<<<<<<<<<<
5948  *             for j in range(self.n_t):
5949  *                 self.y[i,j] = ops[i][2][j]
5950  */
5951       __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error)
5952       __Pyx_GOTREF(__pyx_t_5);
5953       __Pyx_Raise(__pyx_t_5, 0, 0, 0);
5954       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5955       __PYX_ERR(0, 159, __pyx_L1_error)
5956 
5957       /* "qutip/cy/cqobjevo_factor.pyx":158
5958  *         for i in range(self._num_ops):
5959  *             m, cte = _prep_cubic_spline(ops[i][2], tlist)
5960  *             if not cte:             # <<<<<<<<<<<<<<
5961  *                 raise Exception("tlist not sampled uniformly")
5962  *             for j in range(self.n_t):
5963  */
5964     }
5965 
5966     /* "qutip/cy/cqobjevo_factor.pyx":160
5967  *             if not cte:
5968  *                 raise Exception("tlist not sampled uniformly")
5969  *             for j in range(self.n_t):             # <<<<<<<<<<<<<<
5970  *                 self.y[i,j] = ops[i][2][j]
5971  *                 self.M[i,j] = m[j]
5972  */
5973     __pyx_t_12 = __pyx_v_self->n_t;
5974     __pyx_t_17 = __pyx_t_12;
5975     for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
5976       __pyx_v_j = __pyx_t_18;
5977 
5978       /* "qutip/cy/cqobjevo_factor.pyx":161
5979  *                 raise Exception("tlist not sampled uniformly")
5980  *             for j in range(self.n_t):
5981  *                 self.y[i,j] = ops[i][2][j]             # <<<<<<<<<<<<<<
5982  *                 self.M[i,j] = m[j]
5983  *
5984  */
5985       __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_ops, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 161, __pyx_L1_error)
5986       __Pyx_GOTREF(__pyx_t_5);
5987       __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_5, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 161, __pyx_L1_error)
5988       __Pyx_GOTREF(__pyx_t_13);
5989       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5990       __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_13, __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 161, __pyx_L1_error)
5991       __Pyx_GOTREF(__pyx_t_5);
5992       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5993       __pyx_t_19 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
5994       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5995       if (unlikely(!__pyx_v_self->y.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 161, __pyx_L1_error)}
5996       __pyx_t_20 = __pyx_v_i;
5997       __pyx_t_21 = __pyx_v_j;
5998       __pyx_t_22 = -1;
5999       if (__pyx_t_20 < 0) {
6000         __pyx_t_20 += __pyx_v_self->y.shape[0];
6001         if (unlikely(__pyx_t_20 < 0)) __pyx_t_22 = 0;
6002       } else if (unlikely(__pyx_t_20 >= __pyx_v_self->y.shape[0])) __pyx_t_22 = 0;
6003       if (__pyx_t_21 < 0) {
6004         __pyx_t_21 += __pyx_v_self->y.shape[1];
6005         if (unlikely(__pyx_t_21 < 0)) __pyx_t_22 = 1;
6006       } else if (unlikely(__pyx_t_21 >= __pyx_v_self->y.shape[1])) __pyx_t_22 = 1;
6007       if (unlikely(__pyx_t_22 != -1)) {
6008         __Pyx_RaiseBufferIndexError(__pyx_t_22);
6009         __PYX_ERR(0, 161, __pyx_L1_error)
6010       }
6011       *((__pyx_t_double_complex *) ( /* dim=1 */ ((char *) (((__pyx_t_double_complex *) ( /* dim=0 */ (__pyx_v_self->y.data + __pyx_t_20 * __pyx_v_self->y.strides[0]) )) + __pyx_t_21)) )) = __pyx_t_19;
6012 
6013       /* "qutip/cy/cqobjevo_factor.pyx":162
6014  *             for j in range(self.n_t):
6015  *                 self.y[i,j] = ops[i][2][j]
6016  *                 self.M[i,j] = m[j]             # <<<<<<<<<<<<<<
6017  *
6018  *     cdef void _call_core(self, double t, complex* coeff):
6019  */
6020       __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_m, __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 162, __pyx_L1_error)
6021       __Pyx_GOTREF(__pyx_t_5);
6022       __pyx_t_19 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 162, __pyx_L1_error)
6023       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6024       if (unlikely(!__pyx_v_self->M.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 162, __pyx_L1_error)}
6025       __pyx_t_21 = __pyx_v_i;
6026       __pyx_t_20 = __pyx_v_j;
6027       __pyx_t_22 = -1;
6028       if (__pyx_t_21 < 0) {
6029         __pyx_t_21 += __pyx_v_self->M.shape[0];
6030         if (unlikely(__pyx_t_21 < 0)) __pyx_t_22 = 0;
6031       } else if (unlikely(__pyx_t_21 >= __pyx_v_self->M.shape[0])) __pyx_t_22 = 0;
6032       if (__pyx_t_20 < 0) {
6033         __pyx_t_20 += __pyx_v_self->M.shape[1];
6034         if (unlikely(__pyx_t_20 < 0)) __pyx_t_22 = 1;
6035       } else if (unlikely(__pyx_t_20 >= __pyx_v_self->M.shape[1])) __pyx_t_22 = 1;
6036       if (unlikely(__pyx_t_22 != -1)) {
6037         __Pyx_RaiseBufferIndexError(__pyx_t_22);
6038         __PYX_ERR(0, 162, __pyx_L1_error)
6039       }
6040       *((__pyx_t_double_complex *) ( /* dim=1 */ ((char *) (((__pyx_t_double_complex *) ( /* dim=0 */ (__pyx_v_self->M.data + __pyx_t_21 * __pyx_v_self->M.strides[0]) )) + __pyx_t_20)) )) = __pyx_t_19;
6041     }
6042   }
6043 
6044   /* "qutip/cy/cqobjevo_factor.pyx":146
6045  *     cdef complex[:,::1] y, M
6046  *
6047  *     def __init__(self, ops, args, tlist):             # <<<<<<<<<<<<<<
6048  *         cdef int i, j
6049  *         self._args = {}
6050  */
6051 
6052   /* function exit code */
6053   __pyx_r = 0;
6054   goto __pyx_L0;
6055   __pyx_L1_error:;
6056   __Pyx_XDECREF(__pyx_t_1);
6057   __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
6058   __Pyx_XDECREF(__pyx_t_4);
6059   __Pyx_XDECREF(__pyx_t_5);
6060   __Pyx_XDECREF(__pyx_t_7);
6061   __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
6062   __Pyx_XDECREF(__pyx_t_13);
6063   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.InterCoeffCte.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6064   __pyx_r = -1;
6065   __pyx_L0:;
6066   __Pyx_XDECREF(__pyx_v_m);
6067   __Pyx_XDECREF(__pyx_v_cte);
6068   __Pyx_RefNannyFinishContext();
6069   return __pyx_r;
6070 }
6071 
6072 /* "qutip/cy/cqobjevo_factor.pyx":164
6073  *                 self.M[i,j] = m[j]
6074  *
6075  *     cdef void _call_core(self, double t, complex* coeff):             # <<<<<<<<<<<<<<
6076  *         cdef int i
6077  *         for i in range(self._num_ops):
6078  */
6079 
__pyx_f_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte__call_core(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte * __pyx_v_self,double __pyx_v_t,__pyx_t_double_complex * __pyx_v_coeff)6080 static void __pyx_f_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte__call_core(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *__pyx_v_self, double __pyx_v_t, __pyx_t_double_complex *__pyx_v_coeff) {
6081   int __pyx_v_i;
6082   __Pyx_RefNannyDeclarations
6083   int __pyx_t_1;
6084   int __pyx_t_2;
6085   int __pyx_t_3;
6086   __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
6087   __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
6088   int __pyx_lineno = 0;
6089   const char *__pyx_filename = NULL;
6090   int __pyx_clineno = 0;
6091   __Pyx_RefNannySetupContext("_call_core", 0);
6092 
6093   /* "qutip/cy/cqobjevo_factor.pyx":166
6094  *     cdef void _call_core(self, double t, complex* coeff):
6095  *         cdef int i
6096  *         for i in range(self._num_ops):             # <<<<<<<<<<<<<<
6097  *             coeff[i] = _spline_complex_cte_second(t, self.tlist,
6098  *                                     self.y[i,:], self.M[i,:], self.n_t, self.dt)
6099  */
6100   __pyx_t_1 = __pyx_v_self->__pyx_base._num_ops;
6101   __pyx_t_2 = __pyx_t_1;
6102   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
6103     __pyx_v_i = __pyx_t_3;
6104 
6105     /* "qutip/cy/cqobjevo_factor.pyx":167
6106  *         cdef int i
6107  *         for i in range(self._num_ops):
6108  *             coeff[i] = _spline_complex_cte_second(t, self.tlist,             # <<<<<<<<<<<<<<
6109  *                                     self.y[i,:], self.M[i,:], self.n_t, self.dt)
6110  *
6111  */
6112     if (unlikely(!__pyx_v_self->tlist.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 167, __pyx_L1_error)}
6113 
6114     /* "qutip/cy/cqobjevo_factor.pyx":168
6115  *         for i in range(self._num_ops):
6116  *             coeff[i] = _spline_complex_cte_second(t, self.tlist,
6117  *                                     self.y[i,:], self.M[i,:], self.n_t, self.dt)             # <<<<<<<<<<<<<<
6118  *
6119  *     def set_args(self, args):
6120  */
6121     if (unlikely(!__pyx_v_self->y.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 168, __pyx_L1_error)}
6122     __pyx_t_4.data = __pyx_v_self->y.data;
6123     __pyx_t_4.memview = __pyx_v_self->y.memview;
6124     __PYX_INC_MEMVIEW(&__pyx_t_4, 0);
6125     {
6126     Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
6127         Py_ssize_t __pyx_tmp_shape = __pyx_v_self->y.shape[0];
6128     Py_ssize_t __pyx_tmp_stride = __pyx_v_self->y.strides[0];
6129         if (__pyx_tmp_idx < 0)
6130             __pyx_tmp_idx += __pyx_tmp_shape;
6131         if (unlikely(!__Pyx_is_valid_index(__pyx_tmp_idx, __pyx_tmp_shape))) {
6132             PyErr_SetString(PyExc_IndexError,
6133                             "Index out of bounds (axis 0)");
6134             __PYX_ERR(0, 168, __pyx_L1_error)
6135         }
6136         __pyx_t_4.data += __pyx_tmp_idx * __pyx_tmp_stride;
6137 }
6138 
6139 __pyx_t_4.shape[0] = __pyx_v_self->y.shape[1];
6140 __pyx_t_4.strides[0] = __pyx_v_self->y.strides[1];
6141     __pyx_t_4.suboffsets[0] = -1;
6142 
6143 if (unlikely(!__pyx_v_self->M.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 168, __pyx_L1_error)}
6144     __pyx_t_5.data = __pyx_v_self->M.data;
6145     __pyx_t_5.memview = __pyx_v_self->M.memview;
6146     __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
6147     {
6148     Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
6149         Py_ssize_t __pyx_tmp_shape = __pyx_v_self->M.shape[0];
6150     Py_ssize_t __pyx_tmp_stride = __pyx_v_self->M.strides[0];
6151         if (__pyx_tmp_idx < 0)
6152             __pyx_tmp_idx += __pyx_tmp_shape;
6153         if (unlikely(!__Pyx_is_valid_index(__pyx_tmp_idx, __pyx_tmp_shape))) {
6154             PyErr_SetString(PyExc_IndexError,
6155                             "Index out of bounds (axis 0)");
6156             __PYX_ERR(0, 168, __pyx_L1_error)
6157         }
6158         __pyx_t_5.data += __pyx_tmp_idx * __pyx_tmp_stride;
6159 }
6160 
6161 __pyx_t_5.shape[0] = __pyx_v_self->M.shape[1];
6162 __pyx_t_5.strides[0] = __pyx_v_self->M.strides[1];
6163     __pyx_t_5.suboffsets[0] = -1;
6164 
6165 (__pyx_v_coeff[__pyx_v_i]) = __pyx_f_5qutip_2cy_5inter__spline_complex_cte_second(__pyx_v_t, __pyx_v_self->tlist, __pyx_t_4, __pyx_t_5, __pyx_v_self->n_t, __pyx_v_self->dt);
6166 
6167     /* "qutip/cy/cqobjevo_factor.pyx":167
6168  *         cdef int i
6169  *         for i in range(self._num_ops):
6170  *             coeff[i] = _spline_complex_cte_second(t, self.tlist,             # <<<<<<<<<<<<<<
6171  *                                     self.y[i,:], self.M[i,:], self.n_t, self.dt)
6172  *
6173  */
6174     __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6175     __pyx_t_4.memview = NULL;
6176     __pyx_t_4.data = NULL;
6177     __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6178     __pyx_t_5.memview = NULL;
6179     __pyx_t_5.data = NULL;
6180   }
6181 
6182   /* "qutip/cy/cqobjevo_factor.pyx":164
6183  *                 self.M[i,j] = m[j]
6184  *
6185  *     cdef void _call_core(self, double t, complex* coeff):             # <<<<<<<<<<<<<<
6186  *         cdef int i
6187  *         for i in range(self._num_ops):
6188  */
6189 
6190   /* function exit code */
6191   goto __pyx_L0;
6192   __pyx_L1_error:;
6193   __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6194   __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6195   __Pyx_WriteUnraisable("qutip.cy.cqobjevo_factor.InterCoeffCte._call_core", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6196   __pyx_L0:;
6197   __Pyx_RefNannyFinishContext();
6198 }
6199 
6200 /* "qutip/cy/cqobjevo_factor.pyx":170
6201  *                                     self.y[i,:], self.M[i,:], self.n_t, self.dt)
6202  *
6203  *     def set_args(self, args):             # <<<<<<<<<<<<<<
6204  *         pass
6205  *
6206  */
6207 
6208 /* Python wrapper */
6209 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_3set_args(PyObject *__pyx_v_self, PyObject *__pyx_v_args); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_3set_args(PyObject * __pyx_v_self,PyObject * __pyx_v_args)6210 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_3set_args(PyObject *__pyx_v_self, PyObject *__pyx_v_args) {
6211   PyObject *__pyx_r = 0;
6212   __Pyx_RefNannyDeclarations
6213   __Pyx_RefNannySetupContext("set_args (wrapper)", 0);
6214   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_2set_args(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *)__pyx_v_self), ((PyObject *)__pyx_v_args));
6215 
6216   /* function exit code */
6217   __Pyx_RefNannyFinishContext();
6218   return __pyx_r;
6219 }
6220 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_2set_args(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v_args)6221 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_2set_args(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args) {
6222   PyObject *__pyx_r = NULL;
6223   __Pyx_RefNannyDeclarations
6224   __Pyx_RefNannySetupContext("set_args", 0);
6225 
6226   /* function exit code */
6227   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6228   __Pyx_XGIVEREF(__pyx_r);
6229   __Pyx_RefNannyFinishContext();
6230   return __pyx_r;
6231 }
6232 
6233 /* "qutip/cy/cqobjevo_factor.pyx":173
6234  *         pass
6235  *
6236  *     def __getstate__(self):             # <<<<<<<<<<<<<<
6237  *         return (self._num_ops, self.n_t, self.dt, np.array(self.tlist),
6238  *                 np.array(self.y), np.array(self.M))
6239  */
6240 
6241 /* Python wrapper */
6242 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_5__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_5__getstate__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)6243 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_5__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6244   PyObject *__pyx_r = 0;
6245   __Pyx_RefNannyDeclarations
6246   __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
6247   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_4__getstate__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *)__pyx_v_self));
6248 
6249   /* function exit code */
6250   __Pyx_RefNannyFinishContext();
6251   return __pyx_r;
6252 }
6253 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_4__getstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte * __pyx_v_self)6254 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_4__getstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *__pyx_v_self) {
6255   PyObject *__pyx_r = NULL;
6256   __Pyx_RefNannyDeclarations
6257   PyObject *__pyx_t_1 = NULL;
6258   PyObject *__pyx_t_2 = NULL;
6259   PyObject *__pyx_t_3 = NULL;
6260   PyObject *__pyx_t_4 = NULL;
6261   PyObject *__pyx_t_5 = NULL;
6262   PyObject *__pyx_t_6 = NULL;
6263   PyObject *__pyx_t_7 = NULL;
6264   PyObject *__pyx_t_8 = NULL;
6265   PyObject *__pyx_t_9 = NULL;
6266   int __pyx_lineno = 0;
6267   const char *__pyx_filename = NULL;
6268   int __pyx_clineno = 0;
6269   __Pyx_RefNannySetupContext("__getstate__", 0);
6270 
6271   /* "qutip/cy/cqobjevo_factor.pyx":174
6272  *
6273  *     def __getstate__(self):
6274  *         return (self._num_ops, self.n_t, self.dt, np.array(self.tlist),             # <<<<<<<<<<<<<<
6275  *                 np.array(self.y), np.array(self.M))
6276  *
6277  */
6278   __Pyx_XDECREF(__pyx_r);
6279   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base._num_ops); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
6280   __Pyx_GOTREF(__pyx_t_1);
6281   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->n_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
6282   __Pyx_GOTREF(__pyx_t_2);
6283   __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->dt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __pyx_L1_error)
6284   __Pyx_GOTREF(__pyx_t_3);
6285   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 174, __pyx_L1_error)
6286   __Pyx_GOTREF(__pyx_t_5);
6287   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 174, __pyx_L1_error)
6288   __Pyx_GOTREF(__pyx_t_6);
6289   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6290   if (unlikely(!__pyx_v_self->tlist.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 174, __pyx_L1_error)}
6291   __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_self->tlist, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 174, __pyx_L1_error)
6292   __Pyx_GOTREF(__pyx_t_5);
6293   __pyx_t_7 = NULL;
6294   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
6295     __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
6296     if (likely(__pyx_t_7)) {
6297       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
6298       __Pyx_INCREF(__pyx_t_7);
6299       __Pyx_INCREF(function);
6300       __Pyx_DECREF_SET(__pyx_t_6, function);
6301     }
6302   }
6303   __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5);
6304   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6305   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6306   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error)
6307   __Pyx_GOTREF(__pyx_t_4);
6308   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6309 
6310   /* "qutip/cy/cqobjevo_factor.pyx":175
6311  *     def __getstate__(self):
6312  *         return (self._num_ops, self.n_t, self.dt, np.array(self.tlist),
6313  *                 np.array(self.y), np.array(self.M))             # <<<<<<<<<<<<<<
6314  *
6315  *     def __setstate__(self, state):
6316  */
6317   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 175, __pyx_L1_error)
6318   __Pyx_GOTREF(__pyx_t_5);
6319   __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 175, __pyx_L1_error)
6320   __Pyx_GOTREF(__pyx_t_7);
6321   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6322   if (unlikely(!__pyx_v_self->y.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 175, __pyx_L1_error)}
6323   __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_self->y, 2, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 175, __pyx_L1_error)
6324   __Pyx_GOTREF(__pyx_t_5);
6325   __pyx_t_8 = NULL;
6326   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
6327     __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
6328     if (likely(__pyx_t_8)) {
6329       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
6330       __Pyx_INCREF(__pyx_t_8);
6331       __Pyx_INCREF(function);
6332       __Pyx_DECREF_SET(__pyx_t_7, function);
6333     }
6334   }
6335   __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5);
6336   __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6337   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6338   if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 175, __pyx_L1_error)
6339   __Pyx_GOTREF(__pyx_t_6);
6340   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6341   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 175, __pyx_L1_error)
6342   __Pyx_GOTREF(__pyx_t_5);
6343   __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 175, __pyx_L1_error)
6344   __Pyx_GOTREF(__pyx_t_8);
6345   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6346   if (unlikely(!__pyx_v_self->M.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 175, __pyx_L1_error)}
6347   __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_self->M, 2, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 175, __pyx_L1_error)
6348   __Pyx_GOTREF(__pyx_t_5);
6349   __pyx_t_9 = NULL;
6350   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
6351     __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
6352     if (likely(__pyx_t_9)) {
6353       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
6354       __Pyx_INCREF(__pyx_t_9);
6355       __Pyx_INCREF(function);
6356       __Pyx_DECREF_SET(__pyx_t_8, function);
6357     }
6358   }
6359   __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_5);
6360   __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
6361   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6362   if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 175, __pyx_L1_error)
6363   __Pyx_GOTREF(__pyx_t_7);
6364   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6365 
6366   /* "qutip/cy/cqobjevo_factor.pyx":174
6367  *
6368  *     def __getstate__(self):
6369  *         return (self._num_ops, self.n_t, self.dt, np.array(self.tlist),             # <<<<<<<<<<<<<<
6370  *                 np.array(self.y), np.array(self.M))
6371  *
6372  */
6373   __pyx_t_8 = PyTuple_New(6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 174, __pyx_L1_error)
6374   __Pyx_GOTREF(__pyx_t_8);
6375   __Pyx_GIVEREF(__pyx_t_1);
6376   PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
6377   __Pyx_GIVEREF(__pyx_t_2);
6378   PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2);
6379   __Pyx_GIVEREF(__pyx_t_3);
6380   PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_3);
6381   __Pyx_GIVEREF(__pyx_t_4);
6382   PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_4);
6383   __Pyx_GIVEREF(__pyx_t_6);
6384   PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_6);
6385   __Pyx_GIVEREF(__pyx_t_7);
6386   PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_t_7);
6387   __pyx_t_1 = 0;
6388   __pyx_t_2 = 0;
6389   __pyx_t_3 = 0;
6390   __pyx_t_4 = 0;
6391   __pyx_t_6 = 0;
6392   __pyx_t_7 = 0;
6393   __pyx_r = __pyx_t_8;
6394   __pyx_t_8 = 0;
6395   goto __pyx_L0;
6396 
6397   /* "qutip/cy/cqobjevo_factor.pyx":173
6398  *         pass
6399  *
6400  *     def __getstate__(self):             # <<<<<<<<<<<<<<
6401  *         return (self._num_ops, self.n_t, self.dt, np.array(self.tlist),
6402  *                 np.array(self.y), np.array(self.M))
6403  */
6404 
6405   /* function exit code */
6406   __pyx_L1_error:;
6407   __Pyx_XDECREF(__pyx_t_1);
6408   __Pyx_XDECREF(__pyx_t_2);
6409   __Pyx_XDECREF(__pyx_t_3);
6410   __Pyx_XDECREF(__pyx_t_4);
6411   __Pyx_XDECREF(__pyx_t_5);
6412   __Pyx_XDECREF(__pyx_t_6);
6413   __Pyx_XDECREF(__pyx_t_7);
6414   __Pyx_XDECREF(__pyx_t_8);
6415   __Pyx_XDECREF(__pyx_t_9);
6416   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.InterCoeffCte.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6417   __pyx_r = NULL;
6418   __pyx_L0:;
6419   __Pyx_XGIVEREF(__pyx_r);
6420   __Pyx_RefNannyFinishContext();
6421   return __pyx_r;
6422 }
6423 
6424 /* "qutip/cy/cqobjevo_factor.pyx":177
6425  *                 np.array(self.y), np.array(self.M))
6426  *
6427  *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
6428  *         self._num_ops = state[0]
6429  *         self.n_t = state[1]
6430  */
6431 
6432 /* Python wrapper */
6433 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_7__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_7__setstate__(PyObject * __pyx_v_self,PyObject * __pyx_v_state)6434 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_7__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
6435   PyObject *__pyx_r = 0;
6436   __Pyx_RefNannyDeclarations
6437   __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0);
6438   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_6__setstate__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *)__pyx_v_self), ((PyObject *)__pyx_v_state));
6439 
6440   /* function exit code */
6441   __Pyx_RefNannyFinishContext();
6442   return __pyx_r;
6443 }
6444 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_6__setstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte * __pyx_v_self,PyObject * __pyx_v_state)6445 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_6__setstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *__pyx_v_self, PyObject *__pyx_v_state) {
6446   PyObject *__pyx_r = NULL;
6447   __Pyx_RefNannyDeclarations
6448   PyObject *__pyx_t_1 = NULL;
6449   int __pyx_t_2;
6450   double __pyx_t_3;
6451   __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
6452   __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
6453   int __pyx_lineno = 0;
6454   const char *__pyx_filename = NULL;
6455   int __pyx_clineno = 0;
6456   __Pyx_RefNannySetupContext("__setstate__", 0);
6457 
6458   /* "qutip/cy/cqobjevo_factor.pyx":178
6459  *
6460  *     def __setstate__(self, state):
6461  *         self._num_ops = state[0]             # <<<<<<<<<<<<<<
6462  *         self.n_t = state[1]
6463  *         self.dt = state[2]
6464  */
6465   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
6466   __Pyx_GOTREF(__pyx_t_1);
6467   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L1_error)
6468   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6469   __pyx_v_self->__pyx_base._num_ops = __pyx_t_2;
6470 
6471   /* "qutip/cy/cqobjevo_factor.pyx":179
6472  *     def __setstate__(self, state):
6473  *         self._num_ops = state[0]
6474  *         self.n_t = state[1]             # <<<<<<<<<<<<<<
6475  *         self.dt = state[2]
6476  *         self.tlist = state[3]
6477  */
6478   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error)
6479   __Pyx_GOTREF(__pyx_t_1);
6480   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L1_error)
6481   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6482   __pyx_v_self->n_t = __pyx_t_2;
6483 
6484   /* "qutip/cy/cqobjevo_factor.pyx":180
6485  *         self._num_ops = state[0]
6486  *         self.n_t = state[1]
6487  *         self.dt = state[2]             # <<<<<<<<<<<<<<
6488  *         self.tlist = state[3]
6489  *         self.y = state[4]
6490  */
6491   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error)
6492   __Pyx_GOTREF(__pyx_t_1);
6493   __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L1_error)
6494   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6495   __pyx_v_self->dt = __pyx_t_3;
6496 
6497   /* "qutip/cy/cqobjevo_factor.pyx":181
6498  *         self.n_t = state[1]
6499  *         self.dt = state[2]
6500  *         self.tlist = state[3]             # <<<<<<<<<<<<<<
6501  *         self.y = state[4]
6502  *         self.M = state[5]
6503  */
6504   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error)
6505   __Pyx_GOTREF(__pyx_t_1);
6506   __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 181, __pyx_L1_error)
6507   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6508   __PYX_XDEC_MEMVIEW(&__pyx_v_self->tlist, 0);
6509   __pyx_v_self->tlist = __pyx_t_4;
6510   __pyx_t_4.memview = NULL;
6511   __pyx_t_4.data = NULL;
6512 
6513   /* "qutip/cy/cqobjevo_factor.pyx":182
6514  *         self.dt = state[2]
6515  *         self.tlist = state[3]
6516  *         self.y = state[4]             # <<<<<<<<<<<<<<
6517  *         self.M = state[5]
6518  *
6519  */
6520   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error)
6521   __Pyx_GOTREF(__pyx_t_1);
6522   __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 182, __pyx_L1_error)
6523   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6524   __PYX_XDEC_MEMVIEW(&__pyx_v_self->y, 0);
6525   __pyx_v_self->y = __pyx_t_5;
6526   __pyx_t_5.memview = NULL;
6527   __pyx_t_5.data = NULL;
6528 
6529   /* "qutip/cy/cqobjevo_factor.pyx":183
6530  *         self.tlist = state[3]
6531  *         self.y = state[4]
6532  *         self.M = state[5]             # <<<<<<<<<<<<<<
6533  *
6534  *
6535  */
6536   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error)
6537   __Pyx_GOTREF(__pyx_t_1);
6538   __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 183, __pyx_L1_error)
6539   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6540   __PYX_XDEC_MEMVIEW(&__pyx_v_self->M, 0);
6541   __pyx_v_self->M = __pyx_t_5;
6542   __pyx_t_5.memview = NULL;
6543   __pyx_t_5.data = NULL;
6544 
6545   /* "qutip/cy/cqobjevo_factor.pyx":177
6546  *                 np.array(self.y), np.array(self.M))
6547  *
6548  *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
6549  *         self._num_ops = state[0]
6550  *         self.n_t = state[1]
6551  */
6552 
6553   /* function exit code */
6554   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6555   goto __pyx_L0;
6556   __pyx_L1_error:;
6557   __Pyx_XDECREF(__pyx_t_1);
6558   __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6559   __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6560   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.InterCoeffCte.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6561   __pyx_r = NULL;
6562   __pyx_L0:;
6563   __Pyx_XGIVEREF(__pyx_r);
6564   __Pyx_RefNannyFinishContext();
6565   return __pyx_r;
6566 }
6567 
6568 /* "(tree fragment)":1
6569  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
6570  *     cdef tuple state
6571  *     cdef object _dict
6572  */
6573 
6574 /* Python wrapper */
6575 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_9__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)6576 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6577   PyObject *__pyx_r = 0;
6578   __Pyx_RefNannyDeclarations
6579   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6580   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_8__reduce_cython__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *)__pyx_v_self));
6581 
6582   /* function exit code */
6583   __Pyx_RefNannyFinishContext();
6584   return __pyx_r;
6585 }
6586 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_8__reduce_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte * __pyx_v_self)6587 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_8__reduce_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *__pyx_v_self) {
6588   PyObject *__pyx_v_state = 0;
6589   PyObject *__pyx_v__dict = 0;
6590   int __pyx_v_use_setstate;
6591   PyObject *__pyx_r = NULL;
6592   __Pyx_RefNannyDeclarations
6593   PyObject *__pyx_t_1 = NULL;
6594   PyObject *__pyx_t_2 = NULL;
6595   PyObject *__pyx_t_3 = NULL;
6596   PyObject *__pyx_t_4 = NULL;
6597   PyObject *__pyx_t_5 = NULL;
6598   PyObject *__pyx_t_6 = NULL;
6599   PyObject *__pyx_t_7 = NULL;
6600   int __pyx_t_8;
6601   int __pyx_t_9;
6602   int __pyx_lineno = 0;
6603   const char *__pyx_filename = NULL;
6604   int __pyx_clineno = 0;
6605   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
6606 
6607   /* "(tree fragment)":5
6608  *     cdef object _dict
6609  *     cdef bint use_setstate
6610  *     state = (self.M, self._args, self._num_ops, self.dt, self.n_t, self.tlist, self.y)             # <<<<<<<<<<<<<<
6611  *     _dict = getattr(self, '__dict__', None)
6612  *     if _dict is not None:
6613  */
6614   if (unlikely(!__pyx_v_self->M.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 5, __pyx_L1_error)}
6615   __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_self->M, 2, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
6616   __Pyx_GOTREF(__pyx_t_1);
6617   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base._num_ops); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
6618   __Pyx_GOTREF(__pyx_t_2);
6619   __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->dt); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
6620   __Pyx_GOTREF(__pyx_t_3);
6621   __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->n_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
6622   __Pyx_GOTREF(__pyx_t_4);
6623   if (unlikely(!__pyx_v_self->tlist.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 5, __pyx_L1_error)}
6624   __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_self->tlist, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error)
6625   __Pyx_GOTREF(__pyx_t_5);
6626   if (unlikely(!__pyx_v_self->y.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 5, __pyx_L1_error)}
6627   __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_self->y, 2, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 5, __pyx_L1_error)
6628   __Pyx_GOTREF(__pyx_t_6);
6629   __pyx_t_7 = PyTuple_New(7); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 5, __pyx_L1_error)
6630   __Pyx_GOTREF(__pyx_t_7);
6631   __Pyx_GIVEREF(__pyx_t_1);
6632   PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
6633   __Pyx_INCREF(__pyx_v_self->__pyx_base._args);
6634   __Pyx_GIVEREF(__pyx_v_self->__pyx_base._args);
6635   PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_self->__pyx_base._args);
6636   __Pyx_GIVEREF(__pyx_t_2);
6637   PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_2);
6638   __Pyx_GIVEREF(__pyx_t_3);
6639   PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_3);
6640   __Pyx_GIVEREF(__pyx_t_4);
6641   PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_4);
6642   __Pyx_GIVEREF(__pyx_t_5);
6643   PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_5);
6644   __Pyx_GIVEREF(__pyx_t_6);
6645   PyTuple_SET_ITEM(__pyx_t_7, 6, __pyx_t_6);
6646   __pyx_t_1 = 0;
6647   __pyx_t_2 = 0;
6648   __pyx_t_3 = 0;
6649   __pyx_t_4 = 0;
6650   __pyx_t_5 = 0;
6651   __pyx_t_6 = 0;
6652   __pyx_v_state = ((PyObject*)__pyx_t_7);
6653   __pyx_t_7 = 0;
6654 
6655   /* "(tree fragment)":6
6656  *     cdef bint use_setstate
6657  *     state = (self.M, self._args, self._num_ops, self.dt, self.n_t, self.tlist, self.y)
6658  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
6659  *     if _dict is not None:
6660  *         state += (_dict,)
6661  */
6662   __pyx_t_7 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 6, __pyx_L1_error)
6663   __Pyx_GOTREF(__pyx_t_7);
6664   __pyx_v__dict = __pyx_t_7;
6665   __pyx_t_7 = 0;
6666 
6667   /* "(tree fragment)":7
6668  *     state = (self.M, self._args, self._num_ops, self.dt, self.n_t, self.tlist, self.y)
6669  *     _dict = getattr(self, '__dict__', None)
6670  *     if _dict is not None:             # <<<<<<<<<<<<<<
6671  *         state += (_dict,)
6672  *         use_setstate = True
6673  */
6674   __pyx_t_8 = (__pyx_v__dict != Py_None);
6675   __pyx_t_9 = (__pyx_t_8 != 0);
6676   if (__pyx_t_9) {
6677 
6678     /* "(tree fragment)":8
6679  *     _dict = getattr(self, '__dict__', None)
6680  *     if _dict is not None:
6681  *         state += (_dict,)             # <<<<<<<<<<<<<<
6682  *         use_setstate = True
6683  *     else:
6684  */
6685     __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 8, __pyx_L1_error)
6686     __Pyx_GOTREF(__pyx_t_7);
6687     __Pyx_INCREF(__pyx_v__dict);
6688     __Pyx_GIVEREF(__pyx_v__dict);
6689     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v__dict);
6690     __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 8, __pyx_L1_error)
6691     __Pyx_GOTREF(__pyx_t_6);
6692     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6693     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_6));
6694     __pyx_t_6 = 0;
6695 
6696     /* "(tree fragment)":9
6697  *     if _dict is not None:
6698  *         state += (_dict,)
6699  *         use_setstate = True             # <<<<<<<<<<<<<<
6700  *     else:
6701  *         use_setstate = self._args is not None
6702  */
6703     __pyx_v_use_setstate = 1;
6704 
6705     /* "(tree fragment)":7
6706  *     state = (self.M, self._args, self._num_ops, self.dt, self.n_t, self.tlist, self.y)
6707  *     _dict = getattr(self, '__dict__', None)
6708  *     if _dict is not None:             # <<<<<<<<<<<<<<
6709  *         state += (_dict,)
6710  *         use_setstate = True
6711  */
6712     goto __pyx_L3;
6713   }
6714 
6715   /* "(tree fragment)":11
6716  *         use_setstate = True
6717  *     else:
6718  *         use_setstate = self._args is not None             # <<<<<<<<<<<<<<
6719  *     if use_setstate:
6720  *         return __pyx_unpickle_InterCoeffCte, (type(self), 0x94db4ad, None), state
6721  */
6722   /*else*/ {
6723     __pyx_t_9 = (__pyx_v_self->__pyx_base._args != ((PyObject*)Py_None));
6724     __pyx_v_use_setstate = __pyx_t_9;
6725   }
6726   __pyx_L3:;
6727 
6728   /* "(tree fragment)":12
6729  *     else:
6730  *         use_setstate = self._args is not None
6731  *     if use_setstate:             # <<<<<<<<<<<<<<
6732  *         return __pyx_unpickle_InterCoeffCte, (type(self), 0x94db4ad, None), state
6733  *     else:
6734  */
6735   __pyx_t_9 = (__pyx_v_use_setstate != 0);
6736   if (__pyx_t_9) {
6737 
6738     /* "(tree fragment)":13
6739  *         use_setstate = self._args is not None
6740  *     if use_setstate:
6741  *         return __pyx_unpickle_InterCoeffCte, (type(self), 0x94db4ad, None), state             # <<<<<<<<<<<<<<
6742  *     else:
6743  *         return __pyx_unpickle_InterCoeffCte, (type(self), 0x94db4ad, state)
6744  */
6745     __Pyx_XDECREF(__pyx_r);
6746     __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_InterCoeffCte); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error)
6747     __Pyx_GOTREF(__pyx_t_6);
6748     __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 13, __pyx_L1_error)
6749     __Pyx_GOTREF(__pyx_t_7);
6750     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6751     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6752     PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6753     __Pyx_INCREF(__pyx_int_156087469);
6754     __Pyx_GIVEREF(__pyx_int_156087469);
6755     PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_156087469);
6756     __Pyx_INCREF(Py_None);
6757     __Pyx_GIVEREF(Py_None);
6758     PyTuple_SET_ITEM(__pyx_t_7, 2, Py_None);
6759     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
6760     __Pyx_GOTREF(__pyx_t_5);
6761     __Pyx_GIVEREF(__pyx_t_6);
6762     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
6763     __Pyx_GIVEREF(__pyx_t_7);
6764     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7);
6765     __Pyx_INCREF(__pyx_v_state);
6766     __Pyx_GIVEREF(__pyx_v_state);
6767     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
6768     __pyx_t_6 = 0;
6769     __pyx_t_7 = 0;
6770     __pyx_r = __pyx_t_5;
6771     __pyx_t_5 = 0;
6772     goto __pyx_L0;
6773 
6774     /* "(tree fragment)":12
6775  *     else:
6776  *         use_setstate = self._args is not None
6777  *     if use_setstate:             # <<<<<<<<<<<<<<
6778  *         return __pyx_unpickle_InterCoeffCte, (type(self), 0x94db4ad, None), state
6779  *     else:
6780  */
6781   }
6782 
6783   /* "(tree fragment)":15
6784  *         return __pyx_unpickle_InterCoeffCte, (type(self), 0x94db4ad, None), state
6785  *     else:
6786  *         return __pyx_unpickle_InterCoeffCte, (type(self), 0x94db4ad, state)             # <<<<<<<<<<<<<<
6787  * def __setstate_cython__(self, __pyx_state):
6788  *     __pyx_unpickle_InterCoeffCte__set_state(self, __pyx_state)
6789  */
6790   /*else*/ {
6791     __Pyx_XDECREF(__pyx_r);
6792     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_InterCoeffCte); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
6793     __Pyx_GOTREF(__pyx_t_5);
6794     __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 15, __pyx_L1_error)
6795     __Pyx_GOTREF(__pyx_t_7);
6796     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6797     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6798     PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6799     __Pyx_INCREF(__pyx_int_156087469);
6800     __Pyx_GIVEREF(__pyx_int_156087469);
6801     PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_156087469);
6802     __Pyx_INCREF(__pyx_v_state);
6803     __Pyx_GIVEREF(__pyx_v_state);
6804     PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_state);
6805     __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 15, __pyx_L1_error)
6806     __Pyx_GOTREF(__pyx_t_6);
6807     __Pyx_GIVEREF(__pyx_t_5);
6808     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
6809     __Pyx_GIVEREF(__pyx_t_7);
6810     PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
6811     __pyx_t_5 = 0;
6812     __pyx_t_7 = 0;
6813     __pyx_r = __pyx_t_6;
6814     __pyx_t_6 = 0;
6815     goto __pyx_L0;
6816   }
6817 
6818   /* "(tree fragment)":1
6819  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
6820  *     cdef tuple state
6821  *     cdef object _dict
6822  */
6823 
6824   /* function exit code */
6825   __pyx_L1_error:;
6826   __Pyx_XDECREF(__pyx_t_1);
6827   __Pyx_XDECREF(__pyx_t_2);
6828   __Pyx_XDECREF(__pyx_t_3);
6829   __Pyx_XDECREF(__pyx_t_4);
6830   __Pyx_XDECREF(__pyx_t_5);
6831   __Pyx_XDECREF(__pyx_t_6);
6832   __Pyx_XDECREF(__pyx_t_7);
6833   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.InterCoeffCte.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6834   __pyx_r = NULL;
6835   __pyx_L0:;
6836   __Pyx_XDECREF(__pyx_v_state);
6837   __Pyx_XDECREF(__pyx_v__dict);
6838   __Pyx_XGIVEREF(__pyx_r);
6839   __Pyx_RefNannyFinishContext();
6840   return __pyx_r;
6841 }
6842 
6843 /* "(tree fragment)":16
6844  *     else:
6845  *         return __pyx_unpickle_InterCoeffCte, (type(self), 0x94db4ad, state)
6846  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
6847  *     __pyx_unpickle_InterCoeffCte__set_state(self, __pyx_state)
6848  */
6849 
6850 /* Python wrapper */
6851 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_11__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)6852 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6853   PyObject *__pyx_r = 0;
6854   __Pyx_RefNannyDeclarations
6855   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
6856   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_10__setstate_cython__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
6857 
6858   /* function exit code */
6859   __Pyx_RefNannyFinishContext();
6860   return __pyx_r;
6861 }
6862 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_10__setstate_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte * __pyx_v_self,PyObject * __pyx_v___pyx_state)6863 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_10__setstate_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6864   PyObject *__pyx_r = NULL;
6865   __Pyx_RefNannyDeclarations
6866   PyObject *__pyx_t_1 = NULL;
6867   int __pyx_lineno = 0;
6868   const char *__pyx_filename = NULL;
6869   int __pyx_clineno = 0;
6870   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
6871 
6872   /* "(tree fragment)":17
6873  *         return __pyx_unpickle_InterCoeffCte, (type(self), 0x94db4ad, state)
6874  * def __setstate_cython__(self, __pyx_state):
6875  *     __pyx_unpickle_InterCoeffCte__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
6876  */
6877   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
6878   __pyx_t_1 = __pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_InterCoeffCte__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
6879   __Pyx_GOTREF(__pyx_t_1);
6880   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6881 
6882   /* "(tree fragment)":16
6883  *     else:
6884  *         return __pyx_unpickle_InterCoeffCte, (type(self), 0x94db4ad, state)
6885  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
6886  *     __pyx_unpickle_InterCoeffCte__set_state(self, __pyx_state)
6887  */
6888 
6889   /* function exit code */
6890   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6891   goto __pyx_L0;
6892   __pyx_L1_error:;
6893   __Pyx_XDECREF(__pyx_t_1);
6894   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.InterCoeffCte.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6895   __pyx_r = NULL;
6896   __pyx_L0:;
6897   __Pyx_XGIVEREF(__pyx_r);
6898   __Pyx_RefNannyFinishContext();
6899   return __pyx_r;
6900 }
6901 
6902 /* "qutip/cy/cqobjevo_factor.pyx":192
6903  *     cdef complex[:,::1] y, M
6904  *
6905  *     def __init__(self, ops, args, tlist):             # <<<<<<<<<<<<<<
6906  *         cdef int i, j
6907  *         self._args = {}
6908  */
6909 
6910 /* Python wrapper */
6911 static int __pyx_pw_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)6912 static int __pyx_pw_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6913   PyObject *__pyx_v_ops = 0;
6914   CYTHON_UNUSED PyObject *__pyx_v_args = 0;
6915   PyObject *__pyx_v_tlist = 0;
6916   int __pyx_lineno = 0;
6917   const char *__pyx_filename = NULL;
6918   int __pyx_clineno = 0;
6919   int __pyx_r;
6920   __Pyx_RefNannyDeclarations
6921   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
6922   {
6923     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ops,&__pyx_n_s_args,&__pyx_n_s_tlist,0};
6924     PyObject* values[3] = {0,0,0};
6925     if (unlikely(__pyx_kwds)) {
6926       Py_ssize_t kw_args;
6927       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6928       switch (pos_args) {
6929         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6930         CYTHON_FALLTHROUGH;
6931         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6932         CYTHON_FALLTHROUGH;
6933         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6934         CYTHON_FALLTHROUGH;
6935         case  0: break;
6936         default: goto __pyx_L5_argtuple_error;
6937       }
6938       kw_args = PyDict_Size(__pyx_kwds);
6939       switch (pos_args) {
6940         case  0:
6941         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ops)) != 0)) kw_args--;
6942         else goto __pyx_L5_argtuple_error;
6943         CYTHON_FALLTHROUGH;
6944         case  1:
6945         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
6946         else {
6947           __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 192, __pyx_L3_error)
6948         }
6949         CYTHON_FALLTHROUGH;
6950         case  2:
6951         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tlist)) != 0)) kw_args--;
6952         else {
6953           __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 192, __pyx_L3_error)
6954         }
6955       }
6956       if (unlikely(kw_args > 0)) {
6957         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 192, __pyx_L3_error)
6958       }
6959     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
6960       goto __pyx_L5_argtuple_error;
6961     } else {
6962       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6963       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6964       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6965     }
6966     __pyx_v_ops = values[0];
6967     __pyx_v_args = values[1];
6968     __pyx_v_tlist = values[2];
6969   }
6970   goto __pyx_L4_argument_unpacking_done;
6971   __pyx_L5_argtuple_error:;
6972   __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 192, __pyx_L3_error)
6973   __pyx_L3_error:;
6974   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.InterCoeffT.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6975   __Pyx_RefNannyFinishContext();
6976   return -1;
6977   __pyx_L4_argument_unpacking_done:;
6978   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_11InterCoeffT___init__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *)__pyx_v_self), __pyx_v_ops, __pyx_v_args, __pyx_v_tlist);
6979 
6980   /* function exit code */
6981   __Pyx_RefNannyFinishContext();
6982   return __pyx_r;
6983 }
6984 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_11InterCoeffT___init__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT * __pyx_v_self,PyObject * __pyx_v_ops,CYTHON_UNUSED PyObject * __pyx_v_args,PyObject * __pyx_v_tlist)6985 static int __pyx_pf_5qutip_2cy_15cqobjevo_factor_11InterCoeffT___init__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *__pyx_v_self, PyObject *__pyx_v_ops, CYTHON_UNUSED PyObject *__pyx_v_args, PyObject *__pyx_v_tlist) {
6986   int __pyx_v_i;
6987   int __pyx_v_j;
6988   PyObject *__pyx_v_m = NULL;
6989   PyObject *__pyx_v_cte = NULL;
6990   int __pyx_r;
6991   __Pyx_RefNannyDeclarations
6992   PyObject *__pyx_t_1 = NULL;
6993   Py_ssize_t __pyx_t_2;
6994   __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
6995   PyObject *__pyx_t_4 = NULL;
6996   PyObject *__pyx_t_5 = NULL;
6997   PyObject *__pyx_t_6 = NULL;
6998   __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
6999   int __pyx_t_8;
7000   int __pyx_t_9;
7001   int __pyx_t_10;
7002   int __pyx_t_11;
7003   PyObject *__pyx_t_12 = NULL;
7004   PyObject *(*__pyx_t_13)(PyObject *);
7005   int __pyx_t_14;
7006   int __pyx_t_15;
7007   int __pyx_t_16;
7008   __pyx_t_double_complex __pyx_t_17;
7009   Py_ssize_t __pyx_t_18;
7010   Py_ssize_t __pyx_t_19;
7011   int __pyx_t_20;
7012   int __pyx_lineno = 0;
7013   const char *__pyx_filename = NULL;
7014   int __pyx_clineno = 0;
7015   __Pyx_RefNannySetupContext("__init__", 0);
7016 
7017   /* "qutip/cy/cqobjevo_factor.pyx":194
7018  *     def __init__(self, ops, args, tlist):
7019  *         cdef int i, j
7020  *         self._args = {}             # <<<<<<<<<<<<<<
7021  *         self._num_ops = len(ops)
7022  *         self.tlist = tlist
7023  */
7024   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error)
7025   __Pyx_GOTREF(__pyx_t_1);
7026   __Pyx_GIVEREF(__pyx_t_1);
7027   __Pyx_GOTREF(__pyx_v_self->__pyx_base._args);
7028   __Pyx_DECREF(__pyx_v_self->__pyx_base._args);
7029   __pyx_v_self->__pyx_base._args = ((PyObject*)__pyx_t_1);
7030   __pyx_t_1 = 0;
7031 
7032   /* "qutip/cy/cqobjevo_factor.pyx":195
7033  *         cdef int i, j
7034  *         self._args = {}
7035  *         self._num_ops = len(ops)             # <<<<<<<<<<<<<<
7036  *         self.tlist = tlist
7037  *         self.n_t = len(tlist)
7038  */
7039   __pyx_t_2 = PyObject_Length(__pyx_v_ops); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 195, __pyx_L1_error)
7040   __pyx_v_self->__pyx_base._num_ops = __pyx_t_2;
7041 
7042   /* "qutip/cy/cqobjevo_factor.pyx":196
7043  *         self._args = {}
7044  *         self._num_ops = len(ops)
7045  *         self.tlist = tlist             # <<<<<<<<<<<<<<
7046  *         self.n_t = len(tlist)
7047  *         self.y = np.zeros((self._num_ops, self.n_t), dtype=complex)
7048  */
7049   __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_tlist, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 196, __pyx_L1_error)
7050   __PYX_XDEC_MEMVIEW(&__pyx_v_self->tlist, 0);
7051   __pyx_v_self->tlist = __pyx_t_3;
7052   __pyx_t_3.memview = NULL;
7053   __pyx_t_3.data = NULL;
7054 
7055   /* "qutip/cy/cqobjevo_factor.pyx":197
7056  *         self._num_ops = len(ops)
7057  *         self.tlist = tlist
7058  *         self.n_t = len(tlist)             # <<<<<<<<<<<<<<
7059  *         self.y = np.zeros((self._num_ops, self.n_t), dtype=complex)
7060  *         self.M = np.zeros((self._num_ops, self.n_t), dtype=complex)
7061  */
7062   __pyx_t_2 = PyObject_Length(__pyx_v_tlist); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 197, __pyx_L1_error)
7063   __pyx_v_self->n_t = __pyx_t_2;
7064 
7065   /* "qutip/cy/cqobjevo_factor.pyx":198
7066  *         self.tlist = tlist
7067  *         self.n_t = len(tlist)
7068  *         self.y = np.zeros((self._num_ops, self.n_t), dtype=complex)             # <<<<<<<<<<<<<<
7069  *         self.M = np.zeros((self._num_ops, self.n_t), dtype=complex)
7070  *         for i in range(self._num_ops):
7071  */
7072   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error)
7073   __Pyx_GOTREF(__pyx_t_1);
7074   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L1_error)
7075   __Pyx_GOTREF(__pyx_t_4);
7076   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7077   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base._num_ops); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error)
7078   __Pyx_GOTREF(__pyx_t_1);
7079   __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->n_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 198, __pyx_L1_error)
7080   __Pyx_GOTREF(__pyx_t_5);
7081   __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 198, __pyx_L1_error)
7082   __Pyx_GOTREF(__pyx_t_6);
7083   __Pyx_GIVEREF(__pyx_t_1);
7084   PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
7085   __Pyx_GIVEREF(__pyx_t_5);
7086   PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
7087   __pyx_t_1 = 0;
7088   __pyx_t_5 = 0;
7089   __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 198, __pyx_L1_error)
7090   __Pyx_GOTREF(__pyx_t_5);
7091   __Pyx_GIVEREF(__pyx_t_6);
7092   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
7093   __pyx_t_6 = 0;
7094   __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 198, __pyx_L1_error)
7095   __Pyx_GOTREF(__pyx_t_6);
7096   if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, ((PyObject *)(&PyComplex_Type))) < 0) __PYX_ERR(0, 198, __pyx_L1_error)
7097   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error)
7098   __Pyx_GOTREF(__pyx_t_1);
7099   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7100   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7101   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7102   __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 198, __pyx_L1_error)
7103   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7104   __PYX_XDEC_MEMVIEW(&__pyx_v_self->y, 0);
7105   __pyx_v_self->y = __pyx_t_7;
7106   __pyx_t_7.memview = NULL;
7107   __pyx_t_7.data = NULL;
7108 
7109   /* "qutip/cy/cqobjevo_factor.pyx":199
7110  *         self.n_t = len(tlist)
7111  *         self.y = np.zeros((self._num_ops, self.n_t), dtype=complex)
7112  *         self.M = np.zeros((self._num_ops, self.n_t), dtype=complex)             # <<<<<<<<<<<<<<
7113  *         for i in range(self._num_ops):
7114  *             m, cte = _prep_cubic_spline(ops[i][2], tlist)
7115  */
7116   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
7117   __Pyx_GOTREF(__pyx_t_1);
7118   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 199, __pyx_L1_error)
7119   __Pyx_GOTREF(__pyx_t_6);
7120   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7121   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base._num_ops); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
7122   __Pyx_GOTREF(__pyx_t_1);
7123   __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->n_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 199, __pyx_L1_error)
7124   __Pyx_GOTREF(__pyx_t_5);
7125   __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 199, __pyx_L1_error)
7126   __Pyx_GOTREF(__pyx_t_4);
7127   __Pyx_GIVEREF(__pyx_t_1);
7128   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
7129   __Pyx_GIVEREF(__pyx_t_5);
7130   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
7131   __pyx_t_1 = 0;
7132   __pyx_t_5 = 0;
7133   __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 199, __pyx_L1_error)
7134   __Pyx_GOTREF(__pyx_t_5);
7135   __Pyx_GIVEREF(__pyx_t_4);
7136   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
7137   __pyx_t_4 = 0;
7138   __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 199, __pyx_L1_error)
7139   __Pyx_GOTREF(__pyx_t_4);
7140   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, ((PyObject *)(&PyComplex_Type))) < 0) __PYX_ERR(0, 199, __pyx_L1_error)
7141   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
7142   __Pyx_GOTREF(__pyx_t_1);
7143   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7144   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7145   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7146   __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 199, __pyx_L1_error)
7147   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7148   __PYX_XDEC_MEMVIEW(&__pyx_v_self->M, 0);
7149   __pyx_v_self->M = __pyx_t_7;
7150   __pyx_t_7.memview = NULL;
7151   __pyx_t_7.data = NULL;
7152 
7153   /* "qutip/cy/cqobjevo_factor.pyx":200
7154  *         self.y = np.zeros((self._num_ops, self.n_t), dtype=complex)
7155  *         self.M = np.zeros((self._num_ops, self.n_t), dtype=complex)
7156  *         for i in range(self._num_ops):             # <<<<<<<<<<<<<<
7157  *             m, cte = _prep_cubic_spline(ops[i][2], tlist)
7158  *             if cte:
7159  */
7160   __pyx_t_8 = __pyx_v_self->__pyx_base._num_ops;
7161   __pyx_t_9 = __pyx_t_8;
7162   for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
7163     __pyx_v_i = __pyx_t_10;
7164 
7165     /* "qutip/cy/cqobjevo_factor.pyx":201
7166  *         self.M = np.zeros((self._num_ops, self.n_t), dtype=complex)
7167  *         for i in range(self._num_ops):
7168  *             m, cte = _prep_cubic_spline(ops[i][2], tlist)             # <<<<<<<<<<<<<<
7169  *             if cte:
7170  *                 print("tlist not uniform?")
7171  */
7172     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_prep_cubic_spline); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error)
7173     __Pyx_GOTREF(__pyx_t_4);
7174     __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_ops, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 201, __pyx_L1_error)
7175     __Pyx_GOTREF(__pyx_t_5);
7176     __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error)
7177     __Pyx_GOTREF(__pyx_t_6);
7178     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7179     __pyx_t_5 = NULL;
7180     __pyx_t_11 = 0;
7181     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
7182       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
7183       if (likely(__pyx_t_5)) {
7184         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
7185         __Pyx_INCREF(__pyx_t_5);
7186         __Pyx_INCREF(function);
7187         __Pyx_DECREF_SET(__pyx_t_4, function);
7188         __pyx_t_11 = 1;
7189       }
7190     }
7191     #if CYTHON_FAST_PYCALL
7192     if (PyFunction_Check(__pyx_t_4)) {
7193       PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_6, __pyx_v_tlist};
7194       __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
7195       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7196       __Pyx_GOTREF(__pyx_t_1);
7197       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7198     } else
7199     #endif
7200     #if CYTHON_FAST_PYCCALL
7201     if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
7202       PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_6, __pyx_v_tlist};
7203       __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
7204       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7205       __Pyx_GOTREF(__pyx_t_1);
7206       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7207     } else
7208     #endif
7209     {
7210       __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 201, __pyx_L1_error)
7211       __Pyx_GOTREF(__pyx_t_12);
7212       if (__pyx_t_5) {
7213         __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_5); __pyx_t_5 = NULL;
7214       }
7215       __Pyx_GIVEREF(__pyx_t_6);
7216       PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_6);
7217       __Pyx_INCREF(__pyx_v_tlist);
7218       __Pyx_GIVEREF(__pyx_v_tlist);
7219       PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_v_tlist);
7220       __pyx_t_6 = 0;
7221       __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
7222       __Pyx_GOTREF(__pyx_t_1);
7223       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7224     }
7225     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7226     if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
7227       PyObject* sequence = __pyx_t_1;
7228       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7229       if (unlikely(size != 2)) {
7230         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
7231         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7232         __PYX_ERR(0, 201, __pyx_L1_error)
7233       }
7234       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7235       if (likely(PyTuple_CheckExact(sequence))) {
7236         __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
7237         __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1);
7238       } else {
7239         __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
7240         __pyx_t_12 = PyList_GET_ITEM(sequence, 1);
7241       }
7242       __Pyx_INCREF(__pyx_t_4);
7243       __Pyx_INCREF(__pyx_t_12);
7244       #else
7245       __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error)
7246       __Pyx_GOTREF(__pyx_t_4);
7247       __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 201, __pyx_L1_error)
7248       __Pyx_GOTREF(__pyx_t_12);
7249       #endif
7250       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7251     } else {
7252       Py_ssize_t index = -1;
7253       __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error)
7254       __Pyx_GOTREF(__pyx_t_6);
7255       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7256       __pyx_t_13 = Py_TYPE(__pyx_t_6)->tp_iternext;
7257       index = 0; __pyx_t_4 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
7258       __Pyx_GOTREF(__pyx_t_4);
7259       index = 1; __pyx_t_12 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_12)) goto __pyx_L5_unpacking_failed;
7260       __Pyx_GOTREF(__pyx_t_12);
7261       if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_6), 2) < 0) __PYX_ERR(0, 201, __pyx_L1_error)
7262       __pyx_t_13 = NULL;
7263       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7264       goto __pyx_L6_unpacking_done;
7265       __pyx_L5_unpacking_failed:;
7266       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7267       __pyx_t_13 = NULL;
7268       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
7269       __PYX_ERR(0, 201, __pyx_L1_error)
7270       __pyx_L6_unpacking_done:;
7271     }
7272     __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_4);
7273     __pyx_t_4 = 0;
7274     __Pyx_XDECREF_SET(__pyx_v_cte, __pyx_t_12);
7275     __pyx_t_12 = 0;
7276 
7277     /* "qutip/cy/cqobjevo_factor.pyx":202
7278  *         for i in range(self._num_ops):
7279  *             m, cte = _prep_cubic_spline(ops[i][2], tlist)
7280  *             if cte:             # <<<<<<<<<<<<<<
7281  *                 print("tlist not uniform?")
7282  *             for j in range(self.n_t):
7283  */
7284     __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_cte); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 202, __pyx_L1_error)
7285     if (__pyx_t_14) {
7286 
7287       /* "qutip/cy/cqobjevo_factor.pyx":203
7288  *             m, cte = _prep_cubic_spline(ops[i][2], tlist)
7289  *             if cte:
7290  *                 print("tlist not uniform?")             # <<<<<<<<<<<<<<
7291  *             for j in range(self.n_t):
7292  *                 self.y[i,j] = ops[i][2][j]
7293  */
7294       __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error)
7295       __Pyx_GOTREF(__pyx_t_1);
7296       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7297 
7298       /* "qutip/cy/cqobjevo_factor.pyx":202
7299  *         for i in range(self._num_ops):
7300  *             m, cte = _prep_cubic_spline(ops[i][2], tlist)
7301  *             if cte:             # <<<<<<<<<<<<<<
7302  *                 print("tlist not uniform?")
7303  *             for j in range(self.n_t):
7304  */
7305     }
7306 
7307     /* "qutip/cy/cqobjevo_factor.pyx":204
7308  *             if cte:
7309  *                 print("tlist not uniform?")
7310  *             for j in range(self.n_t):             # <<<<<<<<<<<<<<
7311  *                 self.y[i,j] = ops[i][2][j]
7312  *                 self.M[i,j] = m[j]
7313  */
7314     __pyx_t_11 = __pyx_v_self->n_t;
7315     __pyx_t_15 = __pyx_t_11;
7316     for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
7317       __pyx_v_j = __pyx_t_16;
7318 
7319       /* "qutip/cy/cqobjevo_factor.pyx":205
7320  *                 print("tlist not uniform?")
7321  *             for j in range(self.n_t):
7322  *                 self.y[i,j] = ops[i][2][j]             # <<<<<<<<<<<<<<
7323  *                 self.M[i,j] = m[j]
7324  *
7325  */
7326       __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ops, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
7327       __Pyx_GOTREF(__pyx_t_1);
7328       __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 205, __pyx_L1_error)
7329       __Pyx_GOTREF(__pyx_t_12);
7330       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7331       __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_12, __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
7332       __Pyx_GOTREF(__pyx_t_1);
7333       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7334       __pyx_t_17 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 205, __pyx_L1_error)
7335       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7336       if (unlikely(!__pyx_v_self->y.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 205, __pyx_L1_error)}
7337       __pyx_t_18 = __pyx_v_i;
7338       __pyx_t_19 = __pyx_v_j;
7339       __pyx_t_20 = -1;
7340       if (__pyx_t_18 < 0) {
7341         __pyx_t_18 += __pyx_v_self->y.shape[0];
7342         if (unlikely(__pyx_t_18 < 0)) __pyx_t_20 = 0;
7343       } else if (unlikely(__pyx_t_18 >= __pyx_v_self->y.shape[0])) __pyx_t_20 = 0;
7344       if (__pyx_t_19 < 0) {
7345         __pyx_t_19 += __pyx_v_self->y.shape[1];
7346         if (unlikely(__pyx_t_19 < 0)) __pyx_t_20 = 1;
7347       } else if (unlikely(__pyx_t_19 >= __pyx_v_self->y.shape[1])) __pyx_t_20 = 1;
7348       if (unlikely(__pyx_t_20 != -1)) {
7349         __Pyx_RaiseBufferIndexError(__pyx_t_20);
7350         __PYX_ERR(0, 205, __pyx_L1_error)
7351       }
7352       *((__pyx_t_double_complex *) ( /* dim=1 */ ((char *) (((__pyx_t_double_complex *) ( /* dim=0 */ (__pyx_v_self->y.data + __pyx_t_18 * __pyx_v_self->y.strides[0]) )) + __pyx_t_19)) )) = __pyx_t_17;
7353 
7354       /* "qutip/cy/cqobjevo_factor.pyx":206
7355  *             for j in range(self.n_t):
7356  *                 self.y[i,j] = ops[i][2][j]
7357  *                 self.M[i,j] = m[j]             # <<<<<<<<<<<<<<
7358  *
7359  *     cdef void _call_core(self, double t, complex* coeff):
7360  */
7361       __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_m, __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error)
7362       __Pyx_GOTREF(__pyx_t_1);
7363       __pyx_t_17 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L1_error)
7364       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7365       if (unlikely(!__pyx_v_self->M.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 206, __pyx_L1_error)}
7366       __pyx_t_19 = __pyx_v_i;
7367       __pyx_t_18 = __pyx_v_j;
7368       __pyx_t_20 = -1;
7369       if (__pyx_t_19 < 0) {
7370         __pyx_t_19 += __pyx_v_self->M.shape[0];
7371         if (unlikely(__pyx_t_19 < 0)) __pyx_t_20 = 0;
7372       } else if (unlikely(__pyx_t_19 >= __pyx_v_self->M.shape[0])) __pyx_t_20 = 0;
7373       if (__pyx_t_18 < 0) {
7374         __pyx_t_18 += __pyx_v_self->M.shape[1];
7375         if (unlikely(__pyx_t_18 < 0)) __pyx_t_20 = 1;
7376       } else if (unlikely(__pyx_t_18 >= __pyx_v_self->M.shape[1])) __pyx_t_20 = 1;
7377       if (unlikely(__pyx_t_20 != -1)) {
7378         __Pyx_RaiseBufferIndexError(__pyx_t_20);
7379         __PYX_ERR(0, 206, __pyx_L1_error)
7380       }
7381       *((__pyx_t_double_complex *) ( /* dim=1 */ ((char *) (((__pyx_t_double_complex *) ( /* dim=0 */ (__pyx_v_self->M.data + __pyx_t_19 * __pyx_v_self->M.strides[0]) )) + __pyx_t_18)) )) = __pyx_t_17;
7382     }
7383   }
7384 
7385   /* "qutip/cy/cqobjevo_factor.pyx":192
7386  *     cdef complex[:,::1] y, M
7387  *
7388  *     def __init__(self, ops, args, tlist):             # <<<<<<<<<<<<<<
7389  *         cdef int i, j
7390  *         self._args = {}
7391  */
7392 
7393   /* function exit code */
7394   __pyx_r = 0;
7395   goto __pyx_L0;
7396   __pyx_L1_error:;
7397   __Pyx_XDECREF(__pyx_t_1);
7398   __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
7399   __Pyx_XDECREF(__pyx_t_4);
7400   __Pyx_XDECREF(__pyx_t_5);
7401   __Pyx_XDECREF(__pyx_t_6);
7402   __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
7403   __Pyx_XDECREF(__pyx_t_12);
7404   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.InterCoeffT.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7405   __pyx_r = -1;
7406   __pyx_L0:;
7407   __Pyx_XDECREF(__pyx_v_m);
7408   __Pyx_XDECREF(__pyx_v_cte);
7409   __Pyx_RefNannyFinishContext();
7410   return __pyx_r;
7411 }
7412 
7413 /* "qutip/cy/cqobjevo_factor.pyx":208
7414  *                 self.M[i,j] = m[j]
7415  *
7416  *     cdef void _call_core(self, double t, complex* coeff):             # <<<<<<<<<<<<<<
7417  *         cdef int i
7418  *         for i in range(self._num_ops):
7419  */
7420 
__pyx_f_5qutip_2cy_15cqobjevo_factor_11InterCoeffT__call_core(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT * __pyx_v_self,double __pyx_v_t,__pyx_t_double_complex * __pyx_v_coeff)7421 static void __pyx_f_5qutip_2cy_15cqobjevo_factor_11InterCoeffT__call_core(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *__pyx_v_self, double __pyx_v_t, __pyx_t_double_complex *__pyx_v_coeff) {
7422   int __pyx_v_i;
7423   __Pyx_RefNannyDeclarations
7424   int __pyx_t_1;
7425   int __pyx_t_2;
7426   int __pyx_t_3;
7427   __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
7428   __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
7429   int __pyx_lineno = 0;
7430   const char *__pyx_filename = NULL;
7431   int __pyx_clineno = 0;
7432   __Pyx_RefNannySetupContext("_call_core", 0);
7433 
7434   /* "qutip/cy/cqobjevo_factor.pyx":210
7435  *     cdef void _call_core(self, double t, complex* coeff):
7436  *         cdef int i
7437  *         for i in range(self._num_ops):             # <<<<<<<<<<<<<<
7438  *             coeff[i] = _spline_complex_t_second(t, self.tlist,
7439  *                                     self.y[i,:], self.M[i,:], self.n_t)
7440  */
7441   __pyx_t_1 = __pyx_v_self->__pyx_base._num_ops;
7442   __pyx_t_2 = __pyx_t_1;
7443   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
7444     __pyx_v_i = __pyx_t_3;
7445 
7446     /* "qutip/cy/cqobjevo_factor.pyx":211
7447  *         cdef int i
7448  *         for i in range(self._num_ops):
7449  *             coeff[i] = _spline_complex_t_second(t, self.tlist,             # <<<<<<<<<<<<<<
7450  *                                     self.y[i,:], self.M[i,:], self.n_t)
7451  *
7452  */
7453     if (unlikely(!__pyx_v_self->tlist.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 211, __pyx_L1_error)}
7454 
7455     /* "qutip/cy/cqobjevo_factor.pyx":212
7456  *         for i in range(self._num_ops):
7457  *             coeff[i] = _spline_complex_t_second(t, self.tlist,
7458  *                                     self.y[i,:], self.M[i,:], self.n_t)             # <<<<<<<<<<<<<<
7459  *
7460  *     def set_args(self, args):
7461  */
7462     if (unlikely(!__pyx_v_self->y.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 212, __pyx_L1_error)}
7463     __pyx_t_4.data = __pyx_v_self->y.data;
7464     __pyx_t_4.memview = __pyx_v_self->y.memview;
7465     __PYX_INC_MEMVIEW(&__pyx_t_4, 0);
7466     {
7467     Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
7468         Py_ssize_t __pyx_tmp_shape = __pyx_v_self->y.shape[0];
7469     Py_ssize_t __pyx_tmp_stride = __pyx_v_self->y.strides[0];
7470         if (__pyx_tmp_idx < 0)
7471             __pyx_tmp_idx += __pyx_tmp_shape;
7472         if (unlikely(!__Pyx_is_valid_index(__pyx_tmp_idx, __pyx_tmp_shape))) {
7473             PyErr_SetString(PyExc_IndexError,
7474                             "Index out of bounds (axis 0)");
7475             __PYX_ERR(0, 212, __pyx_L1_error)
7476         }
7477         __pyx_t_4.data += __pyx_tmp_idx * __pyx_tmp_stride;
7478 }
7479 
7480 __pyx_t_4.shape[0] = __pyx_v_self->y.shape[1];
7481 __pyx_t_4.strides[0] = __pyx_v_self->y.strides[1];
7482     __pyx_t_4.suboffsets[0] = -1;
7483 
7484 if (unlikely(!__pyx_v_self->M.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 212, __pyx_L1_error)}
7485     __pyx_t_5.data = __pyx_v_self->M.data;
7486     __pyx_t_5.memview = __pyx_v_self->M.memview;
7487     __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
7488     {
7489     Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
7490         Py_ssize_t __pyx_tmp_shape = __pyx_v_self->M.shape[0];
7491     Py_ssize_t __pyx_tmp_stride = __pyx_v_self->M.strides[0];
7492         if (__pyx_tmp_idx < 0)
7493             __pyx_tmp_idx += __pyx_tmp_shape;
7494         if (unlikely(!__Pyx_is_valid_index(__pyx_tmp_idx, __pyx_tmp_shape))) {
7495             PyErr_SetString(PyExc_IndexError,
7496                             "Index out of bounds (axis 0)");
7497             __PYX_ERR(0, 212, __pyx_L1_error)
7498         }
7499         __pyx_t_5.data += __pyx_tmp_idx * __pyx_tmp_stride;
7500 }
7501 
7502 __pyx_t_5.shape[0] = __pyx_v_self->M.shape[1];
7503 __pyx_t_5.strides[0] = __pyx_v_self->M.strides[1];
7504     __pyx_t_5.suboffsets[0] = -1;
7505 
7506 (__pyx_v_coeff[__pyx_v_i]) = __pyx_f_5qutip_2cy_5inter__spline_complex_t_second(__pyx_v_t, __pyx_v_self->tlist, __pyx_t_4, __pyx_t_5, __pyx_v_self->n_t);
7507 
7508     /* "qutip/cy/cqobjevo_factor.pyx":211
7509  *         cdef int i
7510  *         for i in range(self._num_ops):
7511  *             coeff[i] = _spline_complex_t_second(t, self.tlist,             # <<<<<<<<<<<<<<
7512  *                                     self.y[i,:], self.M[i,:], self.n_t)
7513  *
7514  */
7515     __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
7516     __pyx_t_4.memview = NULL;
7517     __pyx_t_4.data = NULL;
7518     __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
7519     __pyx_t_5.memview = NULL;
7520     __pyx_t_5.data = NULL;
7521   }
7522 
7523   /* "qutip/cy/cqobjevo_factor.pyx":208
7524  *                 self.M[i,j] = m[j]
7525  *
7526  *     cdef void _call_core(self, double t, complex* coeff):             # <<<<<<<<<<<<<<
7527  *         cdef int i
7528  *         for i in range(self._num_ops):
7529  */
7530 
7531   /* function exit code */
7532   goto __pyx_L0;
7533   __pyx_L1_error:;
7534   __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
7535   __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
7536   __Pyx_WriteUnraisable("qutip.cy.cqobjevo_factor.InterCoeffT._call_core", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
7537   __pyx_L0:;
7538   __Pyx_RefNannyFinishContext();
7539 }
7540 
7541 /* "qutip/cy/cqobjevo_factor.pyx":214
7542  *                                     self.y[i,:], self.M[i,:], self.n_t)
7543  *
7544  *     def set_args(self, args):             # <<<<<<<<<<<<<<
7545  *         pass
7546  *
7547  */
7548 
7549 /* Python wrapper */
7550 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_3set_args(PyObject *__pyx_v_self, PyObject *__pyx_v_args); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_3set_args(PyObject * __pyx_v_self,PyObject * __pyx_v_args)7551 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_3set_args(PyObject *__pyx_v_self, PyObject *__pyx_v_args) {
7552   PyObject *__pyx_r = 0;
7553   __Pyx_RefNannyDeclarations
7554   __Pyx_RefNannySetupContext("set_args (wrapper)", 0);
7555   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_2set_args(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *)__pyx_v_self), ((PyObject *)__pyx_v_args));
7556 
7557   /* function exit code */
7558   __Pyx_RefNannyFinishContext();
7559   return __pyx_r;
7560 }
7561 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_2set_args(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v_args)7562 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_2set_args(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args) {
7563   PyObject *__pyx_r = NULL;
7564   __Pyx_RefNannyDeclarations
7565   __Pyx_RefNannySetupContext("set_args", 0);
7566 
7567   /* function exit code */
7568   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7569   __Pyx_XGIVEREF(__pyx_r);
7570   __Pyx_RefNannyFinishContext();
7571   return __pyx_r;
7572 }
7573 
7574 /* "qutip/cy/cqobjevo_factor.pyx":217
7575  *         pass
7576  *
7577  *     def __getstate__(self):             # <<<<<<<<<<<<<<
7578  *         return (self._num_ops, self.n_t, None, np.array(self.tlist),
7579  *                 np.array(self.y), np.array(self.M))
7580  */
7581 
7582 /* Python wrapper */
7583 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_5__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_5__getstate__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)7584 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_5__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7585   PyObject *__pyx_r = 0;
7586   __Pyx_RefNannyDeclarations
7587   __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
7588   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_4__getstate__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *)__pyx_v_self));
7589 
7590   /* function exit code */
7591   __Pyx_RefNannyFinishContext();
7592   return __pyx_r;
7593 }
7594 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_4__getstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT * __pyx_v_self)7595 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_4__getstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *__pyx_v_self) {
7596   PyObject *__pyx_r = NULL;
7597   __Pyx_RefNannyDeclarations
7598   PyObject *__pyx_t_1 = NULL;
7599   PyObject *__pyx_t_2 = NULL;
7600   PyObject *__pyx_t_3 = NULL;
7601   PyObject *__pyx_t_4 = NULL;
7602   PyObject *__pyx_t_5 = NULL;
7603   PyObject *__pyx_t_6 = NULL;
7604   PyObject *__pyx_t_7 = NULL;
7605   PyObject *__pyx_t_8 = NULL;
7606   int __pyx_lineno = 0;
7607   const char *__pyx_filename = NULL;
7608   int __pyx_clineno = 0;
7609   __Pyx_RefNannySetupContext("__getstate__", 0);
7610 
7611   /* "qutip/cy/cqobjevo_factor.pyx":218
7612  *
7613  *     def __getstate__(self):
7614  *         return (self._num_ops, self.n_t, None, np.array(self.tlist),             # <<<<<<<<<<<<<<
7615  *                 np.array(self.y), np.array(self.M))
7616  *
7617  */
7618   __Pyx_XDECREF(__pyx_r);
7619   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base._num_ops); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
7620   __Pyx_GOTREF(__pyx_t_1);
7621   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->n_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error)
7622   __Pyx_GOTREF(__pyx_t_2);
7623   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 218, __pyx_L1_error)
7624   __Pyx_GOTREF(__pyx_t_4);
7625   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L1_error)
7626   __Pyx_GOTREF(__pyx_t_5);
7627   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7628   if (unlikely(!__pyx_v_self->tlist.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 218, __pyx_L1_error)}
7629   __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_self->tlist, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 218, __pyx_L1_error)
7630   __Pyx_GOTREF(__pyx_t_4);
7631   __pyx_t_6 = NULL;
7632   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
7633     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
7634     if (likely(__pyx_t_6)) {
7635       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
7636       __Pyx_INCREF(__pyx_t_6);
7637       __Pyx_INCREF(function);
7638       __Pyx_DECREF_SET(__pyx_t_5, function);
7639     }
7640   }
7641   __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
7642   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7643   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7644   if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error)
7645   __Pyx_GOTREF(__pyx_t_3);
7646   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7647 
7648   /* "qutip/cy/cqobjevo_factor.pyx":219
7649  *     def __getstate__(self):
7650  *         return (self._num_ops, self.n_t, None, np.array(self.tlist),
7651  *                 np.array(self.y), np.array(self.M))             # <<<<<<<<<<<<<<
7652  *
7653  *     def __setstate__(self, state):
7654  */
7655   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 219, __pyx_L1_error)
7656   __Pyx_GOTREF(__pyx_t_4);
7657   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 219, __pyx_L1_error)
7658   __Pyx_GOTREF(__pyx_t_6);
7659   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7660   if (unlikely(!__pyx_v_self->y.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 219, __pyx_L1_error)}
7661   __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_self->y, 2, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 219, __pyx_L1_error)
7662   __Pyx_GOTREF(__pyx_t_4);
7663   __pyx_t_7 = NULL;
7664   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
7665     __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
7666     if (likely(__pyx_t_7)) {
7667       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
7668       __Pyx_INCREF(__pyx_t_7);
7669       __Pyx_INCREF(function);
7670       __Pyx_DECREF_SET(__pyx_t_6, function);
7671     }
7672   }
7673   __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4);
7674   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7675   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7676   if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 219, __pyx_L1_error)
7677   __Pyx_GOTREF(__pyx_t_5);
7678   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7679   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 219, __pyx_L1_error)
7680   __Pyx_GOTREF(__pyx_t_4);
7681   __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 219, __pyx_L1_error)
7682   __Pyx_GOTREF(__pyx_t_7);
7683   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7684   if (unlikely(!__pyx_v_self->M.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 219, __pyx_L1_error)}
7685   __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_self->M, 2, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 219, __pyx_L1_error)
7686   __Pyx_GOTREF(__pyx_t_4);
7687   __pyx_t_8 = NULL;
7688   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
7689     __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
7690     if (likely(__pyx_t_8)) {
7691       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
7692       __Pyx_INCREF(__pyx_t_8);
7693       __Pyx_INCREF(function);
7694       __Pyx_DECREF_SET(__pyx_t_7, function);
7695     }
7696   }
7697   __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4);
7698   __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7699   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7700   if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 219, __pyx_L1_error)
7701   __Pyx_GOTREF(__pyx_t_6);
7702   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7703 
7704   /* "qutip/cy/cqobjevo_factor.pyx":218
7705  *
7706  *     def __getstate__(self):
7707  *         return (self._num_ops, self.n_t, None, np.array(self.tlist),             # <<<<<<<<<<<<<<
7708  *                 np.array(self.y), np.array(self.M))
7709  *
7710  */
7711   __pyx_t_7 = PyTuple_New(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 218, __pyx_L1_error)
7712   __Pyx_GOTREF(__pyx_t_7);
7713   __Pyx_GIVEREF(__pyx_t_1);
7714   PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
7715   __Pyx_GIVEREF(__pyx_t_2);
7716   PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
7717   __Pyx_INCREF(Py_None);
7718   __Pyx_GIVEREF(Py_None);
7719   PyTuple_SET_ITEM(__pyx_t_7, 2, Py_None);
7720   __Pyx_GIVEREF(__pyx_t_3);
7721   PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_3);
7722   __Pyx_GIVEREF(__pyx_t_5);
7723   PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_5);
7724   __Pyx_GIVEREF(__pyx_t_6);
7725   PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_6);
7726   __pyx_t_1 = 0;
7727   __pyx_t_2 = 0;
7728   __pyx_t_3 = 0;
7729   __pyx_t_5 = 0;
7730   __pyx_t_6 = 0;
7731   __pyx_r = __pyx_t_7;
7732   __pyx_t_7 = 0;
7733   goto __pyx_L0;
7734 
7735   /* "qutip/cy/cqobjevo_factor.pyx":217
7736  *         pass
7737  *
7738  *     def __getstate__(self):             # <<<<<<<<<<<<<<
7739  *         return (self._num_ops, self.n_t, None, np.array(self.tlist),
7740  *                 np.array(self.y), np.array(self.M))
7741  */
7742 
7743   /* function exit code */
7744   __pyx_L1_error:;
7745   __Pyx_XDECREF(__pyx_t_1);
7746   __Pyx_XDECREF(__pyx_t_2);
7747   __Pyx_XDECREF(__pyx_t_3);
7748   __Pyx_XDECREF(__pyx_t_4);
7749   __Pyx_XDECREF(__pyx_t_5);
7750   __Pyx_XDECREF(__pyx_t_6);
7751   __Pyx_XDECREF(__pyx_t_7);
7752   __Pyx_XDECREF(__pyx_t_8);
7753   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.InterCoeffT.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7754   __pyx_r = NULL;
7755   __pyx_L0:;
7756   __Pyx_XGIVEREF(__pyx_r);
7757   __Pyx_RefNannyFinishContext();
7758   return __pyx_r;
7759 }
7760 
7761 /* "qutip/cy/cqobjevo_factor.pyx":221
7762  *                 np.array(self.y), np.array(self.M))
7763  *
7764  *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
7765  *         self._num_ops = state[0]
7766  *         self.n_t = state[1]
7767  */
7768 
7769 /* Python wrapper */
7770 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_7__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_7__setstate__(PyObject * __pyx_v_self,PyObject * __pyx_v_state)7771 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_7__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
7772   PyObject *__pyx_r = 0;
7773   __Pyx_RefNannyDeclarations
7774   __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0);
7775   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_6__setstate__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *)__pyx_v_self), ((PyObject *)__pyx_v_state));
7776 
7777   /* function exit code */
7778   __Pyx_RefNannyFinishContext();
7779   return __pyx_r;
7780 }
7781 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_6__setstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT * __pyx_v_self,PyObject * __pyx_v_state)7782 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_6__setstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *__pyx_v_self, PyObject *__pyx_v_state) {
7783   PyObject *__pyx_r = NULL;
7784   __Pyx_RefNannyDeclarations
7785   PyObject *__pyx_t_1 = NULL;
7786   int __pyx_t_2;
7787   __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
7788   __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
7789   int __pyx_lineno = 0;
7790   const char *__pyx_filename = NULL;
7791   int __pyx_clineno = 0;
7792   __Pyx_RefNannySetupContext("__setstate__", 0);
7793 
7794   /* "qutip/cy/cqobjevo_factor.pyx":222
7795  *
7796  *     def __setstate__(self, state):
7797  *         self._num_ops = state[0]             # <<<<<<<<<<<<<<
7798  *         self.n_t = state[1]
7799  *         self.tlist = state[3]
7800  */
7801   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error)
7802   __Pyx_GOTREF(__pyx_t_1);
7803   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 222, __pyx_L1_error)
7804   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7805   __pyx_v_self->__pyx_base._num_ops = __pyx_t_2;
7806 
7807   /* "qutip/cy/cqobjevo_factor.pyx":223
7808  *     def __setstate__(self, state):
7809  *         self._num_ops = state[0]
7810  *         self.n_t = state[1]             # <<<<<<<<<<<<<<
7811  *         self.tlist = state[3]
7812  *         self.y = state[4]
7813  */
7814   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error)
7815   __Pyx_GOTREF(__pyx_t_1);
7816   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L1_error)
7817   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7818   __pyx_v_self->n_t = __pyx_t_2;
7819 
7820   /* "qutip/cy/cqobjevo_factor.pyx":224
7821  *         self._num_ops = state[0]
7822  *         self.n_t = state[1]
7823  *         self.tlist = state[3]             # <<<<<<<<<<<<<<
7824  *         self.y = state[4]
7825  *         self.M = state[5]
7826  */
7827   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error)
7828   __Pyx_GOTREF(__pyx_t_1);
7829   __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 224, __pyx_L1_error)
7830   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7831   __PYX_XDEC_MEMVIEW(&__pyx_v_self->tlist, 0);
7832   __pyx_v_self->tlist = __pyx_t_3;
7833   __pyx_t_3.memview = NULL;
7834   __pyx_t_3.data = NULL;
7835 
7836   /* "qutip/cy/cqobjevo_factor.pyx":225
7837  *         self.n_t = state[1]
7838  *         self.tlist = state[3]
7839  *         self.y = state[4]             # <<<<<<<<<<<<<<
7840  *         self.M = state[5]
7841  *
7842  */
7843   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error)
7844   __Pyx_GOTREF(__pyx_t_1);
7845   __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 225, __pyx_L1_error)
7846   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7847   __PYX_XDEC_MEMVIEW(&__pyx_v_self->y, 0);
7848   __pyx_v_self->y = __pyx_t_4;
7849   __pyx_t_4.memview = NULL;
7850   __pyx_t_4.data = NULL;
7851 
7852   /* "qutip/cy/cqobjevo_factor.pyx":226
7853  *         self.tlist = state[3]
7854  *         self.y = state[4]
7855  *         self.M = state[5]             # <<<<<<<<<<<<<<
7856  *
7857  *
7858  */
7859   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
7860   __Pyx_GOTREF(__pyx_t_1);
7861   __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 226, __pyx_L1_error)
7862   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7863   __PYX_XDEC_MEMVIEW(&__pyx_v_self->M, 0);
7864   __pyx_v_self->M = __pyx_t_4;
7865   __pyx_t_4.memview = NULL;
7866   __pyx_t_4.data = NULL;
7867 
7868   /* "qutip/cy/cqobjevo_factor.pyx":221
7869  *                 np.array(self.y), np.array(self.M))
7870  *
7871  *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
7872  *         self._num_ops = state[0]
7873  *         self.n_t = state[1]
7874  */
7875 
7876   /* function exit code */
7877   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7878   goto __pyx_L0;
7879   __pyx_L1_error:;
7880   __Pyx_XDECREF(__pyx_t_1);
7881   __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
7882   __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
7883   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.InterCoeffT.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7884   __pyx_r = NULL;
7885   __pyx_L0:;
7886   __Pyx_XGIVEREF(__pyx_r);
7887   __Pyx_RefNannyFinishContext();
7888   return __pyx_r;
7889 }
7890 
7891 /* "(tree fragment)":1
7892  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
7893  *     cdef tuple state
7894  *     cdef object _dict
7895  */
7896 
7897 /* Python wrapper */
7898 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_9__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)7899 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7900   PyObject *__pyx_r = 0;
7901   __Pyx_RefNannyDeclarations
7902   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
7903   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_8__reduce_cython__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *)__pyx_v_self));
7904 
7905   /* function exit code */
7906   __Pyx_RefNannyFinishContext();
7907   return __pyx_r;
7908 }
7909 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_8__reduce_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT * __pyx_v_self)7910 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_8__reduce_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *__pyx_v_self) {
7911   PyObject *__pyx_v_state = 0;
7912   PyObject *__pyx_v__dict = 0;
7913   int __pyx_v_use_setstate;
7914   PyObject *__pyx_r = NULL;
7915   __Pyx_RefNannyDeclarations
7916   PyObject *__pyx_t_1 = NULL;
7917   PyObject *__pyx_t_2 = NULL;
7918   PyObject *__pyx_t_3 = NULL;
7919   PyObject *__pyx_t_4 = NULL;
7920   PyObject *__pyx_t_5 = NULL;
7921   PyObject *__pyx_t_6 = NULL;
7922   PyObject *__pyx_t_7 = NULL;
7923   int __pyx_t_8;
7924   int __pyx_t_9;
7925   int __pyx_lineno = 0;
7926   const char *__pyx_filename = NULL;
7927   int __pyx_clineno = 0;
7928   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
7929 
7930   /* "(tree fragment)":5
7931  *     cdef object _dict
7932  *     cdef bint use_setstate
7933  *     state = (self.M, self._args, self._num_ops, self.dt, self.n_t, self.tlist, self.y)             # <<<<<<<<<<<<<<
7934  *     _dict = getattr(self, '__dict__', None)
7935  *     if _dict is not None:
7936  */
7937   if (unlikely(!__pyx_v_self->M.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 5, __pyx_L1_error)}
7938   __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_self->M, 2, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
7939   __Pyx_GOTREF(__pyx_t_1);
7940   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base._num_ops); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
7941   __Pyx_GOTREF(__pyx_t_2);
7942   __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->dt); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
7943   __Pyx_GOTREF(__pyx_t_3);
7944   __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->n_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
7945   __Pyx_GOTREF(__pyx_t_4);
7946   if (unlikely(!__pyx_v_self->tlist.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 5, __pyx_L1_error)}
7947   __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_self->tlist, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error)
7948   __Pyx_GOTREF(__pyx_t_5);
7949   if (unlikely(!__pyx_v_self->y.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 5, __pyx_L1_error)}
7950   __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_self->y, 2, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 5, __pyx_L1_error)
7951   __Pyx_GOTREF(__pyx_t_6);
7952   __pyx_t_7 = PyTuple_New(7); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 5, __pyx_L1_error)
7953   __Pyx_GOTREF(__pyx_t_7);
7954   __Pyx_GIVEREF(__pyx_t_1);
7955   PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
7956   __Pyx_INCREF(__pyx_v_self->__pyx_base._args);
7957   __Pyx_GIVEREF(__pyx_v_self->__pyx_base._args);
7958   PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_self->__pyx_base._args);
7959   __Pyx_GIVEREF(__pyx_t_2);
7960   PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_2);
7961   __Pyx_GIVEREF(__pyx_t_3);
7962   PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_3);
7963   __Pyx_GIVEREF(__pyx_t_4);
7964   PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_4);
7965   __Pyx_GIVEREF(__pyx_t_5);
7966   PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_5);
7967   __Pyx_GIVEREF(__pyx_t_6);
7968   PyTuple_SET_ITEM(__pyx_t_7, 6, __pyx_t_6);
7969   __pyx_t_1 = 0;
7970   __pyx_t_2 = 0;
7971   __pyx_t_3 = 0;
7972   __pyx_t_4 = 0;
7973   __pyx_t_5 = 0;
7974   __pyx_t_6 = 0;
7975   __pyx_v_state = ((PyObject*)__pyx_t_7);
7976   __pyx_t_7 = 0;
7977 
7978   /* "(tree fragment)":6
7979  *     cdef bint use_setstate
7980  *     state = (self.M, self._args, self._num_ops, self.dt, self.n_t, self.tlist, self.y)
7981  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
7982  *     if _dict is not None:
7983  *         state += (_dict,)
7984  */
7985   __pyx_t_7 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 6, __pyx_L1_error)
7986   __Pyx_GOTREF(__pyx_t_7);
7987   __pyx_v__dict = __pyx_t_7;
7988   __pyx_t_7 = 0;
7989 
7990   /* "(tree fragment)":7
7991  *     state = (self.M, self._args, self._num_ops, self.dt, self.n_t, self.tlist, self.y)
7992  *     _dict = getattr(self, '__dict__', None)
7993  *     if _dict is not None:             # <<<<<<<<<<<<<<
7994  *         state += (_dict,)
7995  *         use_setstate = True
7996  */
7997   __pyx_t_8 = (__pyx_v__dict != Py_None);
7998   __pyx_t_9 = (__pyx_t_8 != 0);
7999   if (__pyx_t_9) {
8000 
8001     /* "(tree fragment)":8
8002  *     _dict = getattr(self, '__dict__', None)
8003  *     if _dict is not None:
8004  *         state += (_dict,)             # <<<<<<<<<<<<<<
8005  *         use_setstate = True
8006  *     else:
8007  */
8008     __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 8, __pyx_L1_error)
8009     __Pyx_GOTREF(__pyx_t_7);
8010     __Pyx_INCREF(__pyx_v__dict);
8011     __Pyx_GIVEREF(__pyx_v__dict);
8012     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v__dict);
8013     __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 8, __pyx_L1_error)
8014     __Pyx_GOTREF(__pyx_t_6);
8015     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8016     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_6));
8017     __pyx_t_6 = 0;
8018 
8019     /* "(tree fragment)":9
8020  *     if _dict is not None:
8021  *         state += (_dict,)
8022  *         use_setstate = True             # <<<<<<<<<<<<<<
8023  *     else:
8024  *         use_setstate = self._args is not None
8025  */
8026     __pyx_v_use_setstate = 1;
8027 
8028     /* "(tree fragment)":7
8029  *     state = (self.M, self._args, self._num_ops, self.dt, self.n_t, self.tlist, self.y)
8030  *     _dict = getattr(self, '__dict__', None)
8031  *     if _dict is not None:             # <<<<<<<<<<<<<<
8032  *         state += (_dict,)
8033  *         use_setstate = True
8034  */
8035     goto __pyx_L3;
8036   }
8037 
8038   /* "(tree fragment)":11
8039  *         use_setstate = True
8040  *     else:
8041  *         use_setstate = self._args is not None             # <<<<<<<<<<<<<<
8042  *     if use_setstate:
8043  *         return __pyx_unpickle_InterCoeffT, (type(self), 0x94db4ad, None), state
8044  */
8045   /*else*/ {
8046     __pyx_t_9 = (__pyx_v_self->__pyx_base._args != ((PyObject*)Py_None));
8047     __pyx_v_use_setstate = __pyx_t_9;
8048   }
8049   __pyx_L3:;
8050 
8051   /* "(tree fragment)":12
8052  *     else:
8053  *         use_setstate = self._args is not None
8054  *     if use_setstate:             # <<<<<<<<<<<<<<
8055  *         return __pyx_unpickle_InterCoeffT, (type(self), 0x94db4ad, None), state
8056  *     else:
8057  */
8058   __pyx_t_9 = (__pyx_v_use_setstate != 0);
8059   if (__pyx_t_9) {
8060 
8061     /* "(tree fragment)":13
8062  *         use_setstate = self._args is not None
8063  *     if use_setstate:
8064  *         return __pyx_unpickle_InterCoeffT, (type(self), 0x94db4ad, None), state             # <<<<<<<<<<<<<<
8065  *     else:
8066  *         return __pyx_unpickle_InterCoeffT, (type(self), 0x94db4ad, state)
8067  */
8068     __Pyx_XDECREF(__pyx_r);
8069     __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_InterCoeffT); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error)
8070     __Pyx_GOTREF(__pyx_t_6);
8071     __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 13, __pyx_L1_error)
8072     __Pyx_GOTREF(__pyx_t_7);
8073     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8074     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8075     PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8076     __Pyx_INCREF(__pyx_int_156087469);
8077     __Pyx_GIVEREF(__pyx_int_156087469);
8078     PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_156087469);
8079     __Pyx_INCREF(Py_None);
8080     __Pyx_GIVEREF(Py_None);
8081     PyTuple_SET_ITEM(__pyx_t_7, 2, Py_None);
8082     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
8083     __Pyx_GOTREF(__pyx_t_5);
8084     __Pyx_GIVEREF(__pyx_t_6);
8085     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
8086     __Pyx_GIVEREF(__pyx_t_7);
8087     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7);
8088     __Pyx_INCREF(__pyx_v_state);
8089     __Pyx_GIVEREF(__pyx_v_state);
8090     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
8091     __pyx_t_6 = 0;
8092     __pyx_t_7 = 0;
8093     __pyx_r = __pyx_t_5;
8094     __pyx_t_5 = 0;
8095     goto __pyx_L0;
8096 
8097     /* "(tree fragment)":12
8098  *     else:
8099  *         use_setstate = self._args is not None
8100  *     if use_setstate:             # <<<<<<<<<<<<<<
8101  *         return __pyx_unpickle_InterCoeffT, (type(self), 0x94db4ad, None), state
8102  *     else:
8103  */
8104   }
8105 
8106   /* "(tree fragment)":15
8107  *         return __pyx_unpickle_InterCoeffT, (type(self), 0x94db4ad, None), state
8108  *     else:
8109  *         return __pyx_unpickle_InterCoeffT, (type(self), 0x94db4ad, state)             # <<<<<<<<<<<<<<
8110  * def __setstate_cython__(self, __pyx_state):
8111  *     __pyx_unpickle_InterCoeffT__set_state(self, __pyx_state)
8112  */
8113   /*else*/ {
8114     __Pyx_XDECREF(__pyx_r);
8115     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_InterCoeffT); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
8116     __Pyx_GOTREF(__pyx_t_5);
8117     __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 15, __pyx_L1_error)
8118     __Pyx_GOTREF(__pyx_t_7);
8119     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8120     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8121     PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8122     __Pyx_INCREF(__pyx_int_156087469);
8123     __Pyx_GIVEREF(__pyx_int_156087469);
8124     PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_156087469);
8125     __Pyx_INCREF(__pyx_v_state);
8126     __Pyx_GIVEREF(__pyx_v_state);
8127     PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_state);
8128     __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 15, __pyx_L1_error)
8129     __Pyx_GOTREF(__pyx_t_6);
8130     __Pyx_GIVEREF(__pyx_t_5);
8131     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
8132     __Pyx_GIVEREF(__pyx_t_7);
8133     PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
8134     __pyx_t_5 = 0;
8135     __pyx_t_7 = 0;
8136     __pyx_r = __pyx_t_6;
8137     __pyx_t_6 = 0;
8138     goto __pyx_L0;
8139   }
8140 
8141   /* "(tree fragment)":1
8142  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
8143  *     cdef tuple state
8144  *     cdef object _dict
8145  */
8146 
8147   /* function exit code */
8148   __pyx_L1_error:;
8149   __Pyx_XDECREF(__pyx_t_1);
8150   __Pyx_XDECREF(__pyx_t_2);
8151   __Pyx_XDECREF(__pyx_t_3);
8152   __Pyx_XDECREF(__pyx_t_4);
8153   __Pyx_XDECREF(__pyx_t_5);
8154   __Pyx_XDECREF(__pyx_t_6);
8155   __Pyx_XDECREF(__pyx_t_7);
8156   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.InterCoeffT.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8157   __pyx_r = NULL;
8158   __pyx_L0:;
8159   __Pyx_XDECREF(__pyx_v_state);
8160   __Pyx_XDECREF(__pyx_v__dict);
8161   __Pyx_XGIVEREF(__pyx_r);
8162   __Pyx_RefNannyFinishContext();
8163   return __pyx_r;
8164 }
8165 
8166 /* "(tree fragment)":16
8167  *     else:
8168  *         return __pyx_unpickle_InterCoeffT, (type(self), 0x94db4ad, state)
8169  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
8170  *     __pyx_unpickle_InterCoeffT__set_state(self, __pyx_state)
8171  */
8172 
8173 /* Python wrapper */
8174 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_11__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)8175 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8176   PyObject *__pyx_r = 0;
8177   __Pyx_RefNannyDeclarations
8178   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
8179   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_10__setstate_cython__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
8180 
8181   /* function exit code */
8182   __Pyx_RefNannyFinishContext();
8183   return __pyx_r;
8184 }
8185 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_10__setstate_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT * __pyx_v_self,PyObject * __pyx_v___pyx_state)8186 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_10__setstate_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8187   PyObject *__pyx_r = NULL;
8188   __Pyx_RefNannyDeclarations
8189   PyObject *__pyx_t_1 = NULL;
8190   int __pyx_lineno = 0;
8191   const char *__pyx_filename = NULL;
8192   int __pyx_clineno = 0;
8193   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
8194 
8195   /* "(tree fragment)":17
8196  *         return __pyx_unpickle_InterCoeffT, (type(self), 0x94db4ad, state)
8197  * def __setstate_cython__(self, __pyx_state):
8198  *     __pyx_unpickle_InterCoeffT__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
8199  */
8200   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
8201   __pyx_t_1 = __pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_InterCoeffT__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
8202   __Pyx_GOTREF(__pyx_t_1);
8203   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8204 
8205   /* "(tree fragment)":16
8206  *     else:
8207  *         return __pyx_unpickle_InterCoeffT, (type(self), 0x94db4ad, state)
8208  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
8209  *     __pyx_unpickle_InterCoeffT__set_state(self, __pyx_state)
8210  */
8211 
8212   /* function exit code */
8213   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8214   goto __pyx_L0;
8215   __pyx_L1_error:;
8216   __Pyx_XDECREF(__pyx_t_1);
8217   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.InterCoeffT.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8218   __pyx_r = NULL;
8219   __pyx_L0:;
8220   __Pyx_XGIVEREF(__pyx_r);
8221   __Pyx_RefNannyFinishContext();
8222   return __pyx_r;
8223 }
8224 
8225 /* "qutip/cy/cqobjevo_factor.pyx":234
8226  *     cdef complex[:,::1] y
8227  *
8228  *     def __init__(self, ops, args, tlist):             # <<<<<<<<<<<<<<
8229  *         cdef int i, j
8230  *         self._args = {}
8231  */
8232 
8233 /* Python wrapper */
8234 static int __pyx_pw_5qutip_2cy_15cqobjevo_factor_9StepCoeff_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_9StepCoeff_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)8235 static int __pyx_pw_5qutip_2cy_15cqobjevo_factor_9StepCoeff_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8236   PyObject *__pyx_v_ops = 0;
8237   CYTHON_UNUSED PyObject *__pyx_v_args = 0;
8238   PyObject *__pyx_v_tlist = 0;
8239   int __pyx_lineno = 0;
8240   const char *__pyx_filename = NULL;
8241   int __pyx_clineno = 0;
8242   int __pyx_r;
8243   __Pyx_RefNannyDeclarations
8244   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
8245   {
8246     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ops,&__pyx_n_s_args,&__pyx_n_s_tlist,0};
8247     PyObject* values[3] = {0,0,0};
8248     if (unlikely(__pyx_kwds)) {
8249       Py_ssize_t kw_args;
8250       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8251       switch (pos_args) {
8252         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8253         CYTHON_FALLTHROUGH;
8254         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8255         CYTHON_FALLTHROUGH;
8256         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8257         CYTHON_FALLTHROUGH;
8258         case  0: break;
8259         default: goto __pyx_L5_argtuple_error;
8260       }
8261       kw_args = PyDict_Size(__pyx_kwds);
8262       switch (pos_args) {
8263         case  0:
8264         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ops)) != 0)) kw_args--;
8265         else goto __pyx_L5_argtuple_error;
8266         CYTHON_FALLTHROUGH;
8267         case  1:
8268         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
8269         else {
8270           __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 234, __pyx_L3_error)
8271         }
8272         CYTHON_FALLTHROUGH;
8273         case  2:
8274         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tlist)) != 0)) kw_args--;
8275         else {
8276           __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 234, __pyx_L3_error)
8277         }
8278       }
8279       if (unlikely(kw_args > 0)) {
8280         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 234, __pyx_L3_error)
8281       }
8282     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
8283       goto __pyx_L5_argtuple_error;
8284     } else {
8285       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8286       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8287       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8288     }
8289     __pyx_v_ops = values[0];
8290     __pyx_v_args = values[1];
8291     __pyx_v_tlist = values[2];
8292   }
8293   goto __pyx_L4_argument_unpacking_done;
8294   __pyx_L5_argtuple_error:;
8295   __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 234, __pyx_L3_error)
8296   __pyx_L3_error:;
8297   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.StepCoeff.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8298   __Pyx_RefNannyFinishContext();
8299   return -1;
8300   __pyx_L4_argument_unpacking_done:;
8301   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_9StepCoeff___init__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff *)__pyx_v_self), __pyx_v_ops, __pyx_v_args, __pyx_v_tlist);
8302 
8303   /* function exit code */
8304   __Pyx_RefNannyFinishContext();
8305   return __pyx_r;
8306 }
8307 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_9StepCoeff___init__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff * __pyx_v_self,PyObject * __pyx_v_ops,CYTHON_UNUSED PyObject * __pyx_v_args,PyObject * __pyx_v_tlist)8308 static int __pyx_pf_5qutip_2cy_15cqobjevo_factor_9StepCoeff___init__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff *__pyx_v_self, PyObject *__pyx_v_ops, CYTHON_UNUSED PyObject *__pyx_v_args, PyObject *__pyx_v_tlist) {
8309   int __pyx_v_i;
8310   int __pyx_v_j;
8311   int __pyx_r;
8312   __Pyx_RefNannyDeclarations
8313   PyObject *__pyx_t_1 = NULL;
8314   Py_ssize_t __pyx_t_2;
8315   __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
8316   PyObject *__pyx_t_4 = NULL;
8317   PyObject *__pyx_t_5 = NULL;
8318   PyObject *__pyx_t_6 = NULL;
8319   __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
8320   int __pyx_t_8;
8321   int __pyx_t_9;
8322   int __pyx_t_10;
8323   int __pyx_t_11;
8324   int __pyx_t_12;
8325   int __pyx_t_13;
8326   __pyx_t_double_complex __pyx_t_14;
8327   Py_ssize_t __pyx_t_15;
8328   Py_ssize_t __pyx_t_16;
8329   int __pyx_t_17;
8330   int __pyx_lineno = 0;
8331   const char *__pyx_filename = NULL;
8332   int __pyx_clineno = 0;
8333   __Pyx_RefNannySetupContext("__init__", 0);
8334 
8335   /* "qutip/cy/cqobjevo_factor.pyx":236
8336  *     def __init__(self, ops, args, tlist):
8337  *         cdef int i, j
8338  *         self._args = {}             # <<<<<<<<<<<<<<
8339  *         self._num_ops = len(ops)
8340  *         self.tlist = tlist
8341  */
8342   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
8343   __Pyx_GOTREF(__pyx_t_1);
8344   __Pyx_GIVEREF(__pyx_t_1);
8345   __Pyx_GOTREF(__pyx_v_self->__pyx_base._args);
8346   __Pyx_DECREF(__pyx_v_self->__pyx_base._args);
8347   __pyx_v_self->__pyx_base._args = ((PyObject*)__pyx_t_1);
8348   __pyx_t_1 = 0;
8349 
8350   /* "qutip/cy/cqobjevo_factor.pyx":237
8351  *         cdef int i, j
8352  *         self._args = {}
8353  *         self._num_ops = len(ops)             # <<<<<<<<<<<<<<
8354  *         self.tlist = tlist
8355  *         self.n_t = len(tlist)
8356  */
8357   __pyx_t_2 = PyObject_Length(__pyx_v_ops); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 237, __pyx_L1_error)
8358   __pyx_v_self->__pyx_base._num_ops = __pyx_t_2;
8359 
8360   /* "qutip/cy/cqobjevo_factor.pyx":238
8361  *         self._args = {}
8362  *         self._num_ops = len(ops)
8363  *         self.tlist = tlist             # <<<<<<<<<<<<<<
8364  *         self.n_t = len(tlist)
8365  *         self.y = np.zeros((self._num_ops, self.n_t), dtype=complex)
8366  */
8367   __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_tlist, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 238, __pyx_L1_error)
8368   __PYX_XDEC_MEMVIEW(&__pyx_v_self->tlist, 0);
8369   __pyx_v_self->tlist = __pyx_t_3;
8370   __pyx_t_3.memview = NULL;
8371   __pyx_t_3.data = NULL;
8372 
8373   /* "qutip/cy/cqobjevo_factor.pyx":239
8374  *         self._num_ops = len(ops)
8375  *         self.tlist = tlist
8376  *         self.n_t = len(tlist)             # <<<<<<<<<<<<<<
8377  *         self.y = np.zeros((self._num_ops, self.n_t), dtype=complex)
8378  *         for i in range(self._num_ops):
8379  */
8380   __pyx_t_2 = PyObject_Length(__pyx_v_tlist); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 239, __pyx_L1_error)
8381   __pyx_v_self->n_t = __pyx_t_2;
8382 
8383   /* "qutip/cy/cqobjevo_factor.pyx":240
8384  *         self.tlist = tlist
8385  *         self.n_t = len(tlist)
8386  *         self.y = np.zeros((self._num_ops, self.n_t), dtype=complex)             # <<<<<<<<<<<<<<
8387  *         for i in range(self._num_ops):
8388  *             for j in range(self.n_t):
8389  */
8390   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
8391   __Pyx_GOTREF(__pyx_t_1);
8392   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 240, __pyx_L1_error)
8393   __Pyx_GOTREF(__pyx_t_4);
8394   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8395   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base._num_ops); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
8396   __Pyx_GOTREF(__pyx_t_1);
8397   __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->n_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 240, __pyx_L1_error)
8398   __Pyx_GOTREF(__pyx_t_5);
8399   __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error)
8400   __Pyx_GOTREF(__pyx_t_6);
8401   __Pyx_GIVEREF(__pyx_t_1);
8402   PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
8403   __Pyx_GIVEREF(__pyx_t_5);
8404   PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
8405   __pyx_t_1 = 0;
8406   __pyx_t_5 = 0;
8407   __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 240, __pyx_L1_error)
8408   __Pyx_GOTREF(__pyx_t_5);
8409   __Pyx_GIVEREF(__pyx_t_6);
8410   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
8411   __pyx_t_6 = 0;
8412   __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error)
8413   __Pyx_GOTREF(__pyx_t_6);
8414   if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, ((PyObject *)(&PyComplex_Type))) < 0) __PYX_ERR(0, 240, __pyx_L1_error)
8415   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
8416   __Pyx_GOTREF(__pyx_t_1);
8417   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8418   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8419   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8420   __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 240, __pyx_L1_error)
8421   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8422   __PYX_XDEC_MEMVIEW(&__pyx_v_self->y, 0);
8423   __pyx_v_self->y = __pyx_t_7;
8424   __pyx_t_7.memview = NULL;
8425   __pyx_t_7.data = NULL;
8426 
8427   /* "qutip/cy/cqobjevo_factor.pyx":241
8428  *         self.n_t = len(tlist)
8429  *         self.y = np.zeros((self._num_ops, self.n_t), dtype=complex)
8430  *         for i in range(self._num_ops):             # <<<<<<<<<<<<<<
8431  *             for j in range(self.n_t):
8432  *                 self.y[i,j] = ops[i][2][j]
8433  */
8434   __pyx_t_8 = __pyx_v_self->__pyx_base._num_ops;
8435   __pyx_t_9 = __pyx_t_8;
8436   for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
8437     __pyx_v_i = __pyx_t_10;
8438 
8439     /* "qutip/cy/cqobjevo_factor.pyx":242
8440  *         self.y = np.zeros((self._num_ops, self.n_t), dtype=complex)
8441  *         for i in range(self._num_ops):
8442  *             for j in range(self.n_t):             # <<<<<<<<<<<<<<
8443  *                 self.y[i,j] = ops[i][2][j]
8444  *
8445  */
8446     __pyx_t_11 = __pyx_v_self->n_t;
8447     __pyx_t_12 = __pyx_t_11;
8448     for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
8449       __pyx_v_j = __pyx_t_13;
8450 
8451       /* "qutip/cy/cqobjevo_factor.pyx":243
8452  *         for i in range(self._num_ops):
8453  *             for j in range(self.n_t):
8454  *                 self.y[i,j] = ops[i][2][j]             # <<<<<<<<<<<<<<
8455  *
8456  *     def set_arg(self, args):
8457  */
8458       __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ops, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error)
8459       __Pyx_GOTREF(__pyx_t_1);
8460       __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error)
8461       __Pyx_GOTREF(__pyx_t_6);
8462       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8463       __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error)
8464       __Pyx_GOTREF(__pyx_t_1);
8465       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8466       __pyx_t_14 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 243, __pyx_L1_error)
8467       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8468       if (unlikely(!__pyx_v_self->y.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 243, __pyx_L1_error)}
8469       __pyx_t_15 = __pyx_v_i;
8470       __pyx_t_16 = __pyx_v_j;
8471       __pyx_t_17 = -1;
8472       if (__pyx_t_15 < 0) {
8473         __pyx_t_15 += __pyx_v_self->y.shape[0];
8474         if (unlikely(__pyx_t_15 < 0)) __pyx_t_17 = 0;
8475       } else if (unlikely(__pyx_t_15 >= __pyx_v_self->y.shape[0])) __pyx_t_17 = 0;
8476       if (__pyx_t_16 < 0) {
8477         __pyx_t_16 += __pyx_v_self->y.shape[1];
8478         if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 1;
8479       } else if (unlikely(__pyx_t_16 >= __pyx_v_self->y.shape[1])) __pyx_t_17 = 1;
8480       if (unlikely(__pyx_t_17 != -1)) {
8481         __Pyx_RaiseBufferIndexError(__pyx_t_17);
8482         __PYX_ERR(0, 243, __pyx_L1_error)
8483       }
8484       *((__pyx_t_double_complex *) ( /* dim=1 */ ((char *) (((__pyx_t_double_complex *) ( /* dim=0 */ (__pyx_v_self->y.data + __pyx_t_15 * __pyx_v_self->y.strides[0]) )) + __pyx_t_16)) )) = __pyx_t_14;
8485     }
8486   }
8487 
8488   /* "qutip/cy/cqobjevo_factor.pyx":234
8489  *     cdef complex[:,::1] y
8490  *
8491  *     def __init__(self, ops, args, tlist):             # <<<<<<<<<<<<<<
8492  *         cdef int i, j
8493  *         self._args = {}
8494  */
8495 
8496   /* function exit code */
8497   __pyx_r = 0;
8498   goto __pyx_L0;
8499   __pyx_L1_error:;
8500   __Pyx_XDECREF(__pyx_t_1);
8501   __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
8502   __Pyx_XDECREF(__pyx_t_4);
8503   __Pyx_XDECREF(__pyx_t_5);
8504   __Pyx_XDECREF(__pyx_t_6);
8505   __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
8506   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.StepCoeff.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8507   __pyx_r = -1;
8508   __pyx_L0:;
8509   __Pyx_RefNannyFinishContext();
8510   return __pyx_r;
8511 }
8512 
8513 /* "qutip/cy/cqobjevo_factor.pyx":245
8514  *                 self.y[i,j] = ops[i][2][j]
8515  *
8516  *     def set_arg(self, args):             # <<<<<<<<<<<<<<
8517  *         pass
8518  *
8519  */
8520 
8521 /* Python wrapper */
8522 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_9StepCoeff_3set_arg(PyObject *__pyx_v_self, PyObject *__pyx_v_args); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_9StepCoeff_3set_arg(PyObject * __pyx_v_self,PyObject * __pyx_v_args)8523 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_9StepCoeff_3set_arg(PyObject *__pyx_v_self, PyObject *__pyx_v_args) {
8524   PyObject *__pyx_r = 0;
8525   __Pyx_RefNannyDeclarations
8526   __Pyx_RefNannySetupContext("set_arg (wrapper)", 0);
8527   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_9StepCoeff_2set_arg(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff *)__pyx_v_self), ((PyObject *)__pyx_v_args));
8528 
8529   /* function exit code */
8530   __Pyx_RefNannyFinishContext();
8531   return __pyx_r;
8532 }
8533 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_9StepCoeff_2set_arg(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v_args)8534 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_9StepCoeff_2set_arg(CYTHON_UNUSED struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args) {
8535   PyObject *__pyx_r = NULL;
8536   __Pyx_RefNannyDeclarations
8537   __Pyx_RefNannySetupContext("set_arg", 0);
8538 
8539   /* function exit code */
8540   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8541   __Pyx_XGIVEREF(__pyx_r);
8542   __Pyx_RefNannyFinishContext();
8543   return __pyx_r;
8544 }
8545 
8546 /* "qutip/cy/cqobjevo_factor.pyx":248
8547  *         pass
8548  *
8549  *     def __getstate__(self):             # <<<<<<<<<<<<<<
8550  *         return (self._num_ops, self.n_t, None, np.array(self.tlist),
8551  *                 np.array(self.y))
8552  */
8553 
8554 /* Python wrapper */
8555 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_9StepCoeff_5__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_9StepCoeff_5__getstate__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)8556 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_9StepCoeff_5__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8557   PyObject *__pyx_r = 0;
8558   __Pyx_RefNannyDeclarations
8559   __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
8560   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_9StepCoeff_4__getstate__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff *)__pyx_v_self));
8561 
8562   /* function exit code */
8563   __Pyx_RefNannyFinishContext();
8564   return __pyx_r;
8565 }
8566 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_9StepCoeff_4__getstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff * __pyx_v_self)8567 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_9StepCoeff_4__getstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff *__pyx_v_self) {
8568   PyObject *__pyx_r = NULL;
8569   __Pyx_RefNannyDeclarations
8570   PyObject *__pyx_t_1 = NULL;
8571   PyObject *__pyx_t_2 = NULL;
8572   PyObject *__pyx_t_3 = NULL;
8573   PyObject *__pyx_t_4 = NULL;
8574   PyObject *__pyx_t_5 = NULL;
8575   PyObject *__pyx_t_6 = NULL;
8576   PyObject *__pyx_t_7 = NULL;
8577   int __pyx_lineno = 0;
8578   const char *__pyx_filename = NULL;
8579   int __pyx_clineno = 0;
8580   __Pyx_RefNannySetupContext("__getstate__", 0);
8581 
8582   /* "qutip/cy/cqobjevo_factor.pyx":249
8583  *
8584  *     def __getstate__(self):
8585  *         return (self._num_ops, self.n_t, None, np.array(self.tlist),             # <<<<<<<<<<<<<<
8586  *                 np.array(self.y))
8587  *
8588  */
8589   __Pyx_XDECREF(__pyx_r);
8590   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base._num_ops); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error)
8591   __Pyx_GOTREF(__pyx_t_1);
8592   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->n_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error)
8593   __Pyx_GOTREF(__pyx_t_2);
8594   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error)
8595   __Pyx_GOTREF(__pyx_t_4);
8596   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 249, __pyx_L1_error)
8597   __Pyx_GOTREF(__pyx_t_5);
8598   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8599   if (unlikely(!__pyx_v_self->tlist.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 249, __pyx_L1_error)}
8600   __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_self->tlist, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error)
8601   __Pyx_GOTREF(__pyx_t_4);
8602   __pyx_t_6 = NULL;
8603   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
8604     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8605     if (likely(__pyx_t_6)) {
8606       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8607       __Pyx_INCREF(__pyx_t_6);
8608       __Pyx_INCREF(function);
8609       __Pyx_DECREF_SET(__pyx_t_5, function);
8610     }
8611   }
8612   __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
8613   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8614   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8615   if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error)
8616   __Pyx_GOTREF(__pyx_t_3);
8617   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8618 
8619   /* "qutip/cy/cqobjevo_factor.pyx":250
8620  *     def __getstate__(self):
8621  *         return (self._num_ops, self.n_t, None, np.array(self.tlist),
8622  *                 np.array(self.y))             # <<<<<<<<<<<<<<
8623  *
8624  *     def __setstate__(self, state):
8625  */
8626   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
8627   __Pyx_GOTREF(__pyx_t_4);
8628   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __pyx_L1_error)
8629   __Pyx_GOTREF(__pyx_t_6);
8630   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8631   if (unlikely(!__pyx_v_self->y.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 250, __pyx_L1_error)}
8632   __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_self->y, 2, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
8633   __Pyx_GOTREF(__pyx_t_4);
8634   __pyx_t_7 = NULL;
8635   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
8636     __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
8637     if (likely(__pyx_t_7)) {
8638       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
8639       __Pyx_INCREF(__pyx_t_7);
8640       __Pyx_INCREF(function);
8641       __Pyx_DECREF_SET(__pyx_t_6, function);
8642     }
8643   }
8644   __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4);
8645   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8646   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8647   if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 250, __pyx_L1_error)
8648   __Pyx_GOTREF(__pyx_t_5);
8649   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8650 
8651   /* "qutip/cy/cqobjevo_factor.pyx":249
8652  *
8653  *     def __getstate__(self):
8654  *         return (self._num_ops, self.n_t, None, np.array(self.tlist),             # <<<<<<<<<<<<<<
8655  *                 np.array(self.y))
8656  *
8657  */
8658   __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 249, __pyx_L1_error)
8659   __Pyx_GOTREF(__pyx_t_6);
8660   __Pyx_GIVEREF(__pyx_t_1);
8661   PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
8662   __Pyx_GIVEREF(__pyx_t_2);
8663   PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
8664   __Pyx_INCREF(Py_None);
8665   __Pyx_GIVEREF(Py_None);
8666   PyTuple_SET_ITEM(__pyx_t_6, 2, Py_None);
8667   __Pyx_GIVEREF(__pyx_t_3);
8668   PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_3);
8669   __Pyx_GIVEREF(__pyx_t_5);
8670   PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_5);
8671   __pyx_t_1 = 0;
8672   __pyx_t_2 = 0;
8673   __pyx_t_3 = 0;
8674   __pyx_t_5 = 0;
8675   __pyx_r = __pyx_t_6;
8676   __pyx_t_6 = 0;
8677   goto __pyx_L0;
8678 
8679   /* "qutip/cy/cqobjevo_factor.pyx":248
8680  *         pass
8681  *
8682  *     def __getstate__(self):             # <<<<<<<<<<<<<<
8683  *         return (self._num_ops, self.n_t, None, np.array(self.tlist),
8684  *                 np.array(self.y))
8685  */
8686 
8687   /* function exit code */
8688   __pyx_L1_error:;
8689   __Pyx_XDECREF(__pyx_t_1);
8690   __Pyx_XDECREF(__pyx_t_2);
8691   __Pyx_XDECREF(__pyx_t_3);
8692   __Pyx_XDECREF(__pyx_t_4);
8693   __Pyx_XDECREF(__pyx_t_5);
8694   __Pyx_XDECREF(__pyx_t_6);
8695   __Pyx_XDECREF(__pyx_t_7);
8696   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.StepCoeff.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8697   __pyx_r = NULL;
8698   __pyx_L0:;
8699   __Pyx_XGIVEREF(__pyx_r);
8700   __Pyx_RefNannyFinishContext();
8701   return __pyx_r;
8702 }
8703 
8704 /* "qutip/cy/cqobjevo_factor.pyx":252
8705  *                 np.array(self.y))
8706  *
8707  *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
8708  *         self._num_ops = state[0]
8709  *         self.n_t = state[1]
8710  */
8711 
8712 /* Python wrapper */
8713 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_9StepCoeff_7__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_9StepCoeff_7__setstate__(PyObject * __pyx_v_self,PyObject * __pyx_v_state)8714 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_9StepCoeff_7__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
8715   PyObject *__pyx_r = 0;
8716   __Pyx_RefNannyDeclarations
8717   __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0);
8718   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_9StepCoeff_6__setstate__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff *)__pyx_v_self), ((PyObject *)__pyx_v_state));
8719 
8720   /* function exit code */
8721   __Pyx_RefNannyFinishContext();
8722   return __pyx_r;
8723 }
8724 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_9StepCoeff_6__setstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff * __pyx_v_self,PyObject * __pyx_v_state)8725 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_9StepCoeff_6__setstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff *__pyx_v_self, PyObject *__pyx_v_state) {
8726   PyObject *__pyx_r = NULL;
8727   __Pyx_RefNannyDeclarations
8728   PyObject *__pyx_t_1 = NULL;
8729   int __pyx_t_2;
8730   __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
8731   __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
8732   int __pyx_lineno = 0;
8733   const char *__pyx_filename = NULL;
8734   int __pyx_clineno = 0;
8735   __Pyx_RefNannySetupContext("__setstate__", 0);
8736 
8737   /* "qutip/cy/cqobjevo_factor.pyx":253
8738  *
8739  *     def __setstate__(self, state):
8740  *         self._num_ops = state[0]             # <<<<<<<<<<<<<<
8741  *         self.n_t = state[1]
8742  *         self.tlist = state[3]
8743  */
8744   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error)
8745   __Pyx_GOTREF(__pyx_t_1);
8746   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 253, __pyx_L1_error)
8747   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8748   __pyx_v_self->__pyx_base._num_ops = __pyx_t_2;
8749 
8750   /* "qutip/cy/cqobjevo_factor.pyx":254
8751  *     def __setstate__(self, state):
8752  *         self._num_ops = state[0]
8753  *         self.n_t = state[1]             # <<<<<<<<<<<<<<
8754  *         self.tlist = state[3]
8755  *         self.y = state[4]
8756  */
8757   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error)
8758   __Pyx_GOTREF(__pyx_t_1);
8759   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 254, __pyx_L1_error)
8760   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8761   __pyx_v_self->n_t = __pyx_t_2;
8762 
8763   /* "qutip/cy/cqobjevo_factor.pyx":255
8764  *         self._num_ops = state[0]
8765  *         self.n_t = state[1]
8766  *         self.tlist = state[3]             # <<<<<<<<<<<<<<
8767  *         self.y = state[4]
8768  *
8769  */
8770   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error)
8771   __Pyx_GOTREF(__pyx_t_1);
8772   __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 255, __pyx_L1_error)
8773   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8774   __PYX_XDEC_MEMVIEW(&__pyx_v_self->tlist, 0);
8775   __pyx_v_self->tlist = __pyx_t_3;
8776   __pyx_t_3.memview = NULL;
8777   __pyx_t_3.data = NULL;
8778 
8779   /* "qutip/cy/cqobjevo_factor.pyx":256
8780  *         self.n_t = state[1]
8781  *         self.tlist = state[3]
8782  *         self.y = state[4]             # <<<<<<<<<<<<<<
8783  *
8784  *
8785  */
8786   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
8787   __Pyx_GOTREF(__pyx_t_1);
8788   __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 256, __pyx_L1_error)
8789   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8790   __PYX_XDEC_MEMVIEW(&__pyx_v_self->y, 0);
8791   __pyx_v_self->y = __pyx_t_4;
8792   __pyx_t_4.memview = NULL;
8793   __pyx_t_4.data = NULL;
8794 
8795   /* "qutip/cy/cqobjevo_factor.pyx":252
8796  *                 np.array(self.y))
8797  *
8798  *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
8799  *         self._num_ops = state[0]
8800  *         self.n_t = state[1]
8801  */
8802 
8803   /* function exit code */
8804   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8805   goto __pyx_L0;
8806   __pyx_L1_error:;
8807   __Pyx_XDECREF(__pyx_t_1);
8808   __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
8809   __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
8810   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.StepCoeff.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8811   __pyx_r = NULL;
8812   __pyx_L0:;
8813   __Pyx_XGIVEREF(__pyx_r);
8814   __Pyx_RefNannyFinishContext();
8815   return __pyx_r;
8816 }
8817 
8818 /* "(tree fragment)":1
8819  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
8820  *     cdef tuple state
8821  *     cdef object _dict
8822  */
8823 
8824 /* Python wrapper */
8825 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_9StepCoeff_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_9StepCoeff_9__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)8826 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_9StepCoeff_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8827   PyObject *__pyx_r = 0;
8828   __Pyx_RefNannyDeclarations
8829   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
8830   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_9StepCoeff_8__reduce_cython__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff *)__pyx_v_self));
8831 
8832   /* function exit code */
8833   __Pyx_RefNannyFinishContext();
8834   return __pyx_r;
8835 }
8836 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_9StepCoeff_8__reduce_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff * __pyx_v_self)8837 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_9StepCoeff_8__reduce_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff *__pyx_v_self) {
8838   PyObject *__pyx_v_state = 0;
8839   PyObject *__pyx_v__dict = 0;
8840   int __pyx_v_use_setstate;
8841   PyObject *__pyx_r = NULL;
8842   __Pyx_RefNannyDeclarations
8843   PyObject *__pyx_t_1 = NULL;
8844   PyObject *__pyx_t_2 = NULL;
8845   PyObject *__pyx_t_3 = NULL;
8846   PyObject *__pyx_t_4 = NULL;
8847   PyObject *__pyx_t_5 = NULL;
8848   int __pyx_t_6;
8849   int __pyx_t_7;
8850   int __pyx_lineno = 0;
8851   const char *__pyx_filename = NULL;
8852   int __pyx_clineno = 0;
8853   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
8854 
8855   /* "(tree fragment)":5
8856  *     cdef object _dict
8857  *     cdef bint use_setstate
8858  *     state = (self._args, self._num_ops, self.n_t, self.tlist, self.y)             # <<<<<<<<<<<<<<
8859  *     _dict = getattr(self, '__dict__', None)
8860  *     if _dict is not None:
8861  */
8862   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base._num_ops); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
8863   __Pyx_GOTREF(__pyx_t_1);
8864   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->n_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
8865   __Pyx_GOTREF(__pyx_t_2);
8866   if (unlikely(!__pyx_v_self->tlist.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 5, __pyx_L1_error)}
8867   __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_self->tlist, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
8868   __Pyx_GOTREF(__pyx_t_3);
8869   if (unlikely(!__pyx_v_self->y.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 5, __pyx_L1_error)}
8870   __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_self->y, 2, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
8871   __Pyx_GOTREF(__pyx_t_4);
8872   __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error)
8873   __Pyx_GOTREF(__pyx_t_5);
8874   __Pyx_INCREF(__pyx_v_self->__pyx_base._args);
8875   __Pyx_GIVEREF(__pyx_v_self->__pyx_base._args);
8876   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->__pyx_base._args);
8877   __Pyx_GIVEREF(__pyx_t_1);
8878   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
8879   __Pyx_GIVEREF(__pyx_t_2);
8880   PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2);
8881   __Pyx_GIVEREF(__pyx_t_3);
8882   PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_3);
8883   __Pyx_GIVEREF(__pyx_t_4);
8884   PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_4);
8885   __pyx_t_1 = 0;
8886   __pyx_t_2 = 0;
8887   __pyx_t_3 = 0;
8888   __pyx_t_4 = 0;
8889   __pyx_v_state = ((PyObject*)__pyx_t_5);
8890   __pyx_t_5 = 0;
8891 
8892   /* "(tree fragment)":6
8893  *     cdef bint use_setstate
8894  *     state = (self._args, self._num_ops, self.n_t, self.tlist, self.y)
8895  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
8896  *     if _dict is not None:
8897  *         state += (_dict,)
8898  */
8899   __pyx_t_5 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
8900   __Pyx_GOTREF(__pyx_t_5);
8901   __pyx_v__dict = __pyx_t_5;
8902   __pyx_t_5 = 0;
8903 
8904   /* "(tree fragment)":7
8905  *     state = (self._args, self._num_ops, self.n_t, self.tlist, self.y)
8906  *     _dict = getattr(self, '__dict__', None)
8907  *     if _dict is not None:             # <<<<<<<<<<<<<<
8908  *         state += (_dict,)
8909  *         use_setstate = True
8910  */
8911   __pyx_t_6 = (__pyx_v__dict != Py_None);
8912   __pyx_t_7 = (__pyx_t_6 != 0);
8913   if (__pyx_t_7) {
8914 
8915     /* "(tree fragment)":8
8916  *     _dict = getattr(self, '__dict__', None)
8917  *     if _dict is not None:
8918  *         state += (_dict,)             # <<<<<<<<<<<<<<
8919  *         use_setstate = True
8920  *     else:
8921  */
8922     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 8, __pyx_L1_error)
8923     __Pyx_GOTREF(__pyx_t_5);
8924     __Pyx_INCREF(__pyx_v__dict);
8925     __Pyx_GIVEREF(__pyx_v__dict);
8926     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v__dict);
8927     __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
8928     __Pyx_GOTREF(__pyx_t_4);
8929     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8930     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
8931     __pyx_t_4 = 0;
8932 
8933     /* "(tree fragment)":9
8934  *     if _dict is not None:
8935  *         state += (_dict,)
8936  *         use_setstate = True             # <<<<<<<<<<<<<<
8937  *     else:
8938  *         use_setstate = self._args is not None
8939  */
8940     __pyx_v_use_setstate = 1;
8941 
8942     /* "(tree fragment)":7
8943  *     state = (self._args, self._num_ops, self.n_t, self.tlist, self.y)
8944  *     _dict = getattr(self, '__dict__', None)
8945  *     if _dict is not None:             # <<<<<<<<<<<<<<
8946  *         state += (_dict,)
8947  *         use_setstate = True
8948  */
8949     goto __pyx_L3;
8950   }
8951 
8952   /* "(tree fragment)":11
8953  *         use_setstate = True
8954  *     else:
8955  *         use_setstate = self._args is not None             # <<<<<<<<<<<<<<
8956  *     if use_setstate:
8957  *         return __pyx_unpickle_StepCoeff, (type(self), 0x778091c, None), state
8958  */
8959   /*else*/ {
8960     __pyx_t_7 = (__pyx_v_self->__pyx_base._args != ((PyObject*)Py_None));
8961     __pyx_v_use_setstate = __pyx_t_7;
8962   }
8963   __pyx_L3:;
8964 
8965   /* "(tree fragment)":12
8966  *     else:
8967  *         use_setstate = self._args is not None
8968  *     if use_setstate:             # <<<<<<<<<<<<<<
8969  *         return __pyx_unpickle_StepCoeff, (type(self), 0x778091c, None), state
8970  *     else:
8971  */
8972   __pyx_t_7 = (__pyx_v_use_setstate != 0);
8973   if (__pyx_t_7) {
8974 
8975     /* "(tree fragment)":13
8976  *         use_setstate = self._args is not None
8977  *     if use_setstate:
8978  *         return __pyx_unpickle_StepCoeff, (type(self), 0x778091c, None), state             # <<<<<<<<<<<<<<
8979  *     else:
8980  *         return __pyx_unpickle_StepCoeff, (type(self), 0x778091c, state)
8981  */
8982     __Pyx_XDECREF(__pyx_r);
8983     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_StepCoeff); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
8984     __Pyx_GOTREF(__pyx_t_4);
8985     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
8986     __Pyx_GOTREF(__pyx_t_5);
8987     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8988     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8989     PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8990     __Pyx_INCREF(__pyx_int_125307164);
8991     __Pyx_GIVEREF(__pyx_int_125307164);
8992     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_125307164);
8993     __Pyx_INCREF(Py_None);
8994     __Pyx_GIVEREF(Py_None);
8995     PyTuple_SET_ITEM(__pyx_t_5, 2, Py_None);
8996     __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
8997     __Pyx_GOTREF(__pyx_t_3);
8998     __Pyx_GIVEREF(__pyx_t_4);
8999     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
9000     __Pyx_GIVEREF(__pyx_t_5);
9001     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
9002     __Pyx_INCREF(__pyx_v_state);
9003     __Pyx_GIVEREF(__pyx_v_state);
9004     PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
9005     __pyx_t_4 = 0;
9006     __pyx_t_5 = 0;
9007     __pyx_r = __pyx_t_3;
9008     __pyx_t_3 = 0;
9009     goto __pyx_L0;
9010 
9011     /* "(tree fragment)":12
9012  *     else:
9013  *         use_setstate = self._args is not None
9014  *     if use_setstate:             # <<<<<<<<<<<<<<
9015  *         return __pyx_unpickle_StepCoeff, (type(self), 0x778091c, None), state
9016  *     else:
9017  */
9018   }
9019 
9020   /* "(tree fragment)":15
9021  *         return __pyx_unpickle_StepCoeff, (type(self), 0x778091c, None), state
9022  *     else:
9023  *         return __pyx_unpickle_StepCoeff, (type(self), 0x778091c, state)             # <<<<<<<<<<<<<<
9024  * def __setstate_cython__(self, __pyx_state):
9025  *     __pyx_unpickle_StepCoeff__set_state(self, __pyx_state)
9026  */
9027   /*else*/ {
9028     __Pyx_XDECREF(__pyx_r);
9029     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_StepCoeff); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
9030     __Pyx_GOTREF(__pyx_t_3);
9031     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
9032     __Pyx_GOTREF(__pyx_t_5);
9033     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9034     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9035     PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9036     __Pyx_INCREF(__pyx_int_125307164);
9037     __Pyx_GIVEREF(__pyx_int_125307164);
9038     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_125307164);
9039     __Pyx_INCREF(__pyx_v_state);
9040     __Pyx_GIVEREF(__pyx_v_state);
9041     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
9042     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
9043     __Pyx_GOTREF(__pyx_t_4);
9044     __Pyx_GIVEREF(__pyx_t_3);
9045     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
9046     __Pyx_GIVEREF(__pyx_t_5);
9047     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
9048     __pyx_t_3 = 0;
9049     __pyx_t_5 = 0;
9050     __pyx_r = __pyx_t_4;
9051     __pyx_t_4 = 0;
9052     goto __pyx_L0;
9053   }
9054 
9055   /* "(tree fragment)":1
9056  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
9057  *     cdef tuple state
9058  *     cdef object _dict
9059  */
9060 
9061   /* function exit code */
9062   __pyx_L1_error:;
9063   __Pyx_XDECREF(__pyx_t_1);
9064   __Pyx_XDECREF(__pyx_t_2);
9065   __Pyx_XDECREF(__pyx_t_3);
9066   __Pyx_XDECREF(__pyx_t_4);
9067   __Pyx_XDECREF(__pyx_t_5);
9068   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.StepCoeff.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9069   __pyx_r = NULL;
9070   __pyx_L0:;
9071   __Pyx_XDECREF(__pyx_v_state);
9072   __Pyx_XDECREF(__pyx_v__dict);
9073   __Pyx_XGIVEREF(__pyx_r);
9074   __Pyx_RefNannyFinishContext();
9075   return __pyx_r;
9076 }
9077 
9078 /* "(tree fragment)":16
9079  *     else:
9080  *         return __pyx_unpickle_StepCoeff, (type(self), 0x778091c, state)
9081  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
9082  *     __pyx_unpickle_StepCoeff__set_state(self, __pyx_state)
9083  */
9084 
9085 /* Python wrapper */
9086 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_9StepCoeff_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_9StepCoeff_11__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)9087 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_9StepCoeff_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9088   PyObject *__pyx_r = 0;
9089   __Pyx_RefNannyDeclarations
9090   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
9091   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_9StepCoeff_10__setstate_cython__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9092 
9093   /* function exit code */
9094   __Pyx_RefNannyFinishContext();
9095   return __pyx_r;
9096 }
9097 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_9StepCoeff_10__setstate_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff * __pyx_v_self,PyObject * __pyx_v___pyx_state)9098 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_9StepCoeff_10__setstate_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9099   PyObject *__pyx_r = NULL;
9100   __Pyx_RefNannyDeclarations
9101   PyObject *__pyx_t_1 = NULL;
9102   int __pyx_lineno = 0;
9103   const char *__pyx_filename = NULL;
9104   int __pyx_clineno = 0;
9105   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
9106 
9107   /* "(tree fragment)":17
9108  *         return __pyx_unpickle_StepCoeff, (type(self), 0x778091c, state)
9109  * def __setstate_cython__(self, __pyx_state):
9110  *     __pyx_unpickle_StepCoeff__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
9111  */
9112   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
9113   __pyx_t_1 = __pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_StepCoeff__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
9114   __Pyx_GOTREF(__pyx_t_1);
9115   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9116 
9117   /* "(tree fragment)":16
9118  *     else:
9119  *         return __pyx_unpickle_StepCoeff, (type(self), 0x778091c, state)
9120  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
9121  *     __pyx_unpickle_StepCoeff__set_state(self, __pyx_state)
9122  */
9123 
9124   /* function exit code */
9125   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9126   goto __pyx_L0;
9127   __pyx_L1_error:;
9128   __Pyx_XDECREF(__pyx_t_1);
9129   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.StepCoeff.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9130   __pyx_r = NULL;
9131   __pyx_L0:;
9132   __Pyx_XGIVEREF(__pyx_r);
9133   __Pyx_RefNannyFinishContext();
9134   return __pyx_r;
9135 }
9136 
9137 /* "qutip/cy/cqobjevo_factor.pyx":260
9138  *
9139  * cdef class StepCoeffT(StepCoeff):
9140  *     cdef void _call_core(self, double t, complex* coeff):             # <<<<<<<<<<<<<<
9141  *         cdef int i
9142  *         for i in range(self._num_ops):
9143  */
9144 
__pyx_f_5qutip_2cy_15cqobjevo_factor_10StepCoeffT__call_core(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffT * __pyx_v_self,double __pyx_v_t,__pyx_t_double_complex * __pyx_v_coeff)9145 static void __pyx_f_5qutip_2cy_15cqobjevo_factor_10StepCoeffT__call_core(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffT *__pyx_v_self, double __pyx_v_t, __pyx_t_double_complex *__pyx_v_coeff) {
9146   int __pyx_v_i;
9147   __Pyx_RefNannyDeclarations
9148   int __pyx_t_1;
9149   int __pyx_t_2;
9150   int __pyx_t_3;
9151   __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
9152   int __pyx_lineno = 0;
9153   const char *__pyx_filename = NULL;
9154   int __pyx_clineno = 0;
9155   __Pyx_RefNannySetupContext("_call_core", 0);
9156 
9157   /* "qutip/cy/cqobjevo_factor.pyx":262
9158  *     cdef void _call_core(self, double t, complex* coeff):
9159  *         cdef int i
9160  *         for i in range(self._num_ops):             # <<<<<<<<<<<<<<
9161  *             coeff[i] = _step_complex_t(t, self.tlist, self.y[i, :], self.n_t)
9162  *
9163  */
9164   __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base._num_ops;
9165   __pyx_t_2 = __pyx_t_1;
9166   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
9167     __pyx_v_i = __pyx_t_3;
9168 
9169     /* "qutip/cy/cqobjevo_factor.pyx":263
9170  *         cdef int i
9171  *         for i in range(self._num_ops):
9172  *             coeff[i] = _step_complex_t(t, self.tlist, self.y[i, :], self.n_t)             # <<<<<<<<<<<<<<
9173  *
9174  *
9175  */
9176     if (unlikely(!__pyx_v_self->__pyx_base.tlist.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 263, __pyx_L1_error)}
9177     if (unlikely(!__pyx_v_self->__pyx_base.y.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 263, __pyx_L1_error)}
9178     __pyx_t_4.data = __pyx_v_self->__pyx_base.y.data;
9179     __pyx_t_4.memview = __pyx_v_self->__pyx_base.y.memview;
9180     __PYX_INC_MEMVIEW(&__pyx_t_4, 0);
9181     {
9182     Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
9183         Py_ssize_t __pyx_tmp_shape = __pyx_v_self->__pyx_base.y.shape[0];
9184     Py_ssize_t __pyx_tmp_stride = __pyx_v_self->__pyx_base.y.strides[0];
9185         if (__pyx_tmp_idx < 0)
9186             __pyx_tmp_idx += __pyx_tmp_shape;
9187         if (unlikely(!__Pyx_is_valid_index(__pyx_tmp_idx, __pyx_tmp_shape))) {
9188             PyErr_SetString(PyExc_IndexError,
9189                             "Index out of bounds (axis 0)");
9190             __PYX_ERR(0, 263, __pyx_L1_error)
9191         }
9192         __pyx_t_4.data += __pyx_tmp_idx * __pyx_tmp_stride;
9193 }
9194 
9195 __pyx_t_4.shape[0] = __pyx_v_self->__pyx_base.y.shape[1];
9196 __pyx_t_4.strides[0] = __pyx_v_self->__pyx_base.y.strides[1];
9197     __pyx_t_4.suboffsets[0] = -1;
9198 
9199 (__pyx_v_coeff[__pyx_v_i]) = __pyx_f_5qutip_2cy_5inter__step_complex_t(__pyx_v_t, __pyx_v_self->__pyx_base.tlist, __pyx_t_4, __pyx_v_self->__pyx_base.n_t);
9200     __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
9201     __pyx_t_4.memview = NULL;
9202     __pyx_t_4.data = NULL;
9203   }
9204 
9205   /* "qutip/cy/cqobjevo_factor.pyx":260
9206  *
9207  * cdef class StepCoeffT(StepCoeff):
9208  *     cdef void _call_core(self, double t, complex* coeff):             # <<<<<<<<<<<<<<
9209  *         cdef int i
9210  *         for i in range(self._num_ops):
9211  */
9212 
9213   /* function exit code */
9214   goto __pyx_L0;
9215   __pyx_L1_error:;
9216   __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
9217   __Pyx_WriteUnraisable("qutip.cy.cqobjevo_factor.StepCoeffT._call_core", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
9218   __pyx_L0:;
9219   __Pyx_RefNannyFinishContext();
9220 }
9221 
9222 /* "(tree fragment)":1
9223  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
9224  *     cdef tuple state
9225  *     cdef object _dict
9226  */
9227 
9228 /* Python wrapper */
9229 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_10StepCoeffT_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_10StepCoeffT_1__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)9230 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_10StepCoeffT_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9231   PyObject *__pyx_r = 0;
9232   __Pyx_RefNannyDeclarations
9233   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9234   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_10StepCoeffT___reduce_cython__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffT *)__pyx_v_self));
9235 
9236   /* function exit code */
9237   __Pyx_RefNannyFinishContext();
9238   return __pyx_r;
9239 }
9240 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_10StepCoeffT___reduce_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffT * __pyx_v_self)9241 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_10StepCoeffT___reduce_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffT *__pyx_v_self) {
9242   PyObject *__pyx_v_state = 0;
9243   PyObject *__pyx_v__dict = 0;
9244   int __pyx_v_use_setstate;
9245   PyObject *__pyx_r = NULL;
9246   __Pyx_RefNannyDeclarations
9247   PyObject *__pyx_t_1 = NULL;
9248   PyObject *__pyx_t_2 = NULL;
9249   PyObject *__pyx_t_3 = NULL;
9250   PyObject *__pyx_t_4 = NULL;
9251   PyObject *__pyx_t_5 = NULL;
9252   int __pyx_t_6;
9253   int __pyx_t_7;
9254   int __pyx_lineno = 0;
9255   const char *__pyx_filename = NULL;
9256   int __pyx_clineno = 0;
9257   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9258 
9259   /* "(tree fragment)":5
9260  *     cdef object _dict
9261  *     cdef bint use_setstate
9262  *     state = (self._args, self._num_ops, self.n_t, self.tlist, self.y)             # <<<<<<<<<<<<<<
9263  *     _dict = getattr(self, '__dict__', None)
9264  *     if _dict is not None:
9265  */
9266   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.__pyx_base._num_ops); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
9267   __Pyx_GOTREF(__pyx_t_1);
9268   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
9269   __Pyx_GOTREF(__pyx_t_2);
9270   if (unlikely(!__pyx_v_self->__pyx_base.tlist.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 5, __pyx_L1_error)}
9271   __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_self->__pyx_base.tlist, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
9272   __Pyx_GOTREF(__pyx_t_3);
9273   if (unlikely(!__pyx_v_self->__pyx_base.y.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 5, __pyx_L1_error)}
9274   __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_self->__pyx_base.y, 2, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
9275   __Pyx_GOTREF(__pyx_t_4);
9276   __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error)
9277   __Pyx_GOTREF(__pyx_t_5);
9278   __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base._args);
9279   __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base._args);
9280   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->__pyx_base.__pyx_base._args);
9281   __Pyx_GIVEREF(__pyx_t_1);
9282   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
9283   __Pyx_GIVEREF(__pyx_t_2);
9284   PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2);
9285   __Pyx_GIVEREF(__pyx_t_3);
9286   PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_3);
9287   __Pyx_GIVEREF(__pyx_t_4);
9288   PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_4);
9289   __pyx_t_1 = 0;
9290   __pyx_t_2 = 0;
9291   __pyx_t_3 = 0;
9292   __pyx_t_4 = 0;
9293   __pyx_v_state = ((PyObject*)__pyx_t_5);
9294   __pyx_t_5 = 0;
9295 
9296   /* "(tree fragment)":6
9297  *     cdef bint use_setstate
9298  *     state = (self._args, self._num_ops, self.n_t, self.tlist, self.y)
9299  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
9300  *     if _dict is not None:
9301  *         state += (_dict,)
9302  */
9303   __pyx_t_5 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
9304   __Pyx_GOTREF(__pyx_t_5);
9305   __pyx_v__dict = __pyx_t_5;
9306   __pyx_t_5 = 0;
9307 
9308   /* "(tree fragment)":7
9309  *     state = (self._args, self._num_ops, self.n_t, self.tlist, self.y)
9310  *     _dict = getattr(self, '__dict__', None)
9311  *     if _dict is not None:             # <<<<<<<<<<<<<<
9312  *         state += (_dict,)
9313  *         use_setstate = True
9314  */
9315   __pyx_t_6 = (__pyx_v__dict != Py_None);
9316   __pyx_t_7 = (__pyx_t_6 != 0);
9317   if (__pyx_t_7) {
9318 
9319     /* "(tree fragment)":8
9320  *     _dict = getattr(self, '__dict__', None)
9321  *     if _dict is not None:
9322  *         state += (_dict,)             # <<<<<<<<<<<<<<
9323  *         use_setstate = True
9324  *     else:
9325  */
9326     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 8, __pyx_L1_error)
9327     __Pyx_GOTREF(__pyx_t_5);
9328     __Pyx_INCREF(__pyx_v__dict);
9329     __Pyx_GIVEREF(__pyx_v__dict);
9330     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v__dict);
9331     __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
9332     __Pyx_GOTREF(__pyx_t_4);
9333     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9334     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
9335     __pyx_t_4 = 0;
9336 
9337     /* "(tree fragment)":9
9338  *     if _dict is not None:
9339  *         state += (_dict,)
9340  *         use_setstate = True             # <<<<<<<<<<<<<<
9341  *     else:
9342  *         use_setstate = self._args is not None
9343  */
9344     __pyx_v_use_setstate = 1;
9345 
9346     /* "(tree fragment)":7
9347  *     state = (self._args, self._num_ops, self.n_t, self.tlist, self.y)
9348  *     _dict = getattr(self, '__dict__', None)
9349  *     if _dict is not None:             # <<<<<<<<<<<<<<
9350  *         state += (_dict,)
9351  *         use_setstate = True
9352  */
9353     goto __pyx_L3;
9354   }
9355 
9356   /* "(tree fragment)":11
9357  *         use_setstate = True
9358  *     else:
9359  *         use_setstate = self._args is not None             # <<<<<<<<<<<<<<
9360  *     if use_setstate:
9361  *         return __pyx_unpickle_StepCoeffT, (type(self), 0x778091c, None), state
9362  */
9363   /*else*/ {
9364     __pyx_t_7 = (__pyx_v_self->__pyx_base.__pyx_base._args != ((PyObject*)Py_None));
9365     __pyx_v_use_setstate = __pyx_t_7;
9366   }
9367   __pyx_L3:;
9368 
9369   /* "(tree fragment)":12
9370  *     else:
9371  *         use_setstate = self._args is not None
9372  *     if use_setstate:             # <<<<<<<<<<<<<<
9373  *         return __pyx_unpickle_StepCoeffT, (type(self), 0x778091c, None), state
9374  *     else:
9375  */
9376   __pyx_t_7 = (__pyx_v_use_setstate != 0);
9377   if (__pyx_t_7) {
9378 
9379     /* "(tree fragment)":13
9380  *         use_setstate = self._args is not None
9381  *     if use_setstate:
9382  *         return __pyx_unpickle_StepCoeffT, (type(self), 0x778091c, None), state             # <<<<<<<<<<<<<<
9383  *     else:
9384  *         return __pyx_unpickle_StepCoeffT, (type(self), 0x778091c, state)
9385  */
9386     __Pyx_XDECREF(__pyx_r);
9387     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_StepCoeffT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
9388     __Pyx_GOTREF(__pyx_t_4);
9389     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
9390     __Pyx_GOTREF(__pyx_t_5);
9391     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9392     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9393     PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9394     __Pyx_INCREF(__pyx_int_125307164);
9395     __Pyx_GIVEREF(__pyx_int_125307164);
9396     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_125307164);
9397     __Pyx_INCREF(Py_None);
9398     __Pyx_GIVEREF(Py_None);
9399     PyTuple_SET_ITEM(__pyx_t_5, 2, Py_None);
9400     __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
9401     __Pyx_GOTREF(__pyx_t_3);
9402     __Pyx_GIVEREF(__pyx_t_4);
9403     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
9404     __Pyx_GIVEREF(__pyx_t_5);
9405     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
9406     __Pyx_INCREF(__pyx_v_state);
9407     __Pyx_GIVEREF(__pyx_v_state);
9408     PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
9409     __pyx_t_4 = 0;
9410     __pyx_t_5 = 0;
9411     __pyx_r = __pyx_t_3;
9412     __pyx_t_3 = 0;
9413     goto __pyx_L0;
9414 
9415     /* "(tree fragment)":12
9416  *     else:
9417  *         use_setstate = self._args is not None
9418  *     if use_setstate:             # <<<<<<<<<<<<<<
9419  *         return __pyx_unpickle_StepCoeffT, (type(self), 0x778091c, None), state
9420  *     else:
9421  */
9422   }
9423 
9424   /* "(tree fragment)":15
9425  *         return __pyx_unpickle_StepCoeffT, (type(self), 0x778091c, None), state
9426  *     else:
9427  *         return __pyx_unpickle_StepCoeffT, (type(self), 0x778091c, state)             # <<<<<<<<<<<<<<
9428  * def __setstate_cython__(self, __pyx_state):
9429  *     __pyx_unpickle_StepCoeffT__set_state(self, __pyx_state)
9430  */
9431   /*else*/ {
9432     __Pyx_XDECREF(__pyx_r);
9433     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_StepCoeffT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
9434     __Pyx_GOTREF(__pyx_t_3);
9435     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
9436     __Pyx_GOTREF(__pyx_t_5);
9437     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9438     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9439     PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9440     __Pyx_INCREF(__pyx_int_125307164);
9441     __Pyx_GIVEREF(__pyx_int_125307164);
9442     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_125307164);
9443     __Pyx_INCREF(__pyx_v_state);
9444     __Pyx_GIVEREF(__pyx_v_state);
9445     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
9446     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
9447     __Pyx_GOTREF(__pyx_t_4);
9448     __Pyx_GIVEREF(__pyx_t_3);
9449     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
9450     __Pyx_GIVEREF(__pyx_t_5);
9451     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
9452     __pyx_t_3 = 0;
9453     __pyx_t_5 = 0;
9454     __pyx_r = __pyx_t_4;
9455     __pyx_t_4 = 0;
9456     goto __pyx_L0;
9457   }
9458 
9459   /* "(tree fragment)":1
9460  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
9461  *     cdef tuple state
9462  *     cdef object _dict
9463  */
9464 
9465   /* function exit code */
9466   __pyx_L1_error:;
9467   __Pyx_XDECREF(__pyx_t_1);
9468   __Pyx_XDECREF(__pyx_t_2);
9469   __Pyx_XDECREF(__pyx_t_3);
9470   __Pyx_XDECREF(__pyx_t_4);
9471   __Pyx_XDECREF(__pyx_t_5);
9472   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.StepCoeffT.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9473   __pyx_r = NULL;
9474   __pyx_L0:;
9475   __Pyx_XDECREF(__pyx_v_state);
9476   __Pyx_XDECREF(__pyx_v__dict);
9477   __Pyx_XGIVEREF(__pyx_r);
9478   __Pyx_RefNannyFinishContext();
9479   return __pyx_r;
9480 }
9481 
9482 /* "(tree fragment)":16
9483  *     else:
9484  *         return __pyx_unpickle_StepCoeffT, (type(self), 0x778091c, state)
9485  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
9486  *     __pyx_unpickle_StepCoeffT__set_state(self, __pyx_state)
9487  */
9488 
9489 /* Python wrapper */
9490 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_10StepCoeffT_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_10StepCoeffT_3__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)9491 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_10StepCoeffT_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9492   PyObject *__pyx_r = 0;
9493   __Pyx_RefNannyDeclarations
9494   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
9495   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_10StepCoeffT_2__setstate_cython__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffT *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9496 
9497   /* function exit code */
9498   __Pyx_RefNannyFinishContext();
9499   return __pyx_r;
9500 }
9501 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_10StepCoeffT_2__setstate_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffT * __pyx_v_self,PyObject * __pyx_v___pyx_state)9502 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_10StepCoeffT_2__setstate_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffT *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9503   PyObject *__pyx_r = NULL;
9504   __Pyx_RefNannyDeclarations
9505   PyObject *__pyx_t_1 = NULL;
9506   int __pyx_lineno = 0;
9507   const char *__pyx_filename = NULL;
9508   int __pyx_clineno = 0;
9509   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
9510 
9511   /* "(tree fragment)":17
9512  *         return __pyx_unpickle_StepCoeffT, (type(self), 0x778091c, state)
9513  * def __setstate_cython__(self, __pyx_state):
9514  *     __pyx_unpickle_StepCoeffT__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
9515  */
9516   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
9517   __pyx_t_1 = __pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_StepCoeffT__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
9518   __Pyx_GOTREF(__pyx_t_1);
9519   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9520 
9521   /* "(tree fragment)":16
9522  *     else:
9523  *         return __pyx_unpickle_StepCoeffT, (type(self), 0x778091c, state)
9524  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
9525  *     __pyx_unpickle_StepCoeffT__set_state(self, __pyx_state)
9526  */
9527 
9528   /* function exit code */
9529   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9530   goto __pyx_L0;
9531   __pyx_L1_error:;
9532   __Pyx_XDECREF(__pyx_t_1);
9533   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.StepCoeffT.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9534   __pyx_r = NULL;
9535   __pyx_L0:;
9536   __Pyx_XGIVEREF(__pyx_r);
9537   __Pyx_RefNannyFinishContext();
9538   return __pyx_r;
9539 }
9540 
9541 /* "qutip/cy/cqobjevo_factor.pyx":267
9542  *
9543  * cdef class StepCoeffCte(StepCoeff):
9544  *     cdef void _call_core(self, double t, complex* coeff):             # <<<<<<<<<<<<<<
9545  *         cdef int i
9546  *         for i in range(self._num_ops):
9547  */
9548 
__pyx_f_5qutip_2cy_15cqobjevo_factor_12StepCoeffCte__call_core(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffCte * __pyx_v_self,double __pyx_v_t,__pyx_t_double_complex * __pyx_v_coeff)9549 static void __pyx_f_5qutip_2cy_15cqobjevo_factor_12StepCoeffCte__call_core(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffCte *__pyx_v_self, double __pyx_v_t, __pyx_t_double_complex *__pyx_v_coeff) {
9550   int __pyx_v_i;
9551   __Pyx_RefNannyDeclarations
9552   int __pyx_t_1;
9553   int __pyx_t_2;
9554   int __pyx_t_3;
9555   __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
9556   int __pyx_lineno = 0;
9557   const char *__pyx_filename = NULL;
9558   int __pyx_clineno = 0;
9559   __Pyx_RefNannySetupContext("_call_core", 0);
9560 
9561   /* "qutip/cy/cqobjevo_factor.pyx":269
9562  *     cdef void _call_core(self, double t, complex* coeff):
9563  *         cdef int i
9564  *         for i in range(self._num_ops):             # <<<<<<<<<<<<<<
9565  *             coeff[i] = _step_complex_cte(t, self.tlist, self.y[i, :], self.n_t)
9566  *
9567  */
9568   __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base._num_ops;
9569   __pyx_t_2 = __pyx_t_1;
9570   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
9571     __pyx_v_i = __pyx_t_3;
9572 
9573     /* "qutip/cy/cqobjevo_factor.pyx":270
9574  *         cdef int i
9575  *         for i in range(self._num_ops):
9576  *             coeff[i] = _step_complex_cte(t, self.tlist, self.y[i, :], self.n_t)             # <<<<<<<<<<<<<<
9577  *
9578  *
9579  */
9580     if (unlikely(!__pyx_v_self->__pyx_base.tlist.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 270, __pyx_L1_error)}
9581     if (unlikely(!__pyx_v_self->__pyx_base.y.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 270, __pyx_L1_error)}
9582     __pyx_t_4.data = __pyx_v_self->__pyx_base.y.data;
9583     __pyx_t_4.memview = __pyx_v_self->__pyx_base.y.memview;
9584     __PYX_INC_MEMVIEW(&__pyx_t_4, 0);
9585     {
9586     Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
9587         Py_ssize_t __pyx_tmp_shape = __pyx_v_self->__pyx_base.y.shape[0];
9588     Py_ssize_t __pyx_tmp_stride = __pyx_v_self->__pyx_base.y.strides[0];
9589         if (__pyx_tmp_idx < 0)
9590             __pyx_tmp_idx += __pyx_tmp_shape;
9591         if (unlikely(!__Pyx_is_valid_index(__pyx_tmp_idx, __pyx_tmp_shape))) {
9592             PyErr_SetString(PyExc_IndexError,
9593                             "Index out of bounds (axis 0)");
9594             __PYX_ERR(0, 270, __pyx_L1_error)
9595         }
9596         __pyx_t_4.data += __pyx_tmp_idx * __pyx_tmp_stride;
9597 }
9598 
9599 __pyx_t_4.shape[0] = __pyx_v_self->__pyx_base.y.shape[1];
9600 __pyx_t_4.strides[0] = __pyx_v_self->__pyx_base.y.strides[1];
9601     __pyx_t_4.suboffsets[0] = -1;
9602 
9603 (__pyx_v_coeff[__pyx_v_i]) = __pyx_f_5qutip_2cy_5inter__step_complex_cte(__pyx_v_t, __pyx_v_self->__pyx_base.tlist, __pyx_t_4, __pyx_v_self->__pyx_base.n_t);
9604     __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
9605     __pyx_t_4.memview = NULL;
9606     __pyx_t_4.data = NULL;
9607   }
9608 
9609   /* "qutip/cy/cqobjevo_factor.pyx":267
9610  *
9611  * cdef class StepCoeffCte(StepCoeff):
9612  *     cdef void _call_core(self, double t, complex* coeff):             # <<<<<<<<<<<<<<
9613  *         cdef int i
9614  *         for i in range(self._num_ops):
9615  */
9616 
9617   /* function exit code */
9618   goto __pyx_L0;
9619   __pyx_L1_error:;
9620   __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
9621   __Pyx_WriteUnraisable("qutip.cy.cqobjevo_factor.StepCoeffCte._call_core", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
9622   __pyx_L0:;
9623   __Pyx_RefNannyFinishContext();
9624 }
9625 
9626 /* "(tree fragment)":1
9627  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
9628  *     cdef tuple state
9629  *     cdef object _dict
9630  */
9631 
9632 /* Python wrapper */
9633 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_12StepCoeffCte_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_12StepCoeffCte_1__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)9634 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_12StepCoeffCte_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9635   PyObject *__pyx_r = 0;
9636   __Pyx_RefNannyDeclarations
9637   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9638   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_12StepCoeffCte___reduce_cython__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffCte *)__pyx_v_self));
9639 
9640   /* function exit code */
9641   __Pyx_RefNannyFinishContext();
9642   return __pyx_r;
9643 }
9644 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_12StepCoeffCte___reduce_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffCte * __pyx_v_self)9645 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_12StepCoeffCte___reduce_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffCte *__pyx_v_self) {
9646   PyObject *__pyx_v_state = 0;
9647   PyObject *__pyx_v__dict = 0;
9648   int __pyx_v_use_setstate;
9649   PyObject *__pyx_r = NULL;
9650   __Pyx_RefNannyDeclarations
9651   PyObject *__pyx_t_1 = NULL;
9652   PyObject *__pyx_t_2 = NULL;
9653   PyObject *__pyx_t_3 = NULL;
9654   PyObject *__pyx_t_4 = NULL;
9655   PyObject *__pyx_t_5 = NULL;
9656   int __pyx_t_6;
9657   int __pyx_t_7;
9658   int __pyx_lineno = 0;
9659   const char *__pyx_filename = NULL;
9660   int __pyx_clineno = 0;
9661   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9662 
9663   /* "(tree fragment)":5
9664  *     cdef object _dict
9665  *     cdef bint use_setstate
9666  *     state = (self._args, self._num_ops, self.n_t, self.tlist, self.y)             # <<<<<<<<<<<<<<
9667  *     _dict = getattr(self, '__dict__', None)
9668  *     if _dict is not None:
9669  */
9670   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.__pyx_base._num_ops); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
9671   __Pyx_GOTREF(__pyx_t_1);
9672   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
9673   __Pyx_GOTREF(__pyx_t_2);
9674   if (unlikely(!__pyx_v_self->__pyx_base.tlist.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 5, __pyx_L1_error)}
9675   __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_self->__pyx_base.tlist, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
9676   __Pyx_GOTREF(__pyx_t_3);
9677   if (unlikely(!__pyx_v_self->__pyx_base.y.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 5, __pyx_L1_error)}
9678   __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_self->__pyx_base.y, 2, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
9679   __Pyx_GOTREF(__pyx_t_4);
9680   __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error)
9681   __Pyx_GOTREF(__pyx_t_5);
9682   __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base._args);
9683   __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base._args);
9684   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->__pyx_base.__pyx_base._args);
9685   __Pyx_GIVEREF(__pyx_t_1);
9686   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
9687   __Pyx_GIVEREF(__pyx_t_2);
9688   PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2);
9689   __Pyx_GIVEREF(__pyx_t_3);
9690   PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_3);
9691   __Pyx_GIVEREF(__pyx_t_4);
9692   PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_4);
9693   __pyx_t_1 = 0;
9694   __pyx_t_2 = 0;
9695   __pyx_t_3 = 0;
9696   __pyx_t_4 = 0;
9697   __pyx_v_state = ((PyObject*)__pyx_t_5);
9698   __pyx_t_5 = 0;
9699 
9700   /* "(tree fragment)":6
9701  *     cdef bint use_setstate
9702  *     state = (self._args, self._num_ops, self.n_t, self.tlist, self.y)
9703  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
9704  *     if _dict is not None:
9705  *         state += (_dict,)
9706  */
9707   __pyx_t_5 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
9708   __Pyx_GOTREF(__pyx_t_5);
9709   __pyx_v__dict = __pyx_t_5;
9710   __pyx_t_5 = 0;
9711 
9712   /* "(tree fragment)":7
9713  *     state = (self._args, self._num_ops, self.n_t, self.tlist, self.y)
9714  *     _dict = getattr(self, '__dict__', None)
9715  *     if _dict is not None:             # <<<<<<<<<<<<<<
9716  *         state += (_dict,)
9717  *         use_setstate = True
9718  */
9719   __pyx_t_6 = (__pyx_v__dict != Py_None);
9720   __pyx_t_7 = (__pyx_t_6 != 0);
9721   if (__pyx_t_7) {
9722 
9723     /* "(tree fragment)":8
9724  *     _dict = getattr(self, '__dict__', None)
9725  *     if _dict is not None:
9726  *         state += (_dict,)             # <<<<<<<<<<<<<<
9727  *         use_setstate = True
9728  *     else:
9729  */
9730     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 8, __pyx_L1_error)
9731     __Pyx_GOTREF(__pyx_t_5);
9732     __Pyx_INCREF(__pyx_v__dict);
9733     __Pyx_GIVEREF(__pyx_v__dict);
9734     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v__dict);
9735     __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
9736     __Pyx_GOTREF(__pyx_t_4);
9737     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9738     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
9739     __pyx_t_4 = 0;
9740 
9741     /* "(tree fragment)":9
9742  *     if _dict is not None:
9743  *         state += (_dict,)
9744  *         use_setstate = True             # <<<<<<<<<<<<<<
9745  *     else:
9746  *         use_setstate = self._args is not None
9747  */
9748     __pyx_v_use_setstate = 1;
9749 
9750     /* "(tree fragment)":7
9751  *     state = (self._args, self._num_ops, self.n_t, self.tlist, self.y)
9752  *     _dict = getattr(self, '__dict__', None)
9753  *     if _dict is not None:             # <<<<<<<<<<<<<<
9754  *         state += (_dict,)
9755  *         use_setstate = True
9756  */
9757     goto __pyx_L3;
9758   }
9759 
9760   /* "(tree fragment)":11
9761  *         use_setstate = True
9762  *     else:
9763  *         use_setstate = self._args is not None             # <<<<<<<<<<<<<<
9764  *     if use_setstate:
9765  *         return __pyx_unpickle_StepCoeffCte, (type(self), 0x778091c, None), state
9766  */
9767   /*else*/ {
9768     __pyx_t_7 = (__pyx_v_self->__pyx_base.__pyx_base._args != ((PyObject*)Py_None));
9769     __pyx_v_use_setstate = __pyx_t_7;
9770   }
9771   __pyx_L3:;
9772 
9773   /* "(tree fragment)":12
9774  *     else:
9775  *         use_setstate = self._args is not None
9776  *     if use_setstate:             # <<<<<<<<<<<<<<
9777  *         return __pyx_unpickle_StepCoeffCte, (type(self), 0x778091c, None), state
9778  *     else:
9779  */
9780   __pyx_t_7 = (__pyx_v_use_setstate != 0);
9781   if (__pyx_t_7) {
9782 
9783     /* "(tree fragment)":13
9784  *         use_setstate = self._args is not None
9785  *     if use_setstate:
9786  *         return __pyx_unpickle_StepCoeffCte, (type(self), 0x778091c, None), state             # <<<<<<<<<<<<<<
9787  *     else:
9788  *         return __pyx_unpickle_StepCoeffCte, (type(self), 0x778091c, state)
9789  */
9790     __Pyx_XDECREF(__pyx_r);
9791     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_StepCoeffCte); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
9792     __Pyx_GOTREF(__pyx_t_4);
9793     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
9794     __Pyx_GOTREF(__pyx_t_5);
9795     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9796     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9797     PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9798     __Pyx_INCREF(__pyx_int_125307164);
9799     __Pyx_GIVEREF(__pyx_int_125307164);
9800     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_125307164);
9801     __Pyx_INCREF(Py_None);
9802     __Pyx_GIVEREF(Py_None);
9803     PyTuple_SET_ITEM(__pyx_t_5, 2, Py_None);
9804     __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
9805     __Pyx_GOTREF(__pyx_t_3);
9806     __Pyx_GIVEREF(__pyx_t_4);
9807     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
9808     __Pyx_GIVEREF(__pyx_t_5);
9809     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
9810     __Pyx_INCREF(__pyx_v_state);
9811     __Pyx_GIVEREF(__pyx_v_state);
9812     PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
9813     __pyx_t_4 = 0;
9814     __pyx_t_5 = 0;
9815     __pyx_r = __pyx_t_3;
9816     __pyx_t_3 = 0;
9817     goto __pyx_L0;
9818 
9819     /* "(tree fragment)":12
9820  *     else:
9821  *         use_setstate = self._args is not None
9822  *     if use_setstate:             # <<<<<<<<<<<<<<
9823  *         return __pyx_unpickle_StepCoeffCte, (type(self), 0x778091c, None), state
9824  *     else:
9825  */
9826   }
9827 
9828   /* "(tree fragment)":15
9829  *         return __pyx_unpickle_StepCoeffCte, (type(self), 0x778091c, None), state
9830  *     else:
9831  *         return __pyx_unpickle_StepCoeffCte, (type(self), 0x778091c, state)             # <<<<<<<<<<<<<<
9832  * def __setstate_cython__(self, __pyx_state):
9833  *     __pyx_unpickle_StepCoeffCte__set_state(self, __pyx_state)
9834  */
9835   /*else*/ {
9836     __Pyx_XDECREF(__pyx_r);
9837     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_StepCoeffCte); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
9838     __Pyx_GOTREF(__pyx_t_3);
9839     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
9840     __Pyx_GOTREF(__pyx_t_5);
9841     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9842     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9843     PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9844     __Pyx_INCREF(__pyx_int_125307164);
9845     __Pyx_GIVEREF(__pyx_int_125307164);
9846     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_125307164);
9847     __Pyx_INCREF(__pyx_v_state);
9848     __Pyx_GIVEREF(__pyx_v_state);
9849     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
9850     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
9851     __Pyx_GOTREF(__pyx_t_4);
9852     __Pyx_GIVEREF(__pyx_t_3);
9853     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
9854     __Pyx_GIVEREF(__pyx_t_5);
9855     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
9856     __pyx_t_3 = 0;
9857     __pyx_t_5 = 0;
9858     __pyx_r = __pyx_t_4;
9859     __pyx_t_4 = 0;
9860     goto __pyx_L0;
9861   }
9862 
9863   /* "(tree fragment)":1
9864  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
9865  *     cdef tuple state
9866  *     cdef object _dict
9867  */
9868 
9869   /* function exit code */
9870   __pyx_L1_error:;
9871   __Pyx_XDECREF(__pyx_t_1);
9872   __Pyx_XDECREF(__pyx_t_2);
9873   __Pyx_XDECREF(__pyx_t_3);
9874   __Pyx_XDECREF(__pyx_t_4);
9875   __Pyx_XDECREF(__pyx_t_5);
9876   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.StepCoeffCte.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9877   __pyx_r = NULL;
9878   __pyx_L0:;
9879   __Pyx_XDECREF(__pyx_v_state);
9880   __Pyx_XDECREF(__pyx_v__dict);
9881   __Pyx_XGIVEREF(__pyx_r);
9882   __Pyx_RefNannyFinishContext();
9883   return __pyx_r;
9884 }
9885 
9886 /* "(tree fragment)":16
9887  *     else:
9888  *         return __pyx_unpickle_StepCoeffCte, (type(self), 0x778091c, state)
9889  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
9890  *     __pyx_unpickle_StepCoeffCte__set_state(self, __pyx_state)
9891  */
9892 
9893 /* Python wrapper */
9894 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_12StepCoeffCte_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_12StepCoeffCte_3__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)9895 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_12StepCoeffCte_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9896   PyObject *__pyx_r = 0;
9897   __Pyx_RefNannyDeclarations
9898   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
9899   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_12StepCoeffCte_2__setstate_cython__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffCte *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9900 
9901   /* function exit code */
9902   __Pyx_RefNannyFinishContext();
9903   return __pyx_r;
9904 }
9905 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_12StepCoeffCte_2__setstate_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffCte * __pyx_v_self,PyObject * __pyx_v___pyx_state)9906 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_12StepCoeffCte_2__setstate_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffCte *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9907   PyObject *__pyx_r = NULL;
9908   __Pyx_RefNannyDeclarations
9909   PyObject *__pyx_t_1 = NULL;
9910   int __pyx_lineno = 0;
9911   const char *__pyx_filename = NULL;
9912   int __pyx_clineno = 0;
9913   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
9914 
9915   /* "(tree fragment)":17
9916  *         return __pyx_unpickle_StepCoeffCte, (type(self), 0x778091c, state)
9917  * def __setstate_cython__(self, __pyx_state):
9918  *     __pyx_unpickle_StepCoeffCte__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
9919  */
9920   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
9921   __pyx_t_1 = __pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_StepCoeffCte__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
9922   __Pyx_GOTREF(__pyx_t_1);
9923   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9924 
9925   /* "(tree fragment)":16
9926  *     else:
9927  *         return __pyx_unpickle_StepCoeffCte, (type(self), 0x778091c, state)
9928  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
9929  *     __pyx_unpickle_StepCoeffCte__set_state(self, __pyx_state)
9930  */
9931 
9932   /* function exit code */
9933   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9934   goto __pyx_L0;
9935   __pyx_L1_error:;
9936   __Pyx_XDECREF(__pyx_t_1);
9937   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.StepCoeffCte.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9938   __pyx_r = NULL;
9939   __pyx_L0:;
9940   __Pyx_XGIVEREF(__pyx_r);
9941   __Pyx_RefNannyFinishContext();
9942   return __pyx_r;
9943 }
9944 
9945 /* "qutip/cy/cqobjevo_factor.pyx":274
9946  *
9947  * cdef class StrCoeff(CoeffFunc):
9948  *     def __init__(self, ops, args, tlist, dyn_args=[]):             # <<<<<<<<<<<<<<
9949  *         self._num_ops = len(ops)
9950  *         self._args = args
9951  */
9952 
9953 /* Python wrapper */
9954 static int __pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)9955 static int __pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9956   PyObject *__pyx_v_ops = 0;
9957   PyObject *__pyx_v_args = 0;
9958   CYTHON_UNUSED PyObject *__pyx_v_tlist = 0;
9959   PyObject *__pyx_v_dyn_args = 0;
9960   int __pyx_lineno = 0;
9961   const char *__pyx_filename = NULL;
9962   int __pyx_clineno = 0;
9963   int __pyx_r;
9964   __Pyx_RefNannyDeclarations
9965   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
9966   {
9967     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ops,&__pyx_n_s_args,&__pyx_n_s_tlist,&__pyx_n_s_dyn_args,0};
9968     PyObject* values[4] = {0,0,0,0};
9969     values[3] = __pyx_k__5;
9970     if (unlikely(__pyx_kwds)) {
9971       Py_ssize_t kw_args;
9972       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9973       switch (pos_args) {
9974         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9975         CYTHON_FALLTHROUGH;
9976         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9977         CYTHON_FALLTHROUGH;
9978         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9979         CYTHON_FALLTHROUGH;
9980         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9981         CYTHON_FALLTHROUGH;
9982         case  0: break;
9983         default: goto __pyx_L5_argtuple_error;
9984       }
9985       kw_args = PyDict_Size(__pyx_kwds);
9986       switch (pos_args) {
9987         case  0:
9988         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ops)) != 0)) kw_args--;
9989         else goto __pyx_L5_argtuple_error;
9990         CYTHON_FALLTHROUGH;
9991         case  1:
9992         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
9993         else {
9994           __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); __PYX_ERR(0, 274, __pyx_L3_error)
9995         }
9996         CYTHON_FALLTHROUGH;
9997         case  2:
9998         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tlist)) != 0)) kw_args--;
9999         else {
10000           __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); __PYX_ERR(0, 274, __pyx_L3_error)
10001         }
10002         CYTHON_FALLTHROUGH;
10003         case  3:
10004         if (kw_args > 0) {
10005           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dyn_args);
10006           if (value) { values[3] = value; kw_args--; }
10007         }
10008       }
10009       if (unlikely(kw_args > 0)) {
10010         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 274, __pyx_L3_error)
10011       }
10012     } else {
10013       switch (PyTuple_GET_SIZE(__pyx_args)) {
10014         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10015         CYTHON_FALLTHROUGH;
10016         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10017         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10018         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10019         break;
10020         default: goto __pyx_L5_argtuple_error;
10021       }
10022     }
10023     __pyx_v_ops = values[0];
10024     __pyx_v_args = values[1];
10025     __pyx_v_tlist = values[2];
10026     __pyx_v_dyn_args = values[3];
10027   }
10028   goto __pyx_L4_argument_unpacking_done;
10029   __pyx_L5_argtuple_error:;
10030   __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 274, __pyx_L3_error)
10031   __pyx_L3_error:;
10032   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.StrCoeff.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10033   __Pyx_RefNannyFinishContext();
10034   return -1;
10035   __pyx_L4_argument_unpacking_done:;
10036   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff___init__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *)__pyx_v_self), __pyx_v_ops, __pyx_v_args, __pyx_v_tlist, __pyx_v_dyn_args);
10037 
10038   /* function exit code */
10039   __Pyx_RefNannyFinishContext();
10040   return __pyx_r;
10041 }
10042 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff___init__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff * __pyx_v_self,PyObject * __pyx_v_ops,PyObject * __pyx_v_args,CYTHON_UNUSED PyObject * __pyx_v_tlist,PyObject * __pyx_v_dyn_args)10043 static int __pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff___init__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *__pyx_v_self, PyObject *__pyx_v_ops, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_tlist, PyObject *__pyx_v_dyn_args) {
10044   int __pyx_r;
10045   __Pyx_RefNannyDeclarations
10046   Py_ssize_t __pyx_t_1;
10047   PyObject *__pyx_t_2 = NULL;
10048   PyObject *__pyx_t_3 = NULL;
10049   PyObject *__pyx_t_4 = NULL;
10050   int __pyx_lineno = 0;
10051   const char *__pyx_filename = NULL;
10052   int __pyx_clineno = 0;
10053   __Pyx_RefNannySetupContext("__init__", 0);
10054 
10055   /* "qutip/cy/cqobjevo_factor.pyx":275
10056  * cdef class StrCoeff(CoeffFunc):
10057  *     def __init__(self, ops, args, tlist, dyn_args=[]):
10058  *         self._num_ops = len(ops)             # <<<<<<<<<<<<<<
10059  *         self._args = args
10060  *         self._dyn_args_list = dyn_args
10061  */
10062   __pyx_t_1 = PyObject_Length(__pyx_v_ops); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 275, __pyx_L1_error)
10063   __pyx_v_self->__pyx_base._num_ops = __pyx_t_1;
10064 
10065   /* "qutip/cy/cqobjevo_factor.pyx":276
10066  *     def __init__(self, ops, args, tlist, dyn_args=[]):
10067  *         self._num_ops = len(ops)
10068  *         self._args = args             # <<<<<<<<<<<<<<
10069  *         self._dyn_args_list = dyn_args
10070  *         self.set_args(args)
10071  */
10072   if (!(likely(PyDict_CheckExact(__pyx_v_args))||((__pyx_v_args) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_args)->tp_name), 0))) __PYX_ERR(0, 276, __pyx_L1_error)
10073   __pyx_t_2 = __pyx_v_args;
10074   __Pyx_INCREF(__pyx_t_2);
10075   __Pyx_GIVEREF(__pyx_t_2);
10076   __Pyx_GOTREF(__pyx_v_self->__pyx_base._args);
10077   __Pyx_DECREF(__pyx_v_self->__pyx_base._args);
10078   __pyx_v_self->__pyx_base._args = ((PyObject*)__pyx_t_2);
10079   __pyx_t_2 = 0;
10080 
10081   /* "qutip/cy/cqobjevo_factor.pyx":277
10082  *         self._num_ops = len(ops)
10083  *         self._args = args
10084  *         self._dyn_args_list = dyn_args             # <<<<<<<<<<<<<<
10085  *         self.set_args(args)
10086  *         self._set_dyn_args(dyn_args)
10087  */
10088   if (!(likely(PyList_CheckExact(__pyx_v_dyn_args))||((__pyx_v_dyn_args) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_dyn_args)->tp_name), 0))) __PYX_ERR(0, 277, __pyx_L1_error)
10089   __pyx_t_2 = __pyx_v_dyn_args;
10090   __Pyx_INCREF(__pyx_t_2);
10091   __Pyx_GIVEREF(__pyx_t_2);
10092   __Pyx_GOTREF(__pyx_v_self->_dyn_args_list);
10093   __Pyx_DECREF(__pyx_v_self->_dyn_args_list);
10094   __pyx_v_self->_dyn_args_list = ((PyObject*)__pyx_t_2);
10095   __pyx_t_2 = 0;
10096 
10097   /* "qutip/cy/cqobjevo_factor.pyx":278
10098  *         self._args = args
10099  *         self._dyn_args_list = dyn_args
10100  *         self.set_args(args)             # <<<<<<<<<<<<<<
10101  *         self._set_dyn_args(dyn_args)
10102  *
10103  */
10104   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error)
10105   __Pyx_GOTREF(__pyx_t_3);
10106   __pyx_t_4 = NULL;
10107   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
10108     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
10109     if (likely(__pyx_t_4)) {
10110       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
10111       __Pyx_INCREF(__pyx_t_4);
10112       __Pyx_INCREF(function);
10113       __Pyx_DECREF_SET(__pyx_t_3, function);
10114     }
10115   }
10116   __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_args) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_args);
10117   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10118   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error)
10119   __Pyx_GOTREF(__pyx_t_2);
10120   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10121   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10122 
10123   /* "qutip/cy/cqobjevo_factor.pyx":279
10124  *         self._dyn_args_list = dyn_args
10125  *         self.set_args(args)
10126  *         self._set_dyn_args(dyn_args)             # <<<<<<<<<<<<<<
10127  *
10128  *     def _set_dyn_args(self, dyn_args):
10129  */
10130   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dyn_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
10131   __Pyx_GOTREF(__pyx_t_3);
10132   __pyx_t_4 = NULL;
10133   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
10134     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
10135     if (likely(__pyx_t_4)) {
10136       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
10137       __Pyx_INCREF(__pyx_t_4);
10138       __Pyx_INCREF(function);
10139       __Pyx_DECREF_SET(__pyx_t_3, function);
10140     }
10141   }
10142   __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_dyn_args) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_dyn_args);
10143   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10144   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 279, __pyx_L1_error)
10145   __Pyx_GOTREF(__pyx_t_2);
10146   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10147   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10148 
10149   /* "qutip/cy/cqobjevo_factor.pyx":274
10150  *
10151  * cdef class StrCoeff(CoeffFunc):
10152  *     def __init__(self, ops, args, tlist, dyn_args=[]):             # <<<<<<<<<<<<<<
10153  *         self._num_ops = len(ops)
10154  *         self._args = args
10155  */
10156 
10157   /* function exit code */
10158   __pyx_r = 0;
10159   goto __pyx_L0;
10160   __pyx_L1_error:;
10161   __Pyx_XDECREF(__pyx_t_2);
10162   __Pyx_XDECREF(__pyx_t_3);
10163   __Pyx_XDECREF(__pyx_t_4);
10164   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.StrCoeff.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10165   __pyx_r = -1;
10166   __pyx_L0:;
10167   __Pyx_RefNannyFinishContext();
10168   return __pyx_r;
10169 }
10170 
10171 /* "qutip/cy/cqobjevo_factor.pyx":281
10172  *         self._set_dyn_args(dyn_args)
10173  *
10174  *     def _set_dyn_args(self, dyn_args):             # <<<<<<<<<<<<<<
10175  *         self._num_expect = 0
10176  *         self._expect_op = []
10177  */
10178 
10179 /* Python wrapper */
10180 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_3_set_dyn_args(PyObject *__pyx_v_self, PyObject *__pyx_v_dyn_args); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_3_set_dyn_args(PyObject * __pyx_v_self,PyObject * __pyx_v_dyn_args)10181 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_3_set_dyn_args(PyObject *__pyx_v_self, PyObject *__pyx_v_dyn_args) {
10182   PyObject *__pyx_r = 0;
10183   __Pyx_RefNannyDeclarations
10184   __Pyx_RefNannySetupContext("_set_dyn_args (wrapper)", 0);
10185   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff_2_set_dyn_args(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *)__pyx_v_self), ((PyObject *)__pyx_v_dyn_args));
10186 
10187   /* function exit code */
10188   __Pyx_RefNannyFinishContext();
10189   return __pyx_r;
10190 }
10191 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff_2_set_dyn_args(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff * __pyx_v_self,PyObject * __pyx_v_dyn_args)10192 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff_2_set_dyn_args(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *__pyx_v_self, PyObject *__pyx_v_dyn_args) {
10193   PyObject *__pyx_v_expect_def = NULL;
10194   PyObject *__pyx_v_name = NULL;
10195   PyObject *__pyx_v_what = NULL;
10196   PyObject *__pyx_v_op = NULL;
10197   PyObject *__pyx_r = NULL;
10198   __Pyx_RefNannyDeclarations
10199   PyObject *__pyx_t_1 = NULL;
10200   int __pyx_t_2;
10201   Py_ssize_t __pyx_t_3;
10202   PyObject *(*__pyx_t_4)(PyObject *);
10203   PyObject *__pyx_t_5 = NULL;
10204   PyObject *__pyx_t_6 = NULL;
10205   PyObject *__pyx_t_7 = NULL;
10206   PyObject *__pyx_t_8 = NULL;
10207   PyObject *__pyx_t_9 = NULL;
10208   PyObject *(*__pyx_t_10)(PyObject *);
10209   int __pyx_t_11;
10210   __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
10211   int __pyx_t_13;
10212   int __pyx_lineno = 0;
10213   const char *__pyx_filename = NULL;
10214   int __pyx_clineno = 0;
10215   __Pyx_RefNannySetupContext("_set_dyn_args", 0);
10216 
10217   /* "qutip/cy/cqobjevo_factor.pyx":282
10218  *
10219  *     def _set_dyn_args(self, dyn_args):
10220  *         self._num_expect = 0             # <<<<<<<<<<<<<<
10221  *         self._expect_op = []
10222  *         expect_def = []
10223  */
10224   __pyx_v_self->_num_expect = 0;
10225 
10226   /* "qutip/cy/cqobjevo_factor.pyx":283
10227  *     def _set_dyn_args(self, dyn_args):
10228  *         self._num_expect = 0
10229  *         self._expect_op = []             # <<<<<<<<<<<<<<
10230  *         expect_def = []
10231  *         self._mat_shape[0] = 0
10232  */
10233   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error)
10234   __Pyx_GOTREF(__pyx_t_1);
10235   __Pyx_GIVEREF(__pyx_t_1);
10236   __Pyx_GOTREF(__pyx_v_self->_expect_op);
10237   __Pyx_DECREF(__pyx_v_self->_expect_op);
10238   __pyx_v_self->_expect_op = ((PyObject*)__pyx_t_1);
10239   __pyx_t_1 = 0;
10240 
10241   /* "qutip/cy/cqobjevo_factor.pyx":284
10242  *         self._num_expect = 0
10243  *         self._expect_op = []
10244  *         expect_def = []             # <<<<<<<<<<<<<<
10245  *         self._mat_shape[0] = 0
10246  *         self._mat_shape[1] = 0
10247  */
10248   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error)
10249   __Pyx_GOTREF(__pyx_t_1);
10250   __pyx_v_expect_def = ((PyObject*)__pyx_t_1);
10251   __pyx_t_1 = 0;
10252 
10253   /* "qutip/cy/cqobjevo_factor.pyx":285
10254  *         self._expect_op = []
10255  *         expect_def = []
10256  *         self._mat_shape[0] = 0             # <<<<<<<<<<<<<<
10257  *         self._mat_shape[1] = 0
10258  *         if dyn_args:
10259  */
10260   (__pyx_v_self->_mat_shape[0]) = 0;
10261 
10262   /* "qutip/cy/cqobjevo_factor.pyx":286
10263  *         expect_def = []
10264  *         self._mat_shape[0] = 0
10265  *         self._mat_shape[1] = 0             # <<<<<<<<<<<<<<
10266  *         if dyn_args:
10267  *             for name, what, op in dyn_args:
10268  */
10269   (__pyx_v_self->_mat_shape[1]) = 0;
10270 
10271   /* "qutip/cy/cqobjevo_factor.pyx":287
10272  *         self._mat_shape[0] = 0
10273  *         self._mat_shape[1] = 0
10274  *         if dyn_args:             # <<<<<<<<<<<<<<
10275  *             for name, what, op in dyn_args:
10276  *                 if what == "expect":
10277  */
10278   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_dyn_args); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
10279   if (__pyx_t_2) {
10280 
10281     /* "qutip/cy/cqobjevo_factor.pyx":288
10282  *         self._mat_shape[1] = 0
10283  *         if dyn_args:
10284  *             for name, what, op in dyn_args:             # <<<<<<<<<<<<<<
10285  *                 if what == "expect":
10286  *                     self._expect_op.append(op.compiled_qobjevo)
10287  */
10288     if (likely(PyList_CheckExact(__pyx_v_dyn_args)) || PyTuple_CheckExact(__pyx_v_dyn_args)) {
10289       __pyx_t_1 = __pyx_v_dyn_args; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
10290       __pyx_t_4 = NULL;
10291     } else {
10292       __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_dyn_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error)
10293       __Pyx_GOTREF(__pyx_t_1);
10294       __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
10295     }
10296     for (;;) {
10297       if (likely(!__pyx_t_4)) {
10298         if (likely(PyList_CheckExact(__pyx_t_1))) {
10299           if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
10300           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10301           __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 288, __pyx_L1_error)
10302           #else
10303           __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 288, __pyx_L1_error)
10304           __Pyx_GOTREF(__pyx_t_5);
10305           #endif
10306         } else {
10307           if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
10308           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10309           __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 288, __pyx_L1_error)
10310           #else
10311           __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 288, __pyx_L1_error)
10312           __Pyx_GOTREF(__pyx_t_5);
10313           #endif
10314         }
10315       } else {
10316         __pyx_t_5 = __pyx_t_4(__pyx_t_1);
10317         if (unlikely(!__pyx_t_5)) {
10318           PyObject* exc_type = PyErr_Occurred();
10319           if (exc_type) {
10320             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
10321             else __PYX_ERR(0, 288, __pyx_L1_error)
10322           }
10323           break;
10324         }
10325         __Pyx_GOTREF(__pyx_t_5);
10326       }
10327       if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
10328         PyObject* sequence = __pyx_t_5;
10329         Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10330         if (unlikely(size != 3)) {
10331           if (size > 3) __Pyx_RaiseTooManyValuesError(3);
10332           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10333           __PYX_ERR(0, 288, __pyx_L1_error)
10334         }
10335         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10336         if (likely(PyTuple_CheckExact(sequence))) {
10337           __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
10338           __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
10339           __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2);
10340         } else {
10341           __pyx_t_6 = PyList_GET_ITEM(sequence, 0);
10342           __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
10343           __pyx_t_8 = PyList_GET_ITEM(sequence, 2);
10344         }
10345         __Pyx_INCREF(__pyx_t_6);
10346         __Pyx_INCREF(__pyx_t_7);
10347         __Pyx_INCREF(__pyx_t_8);
10348         #else
10349         __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error)
10350         __Pyx_GOTREF(__pyx_t_6);
10351         __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 288, __pyx_L1_error)
10352         __Pyx_GOTREF(__pyx_t_7);
10353         __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 288, __pyx_L1_error)
10354         __Pyx_GOTREF(__pyx_t_8);
10355         #endif
10356         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10357       } else {
10358         Py_ssize_t index = -1;
10359         __pyx_t_9 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 288, __pyx_L1_error)
10360         __Pyx_GOTREF(__pyx_t_9);
10361         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10362         __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
10363         index = 0; __pyx_t_6 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
10364         __Pyx_GOTREF(__pyx_t_6);
10365         index = 1; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
10366         __Pyx_GOTREF(__pyx_t_7);
10367         index = 2; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed;
10368         __Pyx_GOTREF(__pyx_t_8);
10369         if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) __PYX_ERR(0, 288, __pyx_L1_error)
10370         __pyx_t_10 = NULL;
10371         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10372         goto __pyx_L7_unpacking_done;
10373         __pyx_L6_unpacking_failed:;
10374         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10375         __pyx_t_10 = NULL;
10376         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
10377         __PYX_ERR(0, 288, __pyx_L1_error)
10378         __pyx_L7_unpacking_done:;
10379       }
10380       __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_6);
10381       __pyx_t_6 = 0;
10382       __Pyx_XDECREF_SET(__pyx_v_what, __pyx_t_7);
10383       __pyx_t_7 = 0;
10384       __Pyx_XDECREF_SET(__pyx_v_op, __pyx_t_8);
10385       __pyx_t_8 = 0;
10386 
10387       /* "qutip/cy/cqobjevo_factor.pyx":289
10388  *         if dyn_args:
10389  *             for name, what, op in dyn_args:
10390  *                 if what == "expect":             # <<<<<<<<<<<<<<
10391  *                     self._expect_op.append(op.compiled_qobjevo)
10392  *                     expect_def.append(self._args[name])
10393  */
10394       __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_what, __pyx_n_u_expect, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 289, __pyx_L1_error)
10395       if (__pyx_t_2) {
10396 
10397         /* "qutip/cy/cqobjevo_factor.pyx":290
10398  *             for name, what, op in dyn_args:
10399  *                 if what == "expect":
10400  *                     self._expect_op.append(op.compiled_qobjevo)             # <<<<<<<<<<<<<<
10401  *                     expect_def.append(self._args[name])
10402  *                     self._num_expect += 1
10403  */
10404         if (unlikely(__pyx_v_self->_expect_op == Py_None)) {
10405           PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
10406           __PYX_ERR(0, 290, __pyx_L1_error)
10407         }
10408         __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_op, __pyx_n_s_compiled_qobjevo); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 290, __pyx_L1_error)
10409         __Pyx_GOTREF(__pyx_t_5);
10410         __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_self->_expect_op, __pyx_t_5); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 290, __pyx_L1_error)
10411         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10412 
10413         /* "qutip/cy/cqobjevo_factor.pyx":291
10414  *                 if what == "expect":
10415  *                     self._expect_op.append(op.compiled_qobjevo)
10416  *                     expect_def.append(self._args[name])             # <<<<<<<<<<<<<<
10417  *                     self._num_expect += 1
10418  *                 elif what == "vec":
10419  */
10420         if (unlikely(__pyx_v_self->__pyx_base._args == Py_None)) {
10421           PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10422           __PYX_ERR(0, 291, __pyx_L1_error)
10423         }
10424         __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_self->__pyx_base._args, __pyx_v_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 291, __pyx_L1_error)
10425         __Pyx_GOTREF(__pyx_t_5);
10426         __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_expect_def, __pyx_t_5); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 291, __pyx_L1_error)
10427         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10428 
10429         /* "qutip/cy/cqobjevo_factor.pyx":292
10430  *                     self._expect_op.append(op.compiled_qobjevo)
10431  *                     expect_def.append(self._args[name])
10432  *                     self._num_expect += 1             # <<<<<<<<<<<<<<
10433  *                 elif what == "vec":
10434  *                     self._vec = self._args[name]
10435  */
10436         __pyx_v_self->_num_expect = (__pyx_v_self->_num_expect + 1);
10437 
10438         /* "qutip/cy/cqobjevo_factor.pyx":289
10439  *         if dyn_args:
10440  *             for name, what, op in dyn_args:
10441  *                 if what == "expect":             # <<<<<<<<<<<<<<
10442  *                     self._expect_op.append(op.compiled_qobjevo)
10443  *                     expect_def.append(self._args[name])
10444  */
10445         goto __pyx_L8;
10446       }
10447 
10448       /* "qutip/cy/cqobjevo_factor.pyx":293
10449  *                     expect_def.append(self._args[name])
10450  *                     self._num_expect += 1
10451  *                 elif what == "vec":             # <<<<<<<<<<<<<<
10452  *                     self._vec = self._args[name]
10453  *                 elif what == "mat":
10454  */
10455       __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_what, __pyx_n_u_vec, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 293, __pyx_L1_error)
10456       if (__pyx_t_2) {
10457 
10458         /* "qutip/cy/cqobjevo_factor.pyx":294
10459  *                     self._num_expect += 1
10460  *                 elif what == "vec":
10461  *                     self._vec = self._args[name]             # <<<<<<<<<<<<<<
10462  *                 elif what == "mat":
10463  *                     self._vec = self._args[name].ravel("F")
10464  */
10465         if (unlikely(__pyx_v_self->__pyx_base._args == Py_None)) {
10466           PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10467           __PYX_ERR(0, 294, __pyx_L1_error)
10468         }
10469         __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_self->__pyx_base._args, __pyx_v_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 294, __pyx_L1_error)
10470         __Pyx_GOTREF(__pyx_t_5);
10471         __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 294, __pyx_L1_error)
10472         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10473         __PYX_XDEC_MEMVIEW(&__pyx_v_self->_vec, 0);
10474         __pyx_v_self->_vec = __pyx_t_12;
10475         __pyx_t_12.memview = NULL;
10476         __pyx_t_12.data = NULL;
10477 
10478         /* "qutip/cy/cqobjevo_factor.pyx":293
10479  *                     expect_def.append(self._args[name])
10480  *                     self._num_expect += 1
10481  *                 elif what == "vec":             # <<<<<<<<<<<<<<
10482  *                     self._vec = self._args[name]
10483  *                 elif what == "mat":
10484  */
10485         goto __pyx_L8;
10486       }
10487 
10488       /* "qutip/cy/cqobjevo_factor.pyx":295
10489  *                 elif what == "vec":
10490  *                     self._vec = self._args[name]
10491  *                 elif what == "mat":             # <<<<<<<<<<<<<<
10492  *                     self._vec = self._args[name].ravel("F")
10493  *                     self._mat_shape[0] = self._args[name].shape[0]
10494  */
10495       __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_what, __pyx_n_u_mat, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 295, __pyx_L1_error)
10496       if (__pyx_t_2) {
10497 
10498         /* "qutip/cy/cqobjevo_factor.pyx":296
10499  *                     self._vec = self._args[name]
10500  *                 elif what == "mat":
10501  *                     self._vec = self._args[name].ravel("F")             # <<<<<<<<<<<<<<
10502  *                     self._mat_shape[0] = self._args[name].shape[0]
10503  *                     self._mat_shape[1] = self._args[name].shape[0]
10504  */
10505         if (unlikely(__pyx_v_self->__pyx_base._args == Py_None)) {
10506           PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10507           __PYX_ERR(0, 296, __pyx_L1_error)
10508         }
10509         __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_self->__pyx_base._args, __pyx_v_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 296, __pyx_L1_error)
10510         __Pyx_GOTREF(__pyx_t_8);
10511         __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_ravel); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 296, __pyx_L1_error)
10512         __Pyx_GOTREF(__pyx_t_7);
10513         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10514         __pyx_t_8 = NULL;
10515         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
10516           __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
10517           if (likely(__pyx_t_8)) {
10518             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
10519             __Pyx_INCREF(__pyx_t_8);
10520             __Pyx_INCREF(function);
10521             __Pyx_DECREF_SET(__pyx_t_7, function);
10522           }
10523         }
10524         __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_n_u_F) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_n_u_F);
10525         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
10526         if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 296, __pyx_L1_error)
10527         __Pyx_GOTREF(__pyx_t_5);
10528         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10529         __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 296, __pyx_L1_error)
10530         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10531         __PYX_XDEC_MEMVIEW(&__pyx_v_self->_vec, 0);
10532         __pyx_v_self->_vec = __pyx_t_12;
10533         __pyx_t_12.memview = NULL;
10534         __pyx_t_12.data = NULL;
10535 
10536         /* "qutip/cy/cqobjevo_factor.pyx":297
10537  *                 elif what == "mat":
10538  *                     self._vec = self._args[name].ravel("F")
10539  *                     self._mat_shape[0] = self._args[name].shape[0]             # <<<<<<<<<<<<<<
10540  *                     self._mat_shape[1] = self._args[name].shape[0]
10541  *                 elif what == "Qobj":
10542  */
10543         if (unlikely(__pyx_v_self->__pyx_base._args == Py_None)) {
10544           PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10545           __PYX_ERR(0, 297, __pyx_L1_error)
10546         }
10547         __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_self->__pyx_base._args, __pyx_v_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 297, __pyx_L1_error)
10548         __Pyx_GOTREF(__pyx_t_5);
10549         __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 297, __pyx_L1_error)
10550         __Pyx_GOTREF(__pyx_t_7);
10551         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10552         __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 297, __pyx_L1_error)
10553         __Pyx_GOTREF(__pyx_t_5);
10554         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10555         __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 297, __pyx_L1_error)
10556         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10557         (__pyx_v_self->_mat_shape[0]) = __pyx_t_13;
10558 
10559         /* "qutip/cy/cqobjevo_factor.pyx":298
10560  *                     self._vec = self._args[name].ravel("F")
10561  *                     self._mat_shape[0] = self._args[name].shape[0]
10562  *                     self._mat_shape[1] = self._args[name].shape[0]             # <<<<<<<<<<<<<<
10563  *                 elif what == "Qobj":
10564  *                     self._vec = self._args[name].full().ravel("F")
10565  */
10566         if (unlikely(__pyx_v_self->__pyx_base._args == Py_None)) {
10567           PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10568           __PYX_ERR(0, 298, __pyx_L1_error)
10569         }
10570         __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_self->__pyx_base._args, __pyx_v_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 298, __pyx_L1_error)
10571         __Pyx_GOTREF(__pyx_t_5);
10572         __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 298, __pyx_L1_error)
10573         __Pyx_GOTREF(__pyx_t_7);
10574         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10575         __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 298, __pyx_L1_error)
10576         __Pyx_GOTREF(__pyx_t_5);
10577         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10578         __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 298, __pyx_L1_error)
10579         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10580         (__pyx_v_self->_mat_shape[1]) = __pyx_t_13;
10581 
10582         /* "qutip/cy/cqobjevo_factor.pyx":295
10583  *                 elif what == "vec":
10584  *                     self._vec = self._args[name]
10585  *                 elif what == "mat":             # <<<<<<<<<<<<<<
10586  *                     self._vec = self._args[name].ravel("F")
10587  *                     self._mat_shape[0] = self._args[name].shape[0]
10588  */
10589         goto __pyx_L8;
10590       }
10591 
10592       /* "qutip/cy/cqobjevo_factor.pyx":299
10593  *                     self._mat_shape[0] = self._args[name].shape[0]
10594  *                     self._mat_shape[1] = self._args[name].shape[0]
10595  *                 elif what == "Qobj":             # <<<<<<<<<<<<<<
10596  *                     self._vec = self._args[name].full().ravel("F")
10597  *                     self._mat_shape[0] = self._args[name].shape[0]
10598  */
10599       __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_what, __pyx_n_u_Qobj, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 299, __pyx_L1_error)
10600       if (__pyx_t_2) {
10601 
10602         /* "qutip/cy/cqobjevo_factor.pyx":300
10603  *                     self._mat_shape[1] = self._args[name].shape[0]
10604  *                 elif what == "Qobj":
10605  *                     self._vec = self._args[name].full().ravel("F")             # <<<<<<<<<<<<<<
10606  *                     self._mat_shape[0] = self._args[name].shape[0]
10607  *                     self._mat_shape[1] = self._args[name].shape[0]
10608  */
10609         if (unlikely(__pyx_v_self->__pyx_base._args == Py_None)) {
10610           PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10611           __PYX_ERR(0, 300, __pyx_L1_error)
10612         }
10613         __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_self->__pyx_base._args, __pyx_v_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 300, __pyx_L1_error)
10614         __Pyx_GOTREF(__pyx_t_8);
10615         __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_full); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 300, __pyx_L1_error)
10616         __Pyx_GOTREF(__pyx_t_6);
10617         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10618         __pyx_t_8 = NULL;
10619         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
10620           __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
10621           if (likely(__pyx_t_8)) {
10622             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
10623             __Pyx_INCREF(__pyx_t_8);
10624             __Pyx_INCREF(function);
10625             __Pyx_DECREF_SET(__pyx_t_6, function);
10626           }
10627         }
10628         __pyx_t_7 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
10629         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
10630         if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 300, __pyx_L1_error)
10631         __Pyx_GOTREF(__pyx_t_7);
10632         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10633         __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_ravel); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 300, __pyx_L1_error)
10634         __Pyx_GOTREF(__pyx_t_6);
10635         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10636         __pyx_t_7 = NULL;
10637         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
10638           __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
10639           if (likely(__pyx_t_7)) {
10640             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
10641             __Pyx_INCREF(__pyx_t_7);
10642             __Pyx_INCREF(function);
10643             __Pyx_DECREF_SET(__pyx_t_6, function);
10644           }
10645         }
10646         __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_n_u_F) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_u_F);
10647         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10648         if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error)
10649         __Pyx_GOTREF(__pyx_t_5);
10650         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10651         __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 300, __pyx_L1_error)
10652         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10653         __PYX_XDEC_MEMVIEW(&__pyx_v_self->_vec, 0);
10654         __pyx_v_self->_vec = __pyx_t_12;
10655         __pyx_t_12.memview = NULL;
10656         __pyx_t_12.data = NULL;
10657 
10658         /* "qutip/cy/cqobjevo_factor.pyx":301
10659  *                 elif what == "Qobj":
10660  *                     self._vec = self._args[name].full().ravel("F")
10661  *                     self._mat_shape[0] = self._args[name].shape[0]             # <<<<<<<<<<<<<<
10662  *                     self._mat_shape[1] = self._args[name].shape[0]
10663  *         self._expect_vec = np.array(expect_def, dtype=complex)
10664  */
10665         if (unlikely(__pyx_v_self->__pyx_base._args == Py_None)) {
10666           PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10667           __PYX_ERR(0, 301, __pyx_L1_error)
10668         }
10669         __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_self->__pyx_base._args, __pyx_v_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 301, __pyx_L1_error)
10670         __Pyx_GOTREF(__pyx_t_5);
10671         __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 301, __pyx_L1_error)
10672         __Pyx_GOTREF(__pyx_t_6);
10673         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10674         __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 301, __pyx_L1_error)
10675         __Pyx_GOTREF(__pyx_t_5);
10676         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10677         __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 301, __pyx_L1_error)
10678         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10679         (__pyx_v_self->_mat_shape[0]) = __pyx_t_13;
10680 
10681         /* "qutip/cy/cqobjevo_factor.pyx":302
10682  *                     self._vec = self._args[name].full().ravel("F")
10683  *                     self._mat_shape[0] = self._args[name].shape[0]
10684  *                     self._mat_shape[1] = self._args[name].shape[0]             # <<<<<<<<<<<<<<
10685  *         self._expect_vec = np.array(expect_def, dtype=complex)
10686  *
10687  */
10688         if (unlikely(__pyx_v_self->__pyx_base._args == Py_None)) {
10689           PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10690           __PYX_ERR(0, 302, __pyx_L1_error)
10691         }
10692         __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_self->__pyx_base._args, __pyx_v_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 302, __pyx_L1_error)
10693         __Pyx_GOTREF(__pyx_t_5);
10694         __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 302, __pyx_L1_error)
10695         __Pyx_GOTREF(__pyx_t_6);
10696         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10697         __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 302, __pyx_L1_error)
10698         __Pyx_GOTREF(__pyx_t_5);
10699         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10700         __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L1_error)
10701         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10702         (__pyx_v_self->_mat_shape[1]) = __pyx_t_13;
10703 
10704         /* "qutip/cy/cqobjevo_factor.pyx":299
10705  *                     self._mat_shape[0] = self._args[name].shape[0]
10706  *                     self._mat_shape[1] = self._args[name].shape[0]
10707  *                 elif what == "Qobj":             # <<<<<<<<<<<<<<
10708  *                     self._vec = self._args[name].full().ravel("F")
10709  *                     self._mat_shape[0] = self._args[name].shape[0]
10710  */
10711       }
10712       __pyx_L8:;
10713 
10714       /* "qutip/cy/cqobjevo_factor.pyx":288
10715  *         self._mat_shape[1] = 0
10716  *         if dyn_args:
10717  *             for name, what, op in dyn_args:             # <<<<<<<<<<<<<<
10718  *                 if what == "expect":
10719  *                     self._expect_op.append(op.compiled_qobjevo)
10720  */
10721     }
10722     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10723 
10724     /* "qutip/cy/cqobjevo_factor.pyx":287
10725  *         self._mat_shape[0] = 0
10726  *         self._mat_shape[1] = 0
10727  *         if dyn_args:             # <<<<<<<<<<<<<<
10728  *             for name, what, op in dyn_args:
10729  *                 if what == "expect":
10730  */
10731   }
10732 
10733   /* "qutip/cy/cqobjevo_factor.pyx":303
10734  *                     self._mat_shape[0] = self._args[name].shape[0]
10735  *                     self._mat_shape[1] = self._args[name].shape[0]
10736  *         self._expect_vec = np.array(expect_def, dtype=complex)             # <<<<<<<<<<<<<<
10737  *
10738  *     cdef void _dyn_args(self, double t, complex* state, int[::1] shape):
10739  */
10740   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
10741   __Pyx_GOTREF(__pyx_t_1);
10742   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 303, __pyx_L1_error)
10743   __Pyx_GOTREF(__pyx_t_5);
10744   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10745   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
10746   __Pyx_GOTREF(__pyx_t_1);
10747   __Pyx_INCREF(__pyx_v_expect_def);
10748   __Pyx_GIVEREF(__pyx_v_expect_def);
10749   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_expect_def);
10750   __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 303, __pyx_L1_error)
10751   __Pyx_GOTREF(__pyx_t_6);
10752   if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, ((PyObject *)(&PyComplex_Type))) < 0) __PYX_ERR(0, 303, __pyx_L1_error)
10753   __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 303, __pyx_L1_error)
10754   __Pyx_GOTREF(__pyx_t_7);
10755   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10756   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10757   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10758   __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(__pyx_t_7, PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 303, __pyx_L1_error)
10759   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10760   __PYX_XDEC_MEMVIEW(&__pyx_v_self->_expect_vec, 0);
10761   __pyx_v_self->_expect_vec = __pyx_t_12;
10762   __pyx_t_12.memview = NULL;
10763   __pyx_t_12.data = NULL;
10764 
10765   /* "qutip/cy/cqobjevo_factor.pyx":281
10766  *         self._set_dyn_args(dyn_args)
10767  *
10768  *     def _set_dyn_args(self, dyn_args):             # <<<<<<<<<<<<<<
10769  *         self._num_expect = 0
10770  *         self._expect_op = []
10771  */
10772 
10773   /* function exit code */
10774   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10775   goto __pyx_L0;
10776   __pyx_L1_error:;
10777   __Pyx_XDECREF(__pyx_t_1);
10778   __Pyx_XDECREF(__pyx_t_5);
10779   __Pyx_XDECREF(__pyx_t_6);
10780   __Pyx_XDECREF(__pyx_t_7);
10781   __Pyx_XDECREF(__pyx_t_8);
10782   __Pyx_XDECREF(__pyx_t_9);
10783   __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
10784   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.StrCoeff._set_dyn_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
10785   __pyx_r = NULL;
10786   __pyx_L0:;
10787   __Pyx_XDECREF(__pyx_v_expect_def);
10788   __Pyx_XDECREF(__pyx_v_name);
10789   __Pyx_XDECREF(__pyx_v_what);
10790   __Pyx_XDECREF(__pyx_v_op);
10791   __Pyx_XGIVEREF(__pyx_r);
10792   __Pyx_RefNannyFinishContext();
10793   return __pyx_r;
10794 }
10795 
10796 /* "qutip/cy/cqobjevo_factor.pyx":305
10797  *         self._expect_vec = np.array(expect_def, dtype=complex)
10798  *
10799  *     cdef void _dyn_args(self, double t, complex* state, int[::1] shape):             # <<<<<<<<<<<<<<
10800  *         cdef int ii, nn = shape[0] * shape[1]
10801  *         self._vec = <complex[:nn]> state
10802  */
10803 
__pyx_f_5qutip_2cy_15cqobjevo_factor_8StrCoeff__dyn_args(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff * __pyx_v_self,double __pyx_v_t,__pyx_t_double_complex * __pyx_v_state,__Pyx_memviewslice __pyx_v_shape)10804 static void __pyx_f_5qutip_2cy_15cqobjevo_factor_8StrCoeff__dyn_args(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *__pyx_v_self, double __pyx_v_t, __pyx_t_double_complex *__pyx_v_state, __Pyx_memviewslice __pyx_v_shape) {
10805   int __pyx_v_ii;
10806   int __pyx_v_nn;
10807   struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvo *__pyx_v_cop = 0;
10808   __Pyx_RefNannyDeclarations
10809   Py_ssize_t __pyx_t_1;
10810   int __pyx_t_2;
10811   Py_ssize_t __pyx_t_3;
10812   struct __pyx_array_obj *__pyx_t_4 = NULL;
10813   PyObject *__pyx_t_5 = NULL;
10814   PyObject *__pyx_t_6 = NULL;
10815   __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
10816   int __pyx_t_8;
10817   int __pyx_t_9;
10818   int __pyx_t_10;
10819   __pyx_t_double_complex __pyx_t_11;
10820   int __pyx_t_12;
10821   int __pyx_lineno = 0;
10822   const char *__pyx_filename = NULL;
10823   int __pyx_clineno = 0;
10824   __Pyx_RefNannySetupContext("_dyn_args", 0);
10825 
10826   /* "qutip/cy/cqobjevo_factor.pyx":306
10827  *
10828  *     cdef void _dyn_args(self, double t, complex* state, int[::1] shape):
10829  *         cdef int ii, nn = shape[0] * shape[1]             # <<<<<<<<<<<<<<
10830  *         self._vec = <complex[:nn]> state
10831  *         self._mat_shape[0] = shape[0]
10832  */
10833   __pyx_t_1 = 0;
10834   __pyx_t_2 = -1;
10835   if (__pyx_t_1 < 0) {
10836     __pyx_t_1 += __pyx_v_shape.shape[0];
10837     if (unlikely(__pyx_t_1 < 0)) __pyx_t_2 = 0;
10838   } else if (unlikely(__pyx_t_1 >= __pyx_v_shape.shape[0])) __pyx_t_2 = 0;
10839   if (unlikely(__pyx_t_2 != -1)) {
10840     __Pyx_RaiseBufferIndexError(__pyx_t_2);
10841     __PYX_ERR(0, 306, __pyx_L1_error)
10842   }
10843   __pyx_t_3 = 1;
10844   __pyx_t_2 = -1;
10845   if (__pyx_t_3 < 0) {
10846     __pyx_t_3 += __pyx_v_shape.shape[0];
10847     if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
10848   } else if (unlikely(__pyx_t_3 >= __pyx_v_shape.shape[0])) __pyx_t_2 = 0;
10849   if (unlikely(__pyx_t_2 != -1)) {
10850     __Pyx_RaiseBufferIndexError(__pyx_t_2);
10851     __PYX_ERR(0, 306, __pyx_L1_error)
10852   }
10853   __pyx_v_nn = ((*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_shape.data) + __pyx_t_1)) ))) * (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_shape.data) + __pyx_t_3)) ))));
10854 
10855   /* "qutip/cy/cqobjevo_factor.pyx":307
10856  *     cdef void _dyn_args(self, double t, complex* state, int[::1] shape):
10857  *         cdef int ii, nn = shape[0] * shape[1]
10858  *         self._vec = <complex[:nn]> state             # <<<<<<<<<<<<<<
10859  *         self._mat_shape[0] = shape[0]
10860  *         self._mat_shape[1] = shape[1]
10861  */
10862   if (!__pyx_v_state) {
10863     PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
10864     __PYX_ERR(0, 307, __pyx_L1_error)
10865   }
10866   __pyx_t_6 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo___pyx_t_double_complex); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 307, __pyx_L1_error)
10867   __Pyx_GOTREF(__pyx_t_6);
10868   __pyx_t_5 = Py_BuildValue((char*) "("  __PYX_BUILD_PY_SSIZE_T  ")", ((Py_ssize_t)__pyx_v_nn)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 307, __pyx_L1_error)
10869   __Pyx_GOTREF(__pyx_t_5);
10870   __pyx_t_4 = __pyx_array_new(__pyx_t_5, sizeof(__pyx_t_double_complex), PyBytes_AS_STRING(__pyx_t_6), (char *) "c", (char *) __pyx_v_state);
10871   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error)
10872   __Pyx_GOTREF(__pyx_t_4);
10873   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10874   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10875   __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(((PyObject *)__pyx_t_4), PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 307, __pyx_L1_error)
10876   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
10877   __PYX_XDEC_MEMVIEW(&__pyx_v_self->_vec, 0);
10878   __pyx_v_self->_vec = __pyx_t_7;
10879   __pyx_t_7.memview = NULL;
10880   __pyx_t_7.data = NULL;
10881 
10882   /* "qutip/cy/cqobjevo_factor.pyx":308
10883  *         cdef int ii, nn = shape[0] * shape[1]
10884  *         self._vec = <complex[:nn]> state
10885  *         self._mat_shape[0] = shape[0]             # <<<<<<<<<<<<<<
10886  *         self._mat_shape[1] = shape[1]
10887  *         cdef CQobjEvo cop
10888  */
10889   __pyx_t_3 = 0;
10890   __pyx_t_2 = -1;
10891   if (__pyx_t_3 < 0) {
10892     __pyx_t_3 += __pyx_v_shape.shape[0];
10893     if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
10894   } else if (unlikely(__pyx_t_3 >= __pyx_v_shape.shape[0])) __pyx_t_2 = 0;
10895   if (unlikely(__pyx_t_2 != -1)) {
10896     __Pyx_RaiseBufferIndexError(__pyx_t_2);
10897     __PYX_ERR(0, 308, __pyx_L1_error)
10898   }
10899   (__pyx_v_self->_mat_shape[0]) = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_shape.data) + __pyx_t_3)) )));
10900 
10901   /* "qutip/cy/cqobjevo_factor.pyx":309
10902  *         self._vec = <complex[:nn]> state
10903  *         self._mat_shape[0] = shape[0]
10904  *         self._mat_shape[1] = shape[1]             # <<<<<<<<<<<<<<
10905  *         cdef CQobjEvo cop
10906  *         for ii in range(self._num_expect):
10907  */
10908   __pyx_t_3 = 1;
10909   __pyx_t_2 = -1;
10910   if (__pyx_t_3 < 0) {
10911     __pyx_t_3 += __pyx_v_shape.shape[0];
10912     if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
10913   } else if (unlikely(__pyx_t_3 >= __pyx_v_shape.shape[0])) __pyx_t_2 = 0;
10914   if (unlikely(__pyx_t_2 != -1)) {
10915     __Pyx_RaiseBufferIndexError(__pyx_t_2);
10916     __PYX_ERR(0, 309, __pyx_L1_error)
10917   }
10918   (__pyx_v_self->_mat_shape[1]) = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_shape.data) + __pyx_t_3)) )));
10919 
10920   /* "qutip/cy/cqobjevo_factor.pyx":311
10921  *         self._mat_shape[1] = shape[1]
10922  *         cdef CQobjEvo cop
10923  *         for ii in range(self._num_expect):             # <<<<<<<<<<<<<<
10924  *             cop = self._expect_op[ii]
10925  *             if cop.shape1 != nn:
10926  */
10927   __pyx_t_2 = __pyx_v_self->_num_expect;
10928   __pyx_t_8 = __pyx_t_2;
10929   for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
10930     __pyx_v_ii = __pyx_t_9;
10931 
10932     /* "qutip/cy/cqobjevo_factor.pyx":312
10933  *         cdef CQobjEvo cop
10934  *         for ii in range(self._num_expect):
10935  *             cop = self._expect_op[ii]             # <<<<<<<<<<<<<<
10936  *             if cop.shape1 != nn:
10937  *                 self._expect_vec[ii] = cop._overlapse(t, state)
10938  */
10939     if (unlikely(__pyx_v_self->_expect_op == Py_None)) {
10940       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10941       __PYX_ERR(0, 312, __pyx_L1_error)
10942     }
10943     __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_self->_expect_op, __pyx_v_ii, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L1_error)
10944     __Pyx_GOTREF(__pyx_t_6);
10945     if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5qutip_2cy_8cqobjevo_CQobjEvo))))) __PYX_ERR(0, 312, __pyx_L1_error)
10946     __Pyx_XDECREF_SET(__pyx_v_cop, ((struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvo *)__pyx_t_6));
10947     __pyx_t_6 = 0;
10948 
10949     /* "qutip/cy/cqobjevo_factor.pyx":313
10950  *         for ii in range(self._num_expect):
10951  *             cop = self._expect_op[ii]
10952  *             if cop.shape1 != nn:             # <<<<<<<<<<<<<<
10953  *                 self._expect_vec[ii] = cop._overlapse(t, state)
10954  *             elif cop.super:
10955  */
10956     __pyx_t_10 = ((__pyx_v_cop->shape1 != __pyx_v_nn) != 0);
10957     if (__pyx_t_10) {
10958 
10959       /* "qutip/cy/cqobjevo_factor.pyx":314
10960  *             cop = self._expect_op[ii]
10961  *             if cop.shape1 != nn:
10962  *                 self._expect_vec[ii] = cop._overlapse(t, state)             # <<<<<<<<<<<<<<
10963  *             elif cop.super:
10964  *                 self._expect_vec[ii] = cop._expect_super(t, state)
10965  */
10966       __pyx_t_11 = ((struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjEvo *)__pyx_v_cop->__pyx_vtab)->_overlapse(__pyx_v_cop, __pyx_v_t, __pyx_v_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 314, __pyx_L1_error)
10967       if (unlikely(!__pyx_v_self->_expect_vec.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 314, __pyx_L1_error)}
10968       __pyx_t_3 = __pyx_v_ii;
10969       __pyx_t_12 = -1;
10970       if (__pyx_t_3 < 0) {
10971         __pyx_t_3 += __pyx_v_self->_expect_vec.shape[0];
10972         if (unlikely(__pyx_t_3 < 0)) __pyx_t_12 = 0;
10973       } else if (unlikely(__pyx_t_3 >= __pyx_v_self->_expect_vec.shape[0])) __pyx_t_12 = 0;
10974       if (unlikely(__pyx_t_12 != -1)) {
10975         __Pyx_RaiseBufferIndexError(__pyx_t_12);
10976         __PYX_ERR(0, 314, __pyx_L1_error)
10977       }
10978       *((__pyx_t_double_complex *) ( /* dim=0 */ ((char *) (((__pyx_t_double_complex *) __pyx_v_self->_expect_vec.data) + __pyx_t_3)) )) = __pyx_t_11;
10979 
10980       /* "qutip/cy/cqobjevo_factor.pyx":313
10981  *         for ii in range(self._num_expect):
10982  *             cop = self._expect_op[ii]
10983  *             if cop.shape1 != nn:             # <<<<<<<<<<<<<<
10984  *                 self._expect_vec[ii] = cop._overlapse(t, state)
10985  *             elif cop.super:
10986  */
10987       goto __pyx_L5;
10988     }
10989 
10990     /* "qutip/cy/cqobjevo_factor.pyx":315
10991  *             if cop.shape1 != nn:
10992  *                 self._expect_vec[ii] = cop._overlapse(t, state)
10993  *             elif cop.super:             # <<<<<<<<<<<<<<
10994  *                 self._expect_vec[ii] = cop._expect_super(t, state)
10995  *             else:
10996  */
10997     __pyx_t_10 = (__pyx_v_cop->super != 0);
10998     if (__pyx_t_10) {
10999 
11000       /* "qutip/cy/cqobjevo_factor.pyx":316
11001  *                 self._expect_vec[ii] = cop._overlapse(t, state)
11002  *             elif cop.super:
11003  *                 self._expect_vec[ii] = cop._expect_super(t, state)             # <<<<<<<<<<<<<<
11004  *             else:
11005  *                 self._expect_vec[ii] = cop._expect(t, state)
11006  */
11007       __pyx_t_11 = ((struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjEvo *)__pyx_v_cop->__pyx_vtab)->_expect_super(__pyx_v_cop, __pyx_v_t, __pyx_v_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 316, __pyx_L1_error)
11008       if (unlikely(!__pyx_v_self->_expect_vec.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 316, __pyx_L1_error)}
11009       __pyx_t_3 = __pyx_v_ii;
11010       __pyx_t_12 = -1;
11011       if (__pyx_t_3 < 0) {
11012         __pyx_t_3 += __pyx_v_self->_expect_vec.shape[0];
11013         if (unlikely(__pyx_t_3 < 0)) __pyx_t_12 = 0;
11014       } else if (unlikely(__pyx_t_3 >= __pyx_v_self->_expect_vec.shape[0])) __pyx_t_12 = 0;
11015       if (unlikely(__pyx_t_12 != -1)) {
11016         __Pyx_RaiseBufferIndexError(__pyx_t_12);
11017         __PYX_ERR(0, 316, __pyx_L1_error)
11018       }
11019       *((__pyx_t_double_complex *) ( /* dim=0 */ ((char *) (((__pyx_t_double_complex *) __pyx_v_self->_expect_vec.data) + __pyx_t_3)) )) = __pyx_t_11;
11020 
11021       /* "qutip/cy/cqobjevo_factor.pyx":315
11022  *             if cop.shape1 != nn:
11023  *                 self._expect_vec[ii] = cop._overlapse(t, state)
11024  *             elif cop.super:             # <<<<<<<<<<<<<<
11025  *                 self._expect_vec[ii] = cop._expect_super(t, state)
11026  *             else:
11027  */
11028       goto __pyx_L5;
11029     }
11030 
11031     /* "qutip/cy/cqobjevo_factor.pyx":318
11032  *                 self._expect_vec[ii] = cop._expect_super(t, state)
11033  *             else:
11034  *                 self._expect_vec[ii] = cop._expect(t, state)             # <<<<<<<<<<<<<<
11035  *
11036  *     def __call__(self, double t, args={}, vec=None):
11037  */
11038     /*else*/ {
11039       __pyx_t_11 = ((struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjEvo *)__pyx_v_cop->__pyx_vtab)->_expect(__pyx_v_cop, __pyx_v_t, __pyx_v_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 318, __pyx_L1_error)
11040       if (unlikely(!__pyx_v_self->_expect_vec.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 318, __pyx_L1_error)}
11041       __pyx_t_3 = __pyx_v_ii;
11042       __pyx_t_12 = -1;
11043       if (__pyx_t_3 < 0) {
11044         __pyx_t_3 += __pyx_v_self->_expect_vec.shape[0];
11045         if (unlikely(__pyx_t_3 < 0)) __pyx_t_12 = 0;
11046       } else if (unlikely(__pyx_t_3 >= __pyx_v_self->_expect_vec.shape[0])) __pyx_t_12 = 0;
11047       if (unlikely(__pyx_t_12 != -1)) {
11048         __Pyx_RaiseBufferIndexError(__pyx_t_12);
11049         __PYX_ERR(0, 318, __pyx_L1_error)
11050       }
11051       *((__pyx_t_double_complex *) ( /* dim=0 */ ((char *) (((__pyx_t_double_complex *) __pyx_v_self->_expect_vec.data) + __pyx_t_3)) )) = __pyx_t_11;
11052     }
11053     __pyx_L5:;
11054   }
11055 
11056   /* "qutip/cy/cqobjevo_factor.pyx":305
11057  *         self._expect_vec = np.array(expect_def, dtype=complex)
11058  *
11059  *     cdef void _dyn_args(self, double t, complex* state, int[::1] shape):             # <<<<<<<<<<<<<<
11060  *         cdef int ii, nn = shape[0] * shape[1]
11061  *         self._vec = <complex[:nn]> state
11062  */
11063 
11064   /* function exit code */
11065   goto __pyx_L0;
11066   __pyx_L1_error:;
11067   __Pyx_XDECREF(((PyObject *)__pyx_t_4));
11068   __Pyx_XDECREF(__pyx_t_5);
11069   __Pyx_XDECREF(__pyx_t_6);
11070   __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
11071   __Pyx_WriteUnraisable("qutip.cy.cqobjevo_factor.StrCoeff._dyn_args", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
11072   __pyx_L0:;
11073   __Pyx_XDECREF((PyObject *)__pyx_v_cop);
11074   __Pyx_RefNannyFinishContext();
11075 }
11076 
11077 /* "qutip/cy/cqobjevo_factor.pyx":320
11078  *                 self._expect_vec[ii] = cop._expect(t, state)
11079  *
11080  *     def __call__(self, double t, args={}, vec=None):             # <<<<<<<<<<<<<<
11081  *         cdef np.ndarray[ndim=1, dtype=complex] coeff = \
11082  *                                     np.zeros(self._num_ops, dtype=complex)
11083  */
11084 
11085 /* Python wrapper */
11086 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_5__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_5__call__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)11087 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_5__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11088   double __pyx_v_t;
11089   PyObject *__pyx_v_args = 0;
11090   PyObject *__pyx_v_vec = 0;
11091   int __pyx_lineno = 0;
11092   const char *__pyx_filename = NULL;
11093   int __pyx_clineno = 0;
11094   PyObject *__pyx_r = 0;
11095   __Pyx_RefNannyDeclarations
11096   __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
11097   {
11098     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_args,&__pyx_n_s_vec,0};
11099     PyObject* values[3] = {0,0,0};
11100     values[1] = __pyx_k__6;
11101     values[2] = ((PyObject *)Py_None);
11102     if (unlikely(__pyx_kwds)) {
11103       Py_ssize_t kw_args;
11104       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11105       switch (pos_args) {
11106         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11107         CYTHON_FALLTHROUGH;
11108         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11109         CYTHON_FALLTHROUGH;
11110         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11111         CYTHON_FALLTHROUGH;
11112         case  0: break;
11113         default: goto __pyx_L5_argtuple_error;
11114       }
11115       kw_args = PyDict_Size(__pyx_kwds);
11116       switch (pos_args) {
11117         case  0:
11118         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
11119         else goto __pyx_L5_argtuple_error;
11120         CYTHON_FALLTHROUGH;
11121         case  1:
11122         if (kw_args > 0) {
11123           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
11124           if (value) { values[1] = value; kw_args--; }
11125         }
11126         CYTHON_FALLTHROUGH;
11127         case  2:
11128         if (kw_args > 0) {
11129           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec);
11130           if (value) { values[2] = value; kw_args--; }
11131         }
11132       }
11133       if (unlikely(kw_args > 0)) {
11134         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 320, __pyx_L3_error)
11135       }
11136     } else {
11137       switch (PyTuple_GET_SIZE(__pyx_args)) {
11138         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11139         CYTHON_FALLTHROUGH;
11140         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11141         CYTHON_FALLTHROUGH;
11142         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11143         break;
11144         default: goto __pyx_L5_argtuple_error;
11145       }
11146     }
11147     __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error)
11148     __pyx_v_args = values[1];
11149     __pyx_v_vec = values[2];
11150   }
11151   goto __pyx_L4_argument_unpacking_done;
11152   __pyx_L5_argtuple_error:;
11153   __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 320, __pyx_L3_error)
11154   __pyx_L3_error:;
11155   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.StrCoeff.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11156   __Pyx_RefNannyFinishContext();
11157   return NULL;
11158   __pyx_L4_argument_unpacking_done:;
11159   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff_4__call__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *)__pyx_v_self), __pyx_v_t, __pyx_v_args, __pyx_v_vec);
11160 
11161   /* function exit code */
11162   __Pyx_RefNannyFinishContext();
11163   return __pyx_r;
11164 }
11165 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff_4__call__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff * __pyx_v_self,double __pyx_v_t,PyObject * __pyx_v_args,PyObject * __pyx_v_vec)11166 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff_4__call__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *__pyx_v_self, double __pyx_v_t, PyObject *__pyx_v_args, PyObject *__pyx_v_vec) {
11167   PyArrayObject *__pyx_v_coeff = 0;
11168   int __pyx_v_shape[2];
11169   PyObject *__pyx_v_full = NULL;
11170   PyObject *__pyx_v_now_args = NULL;
11171   __Pyx_LocalBuf_ND __pyx_pybuffernd_coeff;
11172   __Pyx_Buffer __pyx_pybuffer_coeff;
11173   PyObject *__pyx_r = NULL;
11174   __Pyx_RefNannyDeclarations
11175   PyObject *__pyx_t_1 = NULL;
11176   PyObject *__pyx_t_2 = NULL;
11177   PyObject *__pyx_t_3 = NULL;
11178   PyObject *__pyx_t_4 = NULL;
11179   PyArrayObject *__pyx_t_5 = NULL;
11180   int __pyx_t_6;
11181   int __pyx_t_7;
11182   __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
11183   int __pyx_t_9;
11184   Py_ssize_t __pyx_t_10;
11185   struct __pyx_array_obj *__pyx_t_11 = NULL;
11186   __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
11187   int __pyx_lineno = 0;
11188   const char *__pyx_filename = NULL;
11189   int __pyx_clineno = 0;
11190   __Pyx_RefNannySetupContext("__call__", 0);
11191   __pyx_pybuffer_coeff.pybuffer.buf = NULL;
11192   __pyx_pybuffer_coeff.refcount = 0;
11193   __pyx_pybuffernd_coeff.data = NULL;
11194   __pyx_pybuffernd_coeff.rcbuffer = &__pyx_pybuffer_coeff;
11195 
11196   /* "qutip/cy/cqobjevo_factor.pyx":322
11197  *     def __call__(self, double t, args={}, vec=None):
11198  *         cdef np.ndarray[ndim=1, dtype=complex] coeff = \
11199  *                                     np.zeros(self._num_ops, dtype=complex)             # <<<<<<<<<<<<<<
11200  *         cdef int[2] shape
11201  *         if vec is not None:
11202  */
11203   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
11204   __Pyx_GOTREF(__pyx_t_1);
11205   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error)
11206   __Pyx_GOTREF(__pyx_t_2);
11207   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11208   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base._num_ops); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
11209   __Pyx_GOTREF(__pyx_t_1);
11210   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error)
11211   __Pyx_GOTREF(__pyx_t_3);
11212   __Pyx_GIVEREF(__pyx_t_1);
11213   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
11214   __pyx_t_1 = 0;
11215   __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
11216   __Pyx_GOTREF(__pyx_t_1);
11217   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)(&PyComplex_Type))) < 0) __PYX_ERR(0, 322, __pyx_L1_error)
11218   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error)
11219   __Pyx_GOTREF(__pyx_t_4);
11220   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11221   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11222   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11223   if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 322, __pyx_L1_error)
11224   __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
11225   {
11226     __Pyx_BufFmt_StackElem __pyx_stack[1];
11227     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_coeff.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
11228       __pyx_v_coeff = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_coeff.rcbuffer->pybuffer.buf = NULL;
11229       __PYX_ERR(0, 321, __pyx_L1_error)
11230     } else {__pyx_pybuffernd_coeff.diminfo[0].strides = __pyx_pybuffernd_coeff.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_coeff.diminfo[0].shape = __pyx_pybuffernd_coeff.rcbuffer->pybuffer.shape[0];
11231     }
11232   }
11233   __pyx_t_5 = 0;
11234   __pyx_v_coeff = ((PyArrayObject *)__pyx_t_4);
11235   __pyx_t_4 = 0;
11236 
11237   /* "qutip/cy/cqobjevo_factor.pyx":324
11238  *                                     np.zeros(self._num_ops, dtype=complex)
11239  *         cdef int[2] shape
11240  *         if vec is not None:             # <<<<<<<<<<<<<<
11241  *             if isinstance(vec, np.ndarray):
11242  *                 self._vec = vec.ravel("F")
11243  */
11244   __pyx_t_6 = (__pyx_v_vec != Py_None);
11245   __pyx_t_7 = (__pyx_t_6 != 0);
11246   if (__pyx_t_7) {
11247 
11248     /* "qutip/cy/cqobjevo_factor.pyx":325
11249  *         cdef int[2] shape
11250  *         if vec is not None:
11251  *             if isinstance(vec, np.ndarray):             # <<<<<<<<<<<<<<
11252  *                 self._vec = vec.ravel("F")
11253  *                 shape[0] = vec.shape[0]
11254  */
11255     __pyx_t_7 = __Pyx_TypeCheck(__pyx_v_vec, __pyx_ptype_5numpy_ndarray);
11256     __pyx_t_6 = (__pyx_t_7 != 0);
11257     if (__pyx_t_6) {
11258 
11259       /* "qutip/cy/cqobjevo_factor.pyx":326
11260  *         if vec is not None:
11261  *             if isinstance(vec, np.ndarray):
11262  *                 self._vec = vec.ravel("F")             # <<<<<<<<<<<<<<
11263  *                 shape[0] = vec.shape[0]
11264  *                 shape[1] = vec.shape[1]
11265  */
11266       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_vec, __pyx_n_s_ravel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error)
11267       __Pyx_GOTREF(__pyx_t_1);
11268       __pyx_t_3 = NULL;
11269       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
11270         __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
11271         if (likely(__pyx_t_3)) {
11272           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
11273           __Pyx_INCREF(__pyx_t_3);
11274           __Pyx_INCREF(function);
11275           __Pyx_DECREF_SET(__pyx_t_1, function);
11276         }
11277       }
11278       __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_n_u_F) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_n_u_F);
11279       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11280       if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 326, __pyx_L1_error)
11281       __Pyx_GOTREF(__pyx_t_4);
11282       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11283       __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 326, __pyx_L1_error)
11284       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11285       __PYX_XDEC_MEMVIEW(&__pyx_v_self->_vec, 0);
11286       __pyx_v_self->_vec = __pyx_t_8;
11287       __pyx_t_8.memview = NULL;
11288       __pyx_t_8.data = NULL;
11289 
11290       /* "qutip/cy/cqobjevo_factor.pyx":327
11291  *             if isinstance(vec, np.ndarray):
11292  *                 self._vec = vec.ravel("F")
11293  *                 shape[0] = vec.shape[0]             # <<<<<<<<<<<<<<
11294  *                 shape[1] = vec.shape[1]
11295  *             else:
11296  */
11297       __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_vec, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L1_error)
11298       __Pyx_GOTREF(__pyx_t_4);
11299       __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
11300       __Pyx_GOTREF(__pyx_t_1);
11301       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11302       __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 327, __pyx_L1_error)
11303       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11304       (__pyx_v_shape[0]) = __pyx_t_9;
11305 
11306       /* "qutip/cy/cqobjevo_factor.pyx":328
11307  *                 self._vec = vec.ravel("F")
11308  *                 shape[0] = vec.shape[0]
11309  *                 shape[1] = vec.shape[1]             # <<<<<<<<<<<<<<
11310  *             else:
11311  *                 full = vec.full()
11312  */
11313       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_vec, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error)
11314       __Pyx_GOTREF(__pyx_t_1);
11315       __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 328, __pyx_L1_error)
11316       __Pyx_GOTREF(__pyx_t_4);
11317       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11318       __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 328, __pyx_L1_error)
11319       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11320       (__pyx_v_shape[1]) = __pyx_t_9;
11321 
11322       /* "qutip/cy/cqobjevo_factor.pyx":325
11323  *         cdef int[2] shape
11324  *         if vec is not None:
11325  *             if isinstance(vec, np.ndarray):             # <<<<<<<<<<<<<<
11326  *                 self._vec = vec.ravel("F")
11327  *                 shape[0] = vec.shape[0]
11328  */
11329       goto __pyx_L4;
11330     }
11331 
11332     /* "qutip/cy/cqobjevo_factor.pyx":330
11333  *                 shape[1] = vec.shape[1]
11334  *             else:
11335  *                 full = vec.full()             # <<<<<<<<<<<<<<
11336  *                 self._vec = full.ravel("F")
11337  *                 shape[0] = full.shape[0]
11338  */
11339     /*else*/ {
11340       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_vec, __pyx_n_s_full); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error)
11341       __Pyx_GOTREF(__pyx_t_1);
11342       __pyx_t_3 = NULL;
11343       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
11344         __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
11345         if (likely(__pyx_t_3)) {
11346           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
11347           __Pyx_INCREF(__pyx_t_3);
11348           __Pyx_INCREF(function);
11349           __Pyx_DECREF_SET(__pyx_t_1, function);
11350         }
11351       }
11352       __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
11353       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11354       if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 330, __pyx_L1_error)
11355       __Pyx_GOTREF(__pyx_t_4);
11356       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11357       __pyx_v_full = __pyx_t_4;
11358       __pyx_t_4 = 0;
11359 
11360       /* "qutip/cy/cqobjevo_factor.pyx":331
11361  *             else:
11362  *                 full = vec.full()
11363  *                 self._vec = full.ravel("F")             # <<<<<<<<<<<<<<
11364  *                 shape[0] = full.shape[0]
11365  *                 shape[1] = full.shape[1]
11366  */
11367       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_full, __pyx_n_s_ravel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error)
11368       __Pyx_GOTREF(__pyx_t_1);
11369       __pyx_t_3 = NULL;
11370       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
11371         __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
11372         if (likely(__pyx_t_3)) {
11373           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
11374           __Pyx_INCREF(__pyx_t_3);
11375           __Pyx_INCREF(function);
11376           __Pyx_DECREF_SET(__pyx_t_1, function);
11377         }
11378       }
11379       __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_n_u_F) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_n_u_F);
11380       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11381       if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
11382       __Pyx_GOTREF(__pyx_t_4);
11383       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11384       __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 331, __pyx_L1_error)
11385       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11386       __PYX_XDEC_MEMVIEW(&__pyx_v_self->_vec, 0);
11387       __pyx_v_self->_vec = __pyx_t_8;
11388       __pyx_t_8.memview = NULL;
11389       __pyx_t_8.data = NULL;
11390 
11391       /* "qutip/cy/cqobjevo_factor.pyx":332
11392  *                 full = vec.full()
11393  *                 self._vec = full.ravel("F")
11394  *                 shape[0] = full.shape[0]             # <<<<<<<<<<<<<<
11395  *                 shape[1] = full.shape[1]
11396  *             self._dyn_args(t, &self._vec[0], shape)
11397  */
11398       __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_full, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
11399       __Pyx_GOTREF(__pyx_t_4);
11400       __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
11401       __Pyx_GOTREF(__pyx_t_1);
11402       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11403       __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 332, __pyx_L1_error)
11404       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11405       (__pyx_v_shape[0]) = __pyx_t_9;
11406 
11407       /* "qutip/cy/cqobjevo_factor.pyx":333
11408  *                 self._vec = full.ravel("F")
11409  *                 shape[0] = full.shape[0]
11410  *                 shape[1] = full.shape[1]             # <<<<<<<<<<<<<<
11411  *             self._dyn_args(t, &self._vec[0], shape)
11412  *
11413  */
11414       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_full, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error)
11415       __Pyx_GOTREF(__pyx_t_1);
11416       __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L1_error)
11417       __Pyx_GOTREF(__pyx_t_4);
11418       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11419       __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 333, __pyx_L1_error)
11420       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11421       (__pyx_v_shape[1]) = __pyx_t_9;
11422     }
11423     __pyx_L4:;
11424 
11425     /* "qutip/cy/cqobjevo_factor.pyx":334
11426  *                 shape[0] = full.shape[0]
11427  *                 shape[1] = full.shape[1]
11428  *             self._dyn_args(t, &self._vec[0], shape)             # <<<<<<<<<<<<<<
11429  *
11430  *         if args:
11431  */
11432     if (unlikely(!__pyx_v_self->_vec.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 334, __pyx_L1_error)}
11433     __pyx_t_10 = 0;
11434     __pyx_t_9 = -1;
11435     if (__pyx_t_10 < 0) {
11436       __pyx_t_10 += __pyx_v_self->_vec.shape[0];
11437       if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
11438     } else if (unlikely(__pyx_t_10 >= __pyx_v_self->_vec.shape[0])) __pyx_t_9 = 0;
11439     if (unlikely(__pyx_t_9 != -1)) {
11440       __Pyx_RaiseBufferIndexError(__pyx_t_9);
11441       __PYX_ERR(0, 334, __pyx_L1_error)
11442     }
11443     __pyx_t_1 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error)
11444     __Pyx_GOTREF(__pyx_t_1);
11445     __pyx_t_4 = Py_BuildValue((char*) "("  __PYX_BUILD_PY_SSIZE_T  ")", ((Py_ssize_t)2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error)
11446     __Pyx_GOTREF(__pyx_t_4);
11447     __pyx_t_11 = __pyx_array_new(__pyx_t_4, sizeof(int), PyBytes_AS_STRING(__pyx_t_1), (char *) "fortran", (char *) __pyx_v_shape);
11448     if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 334, __pyx_L1_error)
11449     __Pyx_GOTREF(__pyx_t_11);
11450     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11451     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11452     __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_int(((PyObject *)__pyx_t_11), PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 334, __pyx_L1_error)
11453     __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
11454     ((struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_StrCoeff *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._dyn_args(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *)__pyx_v_self), __pyx_v_t, (&(*((__pyx_t_double_complex *) ( /* dim=0 */ ((char *) (((__pyx_t_double_complex *) __pyx_v_self->_vec.data) + __pyx_t_10)) )))), __pyx_t_12);
11455     __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
11456     __pyx_t_12.memview = NULL;
11457     __pyx_t_12.data = NULL;
11458 
11459     /* "qutip/cy/cqobjevo_factor.pyx":324
11460  *                                     np.zeros(self._num_ops, dtype=complex)
11461  *         cdef int[2] shape
11462  *         if vec is not None:             # <<<<<<<<<<<<<<
11463  *             if isinstance(vec, np.ndarray):
11464  *                 self._vec = vec.ravel("F")
11465  */
11466   }
11467 
11468   /* "qutip/cy/cqobjevo_factor.pyx":336
11469  *             self._dyn_args(t, &self._vec[0], shape)
11470  *
11471  *         if args:             # <<<<<<<<<<<<<<
11472  *             now_args = self.args.copy()
11473  *             now_args.update(args)
11474  */
11475   __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_args); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 336, __pyx_L1_error)
11476   if (__pyx_t_6) {
11477 
11478     /* "qutip/cy/cqobjevo_factor.pyx":337
11479  *
11480  *         if args:
11481  *             now_args = self.args.copy()             # <<<<<<<<<<<<<<
11482  *             now_args.update(args)
11483  *             self.set_args(now_args)
11484  */
11485     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error)
11486     __Pyx_GOTREF(__pyx_t_4);
11487     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error)
11488     __Pyx_GOTREF(__pyx_t_3);
11489     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11490     __pyx_t_4 = NULL;
11491     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11492       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
11493       if (likely(__pyx_t_4)) {
11494         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
11495         __Pyx_INCREF(__pyx_t_4);
11496         __Pyx_INCREF(function);
11497         __Pyx_DECREF_SET(__pyx_t_3, function);
11498       }
11499     }
11500     __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11501     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11502     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
11503     __Pyx_GOTREF(__pyx_t_1);
11504     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11505     __pyx_v_now_args = __pyx_t_1;
11506     __pyx_t_1 = 0;
11507 
11508     /* "qutip/cy/cqobjevo_factor.pyx":338
11509  *         if args:
11510  *             now_args = self.args.copy()
11511  *             now_args.update(args)             # <<<<<<<<<<<<<<
11512  *             self.set_args(now_args)
11513  *             self._call_core(t, &coeff[0])
11514  */
11515     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_now_args, __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 338, __pyx_L1_error)
11516     __Pyx_GOTREF(__pyx_t_3);
11517     __pyx_t_4 = NULL;
11518     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11519       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
11520       if (likely(__pyx_t_4)) {
11521         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
11522         __Pyx_INCREF(__pyx_t_4);
11523         __Pyx_INCREF(function);
11524         __Pyx_DECREF_SET(__pyx_t_3, function);
11525       }
11526     }
11527     __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_args) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_args);
11528     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11529     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
11530     __Pyx_GOTREF(__pyx_t_1);
11531     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11532     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11533 
11534     /* "qutip/cy/cqobjevo_factor.pyx":339
11535  *             now_args = self.args.copy()
11536  *             now_args.update(args)
11537  *             self.set_args(now_args)             # <<<<<<<<<<<<<<
11538  *             self._call_core(t, &coeff[0])
11539  *             self.set_args(self._args)
11540  */
11541     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 339, __pyx_L1_error)
11542     __Pyx_GOTREF(__pyx_t_3);
11543     __pyx_t_4 = NULL;
11544     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11545       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
11546       if (likely(__pyx_t_4)) {
11547         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
11548         __Pyx_INCREF(__pyx_t_4);
11549         __Pyx_INCREF(function);
11550         __Pyx_DECREF_SET(__pyx_t_3, function);
11551       }
11552     }
11553     __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_now_args) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_now_args);
11554     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11555     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
11556     __Pyx_GOTREF(__pyx_t_1);
11557     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11558     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11559 
11560     /* "qutip/cy/cqobjevo_factor.pyx":340
11561  *             now_args.update(args)
11562  *             self.set_args(now_args)
11563  *             self._call_core(t, &coeff[0])             # <<<<<<<<<<<<<<
11564  *             self.set_args(self._args)
11565  *         else:
11566  */
11567     __pyx_t_10 = 0;
11568     __pyx_t_9 = -1;
11569     if (__pyx_t_10 < 0) {
11570       __pyx_t_10 += __pyx_pybuffernd_coeff.diminfo[0].shape;
11571       if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
11572     } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_coeff.diminfo[0].shape)) __pyx_t_9 = 0;
11573     if (unlikely(__pyx_t_9 != -1)) {
11574       __Pyx_RaiseBufferIndexError(__pyx_t_9);
11575       __PYX_ERR(0, 340, __pyx_L1_error)
11576     }
11577     ((struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_StrCoeff *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._call_core(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *)__pyx_v_self), __pyx_v_t, (&(*__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_coeff.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_coeff.diminfo[0].strides))));
11578 
11579     /* "qutip/cy/cqobjevo_factor.pyx":341
11580  *             self.set_args(now_args)
11581  *             self._call_core(t, &coeff[0])
11582  *             self.set_args(self._args)             # <<<<<<<<<<<<<<
11583  *         else:
11584  *             self._call_core(t, &coeff[0])
11585  */
11586     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 341, __pyx_L1_error)
11587     __Pyx_GOTREF(__pyx_t_3);
11588     __pyx_t_4 = NULL;
11589     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11590       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
11591       if (likely(__pyx_t_4)) {
11592         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
11593         __Pyx_INCREF(__pyx_t_4);
11594         __Pyx_INCREF(function);
11595         __Pyx_DECREF_SET(__pyx_t_3, function);
11596       }
11597     }
11598     __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_self->__pyx_base._args) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->__pyx_base._args);
11599     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11600     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error)
11601     __Pyx_GOTREF(__pyx_t_1);
11602     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11603     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11604 
11605     /* "qutip/cy/cqobjevo_factor.pyx":336
11606  *             self._dyn_args(t, &self._vec[0], shape)
11607  *
11608  *         if args:             # <<<<<<<<<<<<<<
11609  *             now_args = self.args.copy()
11610  *             now_args.update(args)
11611  */
11612     goto __pyx_L5;
11613   }
11614 
11615   /* "qutip/cy/cqobjevo_factor.pyx":343
11616  *             self.set_args(self._args)
11617  *         else:
11618  *             self._call_core(t, &coeff[0])             # <<<<<<<<<<<<<<
11619  *
11620  *         return coeff
11621  */
11622   /*else*/ {
11623     __pyx_t_10 = 0;
11624     __pyx_t_9 = -1;
11625     if (__pyx_t_10 < 0) {
11626       __pyx_t_10 += __pyx_pybuffernd_coeff.diminfo[0].shape;
11627       if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
11628     } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_coeff.diminfo[0].shape)) __pyx_t_9 = 0;
11629     if (unlikely(__pyx_t_9 != -1)) {
11630       __Pyx_RaiseBufferIndexError(__pyx_t_9);
11631       __PYX_ERR(0, 343, __pyx_L1_error)
11632     }
11633     ((struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_StrCoeff *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._call_core(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *)__pyx_v_self), __pyx_v_t, (&(*__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_coeff.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_coeff.diminfo[0].strides))));
11634   }
11635   __pyx_L5:;
11636 
11637   /* "qutip/cy/cqobjevo_factor.pyx":345
11638  *             self._call_core(t, &coeff[0])
11639  *
11640  *         return coeff             # <<<<<<<<<<<<<<
11641  *
11642  *     def __getstate__(self):
11643  */
11644   __Pyx_XDECREF(__pyx_r);
11645   __Pyx_INCREF(((PyObject *)__pyx_v_coeff));
11646   __pyx_r = ((PyObject *)__pyx_v_coeff);
11647   goto __pyx_L0;
11648 
11649   /* "qutip/cy/cqobjevo_factor.pyx":320
11650  *                 self._expect_vec[ii] = cop._expect(t, state)
11651  *
11652  *     def __call__(self, double t, args={}, vec=None):             # <<<<<<<<<<<<<<
11653  *         cdef np.ndarray[ndim=1, dtype=complex] coeff = \
11654  *                                     np.zeros(self._num_ops, dtype=complex)
11655  */
11656 
11657   /* function exit code */
11658   __pyx_L1_error:;
11659   __Pyx_XDECREF(__pyx_t_1);
11660   __Pyx_XDECREF(__pyx_t_2);
11661   __Pyx_XDECREF(__pyx_t_3);
11662   __Pyx_XDECREF(__pyx_t_4);
11663   __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
11664   __Pyx_XDECREF(((PyObject *)__pyx_t_11));
11665   __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
11666   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
11667     __Pyx_PyThreadState_declare
11668     __Pyx_PyThreadState_assign
11669     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
11670     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coeff.rcbuffer->pybuffer);
11671   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
11672   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.StrCoeff.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11673   __pyx_r = NULL;
11674   goto __pyx_L2;
11675   __pyx_L0:;
11676   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coeff.rcbuffer->pybuffer);
11677   __pyx_L2:;
11678   __Pyx_XDECREF((PyObject *)__pyx_v_coeff);
11679   __Pyx_XDECREF(__pyx_v_full);
11680   __Pyx_XDECREF(__pyx_v_now_args);
11681   __Pyx_XGIVEREF(__pyx_r);
11682   __Pyx_RefNannyFinishContext();
11683   return __pyx_r;
11684 }
11685 
11686 /* "qutip/cy/cqobjevo_factor.pyx":347
11687  *         return coeff
11688  *
11689  *     def __getstate__(self):             # <<<<<<<<<<<<<<
11690  *         return (self._num_ops, self._args, self._dyn_args_list)
11691  *
11692  */
11693 
11694 /* Python wrapper */
11695 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_7__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_7__getstate__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)11696 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_7__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11697   PyObject *__pyx_r = 0;
11698   __Pyx_RefNannyDeclarations
11699   __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
11700   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff_6__getstate__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *)__pyx_v_self));
11701 
11702   /* function exit code */
11703   __Pyx_RefNannyFinishContext();
11704   return __pyx_r;
11705 }
11706 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff_6__getstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff * __pyx_v_self)11707 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff_6__getstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *__pyx_v_self) {
11708   PyObject *__pyx_r = NULL;
11709   __Pyx_RefNannyDeclarations
11710   PyObject *__pyx_t_1 = NULL;
11711   PyObject *__pyx_t_2 = NULL;
11712   int __pyx_lineno = 0;
11713   const char *__pyx_filename = NULL;
11714   int __pyx_clineno = 0;
11715   __Pyx_RefNannySetupContext("__getstate__", 0);
11716 
11717   /* "qutip/cy/cqobjevo_factor.pyx":348
11718  *
11719  *     def __getstate__(self):
11720  *         return (self._num_ops, self._args, self._dyn_args_list)             # <<<<<<<<<<<<<<
11721  *
11722  *     def __setstate__(self, state):
11723  */
11724   __Pyx_XDECREF(__pyx_r);
11725   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base._num_ops); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error)
11726   __Pyx_GOTREF(__pyx_t_1);
11727   __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error)
11728   __Pyx_GOTREF(__pyx_t_2);
11729   __Pyx_GIVEREF(__pyx_t_1);
11730   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
11731   __Pyx_INCREF(__pyx_v_self->__pyx_base._args);
11732   __Pyx_GIVEREF(__pyx_v_self->__pyx_base._args);
11733   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->__pyx_base._args);
11734   __Pyx_INCREF(__pyx_v_self->_dyn_args_list);
11735   __Pyx_GIVEREF(__pyx_v_self->_dyn_args_list);
11736   PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_self->_dyn_args_list);
11737   __pyx_t_1 = 0;
11738   __pyx_r = __pyx_t_2;
11739   __pyx_t_2 = 0;
11740   goto __pyx_L0;
11741 
11742   /* "qutip/cy/cqobjevo_factor.pyx":347
11743  *         return coeff
11744  *
11745  *     def __getstate__(self):             # <<<<<<<<<<<<<<
11746  *         return (self._num_ops, self._args, self._dyn_args_list)
11747  *
11748  */
11749 
11750   /* function exit code */
11751   __pyx_L1_error:;
11752   __Pyx_XDECREF(__pyx_t_1);
11753   __Pyx_XDECREF(__pyx_t_2);
11754   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.StrCoeff.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11755   __pyx_r = NULL;
11756   __pyx_L0:;
11757   __Pyx_XGIVEREF(__pyx_r);
11758   __Pyx_RefNannyFinishContext();
11759   return __pyx_r;
11760 }
11761 
11762 /* "qutip/cy/cqobjevo_factor.pyx":350
11763  *         return (self._num_ops, self._args, self._dyn_args_list)
11764  *
11765  *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
11766  *         self._num_ops = state[0]
11767  *         self._args = state[1]
11768  */
11769 
11770 /* Python wrapper */
11771 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_9__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_9__setstate__(PyObject * __pyx_v_self,PyObject * __pyx_v_state)11772 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_9__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
11773   PyObject *__pyx_r = 0;
11774   __Pyx_RefNannyDeclarations
11775   __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0);
11776   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff_8__setstate__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *)__pyx_v_self), ((PyObject *)__pyx_v_state));
11777 
11778   /* function exit code */
11779   __Pyx_RefNannyFinishContext();
11780   return __pyx_r;
11781 }
11782 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff_8__setstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff * __pyx_v_self,PyObject * __pyx_v_state)11783 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff_8__setstate__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *__pyx_v_self, PyObject *__pyx_v_state) {
11784   PyObject *__pyx_r = NULL;
11785   __Pyx_RefNannyDeclarations
11786   PyObject *__pyx_t_1 = NULL;
11787   int __pyx_t_2;
11788   PyObject *__pyx_t_3 = NULL;
11789   PyObject *__pyx_t_4 = NULL;
11790   int __pyx_lineno = 0;
11791   const char *__pyx_filename = NULL;
11792   int __pyx_clineno = 0;
11793   __Pyx_RefNannySetupContext("__setstate__", 0);
11794 
11795   /* "qutip/cy/cqobjevo_factor.pyx":351
11796  *
11797  *     def __setstate__(self, state):
11798  *         self._num_ops = state[0]             # <<<<<<<<<<<<<<
11799  *         self._args = state[1]
11800  *         self._dyn_args_list = state[2]
11801  */
11802   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error)
11803   __Pyx_GOTREF(__pyx_t_1);
11804   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 351, __pyx_L1_error)
11805   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11806   __pyx_v_self->__pyx_base._num_ops = __pyx_t_2;
11807 
11808   /* "qutip/cy/cqobjevo_factor.pyx":352
11809  *     def __setstate__(self, state):
11810  *         self._num_ops = state[0]
11811  *         self._args = state[1]             # <<<<<<<<<<<<<<
11812  *         self._dyn_args_list = state[2]
11813  *         self.set_args(self._args)
11814  */
11815   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error)
11816   __Pyx_GOTREF(__pyx_t_1);
11817   if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 352, __pyx_L1_error)
11818   __Pyx_GIVEREF(__pyx_t_1);
11819   __Pyx_GOTREF(__pyx_v_self->__pyx_base._args);
11820   __Pyx_DECREF(__pyx_v_self->__pyx_base._args);
11821   __pyx_v_self->__pyx_base._args = ((PyObject*)__pyx_t_1);
11822   __pyx_t_1 = 0;
11823 
11824   /* "qutip/cy/cqobjevo_factor.pyx":353
11825  *         self._num_ops = state[0]
11826  *         self._args = state[1]
11827  *         self._dyn_args_list = state[2]             # <<<<<<<<<<<<<<
11828  *         self.set_args(self._args)
11829  *         self._set_dyn_args(self._dyn_args_list)
11830  */
11831   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error)
11832   __Pyx_GOTREF(__pyx_t_1);
11833   if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 353, __pyx_L1_error)
11834   __Pyx_GIVEREF(__pyx_t_1);
11835   __Pyx_GOTREF(__pyx_v_self->_dyn_args_list);
11836   __Pyx_DECREF(__pyx_v_self->_dyn_args_list);
11837   __pyx_v_self->_dyn_args_list = ((PyObject*)__pyx_t_1);
11838   __pyx_t_1 = 0;
11839 
11840   /* "qutip/cy/cqobjevo_factor.pyx":354
11841  *         self._args = state[1]
11842  *         self._dyn_args_list = state[2]
11843  *         self.set_args(self._args)             # <<<<<<<<<<<<<<
11844  *         self._set_dyn_args(self._dyn_args_list)
11845  */
11846   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error)
11847   __Pyx_GOTREF(__pyx_t_3);
11848   __pyx_t_4 = NULL;
11849   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11850     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
11851     if (likely(__pyx_t_4)) {
11852       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
11853       __Pyx_INCREF(__pyx_t_4);
11854       __Pyx_INCREF(function);
11855       __Pyx_DECREF_SET(__pyx_t_3, function);
11856     }
11857   }
11858   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_self->__pyx_base._args) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->__pyx_base._args);
11859   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11860   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error)
11861   __Pyx_GOTREF(__pyx_t_1);
11862   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11863   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11864 
11865   /* "qutip/cy/cqobjevo_factor.pyx":355
11866  *         self._dyn_args_list = state[2]
11867  *         self.set_args(self._args)
11868  *         self._set_dyn_args(self._dyn_args_list)             # <<<<<<<<<<<<<<
11869  */
11870   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dyn_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error)
11871   __Pyx_GOTREF(__pyx_t_3);
11872   __pyx_t_4 = NULL;
11873   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11874     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
11875     if (likely(__pyx_t_4)) {
11876       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
11877       __Pyx_INCREF(__pyx_t_4);
11878       __Pyx_INCREF(function);
11879       __Pyx_DECREF_SET(__pyx_t_3, function);
11880     }
11881   }
11882   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_self->_dyn_args_list) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->_dyn_args_list);
11883   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11884   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error)
11885   __Pyx_GOTREF(__pyx_t_1);
11886   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11887   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11888 
11889   /* "qutip/cy/cqobjevo_factor.pyx":350
11890  *         return (self._num_ops, self._args, self._dyn_args_list)
11891  *
11892  *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
11893  *         self._num_ops = state[0]
11894  *         self._args = state[1]
11895  */
11896 
11897   /* function exit code */
11898   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11899   goto __pyx_L0;
11900   __pyx_L1_error:;
11901   __Pyx_XDECREF(__pyx_t_1);
11902   __Pyx_XDECREF(__pyx_t_3);
11903   __Pyx_XDECREF(__pyx_t_4);
11904   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.StrCoeff.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11905   __pyx_r = NULL;
11906   __pyx_L0:;
11907   __Pyx_XGIVEREF(__pyx_r);
11908   __Pyx_RefNannyFinishContext();
11909   return __pyx_r;
11910 }
11911 
11912 /* "(tree fragment)":1
11913  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
11914  *     cdef tuple state
11915  *     cdef object _dict
11916  */
11917 
11918 /* Python wrapper */
11919 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_11__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)11920 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11921   PyObject *__pyx_r = 0;
11922   __Pyx_RefNannyDeclarations
11923   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
11924   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff_10__reduce_cython__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *)__pyx_v_self));
11925 
11926   /* function exit code */
11927   __Pyx_RefNannyFinishContext();
11928   return __pyx_r;
11929 }
11930 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff_10__reduce_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff * __pyx_v_self)11931 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff_10__reduce_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *__pyx_v_self) {
11932   PyObject *__pyx_v_state = 0;
11933   PyObject *__pyx_v__dict = 0;
11934   int __pyx_v_use_setstate;
11935   PyObject *__pyx_r = NULL;
11936   __Pyx_RefNannyDeclarations
11937   PyObject *__pyx_t_1 = NULL;
11938   PyObject *__pyx_t_2 = NULL;
11939   PyObject *__pyx_t_3 = NULL;
11940   PyObject *__pyx_t_4 = NULL;
11941   PyObject *__pyx_t_5 = NULL;
11942   PyObject *__pyx_t_6 = NULL;
11943   int __pyx_t_7;
11944   int __pyx_t_8;
11945   int __pyx_t_9;
11946   int __pyx_lineno = 0;
11947   const char *__pyx_filename = NULL;
11948   int __pyx_clineno = 0;
11949   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
11950 
11951   /* "(tree fragment)":5
11952  *     cdef object _dict
11953  *     cdef bint use_setstate
11954  *     state = (self._args, self._dyn_args_list, self._expect_op, self._expect_vec, self._mat_shape, self._num_expect, self._num_ops, self._vec)             # <<<<<<<<<<<<<<
11955  *     _dict = getattr(self, '__dict__', None)
11956  *     if _dict is not None:
11957  */
11958   if (unlikely(!__pyx_v_self->_expect_vec.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 5, __pyx_L1_error)}
11959   __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_self->_expect_vec, 1, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
11960   __Pyx_GOTREF(__pyx_t_1);
11961   __pyx_t_2 = __Pyx_carray_to_py_int(__pyx_v_self->_mat_shape, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
11962   __Pyx_GOTREF(__pyx_t_2);
11963   __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->_num_expect); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
11964   __Pyx_GOTREF(__pyx_t_3);
11965   __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base._num_ops); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
11966   __Pyx_GOTREF(__pyx_t_4);
11967   if (unlikely(!__pyx_v_self->_vec.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 5, __pyx_L1_error)}
11968   __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_self->_vec, 1, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error)
11969   __Pyx_GOTREF(__pyx_t_5);
11970   __pyx_t_6 = PyTuple_New(8); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 5, __pyx_L1_error)
11971   __Pyx_GOTREF(__pyx_t_6);
11972   __Pyx_INCREF(__pyx_v_self->__pyx_base._args);
11973   __Pyx_GIVEREF(__pyx_v_self->__pyx_base._args);
11974   PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_self->__pyx_base._args);
11975   __Pyx_INCREF(__pyx_v_self->_dyn_args_list);
11976   __Pyx_GIVEREF(__pyx_v_self->_dyn_args_list);
11977   PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_self->_dyn_args_list);
11978   __Pyx_INCREF(__pyx_v_self->_expect_op);
11979   __Pyx_GIVEREF(__pyx_v_self->_expect_op);
11980   PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_self->_expect_op);
11981   __Pyx_GIVEREF(__pyx_t_1);
11982   PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_1);
11983   __Pyx_GIVEREF(__pyx_t_2);
11984   PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_2);
11985   __Pyx_GIVEREF(__pyx_t_3);
11986   PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_3);
11987   __Pyx_GIVEREF(__pyx_t_4);
11988   PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_t_4);
11989   __Pyx_GIVEREF(__pyx_t_5);
11990   PyTuple_SET_ITEM(__pyx_t_6, 7, __pyx_t_5);
11991   __pyx_t_1 = 0;
11992   __pyx_t_2 = 0;
11993   __pyx_t_3 = 0;
11994   __pyx_t_4 = 0;
11995   __pyx_t_5 = 0;
11996   __pyx_v_state = ((PyObject*)__pyx_t_6);
11997   __pyx_t_6 = 0;
11998 
11999   /* "(tree fragment)":6
12000  *     cdef bint use_setstate
12001  *     state = (self._args, self._dyn_args_list, self._expect_op, self._expect_vec, self._mat_shape, self._num_expect, self._num_ops, self._vec)
12002  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
12003  *     if _dict is not None:
12004  *         state += (_dict,)
12005  */
12006   __pyx_t_6 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 6, __pyx_L1_error)
12007   __Pyx_GOTREF(__pyx_t_6);
12008   __pyx_v__dict = __pyx_t_6;
12009   __pyx_t_6 = 0;
12010 
12011   /* "(tree fragment)":7
12012  *     state = (self._args, self._dyn_args_list, self._expect_op, self._expect_vec, self._mat_shape, self._num_expect, self._num_ops, self._vec)
12013  *     _dict = getattr(self, '__dict__', None)
12014  *     if _dict is not None:             # <<<<<<<<<<<<<<
12015  *         state += (_dict,)
12016  *         use_setstate = True
12017  */
12018   __pyx_t_7 = (__pyx_v__dict != Py_None);
12019   __pyx_t_8 = (__pyx_t_7 != 0);
12020   if (__pyx_t_8) {
12021 
12022     /* "(tree fragment)":8
12023  *     _dict = getattr(self, '__dict__', None)
12024  *     if _dict is not None:
12025  *         state += (_dict,)             # <<<<<<<<<<<<<<
12026  *         use_setstate = True
12027  *     else:
12028  */
12029     __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 8, __pyx_L1_error)
12030     __Pyx_GOTREF(__pyx_t_6);
12031     __Pyx_INCREF(__pyx_v__dict);
12032     __Pyx_GIVEREF(__pyx_v__dict);
12033     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v__dict);
12034     __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 8, __pyx_L1_error)
12035     __Pyx_GOTREF(__pyx_t_5);
12036     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12037     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_5));
12038     __pyx_t_5 = 0;
12039 
12040     /* "(tree fragment)":9
12041  *     if _dict is not None:
12042  *         state += (_dict,)
12043  *         use_setstate = True             # <<<<<<<<<<<<<<
12044  *     else:
12045  *         use_setstate = self._args is not None or self._dyn_args_list is not None or self._expect_op is not None
12046  */
12047     __pyx_v_use_setstate = 1;
12048 
12049     /* "(tree fragment)":7
12050  *     state = (self._args, self._dyn_args_list, self._expect_op, self._expect_vec, self._mat_shape, self._num_expect, self._num_ops, self._vec)
12051  *     _dict = getattr(self, '__dict__', None)
12052  *     if _dict is not None:             # <<<<<<<<<<<<<<
12053  *         state += (_dict,)
12054  *         use_setstate = True
12055  */
12056     goto __pyx_L3;
12057   }
12058 
12059   /* "(tree fragment)":11
12060  *         use_setstate = True
12061  *     else:
12062  *         use_setstate = self._args is not None or self._dyn_args_list is not None or self._expect_op is not None             # <<<<<<<<<<<<<<
12063  *     if use_setstate:
12064  *         return __pyx_unpickle_StrCoeff, (type(self), 0xea1f18a, None), state
12065  */
12066   /*else*/ {
12067     __pyx_t_7 = (__pyx_v_self->__pyx_base._args != ((PyObject*)Py_None));
12068     __pyx_t_9 = (__pyx_t_7 != 0);
12069     if (!__pyx_t_9) {
12070     } else {
12071       __pyx_t_8 = __pyx_t_9;
12072       goto __pyx_L4_bool_binop_done;
12073     }
12074     __pyx_t_9 = (__pyx_v_self->_dyn_args_list != ((PyObject*)Py_None));
12075     __pyx_t_7 = (__pyx_t_9 != 0);
12076     if (!__pyx_t_7) {
12077     } else {
12078       __pyx_t_8 = __pyx_t_7;
12079       goto __pyx_L4_bool_binop_done;
12080     }
12081     __pyx_t_7 = (__pyx_v_self->_expect_op != ((PyObject*)Py_None));
12082     __pyx_t_9 = (__pyx_t_7 != 0);
12083     __pyx_t_8 = __pyx_t_9;
12084     __pyx_L4_bool_binop_done:;
12085     __pyx_v_use_setstate = __pyx_t_8;
12086   }
12087   __pyx_L3:;
12088 
12089   /* "(tree fragment)":12
12090  *     else:
12091  *         use_setstate = self._args is not None or self._dyn_args_list is not None or self._expect_op is not None
12092  *     if use_setstate:             # <<<<<<<<<<<<<<
12093  *         return __pyx_unpickle_StrCoeff, (type(self), 0xea1f18a, None), state
12094  *     else:
12095  */
12096   __pyx_t_8 = (__pyx_v_use_setstate != 0);
12097   if (__pyx_t_8) {
12098 
12099     /* "(tree fragment)":13
12100  *         use_setstate = self._args is not None or self._dyn_args_list is not None or self._expect_op is not None
12101  *     if use_setstate:
12102  *         return __pyx_unpickle_StrCoeff, (type(self), 0xea1f18a, None), state             # <<<<<<<<<<<<<<
12103  *     else:
12104  *         return __pyx_unpickle_StrCoeff, (type(self), 0xea1f18a, state)
12105  */
12106     __Pyx_XDECREF(__pyx_r);
12107     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_StrCoeff); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
12108     __Pyx_GOTREF(__pyx_t_5);
12109     __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error)
12110     __Pyx_GOTREF(__pyx_t_6);
12111     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
12112     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
12113     PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
12114     __Pyx_INCREF(__pyx_int_245494154);
12115     __Pyx_GIVEREF(__pyx_int_245494154);
12116     PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_245494154);
12117     __Pyx_INCREF(Py_None);
12118     __Pyx_GIVEREF(Py_None);
12119     PyTuple_SET_ITEM(__pyx_t_6, 2, Py_None);
12120     __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
12121     __Pyx_GOTREF(__pyx_t_4);
12122     __Pyx_GIVEREF(__pyx_t_5);
12123     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
12124     __Pyx_GIVEREF(__pyx_t_6);
12125     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
12126     __Pyx_INCREF(__pyx_v_state);
12127     __Pyx_GIVEREF(__pyx_v_state);
12128     PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state);
12129     __pyx_t_5 = 0;
12130     __pyx_t_6 = 0;
12131     __pyx_r = __pyx_t_4;
12132     __pyx_t_4 = 0;
12133     goto __pyx_L0;
12134 
12135     /* "(tree fragment)":12
12136  *     else:
12137  *         use_setstate = self._args is not None or self._dyn_args_list is not None or self._expect_op is not None
12138  *     if use_setstate:             # <<<<<<<<<<<<<<
12139  *         return __pyx_unpickle_StrCoeff, (type(self), 0xea1f18a, None), state
12140  *     else:
12141  */
12142   }
12143 
12144   /* "(tree fragment)":15
12145  *         return __pyx_unpickle_StrCoeff, (type(self), 0xea1f18a, None), state
12146  *     else:
12147  *         return __pyx_unpickle_StrCoeff, (type(self), 0xea1f18a, state)             # <<<<<<<<<<<<<<
12148  * def __setstate_cython__(self, __pyx_state):
12149  *     __pyx_unpickle_StrCoeff__set_state(self, __pyx_state)
12150  */
12151   /*else*/ {
12152     __Pyx_XDECREF(__pyx_r);
12153     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_StrCoeff); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
12154     __Pyx_GOTREF(__pyx_t_4);
12155     __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 15, __pyx_L1_error)
12156     __Pyx_GOTREF(__pyx_t_6);
12157     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
12158     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
12159     PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
12160     __Pyx_INCREF(__pyx_int_245494154);
12161     __Pyx_GIVEREF(__pyx_int_245494154);
12162     PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_245494154);
12163     __Pyx_INCREF(__pyx_v_state);
12164     __Pyx_GIVEREF(__pyx_v_state);
12165     PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state);
12166     __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
12167     __Pyx_GOTREF(__pyx_t_5);
12168     __Pyx_GIVEREF(__pyx_t_4);
12169     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
12170     __Pyx_GIVEREF(__pyx_t_6);
12171     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
12172     __pyx_t_4 = 0;
12173     __pyx_t_6 = 0;
12174     __pyx_r = __pyx_t_5;
12175     __pyx_t_5 = 0;
12176     goto __pyx_L0;
12177   }
12178 
12179   /* "(tree fragment)":1
12180  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
12181  *     cdef tuple state
12182  *     cdef object _dict
12183  */
12184 
12185   /* function exit code */
12186   __pyx_L1_error:;
12187   __Pyx_XDECREF(__pyx_t_1);
12188   __Pyx_XDECREF(__pyx_t_2);
12189   __Pyx_XDECREF(__pyx_t_3);
12190   __Pyx_XDECREF(__pyx_t_4);
12191   __Pyx_XDECREF(__pyx_t_5);
12192   __Pyx_XDECREF(__pyx_t_6);
12193   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.StrCoeff.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12194   __pyx_r = NULL;
12195   __pyx_L0:;
12196   __Pyx_XDECREF(__pyx_v_state);
12197   __Pyx_XDECREF(__pyx_v__dict);
12198   __Pyx_XGIVEREF(__pyx_r);
12199   __Pyx_RefNannyFinishContext();
12200   return __pyx_r;
12201 }
12202 
12203 /* "(tree fragment)":16
12204  *     else:
12205  *         return __pyx_unpickle_StrCoeff, (type(self), 0xea1f18a, state)
12206  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
12207  *     __pyx_unpickle_StrCoeff__set_state(self, __pyx_state)
12208  */
12209 
12210 /* Python wrapper */
12211 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_13__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)12212 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
12213   PyObject *__pyx_r = 0;
12214   __Pyx_RefNannyDeclarations
12215   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
12216   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff_12__setstate_cython__(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
12217 
12218   /* function exit code */
12219   __Pyx_RefNannyFinishContext();
12220   return __pyx_r;
12221 }
12222 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff_12__setstate_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff * __pyx_v_self,PyObject * __pyx_v___pyx_state)12223 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_8StrCoeff_12__setstate_cython__(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
12224   PyObject *__pyx_r = NULL;
12225   __Pyx_RefNannyDeclarations
12226   PyObject *__pyx_t_1 = NULL;
12227   int __pyx_lineno = 0;
12228   const char *__pyx_filename = NULL;
12229   int __pyx_clineno = 0;
12230   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
12231 
12232   /* "(tree fragment)":17
12233  *         return __pyx_unpickle_StrCoeff, (type(self), 0xea1f18a, state)
12234  * def __setstate_cython__(self, __pyx_state):
12235  *     __pyx_unpickle_StrCoeff__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
12236  */
12237   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
12238   __pyx_t_1 = __pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_StrCoeff__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
12239   __Pyx_GOTREF(__pyx_t_1);
12240   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12241 
12242   /* "(tree fragment)":16
12243  *     else:
12244  *         return __pyx_unpickle_StrCoeff, (type(self), 0xea1f18a, state)
12245  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
12246  *     __pyx_unpickle_StrCoeff__set_state(self, __pyx_state)
12247  */
12248 
12249   /* function exit code */
12250   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12251   goto __pyx_L0;
12252   __pyx_L1_error:;
12253   __Pyx_XDECREF(__pyx_t_1);
12254   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.StrCoeff.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12255   __pyx_r = NULL;
12256   __pyx_L0:;
12257   __Pyx_XGIVEREF(__pyx_r);
12258   __Pyx_RefNannyFinishContext();
12259   return __pyx_r;
12260 }
12261 
12262 /* "(tree fragment)":1
12263  * def __pyx_unpickle_CoeffFunc(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
12264  *     cdef object __pyx_PickleError
12265  *     cdef object __pyx_result
12266  */
12267 
12268 /* Python wrapper */
12269 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_1__pyx_unpickle_CoeffFunc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
12270 static PyMethodDef __pyx_mdef_5qutip_2cy_15cqobjevo_factor_1__pyx_unpickle_CoeffFunc = {"__pyx_unpickle_CoeffFunc", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5qutip_2cy_15cqobjevo_factor_1__pyx_unpickle_CoeffFunc, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_5qutip_2cy_15cqobjevo_factor_1__pyx_unpickle_CoeffFunc(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)12271 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_1__pyx_unpickle_CoeffFunc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12272   PyObject *__pyx_v___pyx_type = 0;
12273   long __pyx_v___pyx_checksum;
12274   PyObject *__pyx_v___pyx_state = 0;
12275   int __pyx_lineno = 0;
12276   const char *__pyx_filename = NULL;
12277   int __pyx_clineno = 0;
12278   PyObject *__pyx_r = 0;
12279   __Pyx_RefNannyDeclarations
12280   __Pyx_RefNannySetupContext("__pyx_unpickle_CoeffFunc (wrapper)", 0);
12281   {
12282     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
12283     PyObject* values[3] = {0,0,0};
12284     if (unlikely(__pyx_kwds)) {
12285       Py_ssize_t kw_args;
12286       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12287       switch (pos_args) {
12288         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12289         CYTHON_FALLTHROUGH;
12290         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12291         CYTHON_FALLTHROUGH;
12292         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12293         CYTHON_FALLTHROUGH;
12294         case  0: break;
12295         default: goto __pyx_L5_argtuple_error;
12296       }
12297       kw_args = PyDict_Size(__pyx_kwds);
12298       switch (pos_args) {
12299         case  0:
12300         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
12301         else goto __pyx_L5_argtuple_error;
12302         CYTHON_FALLTHROUGH;
12303         case  1:
12304         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
12305         else {
12306           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CoeffFunc", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
12307         }
12308         CYTHON_FALLTHROUGH;
12309         case  2:
12310         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
12311         else {
12312           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CoeffFunc", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
12313         }
12314       }
12315       if (unlikely(kw_args > 0)) {
12316         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_CoeffFunc") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
12317       }
12318     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
12319       goto __pyx_L5_argtuple_error;
12320     } else {
12321       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12322       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12323       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12324     }
12325     __pyx_v___pyx_type = values[0];
12326     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
12327     __pyx_v___pyx_state = values[2];
12328   }
12329   goto __pyx_L4_argument_unpacking_done;
12330   __pyx_L5_argtuple_error:;
12331   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CoeffFunc", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
12332   __pyx_L3_error:;
12333   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.__pyx_unpickle_CoeffFunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
12334   __Pyx_RefNannyFinishContext();
12335   return NULL;
12336   __pyx_L4_argument_unpacking_done:;
12337   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_CoeffFunc(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
12338 
12339   /* function exit code */
12340   __Pyx_RefNannyFinishContext();
12341   return __pyx_r;
12342 }
12343 
__pyx_pf_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_CoeffFunc(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)12344 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_CoeffFunc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
12345   PyObject *__pyx_v___pyx_PickleError = 0;
12346   PyObject *__pyx_v___pyx_result = 0;
12347   PyObject *__pyx_r = NULL;
12348   __Pyx_RefNannyDeclarations
12349   int __pyx_t_1;
12350   PyObject *__pyx_t_2 = NULL;
12351   PyObject *__pyx_t_3 = NULL;
12352   PyObject *__pyx_t_4 = NULL;
12353   PyObject *__pyx_t_5 = NULL;
12354   int __pyx_t_6;
12355   int __pyx_lineno = 0;
12356   const char *__pyx_filename = NULL;
12357   int __pyx_clineno = 0;
12358   __Pyx_RefNannySetupContext("__pyx_unpickle_CoeffFunc", 0);
12359 
12360   /* "(tree fragment)":4
12361  *     cdef object __pyx_PickleError
12362  *     cdef object __pyx_result
12363  *     if __pyx_checksum != 0xc4a3121:             # <<<<<<<<<<<<<<
12364  *         from pickle import PickleError as __pyx_PickleError
12365  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xc4a3121 = (_args, _num_ops))" % __pyx_checksum)
12366  */
12367   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xc4a3121) != 0);
12368   if (__pyx_t_1) {
12369 
12370     /* "(tree fragment)":5
12371  *     cdef object __pyx_result
12372  *     if __pyx_checksum != 0xc4a3121:
12373  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
12374  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xc4a3121 = (_args, _num_ops))" % __pyx_checksum)
12375  *     __pyx_result = CoeffFunc.__new__(__pyx_type)
12376  */
12377     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
12378     __Pyx_GOTREF(__pyx_t_2);
12379     __Pyx_INCREF(__pyx_n_s_PickleError);
12380     __Pyx_GIVEREF(__pyx_n_s_PickleError);
12381     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
12382     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
12383     __Pyx_GOTREF(__pyx_t_3);
12384     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12385     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
12386     __Pyx_GOTREF(__pyx_t_2);
12387     __Pyx_INCREF(__pyx_t_2);
12388     __pyx_v___pyx_PickleError = __pyx_t_2;
12389     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12390     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12391 
12392     /* "(tree fragment)":6
12393  *     if __pyx_checksum != 0xc4a3121:
12394  *         from pickle import PickleError as __pyx_PickleError
12395  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xc4a3121 = (_args, _num_ops))" % __pyx_checksum)             # <<<<<<<<<<<<<<
12396  *     __pyx_result = CoeffFunc.__new__(__pyx_type)
12397  *     if __pyx_state is not None:
12398  */
12399     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
12400     __Pyx_GOTREF(__pyx_t_2);
12401     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xc4, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
12402     __Pyx_GOTREF(__pyx_t_4);
12403     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12404     __Pyx_INCREF(__pyx_v___pyx_PickleError);
12405     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
12406     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
12407       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
12408       if (likely(__pyx_t_5)) {
12409         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
12410         __Pyx_INCREF(__pyx_t_5);
12411         __Pyx_INCREF(function);
12412         __Pyx_DECREF_SET(__pyx_t_2, function);
12413       }
12414     }
12415     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
12416     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12417     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12418     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
12419     __Pyx_GOTREF(__pyx_t_3);
12420     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12421     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12422     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12423     __PYX_ERR(1, 6, __pyx_L1_error)
12424 
12425     /* "(tree fragment)":4
12426  *     cdef object __pyx_PickleError
12427  *     cdef object __pyx_result
12428  *     if __pyx_checksum != 0xc4a3121:             # <<<<<<<<<<<<<<
12429  *         from pickle import PickleError as __pyx_PickleError
12430  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xc4a3121 = (_args, _num_ops))" % __pyx_checksum)
12431  */
12432   }
12433 
12434   /* "(tree fragment)":7
12435  *         from pickle import PickleError as __pyx_PickleError
12436  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xc4a3121 = (_args, _num_ops))" % __pyx_checksum)
12437  *     __pyx_result = CoeffFunc.__new__(__pyx_type)             # <<<<<<<<<<<<<<
12438  *     if __pyx_state is not None:
12439  *         __pyx_unpickle_CoeffFunc__set_state(<CoeffFunc> __pyx_result, __pyx_state)
12440  */
12441   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5qutip_2cy_15cqobjevo_factor_CoeffFunc), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
12442   __Pyx_GOTREF(__pyx_t_2);
12443   __pyx_t_4 = NULL;
12444   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12445     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
12446     if (likely(__pyx_t_4)) {
12447       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
12448       __Pyx_INCREF(__pyx_t_4);
12449       __Pyx_INCREF(function);
12450       __Pyx_DECREF_SET(__pyx_t_2, function);
12451     }
12452   }
12453   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
12454   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12455   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
12456   __Pyx_GOTREF(__pyx_t_3);
12457   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12458   __pyx_v___pyx_result = __pyx_t_3;
12459   __pyx_t_3 = 0;
12460 
12461   /* "(tree fragment)":8
12462  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xc4a3121 = (_args, _num_ops))" % __pyx_checksum)
12463  *     __pyx_result = CoeffFunc.__new__(__pyx_type)
12464  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
12465  *         __pyx_unpickle_CoeffFunc__set_state(<CoeffFunc> __pyx_result, __pyx_state)
12466  *     return __pyx_result
12467  */
12468   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
12469   __pyx_t_6 = (__pyx_t_1 != 0);
12470   if (__pyx_t_6) {
12471 
12472     /* "(tree fragment)":9
12473  *     __pyx_result = CoeffFunc.__new__(__pyx_type)
12474  *     if __pyx_state is not None:
12475  *         __pyx_unpickle_CoeffFunc__set_state(<CoeffFunc> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
12476  *     return __pyx_result
12477  * cdef __pyx_unpickle_CoeffFunc__set_state(CoeffFunc __pyx_result, tuple __pyx_state):
12478  */
12479     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
12480     __pyx_t_3 = __pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_CoeffFunc__set_state(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
12481     __Pyx_GOTREF(__pyx_t_3);
12482     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12483 
12484     /* "(tree fragment)":8
12485  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xc4a3121 = (_args, _num_ops))" % __pyx_checksum)
12486  *     __pyx_result = CoeffFunc.__new__(__pyx_type)
12487  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
12488  *         __pyx_unpickle_CoeffFunc__set_state(<CoeffFunc> __pyx_result, __pyx_state)
12489  *     return __pyx_result
12490  */
12491   }
12492 
12493   /* "(tree fragment)":10
12494  *     if __pyx_state is not None:
12495  *         __pyx_unpickle_CoeffFunc__set_state(<CoeffFunc> __pyx_result, __pyx_state)
12496  *     return __pyx_result             # <<<<<<<<<<<<<<
12497  * cdef __pyx_unpickle_CoeffFunc__set_state(CoeffFunc __pyx_result, tuple __pyx_state):
12498  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]
12499  */
12500   __Pyx_XDECREF(__pyx_r);
12501   __Pyx_INCREF(__pyx_v___pyx_result);
12502   __pyx_r = __pyx_v___pyx_result;
12503   goto __pyx_L0;
12504 
12505   /* "(tree fragment)":1
12506  * def __pyx_unpickle_CoeffFunc(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
12507  *     cdef object __pyx_PickleError
12508  *     cdef object __pyx_result
12509  */
12510 
12511   /* function exit code */
12512   __pyx_L1_error:;
12513   __Pyx_XDECREF(__pyx_t_2);
12514   __Pyx_XDECREF(__pyx_t_3);
12515   __Pyx_XDECREF(__pyx_t_4);
12516   __Pyx_XDECREF(__pyx_t_5);
12517   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.__pyx_unpickle_CoeffFunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
12518   __pyx_r = NULL;
12519   __pyx_L0:;
12520   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
12521   __Pyx_XDECREF(__pyx_v___pyx_result);
12522   __Pyx_XGIVEREF(__pyx_r);
12523   __Pyx_RefNannyFinishContext();
12524   return __pyx_r;
12525 }
12526 
12527 /* "(tree fragment)":11
12528  *         __pyx_unpickle_CoeffFunc__set_state(<CoeffFunc> __pyx_result, __pyx_state)
12529  *     return __pyx_result
12530  * cdef __pyx_unpickle_CoeffFunc__set_state(CoeffFunc __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
12531  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]
12532  *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
12533  */
12534 
__pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_CoeffFunc__set_state(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)12535 static PyObject *__pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_CoeffFunc__set_state(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
12536   PyObject *__pyx_r = NULL;
12537   __Pyx_RefNannyDeclarations
12538   PyObject *__pyx_t_1 = NULL;
12539   int __pyx_t_2;
12540   int __pyx_t_3;
12541   Py_ssize_t __pyx_t_4;
12542   int __pyx_t_5;
12543   int __pyx_t_6;
12544   PyObject *__pyx_t_7 = NULL;
12545   PyObject *__pyx_t_8 = NULL;
12546   PyObject *__pyx_t_9 = NULL;
12547   int __pyx_lineno = 0;
12548   const char *__pyx_filename = NULL;
12549   int __pyx_clineno = 0;
12550   __Pyx_RefNannySetupContext("__pyx_unpickle_CoeffFunc__set_state", 0);
12551 
12552   /* "(tree fragment)":12
12553  *     return __pyx_result
12554  * cdef __pyx_unpickle_CoeffFunc__set_state(CoeffFunc __pyx_result, tuple __pyx_state):
12555  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]             # <<<<<<<<<<<<<<
12556  *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
12557  *         __pyx_result.__dict__.update(__pyx_state[2])
12558  */
12559   if (unlikely(__pyx_v___pyx_state == Py_None)) {
12560     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
12561     __PYX_ERR(1, 12, __pyx_L1_error)
12562   }
12563   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
12564   __Pyx_GOTREF(__pyx_t_1);
12565   if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
12566   __Pyx_GIVEREF(__pyx_t_1);
12567   __Pyx_GOTREF(__pyx_v___pyx_result->_args);
12568   __Pyx_DECREF(__pyx_v___pyx_result->_args);
12569   __pyx_v___pyx_result->_args = ((PyObject*)__pyx_t_1);
12570   __pyx_t_1 = 0;
12571   if (unlikely(__pyx_v___pyx_state == Py_None)) {
12572     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
12573     __PYX_ERR(1, 12, __pyx_L1_error)
12574   }
12575   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
12576   __Pyx_GOTREF(__pyx_t_1);
12577   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
12578   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12579   __pyx_v___pyx_result->_num_ops = __pyx_t_2;
12580 
12581   /* "(tree fragment)":13
12582  * cdef __pyx_unpickle_CoeffFunc__set_state(CoeffFunc __pyx_result, tuple __pyx_state):
12583  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]
12584  *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
12585  *         __pyx_result.__dict__.update(__pyx_state[2])
12586  */
12587   if (unlikely(__pyx_v___pyx_state == Py_None)) {
12588     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
12589     __PYX_ERR(1, 13, __pyx_L1_error)
12590   }
12591   __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
12592   __pyx_t_5 = ((__pyx_t_4 > 2) != 0);
12593   if (__pyx_t_5) {
12594   } else {
12595     __pyx_t_3 = __pyx_t_5;
12596     goto __pyx_L4_bool_binop_done;
12597   }
12598   __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
12599   __pyx_t_6 = (__pyx_t_5 != 0);
12600   __pyx_t_3 = __pyx_t_6;
12601   __pyx_L4_bool_binop_done:;
12602   if (__pyx_t_3) {
12603 
12604     /* "(tree fragment)":14
12605  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]
12606  *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
12607  *         __pyx_result.__dict__.update(__pyx_state[2])             # <<<<<<<<<<<<<<
12608  */
12609     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
12610     __Pyx_GOTREF(__pyx_t_7);
12611     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
12612     __Pyx_GOTREF(__pyx_t_8);
12613     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12614     if (unlikely(__pyx_v___pyx_state == Py_None)) {
12615       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
12616       __PYX_ERR(1, 14, __pyx_L1_error)
12617     }
12618     __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
12619     __Pyx_GOTREF(__pyx_t_7);
12620     __pyx_t_9 = NULL;
12621     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
12622       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
12623       if (likely(__pyx_t_9)) {
12624         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
12625         __Pyx_INCREF(__pyx_t_9);
12626         __Pyx_INCREF(function);
12627         __Pyx_DECREF_SET(__pyx_t_8, function);
12628       }
12629     }
12630     __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7);
12631     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12632     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12633     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
12634     __Pyx_GOTREF(__pyx_t_1);
12635     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12636     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12637 
12638     /* "(tree fragment)":13
12639  * cdef __pyx_unpickle_CoeffFunc__set_state(CoeffFunc __pyx_result, tuple __pyx_state):
12640  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]
12641  *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
12642  *         __pyx_result.__dict__.update(__pyx_state[2])
12643  */
12644   }
12645 
12646   /* "(tree fragment)":11
12647  *         __pyx_unpickle_CoeffFunc__set_state(<CoeffFunc> __pyx_result, __pyx_state)
12648  *     return __pyx_result
12649  * cdef __pyx_unpickle_CoeffFunc__set_state(CoeffFunc __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
12650  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]
12651  *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
12652  */
12653 
12654   /* function exit code */
12655   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12656   goto __pyx_L0;
12657   __pyx_L1_error:;
12658   __Pyx_XDECREF(__pyx_t_1);
12659   __Pyx_XDECREF(__pyx_t_7);
12660   __Pyx_XDECREF(__pyx_t_8);
12661   __Pyx_XDECREF(__pyx_t_9);
12662   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.__pyx_unpickle_CoeffFunc__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
12663   __pyx_r = 0;
12664   __pyx_L0:;
12665   __Pyx_XGIVEREF(__pyx_r);
12666   __Pyx_RefNannyFinishContext();
12667   return __pyx_r;
12668 }
12669 
12670 /* "(tree fragment)":1
12671  * def __pyx_unpickle_InterpolateCoeff(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
12672  *     cdef object __pyx_PickleError
12673  *     cdef object __pyx_result
12674  */
12675 
12676 /* Python wrapper */
12677 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_3__pyx_unpickle_InterpolateCoeff(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
12678 static PyMethodDef __pyx_mdef_5qutip_2cy_15cqobjevo_factor_3__pyx_unpickle_InterpolateCoeff = {"__pyx_unpickle_InterpolateCoeff", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5qutip_2cy_15cqobjevo_factor_3__pyx_unpickle_InterpolateCoeff, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_5qutip_2cy_15cqobjevo_factor_3__pyx_unpickle_InterpolateCoeff(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)12679 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_3__pyx_unpickle_InterpolateCoeff(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12680   PyObject *__pyx_v___pyx_type = 0;
12681   long __pyx_v___pyx_checksum;
12682   PyObject *__pyx_v___pyx_state = 0;
12683   int __pyx_lineno = 0;
12684   const char *__pyx_filename = NULL;
12685   int __pyx_clineno = 0;
12686   PyObject *__pyx_r = 0;
12687   __Pyx_RefNannyDeclarations
12688   __Pyx_RefNannySetupContext("__pyx_unpickle_InterpolateCoeff (wrapper)", 0);
12689   {
12690     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
12691     PyObject* values[3] = {0,0,0};
12692     if (unlikely(__pyx_kwds)) {
12693       Py_ssize_t kw_args;
12694       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12695       switch (pos_args) {
12696         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12697         CYTHON_FALLTHROUGH;
12698         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12699         CYTHON_FALLTHROUGH;
12700         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12701         CYTHON_FALLTHROUGH;
12702         case  0: break;
12703         default: goto __pyx_L5_argtuple_error;
12704       }
12705       kw_args = PyDict_Size(__pyx_kwds);
12706       switch (pos_args) {
12707         case  0:
12708         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
12709         else goto __pyx_L5_argtuple_error;
12710         CYTHON_FALLTHROUGH;
12711         case  1:
12712         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
12713         else {
12714           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_InterpolateCoeff", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
12715         }
12716         CYTHON_FALLTHROUGH;
12717         case  2:
12718         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
12719         else {
12720           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_InterpolateCoeff", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
12721         }
12722       }
12723       if (unlikely(kw_args > 0)) {
12724         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_InterpolateCoeff") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
12725       }
12726     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
12727       goto __pyx_L5_argtuple_error;
12728     } else {
12729       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12730       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12731       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12732     }
12733     __pyx_v___pyx_type = values[0];
12734     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
12735     __pyx_v___pyx_state = values[2];
12736   }
12737   goto __pyx_L4_argument_unpacking_done;
12738   __pyx_L5_argtuple_error:;
12739   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_InterpolateCoeff", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
12740   __pyx_L3_error:;
12741   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.__pyx_unpickle_InterpolateCoeff", __pyx_clineno, __pyx_lineno, __pyx_filename);
12742   __Pyx_RefNannyFinishContext();
12743   return NULL;
12744   __pyx_L4_argument_unpacking_done:;
12745   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_2__pyx_unpickle_InterpolateCoeff(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
12746 
12747   /* function exit code */
12748   __Pyx_RefNannyFinishContext();
12749   return __pyx_r;
12750 }
12751 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_2__pyx_unpickle_InterpolateCoeff(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)12752 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_2__pyx_unpickle_InterpolateCoeff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
12753   PyObject *__pyx_v___pyx_PickleError = 0;
12754   PyObject *__pyx_v___pyx_result = 0;
12755   PyObject *__pyx_r = NULL;
12756   __Pyx_RefNannyDeclarations
12757   int __pyx_t_1;
12758   PyObject *__pyx_t_2 = NULL;
12759   PyObject *__pyx_t_3 = NULL;
12760   PyObject *__pyx_t_4 = NULL;
12761   PyObject *__pyx_t_5 = NULL;
12762   int __pyx_t_6;
12763   int __pyx_lineno = 0;
12764   const char *__pyx_filename = NULL;
12765   int __pyx_clineno = 0;
12766   __Pyx_RefNannySetupContext("__pyx_unpickle_InterpolateCoeff", 0);
12767 
12768   /* "(tree fragment)":4
12769  *     cdef object __pyx_PickleError
12770  *     cdef object __pyx_result
12771  *     if __pyx_checksum != 0xc6a92cd:             # <<<<<<<<<<<<<<
12772  *         from pickle import PickleError as __pyx_PickleError
12773  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xc6a92cd = (_args, _num_ops, a, b, c))" % __pyx_checksum)
12774  */
12775   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xc6a92cd) != 0);
12776   if (__pyx_t_1) {
12777 
12778     /* "(tree fragment)":5
12779  *     cdef object __pyx_result
12780  *     if __pyx_checksum != 0xc6a92cd:
12781  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
12782  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xc6a92cd = (_args, _num_ops, a, b, c))" % __pyx_checksum)
12783  *     __pyx_result = InterpolateCoeff.__new__(__pyx_type)
12784  */
12785     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
12786     __Pyx_GOTREF(__pyx_t_2);
12787     __Pyx_INCREF(__pyx_n_s_PickleError);
12788     __Pyx_GIVEREF(__pyx_n_s_PickleError);
12789     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
12790     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
12791     __Pyx_GOTREF(__pyx_t_3);
12792     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12793     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
12794     __Pyx_GOTREF(__pyx_t_2);
12795     __Pyx_INCREF(__pyx_t_2);
12796     __pyx_v___pyx_PickleError = __pyx_t_2;
12797     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12798     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12799 
12800     /* "(tree fragment)":6
12801  *     if __pyx_checksum != 0xc6a92cd:
12802  *         from pickle import PickleError as __pyx_PickleError
12803  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xc6a92cd = (_args, _num_ops, a, b, c))" % __pyx_checksum)             # <<<<<<<<<<<<<<
12804  *     __pyx_result = InterpolateCoeff.__new__(__pyx_type)
12805  *     if __pyx_state is not None:
12806  */
12807     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
12808     __Pyx_GOTREF(__pyx_t_2);
12809     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xc6, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
12810     __Pyx_GOTREF(__pyx_t_4);
12811     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12812     __Pyx_INCREF(__pyx_v___pyx_PickleError);
12813     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
12814     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
12815       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
12816       if (likely(__pyx_t_5)) {
12817         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
12818         __Pyx_INCREF(__pyx_t_5);
12819         __Pyx_INCREF(function);
12820         __Pyx_DECREF_SET(__pyx_t_2, function);
12821       }
12822     }
12823     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
12824     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12825     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12826     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
12827     __Pyx_GOTREF(__pyx_t_3);
12828     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12829     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12830     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12831     __PYX_ERR(1, 6, __pyx_L1_error)
12832 
12833     /* "(tree fragment)":4
12834  *     cdef object __pyx_PickleError
12835  *     cdef object __pyx_result
12836  *     if __pyx_checksum != 0xc6a92cd:             # <<<<<<<<<<<<<<
12837  *         from pickle import PickleError as __pyx_PickleError
12838  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xc6a92cd = (_args, _num_ops, a, b, c))" % __pyx_checksum)
12839  */
12840   }
12841 
12842   /* "(tree fragment)":7
12843  *         from pickle import PickleError as __pyx_PickleError
12844  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xc6a92cd = (_args, _num_ops, a, b, c))" % __pyx_checksum)
12845  *     __pyx_result = InterpolateCoeff.__new__(__pyx_type)             # <<<<<<<<<<<<<<
12846  *     if __pyx_state is not None:
12847  *         __pyx_unpickle_InterpolateCoeff__set_state(<InterpolateCoeff> __pyx_result, __pyx_state)
12848  */
12849   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
12850   __Pyx_GOTREF(__pyx_t_2);
12851   __pyx_t_4 = NULL;
12852   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12853     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
12854     if (likely(__pyx_t_4)) {
12855       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
12856       __Pyx_INCREF(__pyx_t_4);
12857       __Pyx_INCREF(function);
12858       __Pyx_DECREF_SET(__pyx_t_2, function);
12859     }
12860   }
12861   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
12862   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12863   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
12864   __Pyx_GOTREF(__pyx_t_3);
12865   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12866   __pyx_v___pyx_result = __pyx_t_3;
12867   __pyx_t_3 = 0;
12868 
12869   /* "(tree fragment)":8
12870  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xc6a92cd = (_args, _num_ops, a, b, c))" % __pyx_checksum)
12871  *     __pyx_result = InterpolateCoeff.__new__(__pyx_type)
12872  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
12873  *         __pyx_unpickle_InterpolateCoeff__set_state(<InterpolateCoeff> __pyx_result, __pyx_state)
12874  *     return __pyx_result
12875  */
12876   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
12877   __pyx_t_6 = (__pyx_t_1 != 0);
12878   if (__pyx_t_6) {
12879 
12880     /* "(tree fragment)":9
12881  *     __pyx_result = InterpolateCoeff.__new__(__pyx_type)
12882  *     if __pyx_state is not None:
12883  *         __pyx_unpickle_InterpolateCoeff__set_state(<InterpolateCoeff> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
12884  *     return __pyx_result
12885  * cdef __pyx_unpickle_InterpolateCoeff__set_state(InterpolateCoeff __pyx_result, tuple __pyx_state):
12886  */
12887     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
12888     __pyx_t_3 = __pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_InterpolateCoeff__set_state(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
12889     __Pyx_GOTREF(__pyx_t_3);
12890     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12891 
12892     /* "(tree fragment)":8
12893  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xc6a92cd = (_args, _num_ops, a, b, c))" % __pyx_checksum)
12894  *     __pyx_result = InterpolateCoeff.__new__(__pyx_type)
12895  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
12896  *         __pyx_unpickle_InterpolateCoeff__set_state(<InterpolateCoeff> __pyx_result, __pyx_state)
12897  *     return __pyx_result
12898  */
12899   }
12900 
12901   /* "(tree fragment)":10
12902  *     if __pyx_state is not None:
12903  *         __pyx_unpickle_InterpolateCoeff__set_state(<InterpolateCoeff> __pyx_result, __pyx_state)
12904  *     return __pyx_result             # <<<<<<<<<<<<<<
12905  * cdef __pyx_unpickle_InterpolateCoeff__set_state(InterpolateCoeff __pyx_result, tuple __pyx_state):
12906  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.a = __pyx_state[2]; __pyx_result.b = __pyx_state[3]; __pyx_result.c = __pyx_state[4]
12907  */
12908   __Pyx_XDECREF(__pyx_r);
12909   __Pyx_INCREF(__pyx_v___pyx_result);
12910   __pyx_r = __pyx_v___pyx_result;
12911   goto __pyx_L0;
12912 
12913   /* "(tree fragment)":1
12914  * def __pyx_unpickle_InterpolateCoeff(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
12915  *     cdef object __pyx_PickleError
12916  *     cdef object __pyx_result
12917  */
12918 
12919   /* function exit code */
12920   __pyx_L1_error:;
12921   __Pyx_XDECREF(__pyx_t_2);
12922   __Pyx_XDECREF(__pyx_t_3);
12923   __Pyx_XDECREF(__pyx_t_4);
12924   __Pyx_XDECREF(__pyx_t_5);
12925   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.__pyx_unpickle_InterpolateCoeff", __pyx_clineno, __pyx_lineno, __pyx_filename);
12926   __pyx_r = NULL;
12927   __pyx_L0:;
12928   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
12929   __Pyx_XDECREF(__pyx_v___pyx_result);
12930   __Pyx_XGIVEREF(__pyx_r);
12931   __Pyx_RefNannyFinishContext();
12932   return __pyx_r;
12933 }
12934 
12935 /* "(tree fragment)":11
12936  *         __pyx_unpickle_InterpolateCoeff__set_state(<InterpolateCoeff> __pyx_result, __pyx_state)
12937  *     return __pyx_result
12938  * cdef __pyx_unpickle_InterpolateCoeff__set_state(InterpolateCoeff __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
12939  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.a = __pyx_state[2]; __pyx_result.b = __pyx_state[3]; __pyx_result.c = __pyx_state[4]
12940  *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):
12941  */
12942 
__pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_InterpolateCoeff__set_state(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)12943 static PyObject *__pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_InterpolateCoeff__set_state(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
12944   PyObject *__pyx_r = NULL;
12945   __Pyx_RefNannyDeclarations
12946   PyObject *__pyx_t_1 = NULL;
12947   int __pyx_t_2;
12948   double __pyx_t_3;
12949   __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
12950   int __pyx_t_5;
12951   Py_ssize_t __pyx_t_6;
12952   int __pyx_t_7;
12953   int __pyx_t_8;
12954   PyObject *__pyx_t_9 = NULL;
12955   PyObject *__pyx_t_10 = NULL;
12956   PyObject *__pyx_t_11 = NULL;
12957   int __pyx_lineno = 0;
12958   const char *__pyx_filename = NULL;
12959   int __pyx_clineno = 0;
12960   __Pyx_RefNannySetupContext("__pyx_unpickle_InterpolateCoeff__set_state", 0);
12961 
12962   /* "(tree fragment)":12
12963  *     return __pyx_result
12964  * cdef __pyx_unpickle_InterpolateCoeff__set_state(InterpolateCoeff __pyx_result, tuple __pyx_state):
12965  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.a = __pyx_state[2]; __pyx_result.b = __pyx_state[3]; __pyx_result.c = __pyx_state[4]             # <<<<<<<<<<<<<<
12966  *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):
12967  *         __pyx_result.__dict__.update(__pyx_state[5])
12968  */
12969   if (unlikely(__pyx_v___pyx_state == Py_None)) {
12970     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
12971     __PYX_ERR(1, 12, __pyx_L1_error)
12972   }
12973   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
12974   __Pyx_GOTREF(__pyx_t_1);
12975   if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
12976   __Pyx_GIVEREF(__pyx_t_1);
12977   __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base._args);
12978   __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base._args);
12979   __pyx_v___pyx_result->__pyx_base._args = ((PyObject*)__pyx_t_1);
12980   __pyx_t_1 = 0;
12981   if (unlikely(__pyx_v___pyx_state == Py_None)) {
12982     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
12983     __PYX_ERR(1, 12, __pyx_L1_error)
12984   }
12985   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
12986   __Pyx_GOTREF(__pyx_t_1);
12987   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
12988   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12989   __pyx_v___pyx_result->__pyx_base._num_ops = __pyx_t_2;
12990   if (unlikely(__pyx_v___pyx_state == Py_None)) {
12991     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
12992     __PYX_ERR(1, 12, __pyx_L1_error)
12993   }
12994   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
12995   __Pyx_GOTREF(__pyx_t_1);
12996   __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
12997   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12998   __pyx_v___pyx_result->a = __pyx_t_3;
12999   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13000     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13001     __PYX_ERR(1, 12, __pyx_L1_error)
13002   }
13003   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
13004   __Pyx_GOTREF(__pyx_t_1);
13005   __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
13006   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13007   __pyx_v___pyx_result->b = __pyx_t_3;
13008   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13009     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13010     __PYX_ERR(1, 12, __pyx_L1_error)
13011   }
13012   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
13013   __Pyx_GOTREF(__pyx_t_1);
13014   __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
13015   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13016   __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->c, 0);
13017   __pyx_v___pyx_result->c = __pyx_t_4;
13018   __pyx_t_4.memview = NULL;
13019   __pyx_t_4.data = NULL;
13020 
13021   /* "(tree fragment)":13
13022  * cdef __pyx_unpickle_InterpolateCoeff__set_state(InterpolateCoeff __pyx_result, tuple __pyx_state):
13023  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.a = __pyx_state[2]; __pyx_result.b = __pyx_state[3]; __pyx_result.c = __pyx_state[4]
13024  *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
13025  *         __pyx_result.__dict__.update(__pyx_state[5])
13026  */
13027   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13028     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
13029     __PYX_ERR(1, 13, __pyx_L1_error)
13030   }
13031   __pyx_t_6 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
13032   __pyx_t_7 = ((__pyx_t_6 > 5) != 0);
13033   if (__pyx_t_7) {
13034   } else {
13035     __pyx_t_5 = __pyx_t_7;
13036     goto __pyx_L4_bool_binop_done;
13037   }
13038   __pyx_t_7 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
13039   __pyx_t_8 = (__pyx_t_7 != 0);
13040   __pyx_t_5 = __pyx_t_8;
13041   __pyx_L4_bool_binop_done:;
13042   if (__pyx_t_5) {
13043 
13044     /* "(tree fragment)":14
13045  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.a = __pyx_state[2]; __pyx_result.b = __pyx_state[3]; __pyx_result.c = __pyx_state[4]
13046  *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):
13047  *         __pyx_result.__dict__.update(__pyx_state[5])             # <<<<<<<<<<<<<<
13048  */
13049     __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
13050     __Pyx_GOTREF(__pyx_t_9);
13051     __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_update); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 14, __pyx_L1_error)
13052     __Pyx_GOTREF(__pyx_t_10);
13053     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13054     if (unlikely(__pyx_v___pyx_state == Py_None)) {
13055       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13056       __PYX_ERR(1, 14, __pyx_L1_error)
13057     }
13058     __pyx_t_9 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
13059     __Pyx_GOTREF(__pyx_t_9);
13060     __pyx_t_11 = NULL;
13061     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
13062       __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
13063       if (likely(__pyx_t_11)) {
13064         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
13065         __Pyx_INCREF(__pyx_t_11);
13066         __Pyx_INCREF(function);
13067         __Pyx_DECREF_SET(__pyx_t_10, function);
13068       }
13069     }
13070     __pyx_t_1 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9);
13071     __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
13072     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13073     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
13074     __Pyx_GOTREF(__pyx_t_1);
13075     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13076     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13077 
13078     /* "(tree fragment)":13
13079  * cdef __pyx_unpickle_InterpolateCoeff__set_state(InterpolateCoeff __pyx_result, tuple __pyx_state):
13080  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.a = __pyx_state[2]; __pyx_result.b = __pyx_state[3]; __pyx_result.c = __pyx_state[4]
13081  *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
13082  *         __pyx_result.__dict__.update(__pyx_state[5])
13083  */
13084   }
13085 
13086   /* "(tree fragment)":11
13087  *         __pyx_unpickle_InterpolateCoeff__set_state(<InterpolateCoeff> __pyx_result, __pyx_state)
13088  *     return __pyx_result
13089  * cdef __pyx_unpickle_InterpolateCoeff__set_state(InterpolateCoeff __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
13090  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.a = __pyx_state[2]; __pyx_result.b = __pyx_state[3]; __pyx_result.c = __pyx_state[4]
13091  *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):
13092  */
13093 
13094   /* function exit code */
13095   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13096   goto __pyx_L0;
13097   __pyx_L1_error:;
13098   __Pyx_XDECREF(__pyx_t_1);
13099   __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
13100   __Pyx_XDECREF(__pyx_t_9);
13101   __Pyx_XDECREF(__pyx_t_10);
13102   __Pyx_XDECREF(__pyx_t_11);
13103   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.__pyx_unpickle_InterpolateCoeff__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
13104   __pyx_r = 0;
13105   __pyx_L0:;
13106   __Pyx_XGIVEREF(__pyx_r);
13107   __Pyx_RefNannyFinishContext();
13108   return __pyx_r;
13109 }
13110 
13111 /* "(tree fragment)":1
13112  * def __pyx_unpickle_InterCoeffCte(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
13113  *     cdef object __pyx_PickleError
13114  *     cdef object __pyx_result
13115  */
13116 
13117 /* Python wrapper */
13118 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_5__pyx_unpickle_InterCoeffCte(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
13119 static PyMethodDef __pyx_mdef_5qutip_2cy_15cqobjevo_factor_5__pyx_unpickle_InterCoeffCte = {"__pyx_unpickle_InterCoeffCte", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5qutip_2cy_15cqobjevo_factor_5__pyx_unpickle_InterCoeffCte, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_5qutip_2cy_15cqobjevo_factor_5__pyx_unpickle_InterCoeffCte(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)13120 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_5__pyx_unpickle_InterCoeffCte(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13121   PyObject *__pyx_v___pyx_type = 0;
13122   long __pyx_v___pyx_checksum;
13123   PyObject *__pyx_v___pyx_state = 0;
13124   int __pyx_lineno = 0;
13125   const char *__pyx_filename = NULL;
13126   int __pyx_clineno = 0;
13127   PyObject *__pyx_r = 0;
13128   __Pyx_RefNannyDeclarations
13129   __Pyx_RefNannySetupContext("__pyx_unpickle_InterCoeffCte (wrapper)", 0);
13130   {
13131     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
13132     PyObject* values[3] = {0,0,0};
13133     if (unlikely(__pyx_kwds)) {
13134       Py_ssize_t kw_args;
13135       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13136       switch (pos_args) {
13137         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13138         CYTHON_FALLTHROUGH;
13139         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13140         CYTHON_FALLTHROUGH;
13141         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13142         CYTHON_FALLTHROUGH;
13143         case  0: break;
13144         default: goto __pyx_L5_argtuple_error;
13145       }
13146       kw_args = PyDict_Size(__pyx_kwds);
13147       switch (pos_args) {
13148         case  0:
13149         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
13150         else goto __pyx_L5_argtuple_error;
13151         CYTHON_FALLTHROUGH;
13152         case  1:
13153         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
13154         else {
13155           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_InterCoeffCte", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
13156         }
13157         CYTHON_FALLTHROUGH;
13158         case  2:
13159         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
13160         else {
13161           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_InterCoeffCte", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
13162         }
13163       }
13164       if (unlikely(kw_args > 0)) {
13165         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_InterCoeffCte") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
13166       }
13167     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
13168       goto __pyx_L5_argtuple_error;
13169     } else {
13170       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13171       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13172       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13173     }
13174     __pyx_v___pyx_type = values[0];
13175     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
13176     __pyx_v___pyx_state = values[2];
13177   }
13178   goto __pyx_L4_argument_unpacking_done;
13179   __pyx_L5_argtuple_error:;
13180   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_InterCoeffCte", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
13181   __pyx_L3_error:;
13182   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.__pyx_unpickle_InterCoeffCte", __pyx_clineno, __pyx_lineno, __pyx_filename);
13183   __Pyx_RefNannyFinishContext();
13184   return NULL;
13185   __pyx_L4_argument_unpacking_done:;
13186   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_4__pyx_unpickle_InterCoeffCte(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
13187 
13188   /* function exit code */
13189   __Pyx_RefNannyFinishContext();
13190   return __pyx_r;
13191 }
13192 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_4__pyx_unpickle_InterCoeffCte(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)13193 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_4__pyx_unpickle_InterCoeffCte(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
13194   PyObject *__pyx_v___pyx_PickleError = 0;
13195   PyObject *__pyx_v___pyx_result = 0;
13196   PyObject *__pyx_r = NULL;
13197   __Pyx_RefNannyDeclarations
13198   int __pyx_t_1;
13199   PyObject *__pyx_t_2 = NULL;
13200   PyObject *__pyx_t_3 = NULL;
13201   PyObject *__pyx_t_4 = NULL;
13202   PyObject *__pyx_t_5 = NULL;
13203   int __pyx_t_6;
13204   int __pyx_lineno = 0;
13205   const char *__pyx_filename = NULL;
13206   int __pyx_clineno = 0;
13207   __Pyx_RefNannySetupContext("__pyx_unpickle_InterCoeffCte", 0);
13208 
13209   /* "(tree fragment)":4
13210  *     cdef object __pyx_PickleError
13211  *     cdef object __pyx_result
13212  *     if __pyx_checksum != 0x94db4ad:             # <<<<<<<<<<<<<<
13213  *         from pickle import PickleError as __pyx_PickleError
13214  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x94db4ad = (M, _args, _num_ops, dt, n_t, tlist, y))" % __pyx_checksum)
13215  */
13216   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x94db4ad) != 0);
13217   if (__pyx_t_1) {
13218 
13219     /* "(tree fragment)":5
13220  *     cdef object __pyx_result
13221  *     if __pyx_checksum != 0x94db4ad:
13222  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
13223  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x94db4ad = (M, _args, _num_ops, dt, n_t, tlist, y))" % __pyx_checksum)
13224  *     __pyx_result = InterCoeffCte.__new__(__pyx_type)
13225  */
13226     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
13227     __Pyx_GOTREF(__pyx_t_2);
13228     __Pyx_INCREF(__pyx_n_s_PickleError);
13229     __Pyx_GIVEREF(__pyx_n_s_PickleError);
13230     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
13231     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
13232     __Pyx_GOTREF(__pyx_t_3);
13233     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13234     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
13235     __Pyx_GOTREF(__pyx_t_2);
13236     __Pyx_INCREF(__pyx_t_2);
13237     __pyx_v___pyx_PickleError = __pyx_t_2;
13238     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13239     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13240 
13241     /* "(tree fragment)":6
13242  *     if __pyx_checksum != 0x94db4ad:
13243  *         from pickle import PickleError as __pyx_PickleError
13244  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x94db4ad = (M, _args, _num_ops, dt, n_t, tlist, y))" % __pyx_checksum)             # <<<<<<<<<<<<<<
13245  *     __pyx_result = InterCoeffCte.__new__(__pyx_type)
13246  *     if __pyx_state is not None:
13247  */
13248     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
13249     __Pyx_GOTREF(__pyx_t_2);
13250     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x94, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
13251     __Pyx_GOTREF(__pyx_t_4);
13252     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13253     __Pyx_INCREF(__pyx_v___pyx_PickleError);
13254     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
13255     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
13256       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
13257       if (likely(__pyx_t_5)) {
13258         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
13259         __Pyx_INCREF(__pyx_t_5);
13260         __Pyx_INCREF(function);
13261         __Pyx_DECREF_SET(__pyx_t_2, function);
13262       }
13263     }
13264     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
13265     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13266     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13267     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
13268     __Pyx_GOTREF(__pyx_t_3);
13269     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13270     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13271     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13272     __PYX_ERR(1, 6, __pyx_L1_error)
13273 
13274     /* "(tree fragment)":4
13275  *     cdef object __pyx_PickleError
13276  *     cdef object __pyx_result
13277  *     if __pyx_checksum != 0x94db4ad:             # <<<<<<<<<<<<<<
13278  *         from pickle import PickleError as __pyx_PickleError
13279  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x94db4ad = (M, _args, _num_ops, dt, n_t, tlist, y))" % __pyx_checksum)
13280  */
13281   }
13282 
13283   /* "(tree fragment)":7
13284  *         from pickle import PickleError as __pyx_PickleError
13285  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x94db4ad = (M, _args, _num_ops, dt, n_t, tlist, y))" % __pyx_checksum)
13286  *     __pyx_result = InterCoeffCte.__new__(__pyx_type)             # <<<<<<<<<<<<<<
13287  *     if __pyx_state is not None:
13288  *         __pyx_unpickle_InterCoeffCte__set_state(<InterCoeffCte> __pyx_result, __pyx_state)
13289  */
13290   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5qutip_2cy_15cqobjevo_factor_InterCoeffCte), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
13291   __Pyx_GOTREF(__pyx_t_2);
13292   __pyx_t_4 = NULL;
13293   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
13294     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
13295     if (likely(__pyx_t_4)) {
13296       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
13297       __Pyx_INCREF(__pyx_t_4);
13298       __Pyx_INCREF(function);
13299       __Pyx_DECREF_SET(__pyx_t_2, function);
13300     }
13301   }
13302   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
13303   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13304   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
13305   __Pyx_GOTREF(__pyx_t_3);
13306   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13307   __pyx_v___pyx_result = __pyx_t_3;
13308   __pyx_t_3 = 0;
13309 
13310   /* "(tree fragment)":8
13311  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x94db4ad = (M, _args, _num_ops, dt, n_t, tlist, y))" % __pyx_checksum)
13312  *     __pyx_result = InterCoeffCte.__new__(__pyx_type)
13313  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
13314  *         __pyx_unpickle_InterCoeffCte__set_state(<InterCoeffCte> __pyx_result, __pyx_state)
13315  *     return __pyx_result
13316  */
13317   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
13318   __pyx_t_6 = (__pyx_t_1 != 0);
13319   if (__pyx_t_6) {
13320 
13321     /* "(tree fragment)":9
13322  *     __pyx_result = InterCoeffCte.__new__(__pyx_type)
13323  *     if __pyx_state is not None:
13324  *         __pyx_unpickle_InterCoeffCte__set_state(<InterCoeffCte> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
13325  *     return __pyx_result
13326  * cdef __pyx_unpickle_InterCoeffCte__set_state(InterCoeffCte __pyx_result, tuple __pyx_state):
13327  */
13328     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
13329     __pyx_t_3 = __pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_InterCoeffCte__set_state(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
13330     __Pyx_GOTREF(__pyx_t_3);
13331     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13332 
13333     /* "(tree fragment)":8
13334  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x94db4ad = (M, _args, _num_ops, dt, n_t, tlist, y))" % __pyx_checksum)
13335  *     __pyx_result = InterCoeffCte.__new__(__pyx_type)
13336  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
13337  *         __pyx_unpickle_InterCoeffCte__set_state(<InterCoeffCte> __pyx_result, __pyx_state)
13338  *     return __pyx_result
13339  */
13340   }
13341 
13342   /* "(tree fragment)":10
13343  *     if __pyx_state is not None:
13344  *         __pyx_unpickle_InterCoeffCte__set_state(<InterCoeffCte> __pyx_result, __pyx_state)
13345  *     return __pyx_result             # <<<<<<<<<<<<<<
13346  * cdef __pyx_unpickle_InterCoeffCte__set_state(InterCoeffCte __pyx_result, tuple __pyx_state):
13347  *     __pyx_result.M = __pyx_state[0]; __pyx_result._args = __pyx_state[1]; __pyx_result._num_ops = __pyx_state[2]; __pyx_result.dt = __pyx_state[3]; __pyx_result.n_t = __pyx_state[4]; __pyx_result.tlist = __pyx_state[5]; __pyx_result.y = __pyx_state[6]
13348  */
13349   __Pyx_XDECREF(__pyx_r);
13350   __Pyx_INCREF(__pyx_v___pyx_result);
13351   __pyx_r = __pyx_v___pyx_result;
13352   goto __pyx_L0;
13353 
13354   /* "(tree fragment)":1
13355  * def __pyx_unpickle_InterCoeffCte(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
13356  *     cdef object __pyx_PickleError
13357  *     cdef object __pyx_result
13358  */
13359 
13360   /* function exit code */
13361   __pyx_L1_error:;
13362   __Pyx_XDECREF(__pyx_t_2);
13363   __Pyx_XDECREF(__pyx_t_3);
13364   __Pyx_XDECREF(__pyx_t_4);
13365   __Pyx_XDECREF(__pyx_t_5);
13366   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.__pyx_unpickle_InterCoeffCte", __pyx_clineno, __pyx_lineno, __pyx_filename);
13367   __pyx_r = NULL;
13368   __pyx_L0:;
13369   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
13370   __Pyx_XDECREF(__pyx_v___pyx_result);
13371   __Pyx_XGIVEREF(__pyx_r);
13372   __Pyx_RefNannyFinishContext();
13373   return __pyx_r;
13374 }
13375 
13376 /* "(tree fragment)":11
13377  *         __pyx_unpickle_InterCoeffCte__set_state(<InterCoeffCte> __pyx_result, __pyx_state)
13378  *     return __pyx_result
13379  * cdef __pyx_unpickle_InterCoeffCte__set_state(InterCoeffCte __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
13380  *     __pyx_result.M = __pyx_state[0]; __pyx_result._args = __pyx_state[1]; __pyx_result._num_ops = __pyx_state[2]; __pyx_result.dt = __pyx_state[3]; __pyx_result.n_t = __pyx_state[4]; __pyx_result.tlist = __pyx_state[5]; __pyx_result.y = __pyx_state[6]
13381  *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
13382  */
13383 
__pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_InterCoeffCte__set_state(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)13384 static PyObject *__pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_InterCoeffCte__set_state(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
13385   PyObject *__pyx_r = NULL;
13386   __Pyx_RefNannyDeclarations
13387   PyObject *__pyx_t_1 = NULL;
13388   __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
13389   int __pyx_t_3;
13390   double __pyx_t_4;
13391   __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
13392   int __pyx_t_6;
13393   Py_ssize_t __pyx_t_7;
13394   int __pyx_t_8;
13395   int __pyx_t_9;
13396   PyObject *__pyx_t_10 = NULL;
13397   PyObject *__pyx_t_11 = NULL;
13398   PyObject *__pyx_t_12 = NULL;
13399   int __pyx_lineno = 0;
13400   const char *__pyx_filename = NULL;
13401   int __pyx_clineno = 0;
13402   __Pyx_RefNannySetupContext("__pyx_unpickle_InterCoeffCte__set_state", 0);
13403 
13404   /* "(tree fragment)":12
13405  *     return __pyx_result
13406  * cdef __pyx_unpickle_InterCoeffCte__set_state(InterCoeffCte __pyx_result, tuple __pyx_state):
13407  *     __pyx_result.M = __pyx_state[0]; __pyx_result._args = __pyx_state[1]; __pyx_result._num_ops = __pyx_state[2]; __pyx_result.dt = __pyx_state[3]; __pyx_result.n_t = __pyx_state[4]; __pyx_result.tlist = __pyx_state[5]; __pyx_result.y = __pyx_state[6]             # <<<<<<<<<<<<<<
13408  *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
13409  *         __pyx_result.__dict__.update(__pyx_state[7])
13410  */
13411   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13412     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13413     __PYX_ERR(1, 12, __pyx_L1_error)
13414   }
13415   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
13416   __Pyx_GOTREF(__pyx_t_1);
13417   __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
13418   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13419   __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->M, 0);
13420   __pyx_v___pyx_result->M = __pyx_t_2;
13421   __pyx_t_2.memview = NULL;
13422   __pyx_t_2.data = NULL;
13423   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13424     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13425     __PYX_ERR(1, 12, __pyx_L1_error)
13426   }
13427   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
13428   __Pyx_GOTREF(__pyx_t_1);
13429   if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
13430   __Pyx_GIVEREF(__pyx_t_1);
13431   __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base._args);
13432   __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base._args);
13433   __pyx_v___pyx_result->__pyx_base._args = ((PyObject*)__pyx_t_1);
13434   __pyx_t_1 = 0;
13435   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13436     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13437     __PYX_ERR(1, 12, __pyx_L1_error)
13438   }
13439   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
13440   __Pyx_GOTREF(__pyx_t_1);
13441   __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
13442   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13443   __pyx_v___pyx_result->__pyx_base._num_ops = __pyx_t_3;
13444   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13445     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13446     __PYX_ERR(1, 12, __pyx_L1_error)
13447   }
13448   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
13449   __Pyx_GOTREF(__pyx_t_1);
13450   __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
13451   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13452   __pyx_v___pyx_result->dt = __pyx_t_4;
13453   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13454     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13455     __PYX_ERR(1, 12, __pyx_L1_error)
13456   }
13457   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
13458   __Pyx_GOTREF(__pyx_t_1);
13459   __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
13460   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13461   __pyx_v___pyx_result->n_t = __pyx_t_3;
13462   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13463     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13464     __PYX_ERR(1, 12, __pyx_L1_error)
13465   }
13466   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
13467   __Pyx_GOTREF(__pyx_t_1);
13468   __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
13469   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13470   __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->tlist, 0);
13471   __pyx_v___pyx_result->tlist = __pyx_t_5;
13472   __pyx_t_5.memview = NULL;
13473   __pyx_t_5.data = NULL;
13474   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13475     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13476     __PYX_ERR(1, 12, __pyx_L1_error)
13477   }
13478   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
13479   __Pyx_GOTREF(__pyx_t_1);
13480   __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
13481   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13482   __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->y, 0);
13483   __pyx_v___pyx_result->y = __pyx_t_2;
13484   __pyx_t_2.memview = NULL;
13485   __pyx_t_2.data = NULL;
13486 
13487   /* "(tree fragment)":13
13488  * cdef __pyx_unpickle_InterCoeffCte__set_state(InterCoeffCte __pyx_result, tuple __pyx_state):
13489  *     __pyx_result.M = __pyx_state[0]; __pyx_result._args = __pyx_state[1]; __pyx_result._num_ops = __pyx_state[2]; __pyx_result.dt = __pyx_state[3]; __pyx_result.n_t = __pyx_state[4]; __pyx_result.tlist = __pyx_state[5]; __pyx_result.y = __pyx_state[6]
13490  *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
13491  *         __pyx_result.__dict__.update(__pyx_state[7])
13492  */
13493   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13494     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
13495     __PYX_ERR(1, 13, __pyx_L1_error)
13496   }
13497   __pyx_t_7 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
13498   __pyx_t_8 = ((__pyx_t_7 > 7) != 0);
13499   if (__pyx_t_8) {
13500   } else {
13501     __pyx_t_6 = __pyx_t_8;
13502     goto __pyx_L4_bool_binop_done;
13503   }
13504   __pyx_t_8 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
13505   __pyx_t_9 = (__pyx_t_8 != 0);
13506   __pyx_t_6 = __pyx_t_9;
13507   __pyx_L4_bool_binop_done:;
13508   if (__pyx_t_6) {
13509 
13510     /* "(tree fragment)":14
13511  *     __pyx_result.M = __pyx_state[0]; __pyx_result._args = __pyx_state[1]; __pyx_result._num_ops = __pyx_state[2]; __pyx_result.dt = __pyx_state[3]; __pyx_result.n_t = __pyx_state[4]; __pyx_result.tlist = __pyx_state[5]; __pyx_result.y = __pyx_state[6]
13512  *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
13513  *         __pyx_result.__dict__.update(__pyx_state[7])             # <<<<<<<<<<<<<<
13514  */
13515     __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 14, __pyx_L1_error)
13516     __Pyx_GOTREF(__pyx_t_10);
13517     __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_update); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 14, __pyx_L1_error)
13518     __Pyx_GOTREF(__pyx_t_11);
13519     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13520     if (unlikely(__pyx_v___pyx_state == Py_None)) {
13521       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13522       __PYX_ERR(1, 14, __pyx_L1_error)
13523     }
13524     __pyx_t_10 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 14, __pyx_L1_error)
13525     __Pyx_GOTREF(__pyx_t_10);
13526     __pyx_t_12 = NULL;
13527     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
13528       __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
13529       if (likely(__pyx_t_12)) {
13530         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
13531         __Pyx_INCREF(__pyx_t_12);
13532         __Pyx_INCREF(function);
13533         __Pyx_DECREF_SET(__pyx_t_11, function);
13534       }
13535     }
13536     __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_10);
13537     __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
13538     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13539     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
13540     __Pyx_GOTREF(__pyx_t_1);
13541     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13542     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13543 
13544     /* "(tree fragment)":13
13545  * cdef __pyx_unpickle_InterCoeffCte__set_state(InterCoeffCte __pyx_result, tuple __pyx_state):
13546  *     __pyx_result.M = __pyx_state[0]; __pyx_result._args = __pyx_state[1]; __pyx_result._num_ops = __pyx_state[2]; __pyx_result.dt = __pyx_state[3]; __pyx_result.n_t = __pyx_state[4]; __pyx_result.tlist = __pyx_state[5]; __pyx_result.y = __pyx_state[6]
13547  *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
13548  *         __pyx_result.__dict__.update(__pyx_state[7])
13549  */
13550   }
13551 
13552   /* "(tree fragment)":11
13553  *         __pyx_unpickle_InterCoeffCte__set_state(<InterCoeffCte> __pyx_result, __pyx_state)
13554  *     return __pyx_result
13555  * cdef __pyx_unpickle_InterCoeffCte__set_state(InterCoeffCte __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
13556  *     __pyx_result.M = __pyx_state[0]; __pyx_result._args = __pyx_state[1]; __pyx_result._num_ops = __pyx_state[2]; __pyx_result.dt = __pyx_state[3]; __pyx_result.n_t = __pyx_state[4]; __pyx_result.tlist = __pyx_state[5]; __pyx_result.y = __pyx_state[6]
13557  *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
13558  */
13559 
13560   /* function exit code */
13561   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13562   goto __pyx_L0;
13563   __pyx_L1_error:;
13564   __Pyx_XDECREF(__pyx_t_1);
13565   __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
13566   __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
13567   __Pyx_XDECREF(__pyx_t_10);
13568   __Pyx_XDECREF(__pyx_t_11);
13569   __Pyx_XDECREF(__pyx_t_12);
13570   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.__pyx_unpickle_InterCoeffCte__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
13571   __pyx_r = 0;
13572   __pyx_L0:;
13573   __Pyx_XGIVEREF(__pyx_r);
13574   __Pyx_RefNannyFinishContext();
13575   return __pyx_r;
13576 }
13577 
13578 /* "(tree fragment)":1
13579  * def __pyx_unpickle_InterCoeffT(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
13580  *     cdef object __pyx_PickleError
13581  *     cdef object __pyx_result
13582  */
13583 
13584 /* Python wrapper */
13585 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_7__pyx_unpickle_InterCoeffT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
13586 static PyMethodDef __pyx_mdef_5qutip_2cy_15cqobjevo_factor_7__pyx_unpickle_InterCoeffT = {"__pyx_unpickle_InterCoeffT", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5qutip_2cy_15cqobjevo_factor_7__pyx_unpickle_InterCoeffT, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_5qutip_2cy_15cqobjevo_factor_7__pyx_unpickle_InterCoeffT(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)13587 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_7__pyx_unpickle_InterCoeffT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13588   PyObject *__pyx_v___pyx_type = 0;
13589   long __pyx_v___pyx_checksum;
13590   PyObject *__pyx_v___pyx_state = 0;
13591   int __pyx_lineno = 0;
13592   const char *__pyx_filename = NULL;
13593   int __pyx_clineno = 0;
13594   PyObject *__pyx_r = 0;
13595   __Pyx_RefNannyDeclarations
13596   __Pyx_RefNannySetupContext("__pyx_unpickle_InterCoeffT (wrapper)", 0);
13597   {
13598     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
13599     PyObject* values[3] = {0,0,0};
13600     if (unlikely(__pyx_kwds)) {
13601       Py_ssize_t kw_args;
13602       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13603       switch (pos_args) {
13604         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13605         CYTHON_FALLTHROUGH;
13606         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13607         CYTHON_FALLTHROUGH;
13608         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13609         CYTHON_FALLTHROUGH;
13610         case  0: break;
13611         default: goto __pyx_L5_argtuple_error;
13612       }
13613       kw_args = PyDict_Size(__pyx_kwds);
13614       switch (pos_args) {
13615         case  0:
13616         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
13617         else goto __pyx_L5_argtuple_error;
13618         CYTHON_FALLTHROUGH;
13619         case  1:
13620         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
13621         else {
13622           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_InterCoeffT", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
13623         }
13624         CYTHON_FALLTHROUGH;
13625         case  2:
13626         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
13627         else {
13628           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_InterCoeffT", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
13629         }
13630       }
13631       if (unlikely(kw_args > 0)) {
13632         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_InterCoeffT") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
13633       }
13634     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
13635       goto __pyx_L5_argtuple_error;
13636     } else {
13637       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13638       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13639       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13640     }
13641     __pyx_v___pyx_type = values[0];
13642     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
13643     __pyx_v___pyx_state = values[2];
13644   }
13645   goto __pyx_L4_argument_unpacking_done;
13646   __pyx_L5_argtuple_error:;
13647   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_InterCoeffT", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
13648   __pyx_L3_error:;
13649   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.__pyx_unpickle_InterCoeffT", __pyx_clineno, __pyx_lineno, __pyx_filename);
13650   __Pyx_RefNannyFinishContext();
13651   return NULL;
13652   __pyx_L4_argument_unpacking_done:;
13653   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_6__pyx_unpickle_InterCoeffT(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
13654 
13655   /* function exit code */
13656   __Pyx_RefNannyFinishContext();
13657   return __pyx_r;
13658 }
13659 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_6__pyx_unpickle_InterCoeffT(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)13660 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_6__pyx_unpickle_InterCoeffT(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
13661   PyObject *__pyx_v___pyx_PickleError = 0;
13662   PyObject *__pyx_v___pyx_result = 0;
13663   PyObject *__pyx_r = NULL;
13664   __Pyx_RefNannyDeclarations
13665   int __pyx_t_1;
13666   PyObject *__pyx_t_2 = NULL;
13667   PyObject *__pyx_t_3 = NULL;
13668   PyObject *__pyx_t_4 = NULL;
13669   PyObject *__pyx_t_5 = NULL;
13670   int __pyx_t_6;
13671   int __pyx_lineno = 0;
13672   const char *__pyx_filename = NULL;
13673   int __pyx_clineno = 0;
13674   __Pyx_RefNannySetupContext("__pyx_unpickle_InterCoeffT", 0);
13675 
13676   /* "(tree fragment)":4
13677  *     cdef object __pyx_PickleError
13678  *     cdef object __pyx_result
13679  *     if __pyx_checksum != 0x94db4ad:             # <<<<<<<<<<<<<<
13680  *         from pickle import PickleError as __pyx_PickleError
13681  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x94db4ad = (M, _args, _num_ops, dt, n_t, tlist, y))" % __pyx_checksum)
13682  */
13683   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x94db4ad) != 0);
13684   if (__pyx_t_1) {
13685 
13686     /* "(tree fragment)":5
13687  *     cdef object __pyx_result
13688  *     if __pyx_checksum != 0x94db4ad:
13689  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
13690  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x94db4ad = (M, _args, _num_ops, dt, n_t, tlist, y))" % __pyx_checksum)
13691  *     __pyx_result = InterCoeffT.__new__(__pyx_type)
13692  */
13693     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
13694     __Pyx_GOTREF(__pyx_t_2);
13695     __Pyx_INCREF(__pyx_n_s_PickleError);
13696     __Pyx_GIVEREF(__pyx_n_s_PickleError);
13697     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
13698     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
13699     __Pyx_GOTREF(__pyx_t_3);
13700     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13701     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
13702     __Pyx_GOTREF(__pyx_t_2);
13703     __Pyx_INCREF(__pyx_t_2);
13704     __pyx_v___pyx_PickleError = __pyx_t_2;
13705     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13706     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13707 
13708     /* "(tree fragment)":6
13709  *     if __pyx_checksum != 0x94db4ad:
13710  *         from pickle import PickleError as __pyx_PickleError
13711  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x94db4ad = (M, _args, _num_ops, dt, n_t, tlist, y))" % __pyx_checksum)             # <<<<<<<<<<<<<<
13712  *     __pyx_result = InterCoeffT.__new__(__pyx_type)
13713  *     if __pyx_state is not None:
13714  */
13715     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
13716     __Pyx_GOTREF(__pyx_t_2);
13717     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x94, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
13718     __Pyx_GOTREF(__pyx_t_4);
13719     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13720     __Pyx_INCREF(__pyx_v___pyx_PickleError);
13721     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
13722     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
13723       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
13724       if (likely(__pyx_t_5)) {
13725         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
13726         __Pyx_INCREF(__pyx_t_5);
13727         __Pyx_INCREF(function);
13728         __Pyx_DECREF_SET(__pyx_t_2, function);
13729       }
13730     }
13731     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
13732     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13733     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13734     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
13735     __Pyx_GOTREF(__pyx_t_3);
13736     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13737     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13738     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13739     __PYX_ERR(1, 6, __pyx_L1_error)
13740 
13741     /* "(tree fragment)":4
13742  *     cdef object __pyx_PickleError
13743  *     cdef object __pyx_result
13744  *     if __pyx_checksum != 0x94db4ad:             # <<<<<<<<<<<<<<
13745  *         from pickle import PickleError as __pyx_PickleError
13746  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x94db4ad = (M, _args, _num_ops, dt, n_t, tlist, y))" % __pyx_checksum)
13747  */
13748   }
13749 
13750   /* "(tree fragment)":7
13751  *         from pickle import PickleError as __pyx_PickleError
13752  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x94db4ad = (M, _args, _num_ops, dt, n_t, tlist, y))" % __pyx_checksum)
13753  *     __pyx_result = InterCoeffT.__new__(__pyx_type)             # <<<<<<<<<<<<<<
13754  *     if __pyx_state is not None:
13755  *         __pyx_unpickle_InterCoeffT__set_state(<InterCoeffT> __pyx_result, __pyx_state)
13756  */
13757   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5qutip_2cy_15cqobjevo_factor_InterCoeffT), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
13758   __Pyx_GOTREF(__pyx_t_2);
13759   __pyx_t_4 = NULL;
13760   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
13761     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
13762     if (likely(__pyx_t_4)) {
13763       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
13764       __Pyx_INCREF(__pyx_t_4);
13765       __Pyx_INCREF(function);
13766       __Pyx_DECREF_SET(__pyx_t_2, function);
13767     }
13768   }
13769   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
13770   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13771   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
13772   __Pyx_GOTREF(__pyx_t_3);
13773   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13774   __pyx_v___pyx_result = __pyx_t_3;
13775   __pyx_t_3 = 0;
13776 
13777   /* "(tree fragment)":8
13778  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x94db4ad = (M, _args, _num_ops, dt, n_t, tlist, y))" % __pyx_checksum)
13779  *     __pyx_result = InterCoeffT.__new__(__pyx_type)
13780  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
13781  *         __pyx_unpickle_InterCoeffT__set_state(<InterCoeffT> __pyx_result, __pyx_state)
13782  *     return __pyx_result
13783  */
13784   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
13785   __pyx_t_6 = (__pyx_t_1 != 0);
13786   if (__pyx_t_6) {
13787 
13788     /* "(tree fragment)":9
13789  *     __pyx_result = InterCoeffT.__new__(__pyx_type)
13790  *     if __pyx_state is not None:
13791  *         __pyx_unpickle_InterCoeffT__set_state(<InterCoeffT> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
13792  *     return __pyx_result
13793  * cdef __pyx_unpickle_InterCoeffT__set_state(InterCoeffT __pyx_result, tuple __pyx_state):
13794  */
13795     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
13796     __pyx_t_3 = __pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_InterCoeffT__set_state(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
13797     __Pyx_GOTREF(__pyx_t_3);
13798     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13799 
13800     /* "(tree fragment)":8
13801  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x94db4ad = (M, _args, _num_ops, dt, n_t, tlist, y))" % __pyx_checksum)
13802  *     __pyx_result = InterCoeffT.__new__(__pyx_type)
13803  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
13804  *         __pyx_unpickle_InterCoeffT__set_state(<InterCoeffT> __pyx_result, __pyx_state)
13805  *     return __pyx_result
13806  */
13807   }
13808 
13809   /* "(tree fragment)":10
13810  *     if __pyx_state is not None:
13811  *         __pyx_unpickle_InterCoeffT__set_state(<InterCoeffT> __pyx_result, __pyx_state)
13812  *     return __pyx_result             # <<<<<<<<<<<<<<
13813  * cdef __pyx_unpickle_InterCoeffT__set_state(InterCoeffT __pyx_result, tuple __pyx_state):
13814  *     __pyx_result.M = __pyx_state[0]; __pyx_result._args = __pyx_state[1]; __pyx_result._num_ops = __pyx_state[2]; __pyx_result.dt = __pyx_state[3]; __pyx_result.n_t = __pyx_state[4]; __pyx_result.tlist = __pyx_state[5]; __pyx_result.y = __pyx_state[6]
13815  */
13816   __Pyx_XDECREF(__pyx_r);
13817   __Pyx_INCREF(__pyx_v___pyx_result);
13818   __pyx_r = __pyx_v___pyx_result;
13819   goto __pyx_L0;
13820 
13821   /* "(tree fragment)":1
13822  * def __pyx_unpickle_InterCoeffT(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
13823  *     cdef object __pyx_PickleError
13824  *     cdef object __pyx_result
13825  */
13826 
13827   /* function exit code */
13828   __pyx_L1_error:;
13829   __Pyx_XDECREF(__pyx_t_2);
13830   __Pyx_XDECREF(__pyx_t_3);
13831   __Pyx_XDECREF(__pyx_t_4);
13832   __Pyx_XDECREF(__pyx_t_5);
13833   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.__pyx_unpickle_InterCoeffT", __pyx_clineno, __pyx_lineno, __pyx_filename);
13834   __pyx_r = NULL;
13835   __pyx_L0:;
13836   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
13837   __Pyx_XDECREF(__pyx_v___pyx_result);
13838   __Pyx_XGIVEREF(__pyx_r);
13839   __Pyx_RefNannyFinishContext();
13840   return __pyx_r;
13841 }
13842 
13843 /* "(tree fragment)":11
13844  *         __pyx_unpickle_InterCoeffT__set_state(<InterCoeffT> __pyx_result, __pyx_state)
13845  *     return __pyx_result
13846  * cdef __pyx_unpickle_InterCoeffT__set_state(InterCoeffT __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
13847  *     __pyx_result.M = __pyx_state[0]; __pyx_result._args = __pyx_state[1]; __pyx_result._num_ops = __pyx_state[2]; __pyx_result.dt = __pyx_state[3]; __pyx_result.n_t = __pyx_state[4]; __pyx_result.tlist = __pyx_state[5]; __pyx_result.y = __pyx_state[6]
13848  *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
13849  */
13850 
__pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_InterCoeffT__set_state(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)13851 static PyObject *__pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_InterCoeffT__set_state(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
13852   PyObject *__pyx_r = NULL;
13853   __Pyx_RefNannyDeclarations
13854   PyObject *__pyx_t_1 = NULL;
13855   __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
13856   int __pyx_t_3;
13857   double __pyx_t_4;
13858   __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
13859   int __pyx_t_6;
13860   Py_ssize_t __pyx_t_7;
13861   int __pyx_t_8;
13862   int __pyx_t_9;
13863   PyObject *__pyx_t_10 = NULL;
13864   PyObject *__pyx_t_11 = NULL;
13865   PyObject *__pyx_t_12 = NULL;
13866   int __pyx_lineno = 0;
13867   const char *__pyx_filename = NULL;
13868   int __pyx_clineno = 0;
13869   __Pyx_RefNannySetupContext("__pyx_unpickle_InterCoeffT__set_state", 0);
13870 
13871   /* "(tree fragment)":12
13872  *     return __pyx_result
13873  * cdef __pyx_unpickle_InterCoeffT__set_state(InterCoeffT __pyx_result, tuple __pyx_state):
13874  *     __pyx_result.M = __pyx_state[0]; __pyx_result._args = __pyx_state[1]; __pyx_result._num_ops = __pyx_state[2]; __pyx_result.dt = __pyx_state[3]; __pyx_result.n_t = __pyx_state[4]; __pyx_result.tlist = __pyx_state[5]; __pyx_result.y = __pyx_state[6]             # <<<<<<<<<<<<<<
13875  *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
13876  *         __pyx_result.__dict__.update(__pyx_state[7])
13877  */
13878   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13879     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13880     __PYX_ERR(1, 12, __pyx_L1_error)
13881   }
13882   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
13883   __Pyx_GOTREF(__pyx_t_1);
13884   __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
13885   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13886   __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->M, 0);
13887   __pyx_v___pyx_result->M = __pyx_t_2;
13888   __pyx_t_2.memview = NULL;
13889   __pyx_t_2.data = NULL;
13890   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13891     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13892     __PYX_ERR(1, 12, __pyx_L1_error)
13893   }
13894   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
13895   __Pyx_GOTREF(__pyx_t_1);
13896   if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
13897   __Pyx_GIVEREF(__pyx_t_1);
13898   __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base._args);
13899   __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base._args);
13900   __pyx_v___pyx_result->__pyx_base._args = ((PyObject*)__pyx_t_1);
13901   __pyx_t_1 = 0;
13902   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13903     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13904     __PYX_ERR(1, 12, __pyx_L1_error)
13905   }
13906   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
13907   __Pyx_GOTREF(__pyx_t_1);
13908   __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
13909   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13910   __pyx_v___pyx_result->__pyx_base._num_ops = __pyx_t_3;
13911   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13912     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13913     __PYX_ERR(1, 12, __pyx_L1_error)
13914   }
13915   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
13916   __Pyx_GOTREF(__pyx_t_1);
13917   __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
13918   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13919   __pyx_v___pyx_result->dt = __pyx_t_4;
13920   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13921     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13922     __PYX_ERR(1, 12, __pyx_L1_error)
13923   }
13924   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
13925   __Pyx_GOTREF(__pyx_t_1);
13926   __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
13927   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13928   __pyx_v___pyx_result->n_t = __pyx_t_3;
13929   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13930     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13931     __PYX_ERR(1, 12, __pyx_L1_error)
13932   }
13933   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
13934   __Pyx_GOTREF(__pyx_t_1);
13935   __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
13936   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13937   __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->tlist, 0);
13938   __pyx_v___pyx_result->tlist = __pyx_t_5;
13939   __pyx_t_5.memview = NULL;
13940   __pyx_t_5.data = NULL;
13941   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13942     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13943     __PYX_ERR(1, 12, __pyx_L1_error)
13944   }
13945   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
13946   __Pyx_GOTREF(__pyx_t_1);
13947   __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
13948   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13949   __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->y, 0);
13950   __pyx_v___pyx_result->y = __pyx_t_2;
13951   __pyx_t_2.memview = NULL;
13952   __pyx_t_2.data = NULL;
13953 
13954   /* "(tree fragment)":13
13955  * cdef __pyx_unpickle_InterCoeffT__set_state(InterCoeffT __pyx_result, tuple __pyx_state):
13956  *     __pyx_result.M = __pyx_state[0]; __pyx_result._args = __pyx_state[1]; __pyx_result._num_ops = __pyx_state[2]; __pyx_result.dt = __pyx_state[3]; __pyx_result.n_t = __pyx_state[4]; __pyx_result.tlist = __pyx_state[5]; __pyx_result.y = __pyx_state[6]
13957  *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
13958  *         __pyx_result.__dict__.update(__pyx_state[7])
13959  */
13960   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13961     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
13962     __PYX_ERR(1, 13, __pyx_L1_error)
13963   }
13964   __pyx_t_7 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
13965   __pyx_t_8 = ((__pyx_t_7 > 7) != 0);
13966   if (__pyx_t_8) {
13967   } else {
13968     __pyx_t_6 = __pyx_t_8;
13969     goto __pyx_L4_bool_binop_done;
13970   }
13971   __pyx_t_8 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
13972   __pyx_t_9 = (__pyx_t_8 != 0);
13973   __pyx_t_6 = __pyx_t_9;
13974   __pyx_L4_bool_binop_done:;
13975   if (__pyx_t_6) {
13976 
13977     /* "(tree fragment)":14
13978  *     __pyx_result.M = __pyx_state[0]; __pyx_result._args = __pyx_state[1]; __pyx_result._num_ops = __pyx_state[2]; __pyx_result.dt = __pyx_state[3]; __pyx_result.n_t = __pyx_state[4]; __pyx_result.tlist = __pyx_state[5]; __pyx_result.y = __pyx_state[6]
13979  *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
13980  *         __pyx_result.__dict__.update(__pyx_state[7])             # <<<<<<<<<<<<<<
13981  */
13982     __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 14, __pyx_L1_error)
13983     __Pyx_GOTREF(__pyx_t_10);
13984     __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_update); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 14, __pyx_L1_error)
13985     __Pyx_GOTREF(__pyx_t_11);
13986     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13987     if (unlikely(__pyx_v___pyx_state == Py_None)) {
13988       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13989       __PYX_ERR(1, 14, __pyx_L1_error)
13990     }
13991     __pyx_t_10 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 14, __pyx_L1_error)
13992     __Pyx_GOTREF(__pyx_t_10);
13993     __pyx_t_12 = NULL;
13994     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
13995       __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
13996       if (likely(__pyx_t_12)) {
13997         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
13998         __Pyx_INCREF(__pyx_t_12);
13999         __Pyx_INCREF(function);
14000         __Pyx_DECREF_SET(__pyx_t_11, function);
14001       }
14002     }
14003     __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_10);
14004     __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
14005     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14006     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
14007     __Pyx_GOTREF(__pyx_t_1);
14008     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14009     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14010 
14011     /* "(tree fragment)":13
14012  * cdef __pyx_unpickle_InterCoeffT__set_state(InterCoeffT __pyx_result, tuple __pyx_state):
14013  *     __pyx_result.M = __pyx_state[0]; __pyx_result._args = __pyx_state[1]; __pyx_result._num_ops = __pyx_state[2]; __pyx_result.dt = __pyx_state[3]; __pyx_result.n_t = __pyx_state[4]; __pyx_result.tlist = __pyx_state[5]; __pyx_result.y = __pyx_state[6]
14014  *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
14015  *         __pyx_result.__dict__.update(__pyx_state[7])
14016  */
14017   }
14018 
14019   /* "(tree fragment)":11
14020  *         __pyx_unpickle_InterCoeffT__set_state(<InterCoeffT> __pyx_result, __pyx_state)
14021  *     return __pyx_result
14022  * cdef __pyx_unpickle_InterCoeffT__set_state(InterCoeffT __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
14023  *     __pyx_result.M = __pyx_state[0]; __pyx_result._args = __pyx_state[1]; __pyx_result._num_ops = __pyx_state[2]; __pyx_result.dt = __pyx_state[3]; __pyx_result.n_t = __pyx_state[4]; __pyx_result.tlist = __pyx_state[5]; __pyx_result.y = __pyx_state[6]
14024  *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
14025  */
14026 
14027   /* function exit code */
14028   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14029   goto __pyx_L0;
14030   __pyx_L1_error:;
14031   __Pyx_XDECREF(__pyx_t_1);
14032   __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
14033   __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
14034   __Pyx_XDECREF(__pyx_t_10);
14035   __Pyx_XDECREF(__pyx_t_11);
14036   __Pyx_XDECREF(__pyx_t_12);
14037   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.__pyx_unpickle_InterCoeffT__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
14038   __pyx_r = 0;
14039   __pyx_L0:;
14040   __Pyx_XGIVEREF(__pyx_r);
14041   __Pyx_RefNannyFinishContext();
14042   return __pyx_r;
14043 }
14044 
14045 /* "(tree fragment)":1
14046  * def __pyx_unpickle_StepCoeff(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
14047  *     cdef object __pyx_PickleError
14048  *     cdef object __pyx_result
14049  */
14050 
14051 /* Python wrapper */
14052 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_9__pyx_unpickle_StepCoeff(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
14053 static PyMethodDef __pyx_mdef_5qutip_2cy_15cqobjevo_factor_9__pyx_unpickle_StepCoeff = {"__pyx_unpickle_StepCoeff", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5qutip_2cy_15cqobjevo_factor_9__pyx_unpickle_StepCoeff, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_5qutip_2cy_15cqobjevo_factor_9__pyx_unpickle_StepCoeff(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)14054 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_9__pyx_unpickle_StepCoeff(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14055   PyObject *__pyx_v___pyx_type = 0;
14056   long __pyx_v___pyx_checksum;
14057   PyObject *__pyx_v___pyx_state = 0;
14058   int __pyx_lineno = 0;
14059   const char *__pyx_filename = NULL;
14060   int __pyx_clineno = 0;
14061   PyObject *__pyx_r = 0;
14062   __Pyx_RefNannyDeclarations
14063   __Pyx_RefNannySetupContext("__pyx_unpickle_StepCoeff (wrapper)", 0);
14064   {
14065     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
14066     PyObject* values[3] = {0,0,0};
14067     if (unlikely(__pyx_kwds)) {
14068       Py_ssize_t kw_args;
14069       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14070       switch (pos_args) {
14071         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14072         CYTHON_FALLTHROUGH;
14073         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14074         CYTHON_FALLTHROUGH;
14075         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14076         CYTHON_FALLTHROUGH;
14077         case  0: break;
14078         default: goto __pyx_L5_argtuple_error;
14079       }
14080       kw_args = PyDict_Size(__pyx_kwds);
14081       switch (pos_args) {
14082         case  0:
14083         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
14084         else goto __pyx_L5_argtuple_error;
14085         CYTHON_FALLTHROUGH;
14086         case  1:
14087         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
14088         else {
14089           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_StepCoeff", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
14090         }
14091         CYTHON_FALLTHROUGH;
14092         case  2:
14093         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
14094         else {
14095           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_StepCoeff", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
14096         }
14097       }
14098       if (unlikely(kw_args > 0)) {
14099         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_StepCoeff") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
14100       }
14101     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
14102       goto __pyx_L5_argtuple_error;
14103     } else {
14104       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14105       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14106       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14107     }
14108     __pyx_v___pyx_type = values[0];
14109     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
14110     __pyx_v___pyx_state = values[2];
14111   }
14112   goto __pyx_L4_argument_unpacking_done;
14113   __pyx_L5_argtuple_error:;
14114   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_StepCoeff", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
14115   __pyx_L3_error:;
14116   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.__pyx_unpickle_StepCoeff", __pyx_clineno, __pyx_lineno, __pyx_filename);
14117   __Pyx_RefNannyFinishContext();
14118   return NULL;
14119   __pyx_L4_argument_unpacking_done:;
14120   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_8__pyx_unpickle_StepCoeff(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
14121 
14122   /* function exit code */
14123   __Pyx_RefNannyFinishContext();
14124   return __pyx_r;
14125 }
14126 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_8__pyx_unpickle_StepCoeff(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)14127 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_8__pyx_unpickle_StepCoeff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
14128   PyObject *__pyx_v___pyx_PickleError = 0;
14129   PyObject *__pyx_v___pyx_result = 0;
14130   PyObject *__pyx_r = NULL;
14131   __Pyx_RefNannyDeclarations
14132   int __pyx_t_1;
14133   PyObject *__pyx_t_2 = NULL;
14134   PyObject *__pyx_t_3 = NULL;
14135   PyObject *__pyx_t_4 = NULL;
14136   PyObject *__pyx_t_5 = NULL;
14137   int __pyx_t_6;
14138   int __pyx_lineno = 0;
14139   const char *__pyx_filename = NULL;
14140   int __pyx_clineno = 0;
14141   __Pyx_RefNannySetupContext("__pyx_unpickle_StepCoeff", 0);
14142 
14143   /* "(tree fragment)":4
14144  *     cdef object __pyx_PickleError
14145  *     cdef object __pyx_result
14146  *     if __pyx_checksum != 0x778091c:             # <<<<<<<<<<<<<<
14147  *         from pickle import PickleError as __pyx_PickleError
14148  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x778091c = (_args, _num_ops, n_t, tlist, y))" % __pyx_checksum)
14149  */
14150   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x778091c) != 0);
14151   if (__pyx_t_1) {
14152 
14153     /* "(tree fragment)":5
14154  *     cdef object __pyx_result
14155  *     if __pyx_checksum != 0x778091c:
14156  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
14157  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x778091c = (_args, _num_ops, n_t, tlist, y))" % __pyx_checksum)
14158  *     __pyx_result = StepCoeff.__new__(__pyx_type)
14159  */
14160     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
14161     __Pyx_GOTREF(__pyx_t_2);
14162     __Pyx_INCREF(__pyx_n_s_PickleError);
14163     __Pyx_GIVEREF(__pyx_n_s_PickleError);
14164     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
14165     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
14166     __Pyx_GOTREF(__pyx_t_3);
14167     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14168     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
14169     __Pyx_GOTREF(__pyx_t_2);
14170     __Pyx_INCREF(__pyx_t_2);
14171     __pyx_v___pyx_PickleError = __pyx_t_2;
14172     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14173     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14174 
14175     /* "(tree fragment)":6
14176  *     if __pyx_checksum != 0x778091c:
14177  *         from pickle import PickleError as __pyx_PickleError
14178  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x778091c = (_args, _num_ops, n_t, tlist, y))" % __pyx_checksum)             # <<<<<<<<<<<<<<
14179  *     __pyx_result = StepCoeff.__new__(__pyx_type)
14180  *     if __pyx_state is not None:
14181  */
14182     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
14183     __Pyx_GOTREF(__pyx_t_2);
14184     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x77, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
14185     __Pyx_GOTREF(__pyx_t_4);
14186     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14187     __Pyx_INCREF(__pyx_v___pyx_PickleError);
14188     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
14189     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
14190       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
14191       if (likely(__pyx_t_5)) {
14192         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
14193         __Pyx_INCREF(__pyx_t_5);
14194         __Pyx_INCREF(function);
14195         __Pyx_DECREF_SET(__pyx_t_2, function);
14196       }
14197     }
14198     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
14199     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14200     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14201     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
14202     __Pyx_GOTREF(__pyx_t_3);
14203     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14204     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
14205     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14206     __PYX_ERR(1, 6, __pyx_L1_error)
14207 
14208     /* "(tree fragment)":4
14209  *     cdef object __pyx_PickleError
14210  *     cdef object __pyx_result
14211  *     if __pyx_checksum != 0x778091c:             # <<<<<<<<<<<<<<
14212  *         from pickle import PickleError as __pyx_PickleError
14213  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x778091c = (_args, _num_ops, n_t, tlist, y))" % __pyx_checksum)
14214  */
14215   }
14216 
14217   /* "(tree fragment)":7
14218  *         from pickle import PickleError as __pyx_PickleError
14219  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x778091c = (_args, _num_ops, n_t, tlist, y))" % __pyx_checksum)
14220  *     __pyx_result = StepCoeff.__new__(__pyx_type)             # <<<<<<<<<<<<<<
14221  *     if __pyx_state is not None:
14222  *         __pyx_unpickle_StepCoeff__set_state(<StepCoeff> __pyx_result, __pyx_state)
14223  */
14224   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5qutip_2cy_15cqobjevo_factor_StepCoeff), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
14225   __Pyx_GOTREF(__pyx_t_2);
14226   __pyx_t_4 = NULL;
14227   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
14228     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
14229     if (likely(__pyx_t_4)) {
14230       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
14231       __Pyx_INCREF(__pyx_t_4);
14232       __Pyx_INCREF(function);
14233       __Pyx_DECREF_SET(__pyx_t_2, function);
14234     }
14235   }
14236   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
14237   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14238   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
14239   __Pyx_GOTREF(__pyx_t_3);
14240   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14241   __pyx_v___pyx_result = __pyx_t_3;
14242   __pyx_t_3 = 0;
14243 
14244   /* "(tree fragment)":8
14245  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x778091c = (_args, _num_ops, n_t, tlist, y))" % __pyx_checksum)
14246  *     __pyx_result = StepCoeff.__new__(__pyx_type)
14247  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
14248  *         __pyx_unpickle_StepCoeff__set_state(<StepCoeff> __pyx_result, __pyx_state)
14249  *     return __pyx_result
14250  */
14251   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
14252   __pyx_t_6 = (__pyx_t_1 != 0);
14253   if (__pyx_t_6) {
14254 
14255     /* "(tree fragment)":9
14256  *     __pyx_result = StepCoeff.__new__(__pyx_type)
14257  *     if __pyx_state is not None:
14258  *         __pyx_unpickle_StepCoeff__set_state(<StepCoeff> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
14259  *     return __pyx_result
14260  * cdef __pyx_unpickle_StepCoeff__set_state(StepCoeff __pyx_result, tuple __pyx_state):
14261  */
14262     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
14263     __pyx_t_3 = __pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_StepCoeff__set_state(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
14264     __Pyx_GOTREF(__pyx_t_3);
14265     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14266 
14267     /* "(tree fragment)":8
14268  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x778091c = (_args, _num_ops, n_t, tlist, y))" % __pyx_checksum)
14269  *     __pyx_result = StepCoeff.__new__(__pyx_type)
14270  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
14271  *         __pyx_unpickle_StepCoeff__set_state(<StepCoeff> __pyx_result, __pyx_state)
14272  *     return __pyx_result
14273  */
14274   }
14275 
14276   /* "(tree fragment)":10
14277  *     if __pyx_state is not None:
14278  *         __pyx_unpickle_StepCoeff__set_state(<StepCoeff> __pyx_result, __pyx_state)
14279  *     return __pyx_result             # <<<<<<<<<<<<<<
14280  * cdef __pyx_unpickle_StepCoeff__set_state(StepCoeff __pyx_result, tuple __pyx_state):
14281  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.n_t = __pyx_state[2]; __pyx_result.tlist = __pyx_state[3]; __pyx_result.y = __pyx_state[4]
14282  */
14283   __Pyx_XDECREF(__pyx_r);
14284   __Pyx_INCREF(__pyx_v___pyx_result);
14285   __pyx_r = __pyx_v___pyx_result;
14286   goto __pyx_L0;
14287 
14288   /* "(tree fragment)":1
14289  * def __pyx_unpickle_StepCoeff(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
14290  *     cdef object __pyx_PickleError
14291  *     cdef object __pyx_result
14292  */
14293 
14294   /* function exit code */
14295   __pyx_L1_error:;
14296   __Pyx_XDECREF(__pyx_t_2);
14297   __Pyx_XDECREF(__pyx_t_3);
14298   __Pyx_XDECREF(__pyx_t_4);
14299   __Pyx_XDECREF(__pyx_t_5);
14300   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.__pyx_unpickle_StepCoeff", __pyx_clineno, __pyx_lineno, __pyx_filename);
14301   __pyx_r = NULL;
14302   __pyx_L0:;
14303   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
14304   __Pyx_XDECREF(__pyx_v___pyx_result);
14305   __Pyx_XGIVEREF(__pyx_r);
14306   __Pyx_RefNannyFinishContext();
14307   return __pyx_r;
14308 }
14309 
14310 /* "(tree fragment)":11
14311  *         __pyx_unpickle_StepCoeff__set_state(<StepCoeff> __pyx_result, __pyx_state)
14312  *     return __pyx_result
14313  * cdef __pyx_unpickle_StepCoeff__set_state(StepCoeff __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
14314  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.n_t = __pyx_state[2]; __pyx_result.tlist = __pyx_state[3]; __pyx_result.y = __pyx_state[4]
14315  *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):
14316  */
14317 
__pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_StepCoeff__set_state(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)14318 static PyObject *__pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_StepCoeff__set_state(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
14319   PyObject *__pyx_r = NULL;
14320   __Pyx_RefNannyDeclarations
14321   PyObject *__pyx_t_1 = NULL;
14322   int __pyx_t_2;
14323   __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
14324   __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
14325   int __pyx_t_5;
14326   Py_ssize_t __pyx_t_6;
14327   int __pyx_t_7;
14328   int __pyx_t_8;
14329   PyObject *__pyx_t_9 = NULL;
14330   PyObject *__pyx_t_10 = NULL;
14331   PyObject *__pyx_t_11 = NULL;
14332   int __pyx_lineno = 0;
14333   const char *__pyx_filename = NULL;
14334   int __pyx_clineno = 0;
14335   __Pyx_RefNannySetupContext("__pyx_unpickle_StepCoeff__set_state", 0);
14336 
14337   /* "(tree fragment)":12
14338  *     return __pyx_result
14339  * cdef __pyx_unpickle_StepCoeff__set_state(StepCoeff __pyx_result, tuple __pyx_state):
14340  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.n_t = __pyx_state[2]; __pyx_result.tlist = __pyx_state[3]; __pyx_result.y = __pyx_state[4]             # <<<<<<<<<<<<<<
14341  *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):
14342  *         __pyx_result.__dict__.update(__pyx_state[5])
14343  */
14344   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14345     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14346     __PYX_ERR(1, 12, __pyx_L1_error)
14347   }
14348   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
14349   __Pyx_GOTREF(__pyx_t_1);
14350   if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
14351   __Pyx_GIVEREF(__pyx_t_1);
14352   __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base._args);
14353   __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base._args);
14354   __pyx_v___pyx_result->__pyx_base._args = ((PyObject*)__pyx_t_1);
14355   __pyx_t_1 = 0;
14356   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14357     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14358     __PYX_ERR(1, 12, __pyx_L1_error)
14359   }
14360   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
14361   __Pyx_GOTREF(__pyx_t_1);
14362   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
14363   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14364   __pyx_v___pyx_result->__pyx_base._num_ops = __pyx_t_2;
14365   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14366     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14367     __PYX_ERR(1, 12, __pyx_L1_error)
14368   }
14369   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
14370   __Pyx_GOTREF(__pyx_t_1);
14371   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
14372   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14373   __pyx_v___pyx_result->n_t = __pyx_t_2;
14374   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14375     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14376     __PYX_ERR(1, 12, __pyx_L1_error)
14377   }
14378   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
14379   __Pyx_GOTREF(__pyx_t_1);
14380   __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
14381   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14382   __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->tlist, 0);
14383   __pyx_v___pyx_result->tlist = __pyx_t_3;
14384   __pyx_t_3.memview = NULL;
14385   __pyx_t_3.data = NULL;
14386   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14387     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14388     __PYX_ERR(1, 12, __pyx_L1_error)
14389   }
14390   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
14391   __Pyx_GOTREF(__pyx_t_1);
14392   __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
14393   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14394   __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->y, 0);
14395   __pyx_v___pyx_result->y = __pyx_t_4;
14396   __pyx_t_4.memview = NULL;
14397   __pyx_t_4.data = NULL;
14398 
14399   /* "(tree fragment)":13
14400  * cdef __pyx_unpickle_StepCoeff__set_state(StepCoeff __pyx_result, tuple __pyx_state):
14401  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.n_t = __pyx_state[2]; __pyx_result.tlist = __pyx_state[3]; __pyx_result.y = __pyx_state[4]
14402  *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
14403  *         __pyx_result.__dict__.update(__pyx_state[5])
14404  */
14405   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14406     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
14407     __PYX_ERR(1, 13, __pyx_L1_error)
14408   }
14409   __pyx_t_6 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
14410   __pyx_t_7 = ((__pyx_t_6 > 5) != 0);
14411   if (__pyx_t_7) {
14412   } else {
14413     __pyx_t_5 = __pyx_t_7;
14414     goto __pyx_L4_bool_binop_done;
14415   }
14416   __pyx_t_7 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
14417   __pyx_t_8 = (__pyx_t_7 != 0);
14418   __pyx_t_5 = __pyx_t_8;
14419   __pyx_L4_bool_binop_done:;
14420   if (__pyx_t_5) {
14421 
14422     /* "(tree fragment)":14
14423  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.n_t = __pyx_state[2]; __pyx_result.tlist = __pyx_state[3]; __pyx_result.y = __pyx_state[4]
14424  *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):
14425  *         __pyx_result.__dict__.update(__pyx_state[5])             # <<<<<<<<<<<<<<
14426  */
14427     __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
14428     __Pyx_GOTREF(__pyx_t_9);
14429     __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_update); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 14, __pyx_L1_error)
14430     __Pyx_GOTREF(__pyx_t_10);
14431     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14432     if (unlikely(__pyx_v___pyx_state == Py_None)) {
14433       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14434       __PYX_ERR(1, 14, __pyx_L1_error)
14435     }
14436     __pyx_t_9 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
14437     __Pyx_GOTREF(__pyx_t_9);
14438     __pyx_t_11 = NULL;
14439     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
14440       __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
14441       if (likely(__pyx_t_11)) {
14442         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
14443         __Pyx_INCREF(__pyx_t_11);
14444         __Pyx_INCREF(function);
14445         __Pyx_DECREF_SET(__pyx_t_10, function);
14446       }
14447     }
14448     __pyx_t_1 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9);
14449     __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
14450     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14451     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
14452     __Pyx_GOTREF(__pyx_t_1);
14453     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14454     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14455 
14456     /* "(tree fragment)":13
14457  * cdef __pyx_unpickle_StepCoeff__set_state(StepCoeff __pyx_result, tuple __pyx_state):
14458  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.n_t = __pyx_state[2]; __pyx_result.tlist = __pyx_state[3]; __pyx_result.y = __pyx_state[4]
14459  *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
14460  *         __pyx_result.__dict__.update(__pyx_state[5])
14461  */
14462   }
14463 
14464   /* "(tree fragment)":11
14465  *         __pyx_unpickle_StepCoeff__set_state(<StepCoeff> __pyx_result, __pyx_state)
14466  *     return __pyx_result
14467  * cdef __pyx_unpickle_StepCoeff__set_state(StepCoeff __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
14468  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.n_t = __pyx_state[2]; __pyx_result.tlist = __pyx_state[3]; __pyx_result.y = __pyx_state[4]
14469  *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):
14470  */
14471 
14472   /* function exit code */
14473   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14474   goto __pyx_L0;
14475   __pyx_L1_error:;
14476   __Pyx_XDECREF(__pyx_t_1);
14477   __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
14478   __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
14479   __Pyx_XDECREF(__pyx_t_9);
14480   __Pyx_XDECREF(__pyx_t_10);
14481   __Pyx_XDECREF(__pyx_t_11);
14482   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.__pyx_unpickle_StepCoeff__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
14483   __pyx_r = 0;
14484   __pyx_L0:;
14485   __Pyx_XGIVEREF(__pyx_r);
14486   __Pyx_RefNannyFinishContext();
14487   return __pyx_r;
14488 }
14489 
14490 /* "(tree fragment)":1
14491  * def __pyx_unpickle_StepCoeffT(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
14492  *     cdef object __pyx_PickleError
14493  *     cdef object __pyx_result
14494  */
14495 
14496 /* Python wrapper */
14497 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_11__pyx_unpickle_StepCoeffT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
14498 static PyMethodDef __pyx_mdef_5qutip_2cy_15cqobjevo_factor_11__pyx_unpickle_StepCoeffT = {"__pyx_unpickle_StepCoeffT", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5qutip_2cy_15cqobjevo_factor_11__pyx_unpickle_StepCoeffT, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_5qutip_2cy_15cqobjevo_factor_11__pyx_unpickle_StepCoeffT(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)14499 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_11__pyx_unpickle_StepCoeffT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14500   PyObject *__pyx_v___pyx_type = 0;
14501   long __pyx_v___pyx_checksum;
14502   PyObject *__pyx_v___pyx_state = 0;
14503   int __pyx_lineno = 0;
14504   const char *__pyx_filename = NULL;
14505   int __pyx_clineno = 0;
14506   PyObject *__pyx_r = 0;
14507   __Pyx_RefNannyDeclarations
14508   __Pyx_RefNannySetupContext("__pyx_unpickle_StepCoeffT (wrapper)", 0);
14509   {
14510     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
14511     PyObject* values[3] = {0,0,0};
14512     if (unlikely(__pyx_kwds)) {
14513       Py_ssize_t kw_args;
14514       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14515       switch (pos_args) {
14516         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14517         CYTHON_FALLTHROUGH;
14518         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14519         CYTHON_FALLTHROUGH;
14520         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14521         CYTHON_FALLTHROUGH;
14522         case  0: break;
14523         default: goto __pyx_L5_argtuple_error;
14524       }
14525       kw_args = PyDict_Size(__pyx_kwds);
14526       switch (pos_args) {
14527         case  0:
14528         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
14529         else goto __pyx_L5_argtuple_error;
14530         CYTHON_FALLTHROUGH;
14531         case  1:
14532         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
14533         else {
14534           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_StepCoeffT", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
14535         }
14536         CYTHON_FALLTHROUGH;
14537         case  2:
14538         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
14539         else {
14540           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_StepCoeffT", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
14541         }
14542       }
14543       if (unlikely(kw_args > 0)) {
14544         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_StepCoeffT") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
14545       }
14546     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
14547       goto __pyx_L5_argtuple_error;
14548     } else {
14549       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14550       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14551       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14552     }
14553     __pyx_v___pyx_type = values[0];
14554     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
14555     __pyx_v___pyx_state = values[2];
14556   }
14557   goto __pyx_L4_argument_unpacking_done;
14558   __pyx_L5_argtuple_error:;
14559   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_StepCoeffT", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
14560   __pyx_L3_error:;
14561   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.__pyx_unpickle_StepCoeffT", __pyx_clineno, __pyx_lineno, __pyx_filename);
14562   __Pyx_RefNannyFinishContext();
14563   return NULL;
14564   __pyx_L4_argument_unpacking_done:;
14565   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_10__pyx_unpickle_StepCoeffT(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
14566 
14567   /* function exit code */
14568   __Pyx_RefNannyFinishContext();
14569   return __pyx_r;
14570 }
14571 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_10__pyx_unpickle_StepCoeffT(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)14572 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_10__pyx_unpickle_StepCoeffT(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
14573   PyObject *__pyx_v___pyx_PickleError = 0;
14574   PyObject *__pyx_v___pyx_result = 0;
14575   PyObject *__pyx_r = NULL;
14576   __Pyx_RefNannyDeclarations
14577   int __pyx_t_1;
14578   PyObject *__pyx_t_2 = NULL;
14579   PyObject *__pyx_t_3 = NULL;
14580   PyObject *__pyx_t_4 = NULL;
14581   PyObject *__pyx_t_5 = NULL;
14582   int __pyx_t_6;
14583   int __pyx_lineno = 0;
14584   const char *__pyx_filename = NULL;
14585   int __pyx_clineno = 0;
14586   __Pyx_RefNannySetupContext("__pyx_unpickle_StepCoeffT", 0);
14587 
14588   /* "(tree fragment)":4
14589  *     cdef object __pyx_PickleError
14590  *     cdef object __pyx_result
14591  *     if __pyx_checksum != 0x778091c:             # <<<<<<<<<<<<<<
14592  *         from pickle import PickleError as __pyx_PickleError
14593  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x778091c = (_args, _num_ops, n_t, tlist, y))" % __pyx_checksum)
14594  */
14595   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x778091c) != 0);
14596   if (__pyx_t_1) {
14597 
14598     /* "(tree fragment)":5
14599  *     cdef object __pyx_result
14600  *     if __pyx_checksum != 0x778091c:
14601  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
14602  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x778091c = (_args, _num_ops, n_t, tlist, y))" % __pyx_checksum)
14603  *     __pyx_result = StepCoeffT.__new__(__pyx_type)
14604  */
14605     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
14606     __Pyx_GOTREF(__pyx_t_2);
14607     __Pyx_INCREF(__pyx_n_s_PickleError);
14608     __Pyx_GIVEREF(__pyx_n_s_PickleError);
14609     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
14610     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
14611     __Pyx_GOTREF(__pyx_t_3);
14612     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14613     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
14614     __Pyx_GOTREF(__pyx_t_2);
14615     __Pyx_INCREF(__pyx_t_2);
14616     __pyx_v___pyx_PickleError = __pyx_t_2;
14617     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14618     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14619 
14620     /* "(tree fragment)":6
14621  *     if __pyx_checksum != 0x778091c:
14622  *         from pickle import PickleError as __pyx_PickleError
14623  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x778091c = (_args, _num_ops, n_t, tlist, y))" % __pyx_checksum)             # <<<<<<<<<<<<<<
14624  *     __pyx_result = StepCoeffT.__new__(__pyx_type)
14625  *     if __pyx_state is not None:
14626  */
14627     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
14628     __Pyx_GOTREF(__pyx_t_2);
14629     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x77, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
14630     __Pyx_GOTREF(__pyx_t_4);
14631     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14632     __Pyx_INCREF(__pyx_v___pyx_PickleError);
14633     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
14634     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
14635       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
14636       if (likely(__pyx_t_5)) {
14637         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
14638         __Pyx_INCREF(__pyx_t_5);
14639         __Pyx_INCREF(function);
14640         __Pyx_DECREF_SET(__pyx_t_2, function);
14641       }
14642     }
14643     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
14644     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14645     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14646     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
14647     __Pyx_GOTREF(__pyx_t_3);
14648     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14649     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
14650     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14651     __PYX_ERR(1, 6, __pyx_L1_error)
14652 
14653     /* "(tree fragment)":4
14654  *     cdef object __pyx_PickleError
14655  *     cdef object __pyx_result
14656  *     if __pyx_checksum != 0x778091c:             # <<<<<<<<<<<<<<
14657  *         from pickle import PickleError as __pyx_PickleError
14658  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x778091c = (_args, _num_ops, n_t, tlist, y))" % __pyx_checksum)
14659  */
14660   }
14661 
14662   /* "(tree fragment)":7
14663  *         from pickle import PickleError as __pyx_PickleError
14664  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x778091c = (_args, _num_ops, n_t, tlist, y))" % __pyx_checksum)
14665  *     __pyx_result = StepCoeffT.__new__(__pyx_type)             # <<<<<<<<<<<<<<
14666  *     if __pyx_state is not None:
14667  *         __pyx_unpickle_StepCoeffT__set_state(<StepCoeffT> __pyx_result, __pyx_state)
14668  */
14669   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5qutip_2cy_15cqobjevo_factor_StepCoeffT), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
14670   __Pyx_GOTREF(__pyx_t_2);
14671   __pyx_t_4 = NULL;
14672   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
14673     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
14674     if (likely(__pyx_t_4)) {
14675       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
14676       __Pyx_INCREF(__pyx_t_4);
14677       __Pyx_INCREF(function);
14678       __Pyx_DECREF_SET(__pyx_t_2, function);
14679     }
14680   }
14681   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
14682   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14683   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
14684   __Pyx_GOTREF(__pyx_t_3);
14685   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14686   __pyx_v___pyx_result = __pyx_t_3;
14687   __pyx_t_3 = 0;
14688 
14689   /* "(tree fragment)":8
14690  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x778091c = (_args, _num_ops, n_t, tlist, y))" % __pyx_checksum)
14691  *     __pyx_result = StepCoeffT.__new__(__pyx_type)
14692  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
14693  *         __pyx_unpickle_StepCoeffT__set_state(<StepCoeffT> __pyx_result, __pyx_state)
14694  *     return __pyx_result
14695  */
14696   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
14697   __pyx_t_6 = (__pyx_t_1 != 0);
14698   if (__pyx_t_6) {
14699 
14700     /* "(tree fragment)":9
14701  *     __pyx_result = StepCoeffT.__new__(__pyx_type)
14702  *     if __pyx_state is not None:
14703  *         __pyx_unpickle_StepCoeffT__set_state(<StepCoeffT> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
14704  *     return __pyx_result
14705  * cdef __pyx_unpickle_StepCoeffT__set_state(StepCoeffT __pyx_result, tuple __pyx_state):
14706  */
14707     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
14708     __pyx_t_3 = __pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_StepCoeffT__set_state(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffT *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
14709     __Pyx_GOTREF(__pyx_t_3);
14710     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14711 
14712     /* "(tree fragment)":8
14713  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x778091c = (_args, _num_ops, n_t, tlist, y))" % __pyx_checksum)
14714  *     __pyx_result = StepCoeffT.__new__(__pyx_type)
14715  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
14716  *         __pyx_unpickle_StepCoeffT__set_state(<StepCoeffT> __pyx_result, __pyx_state)
14717  *     return __pyx_result
14718  */
14719   }
14720 
14721   /* "(tree fragment)":10
14722  *     if __pyx_state is not None:
14723  *         __pyx_unpickle_StepCoeffT__set_state(<StepCoeffT> __pyx_result, __pyx_state)
14724  *     return __pyx_result             # <<<<<<<<<<<<<<
14725  * cdef __pyx_unpickle_StepCoeffT__set_state(StepCoeffT __pyx_result, tuple __pyx_state):
14726  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.n_t = __pyx_state[2]; __pyx_result.tlist = __pyx_state[3]; __pyx_result.y = __pyx_state[4]
14727  */
14728   __Pyx_XDECREF(__pyx_r);
14729   __Pyx_INCREF(__pyx_v___pyx_result);
14730   __pyx_r = __pyx_v___pyx_result;
14731   goto __pyx_L0;
14732 
14733   /* "(tree fragment)":1
14734  * def __pyx_unpickle_StepCoeffT(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
14735  *     cdef object __pyx_PickleError
14736  *     cdef object __pyx_result
14737  */
14738 
14739   /* function exit code */
14740   __pyx_L1_error:;
14741   __Pyx_XDECREF(__pyx_t_2);
14742   __Pyx_XDECREF(__pyx_t_3);
14743   __Pyx_XDECREF(__pyx_t_4);
14744   __Pyx_XDECREF(__pyx_t_5);
14745   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.__pyx_unpickle_StepCoeffT", __pyx_clineno, __pyx_lineno, __pyx_filename);
14746   __pyx_r = NULL;
14747   __pyx_L0:;
14748   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
14749   __Pyx_XDECREF(__pyx_v___pyx_result);
14750   __Pyx_XGIVEREF(__pyx_r);
14751   __Pyx_RefNannyFinishContext();
14752   return __pyx_r;
14753 }
14754 
14755 /* "(tree fragment)":11
14756  *         __pyx_unpickle_StepCoeffT__set_state(<StepCoeffT> __pyx_result, __pyx_state)
14757  *     return __pyx_result
14758  * cdef __pyx_unpickle_StepCoeffT__set_state(StepCoeffT __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
14759  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.n_t = __pyx_state[2]; __pyx_result.tlist = __pyx_state[3]; __pyx_result.y = __pyx_state[4]
14760  *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):
14761  */
14762 
__pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_StepCoeffT__set_state(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffT * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)14763 static PyObject *__pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_StepCoeffT__set_state(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffT *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
14764   PyObject *__pyx_r = NULL;
14765   __Pyx_RefNannyDeclarations
14766   PyObject *__pyx_t_1 = NULL;
14767   int __pyx_t_2;
14768   __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
14769   __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
14770   int __pyx_t_5;
14771   Py_ssize_t __pyx_t_6;
14772   int __pyx_t_7;
14773   int __pyx_t_8;
14774   PyObject *__pyx_t_9 = NULL;
14775   PyObject *__pyx_t_10 = NULL;
14776   PyObject *__pyx_t_11 = NULL;
14777   int __pyx_lineno = 0;
14778   const char *__pyx_filename = NULL;
14779   int __pyx_clineno = 0;
14780   __Pyx_RefNannySetupContext("__pyx_unpickle_StepCoeffT__set_state", 0);
14781 
14782   /* "(tree fragment)":12
14783  *     return __pyx_result
14784  * cdef __pyx_unpickle_StepCoeffT__set_state(StepCoeffT __pyx_result, tuple __pyx_state):
14785  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.n_t = __pyx_state[2]; __pyx_result.tlist = __pyx_state[3]; __pyx_result.y = __pyx_state[4]             # <<<<<<<<<<<<<<
14786  *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):
14787  *         __pyx_result.__dict__.update(__pyx_state[5])
14788  */
14789   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14790     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14791     __PYX_ERR(1, 12, __pyx_L1_error)
14792   }
14793   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
14794   __Pyx_GOTREF(__pyx_t_1);
14795   if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
14796   __Pyx_GIVEREF(__pyx_t_1);
14797   __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.__pyx_base._args);
14798   __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.__pyx_base._args);
14799   __pyx_v___pyx_result->__pyx_base.__pyx_base._args = ((PyObject*)__pyx_t_1);
14800   __pyx_t_1 = 0;
14801   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14802     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14803     __PYX_ERR(1, 12, __pyx_L1_error)
14804   }
14805   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
14806   __Pyx_GOTREF(__pyx_t_1);
14807   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
14808   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14809   __pyx_v___pyx_result->__pyx_base.__pyx_base._num_ops = __pyx_t_2;
14810   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14811     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14812     __PYX_ERR(1, 12, __pyx_L1_error)
14813   }
14814   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
14815   __Pyx_GOTREF(__pyx_t_1);
14816   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
14817   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14818   __pyx_v___pyx_result->__pyx_base.n_t = __pyx_t_2;
14819   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14820     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14821     __PYX_ERR(1, 12, __pyx_L1_error)
14822   }
14823   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
14824   __Pyx_GOTREF(__pyx_t_1);
14825   __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
14826   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14827   __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->__pyx_base.tlist, 0);
14828   __pyx_v___pyx_result->__pyx_base.tlist = __pyx_t_3;
14829   __pyx_t_3.memview = NULL;
14830   __pyx_t_3.data = NULL;
14831   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14832     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14833     __PYX_ERR(1, 12, __pyx_L1_error)
14834   }
14835   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
14836   __Pyx_GOTREF(__pyx_t_1);
14837   __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
14838   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14839   __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->__pyx_base.y, 0);
14840   __pyx_v___pyx_result->__pyx_base.y = __pyx_t_4;
14841   __pyx_t_4.memview = NULL;
14842   __pyx_t_4.data = NULL;
14843 
14844   /* "(tree fragment)":13
14845  * cdef __pyx_unpickle_StepCoeffT__set_state(StepCoeffT __pyx_result, tuple __pyx_state):
14846  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.n_t = __pyx_state[2]; __pyx_result.tlist = __pyx_state[3]; __pyx_result.y = __pyx_state[4]
14847  *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
14848  *         __pyx_result.__dict__.update(__pyx_state[5])
14849  */
14850   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14851     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
14852     __PYX_ERR(1, 13, __pyx_L1_error)
14853   }
14854   __pyx_t_6 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
14855   __pyx_t_7 = ((__pyx_t_6 > 5) != 0);
14856   if (__pyx_t_7) {
14857   } else {
14858     __pyx_t_5 = __pyx_t_7;
14859     goto __pyx_L4_bool_binop_done;
14860   }
14861   __pyx_t_7 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
14862   __pyx_t_8 = (__pyx_t_7 != 0);
14863   __pyx_t_5 = __pyx_t_8;
14864   __pyx_L4_bool_binop_done:;
14865   if (__pyx_t_5) {
14866 
14867     /* "(tree fragment)":14
14868  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.n_t = __pyx_state[2]; __pyx_result.tlist = __pyx_state[3]; __pyx_result.y = __pyx_state[4]
14869  *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):
14870  *         __pyx_result.__dict__.update(__pyx_state[5])             # <<<<<<<<<<<<<<
14871  */
14872     __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
14873     __Pyx_GOTREF(__pyx_t_9);
14874     __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_update); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 14, __pyx_L1_error)
14875     __Pyx_GOTREF(__pyx_t_10);
14876     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14877     if (unlikely(__pyx_v___pyx_state == Py_None)) {
14878       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14879       __PYX_ERR(1, 14, __pyx_L1_error)
14880     }
14881     __pyx_t_9 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
14882     __Pyx_GOTREF(__pyx_t_9);
14883     __pyx_t_11 = NULL;
14884     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
14885       __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
14886       if (likely(__pyx_t_11)) {
14887         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
14888         __Pyx_INCREF(__pyx_t_11);
14889         __Pyx_INCREF(function);
14890         __Pyx_DECREF_SET(__pyx_t_10, function);
14891       }
14892     }
14893     __pyx_t_1 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9);
14894     __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
14895     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14896     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
14897     __Pyx_GOTREF(__pyx_t_1);
14898     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14899     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14900 
14901     /* "(tree fragment)":13
14902  * cdef __pyx_unpickle_StepCoeffT__set_state(StepCoeffT __pyx_result, tuple __pyx_state):
14903  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.n_t = __pyx_state[2]; __pyx_result.tlist = __pyx_state[3]; __pyx_result.y = __pyx_state[4]
14904  *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
14905  *         __pyx_result.__dict__.update(__pyx_state[5])
14906  */
14907   }
14908 
14909   /* "(tree fragment)":11
14910  *         __pyx_unpickle_StepCoeffT__set_state(<StepCoeffT> __pyx_result, __pyx_state)
14911  *     return __pyx_result
14912  * cdef __pyx_unpickle_StepCoeffT__set_state(StepCoeffT __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
14913  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.n_t = __pyx_state[2]; __pyx_result.tlist = __pyx_state[3]; __pyx_result.y = __pyx_state[4]
14914  *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):
14915  */
14916 
14917   /* function exit code */
14918   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14919   goto __pyx_L0;
14920   __pyx_L1_error:;
14921   __Pyx_XDECREF(__pyx_t_1);
14922   __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
14923   __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
14924   __Pyx_XDECREF(__pyx_t_9);
14925   __Pyx_XDECREF(__pyx_t_10);
14926   __Pyx_XDECREF(__pyx_t_11);
14927   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.__pyx_unpickle_StepCoeffT__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
14928   __pyx_r = 0;
14929   __pyx_L0:;
14930   __Pyx_XGIVEREF(__pyx_r);
14931   __Pyx_RefNannyFinishContext();
14932   return __pyx_r;
14933 }
14934 
14935 /* "(tree fragment)":1
14936  * def __pyx_unpickle_StepCoeffCte(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
14937  *     cdef object __pyx_PickleError
14938  *     cdef object __pyx_result
14939  */
14940 
14941 /* Python wrapper */
14942 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_13__pyx_unpickle_StepCoeffCte(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
14943 static PyMethodDef __pyx_mdef_5qutip_2cy_15cqobjevo_factor_13__pyx_unpickle_StepCoeffCte = {"__pyx_unpickle_StepCoeffCte", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5qutip_2cy_15cqobjevo_factor_13__pyx_unpickle_StepCoeffCte, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_5qutip_2cy_15cqobjevo_factor_13__pyx_unpickle_StepCoeffCte(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)14944 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_13__pyx_unpickle_StepCoeffCte(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14945   PyObject *__pyx_v___pyx_type = 0;
14946   long __pyx_v___pyx_checksum;
14947   PyObject *__pyx_v___pyx_state = 0;
14948   int __pyx_lineno = 0;
14949   const char *__pyx_filename = NULL;
14950   int __pyx_clineno = 0;
14951   PyObject *__pyx_r = 0;
14952   __Pyx_RefNannyDeclarations
14953   __Pyx_RefNannySetupContext("__pyx_unpickle_StepCoeffCte (wrapper)", 0);
14954   {
14955     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
14956     PyObject* values[3] = {0,0,0};
14957     if (unlikely(__pyx_kwds)) {
14958       Py_ssize_t kw_args;
14959       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14960       switch (pos_args) {
14961         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14962         CYTHON_FALLTHROUGH;
14963         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14964         CYTHON_FALLTHROUGH;
14965         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14966         CYTHON_FALLTHROUGH;
14967         case  0: break;
14968         default: goto __pyx_L5_argtuple_error;
14969       }
14970       kw_args = PyDict_Size(__pyx_kwds);
14971       switch (pos_args) {
14972         case  0:
14973         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
14974         else goto __pyx_L5_argtuple_error;
14975         CYTHON_FALLTHROUGH;
14976         case  1:
14977         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
14978         else {
14979           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_StepCoeffCte", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
14980         }
14981         CYTHON_FALLTHROUGH;
14982         case  2:
14983         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
14984         else {
14985           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_StepCoeffCte", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
14986         }
14987       }
14988       if (unlikely(kw_args > 0)) {
14989         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_StepCoeffCte") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
14990       }
14991     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
14992       goto __pyx_L5_argtuple_error;
14993     } else {
14994       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14995       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14996       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14997     }
14998     __pyx_v___pyx_type = values[0];
14999     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
15000     __pyx_v___pyx_state = values[2];
15001   }
15002   goto __pyx_L4_argument_unpacking_done;
15003   __pyx_L5_argtuple_error:;
15004   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_StepCoeffCte", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
15005   __pyx_L3_error:;
15006   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.__pyx_unpickle_StepCoeffCte", __pyx_clineno, __pyx_lineno, __pyx_filename);
15007   __Pyx_RefNannyFinishContext();
15008   return NULL;
15009   __pyx_L4_argument_unpacking_done:;
15010   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_12__pyx_unpickle_StepCoeffCte(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
15011 
15012   /* function exit code */
15013   __Pyx_RefNannyFinishContext();
15014   return __pyx_r;
15015 }
15016 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_12__pyx_unpickle_StepCoeffCte(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)15017 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_12__pyx_unpickle_StepCoeffCte(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
15018   PyObject *__pyx_v___pyx_PickleError = 0;
15019   PyObject *__pyx_v___pyx_result = 0;
15020   PyObject *__pyx_r = NULL;
15021   __Pyx_RefNannyDeclarations
15022   int __pyx_t_1;
15023   PyObject *__pyx_t_2 = NULL;
15024   PyObject *__pyx_t_3 = NULL;
15025   PyObject *__pyx_t_4 = NULL;
15026   PyObject *__pyx_t_5 = NULL;
15027   int __pyx_t_6;
15028   int __pyx_lineno = 0;
15029   const char *__pyx_filename = NULL;
15030   int __pyx_clineno = 0;
15031   __Pyx_RefNannySetupContext("__pyx_unpickle_StepCoeffCte", 0);
15032 
15033   /* "(tree fragment)":4
15034  *     cdef object __pyx_PickleError
15035  *     cdef object __pyx_result
15036  *     if __pyx_checksum != 0x778091c:             # <<<<<<<<<<<<<<
15037  *         from pickle import PickleError as __pyx_PickleError
15038  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x778091c = (_args, _num_ops, n_t, tlist, y))" % __pyx_checksum)
15039  */
15040   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x778091c) != 0);
15041   if (__pyx_t_1) {
15042 
15043     /* "(tree fragment)":5
15044  *     cdef object __pyx_result
15045  *     if __pyx_checksum != 0x778091c:
15046  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
15047  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x778091c = (_args, _num_ops, n_t, tlist, y))" % __pyx_checksum)
15048  *     __pyx_result = StepCoeffCte.__new__(__pyx_type)
15049  */
15050     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
15051     __Pyx_GOTREF(__pyx_t_2);
15052     __Pyx_INCREF(__pyx_n_s_PickleError);
15053     __Pyx_GIVEREF(__pyx_n_s_PickleError);
15054     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
15055     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
15056     __Pyx_GOTREF(__pyx_t_3);
15057     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15058     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
15059     __Pyx_GOTREF(__pyx_t_2);
15060     __Pyx_INCREF(__pyx_t_2);
15061     __pyx_v___pyx_PickleError = __pyx_t_2;
15062     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15063     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15064 
15065     /* "(tree fragment)":6
15066  *     if __pyx_checksum != 0x778091c:
15067  *         from pickle import PickleError as __pyx_PickleError
15068  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x778091c = (_args, _num_ops, n_t, tlist, y))" % __pyx_checksum)             # <<<<<<<<<<<<<<
15069  *     __pyx_result = StepCoeffCte.__new__(__pyx_type)
15070  *     if __pyx_state is not None:
15071  */
15072     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
15073     __Pyx_GOTREF(__pyx_t_2);
15074     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x77, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
15075     __Pyx_GOTREF(__pyx_t_4);
15076     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15077     __Pyx_INCREF(__pyx_v___pyx_PickleError);
15078     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
15079     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
15080       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
15081       if (likely(__pyx_t_5)) {
15082         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
15083         __Pyx_INCREF(__pyx_t_5);
15084         __Pyx_INCREF(function);
15085         __Pyx_DECREF_SET(__pyx_t_2, function);
15086       }
15087     }
15088     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
15089     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15090     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15091     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
15092     __Pyx_GOTREF(__pyx_t_3);
15093     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15094     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
15095     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15096     __PYX_ERR(1, 6, __pyx_L1_error)
15097 
15098     /* "(tree fragment)":4
15099  *     cdef object __pyx_PickleError
15100  *     cdef object __pyx_result
15101  *     if __pyx_checksum != 0x778091c:             # <<<<<<<<<<<<<<
15102  *         from pickle import PickleError as __pyx_PickleError
15103  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x778091c = (_args, _num_ops, n_t, tlist, y))" % __pyx_checksum)
15104  */
15105   }
15106 
15107   /* "(tree fragment)":7
15108  *         from pickle import PickleError as __pyx_PickleError
15109  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x778091c = (_args, _num_ops, n_t, tlist, y))" % __pyx_checksum)
15110  *     __pyx_result = StepCoeffCte.__new__(__pyx_type)             # <<<<<<<<<<<<<<
15111  *     if __pyx_state is not None:
15112  *         __pyx_unpickle_StepCoeffCte__set_state(<StepCoeffCte> __pyx_result, __pyx_state)
15113  */
15114   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5qutip_2cy_15cqobjevo_factor_StepCoeffCte), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
15115   __Pyx_GOTREF(__pyx_t_2);
15116   __pyx_t_4 = NULL;
15117   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
15118     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
15119     if (likely(__pyx_t_4)) {
15120       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
15121       __Pyx_INCREF(__pyx_t_4);
15122       __Pyx_INCREF(function);
15123       __Pyx_DECREF_SET(__pyx_t_2, function);
15124     }
15125   }
15126   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
15127   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15128   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
15129   __Pyx_GOTREF(__pyx_t_3);
15130   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15131   __pyx_v___pyx_result = __pyx_t_3;
15132   __pyx_t_3 = 0;
15133 
15134   /* "(tree fragment)":8
15135  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x778091c = (_args, _num_ops, n_t, tlist, y))" % __pyx_checksum)
15136  *     __pyx_result = StepCoeffCte.__new__(__pyx_type)
15137  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
15138  *         __pyx_unpickle_StepCoeffCte__set_state(<StepCoeffCte> __pyx_result, __pyx_state)
15139  *     return __pyx_result
15140  */
15141   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
15142   __pyx_t_6 = (__pyx_t_1 != 0);
15143   if (__pyx_t_6) {
15144 
15145     /* "(tree fragment)":9
15146  *     __pyx_result = StepCoeffCte.__new__(__pyx_type)
15147  *     if __pyx_state is not None:
15148  *         __pyx_unpickle_StepCoeffCte__set_state(<StepCoeffCte> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
15149  *     return __pyx_result
15150  * cdef __pyx_unpickle_StepCoeffCte__set_state(StepCoeffCte __pyx_result, tuple __pyx_state):
15151  */
15152     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
15153     __pyx_t_3 = __pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_StepCoeffCte__set_state(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffCte *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
15154     __Pyx_GOTREF(__pyx_t_3);
15155     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15156 
15157     /* "(tree fragment)":8
15158  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x778091c = (_args, _num_ops, n_t, tlist, y))" % __pyx_checksum)
15159  *     __pyx_result = StepCoeffCte.__new__(__pyx_type)
15160  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
15161  *         __pyx_unpickle_StepCoeffCte__set_state(<StepCoeffCte> __pyx_result, __pyx_state)
15162  *     return __pyx_result
15163  */
15164   }
15165 
15166   /* "(tree fragment)":10
15167  *     if __pyx_state is not None:
15168  *         __pyx_unpickle_StepCoeffCte__set_state(<StepCoeffCte> __pyx_result, __pyx_state)
15169  *     return __pyx_result             # <<<<<<<<<<<<<<
15170  * cdef __pyx_unpickle_StepCoeffCte__set_state(StepCoeffCte __pyx_result, tuple __pyx_state):
15171  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.n_t = __pyx_state[2]; __pyx_result.tlist = __pyx_state[3]; __pyx_result.y = __pyx_state[4]
15172  */
15173   __Pyx_XDECREF(__pyx_r);
15174   __Pyx_INCREF(__pyx_v___pyx_result);
15175   __pyx_r = __pyx_v___pyx_result;
15176   goto __pyx_L0;
15177 
15178   /* "(tree fragment)":1
15179  * def __pyx_unpickle_StepCoeffCte(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
15180  *     cdef object __pyx_PickleError
15181  *     cdef object __pyx_result
15182  */
15183 
15184   /* function exit code */
15185   __pyx_L1_error:;
15186   __Pyx_XDECREF(__pyx_t_2);
15187   __Pyx_XDECREF(__pyx_t_3);
15188   __Pyx_XDECREF(__pyx_t_4);
15189   __Pyx_XDECREF(__pyx_t_5);
15190   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.__pyx_unpickle_StepCoeffCte", __pyx_clineno, __pyx_lineno, __pyx_filename);
15191   __pyx_r = NULL;
15192   __pyx_L0:;
15193   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
15194   __Pyx_XDECREF(__pyx_v___pyx_result);
15195   __Pyx_XGIVEREF(__pyx_r);
15196   __Pyx_RefNannyFinishContext();
15197   return __pyx_r;
15198 }
15199 
15200 /* "(tree fragment)":11
15201  *         __pyx_unpickle_StepCoeffCte__set_state(<StepCoeffCte> __pyx_result, __pyx_state)
15202  *     return __pyx_result
15203  * cdef __pyx_unpickle_StepCoeffCte__set_state(StepCoeffCte __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
15204  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.n_t = __pyx_state[2]; __pyx_result.tlist = __pyx_state[3]; __pyx_result.y = __pyx_state[4]
15205  *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):
15206  */
15207 
__pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_StepCoeffCte__set_state(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffCte * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)15208 static PyObject *__pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_StepCoeffCte__set_state(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffCte *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
15209   PyObject *__pyx_r = NULL;
15210   __Pyx_RefNannyDeclarations
15211   PyObject *__pyx_t_1 = NULL;
15212   int __pyx_t_2;
15213   __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
15214   __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
15215   int __pyx_t_5;
15216   Py_ssize_t __pyx_t_6;
15217   int __pyx_t_7;
15218   int __pyx_t_8;
15219   PyObject *__pyx_t_9 = NULL;
15220   PyObject *__pyx_t_10 = NULL;
15221   PyObject *__pyx_t_11 = NULL;
15222   int __pyx_lineno = 0;
15223   const char *__pyx_filename = NULL;
15224   int __pyx_clineno = 0;
15225   __Pyx_RefNannySetupContext("__pyx_unpickle_StepCoeffCte__set_state", 0);
15226 
15227   /* "(tree fragment)":12
15228  *     return __pyx_result
15229  * cdef __pyx_unpickle_StepCoeffCte__set_state(StepCoeffCte __pyx_result, tuple __pyx_state):
15230  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.n_t = __pyx_state[2]; __pyx_result.tlist = __pyx_state[3]; __pyx_result.y = __pyx_state[4]             # <<<<<<<<<<<<<<
15231  *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):
15232  *         __pyx_result.__dict__.update(__pyx_state[5])
15233  */
15234   if (unlikely(__pyx_v___pyx_state == Py_None)) {
15235     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15236     __PYX_ERR(1, 12, __pyx_L1_error)
15237   }
15238   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
15239   __Pyx_GOTREF(__pyx_t_1);
15240   if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
15241   __Pyx_GIVEREF(__pyx_t_1);
15242   __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.__pyx_base._args);
15243   __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.__pyx_base._args);
15244   __pyx_v___pyx_result->__pyx_base.__pyx_base._args = ((PyObject*)__pyx_t_1);
15245   __pyx_t_1 = 0;
15246   if (unlikely(__pyx_v___pyx_state == Py_None)) {
15247     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15248     __PYX_ERR(1, 12, __pyx_L1_error)
15249   }
15250   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
15251   __Pyx_GOTREF(__pyx_t_1);
15252   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
15253   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15254   __pyx_v___pyx_result->__pyx_base.__pyx_base._num_ops = __pyx_t_2;
15255   if (unlikely(__pyx_v___pyx_state == Py_None)) {
15256     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15257     __PYX_ERR(1, 12, __pyx_L1_error)
15258   }
15259   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
15260   __Pyx_GOTREF(__pyx_t_1);
15261   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
15262   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15263   __pyx_v___pyx_result->__pyx_base.n_t = __pyx_t_2;
15264   if (unlikely(__pyx_v___pyx_state == Py_None)) {
15265     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15266     __PYX_ERR(1, 12, __pyx_L1_error)
15267   }
15268   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
15269   __Pyx_GOTREF(__pyx_t_1);
15270   __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
15271   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15272   __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->__pyx_base.tlist, 0);
15273   __pyx_v___pyx_result->__pyx_base.tlist = __pyx_t_3;
15274   __pyx_t_3.memview = NULL;
15275   __pyx_t_3.data = NULL;
15276   if (unlikely(__pyx_v___pyx_state == Py_None)) {
15277     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15278     __PYX_ERR(1, 12, __pyx_L1_error)
15279   }
15280   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
15281   __Pyx_GOTREF(__pyx_t_1);
15282   __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
15283   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15284   __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->__pyx_base.y, 0);
15285   __pyx_v___pyx_result->__pyx_base.y = __pyx_t_4;
15286   __pyx_t_4.memview = NULL;
15287   __pyx_t_4.data = NULL;
15288 
15289   /* "(tree fragment)":13
15290  * cdef __pyx_unpickle_StepCoeffCte__set_state(StepCoeffCte __pyx_result, tuple __pyx_state):
15291  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.n_t = __pyx_state[2]; __pyx_result.tlist = __pyx_state[3]; __pyx_result.y = __pyx_state[4]
15292  *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
15293  *         __pyx_result.__dict__.update(__pyx_state[5])
15294  */
15295   if (unlikely(__pyx_v___pyx_state == Py_None)) {
15296     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
15297     __PYX_ERR(1, 13, __pyx_L1_error)
15298   }
15299   __pyx_t_6 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
15300   __pyx_t_7 = ((__pyx_t_6 > 5) != 0);
15301   if (__pyx_t_7) {
15302   } else {
15303     __pyx_t_5 = __pyx_t_7;
15304     goto __pyx_L4_bool_binop_done;
15305   }
15306   __pyx_t_7 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
15307   __pyx_t_8 = (__pyx_t_7 != 0);
15308   __pyx_t_5 = __pyx_t_8;
15309   __pyx_L4_bool_binop_done:;
15310   if (__pyx_t_5) {
15311 
15312     /* "(tree fragment)":14
15313  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.n_t = __pyx_state[2]; __pyx_result.tlist = __pyx_state[3]; __pyx_result.y = __pyx_state[4]
15314  *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):
15315  *         __pyx_result.__dict__.update(__pyx_state[5])             # <<<<<<<<<<<<<<
15316  */
15317     __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
15318     __Pyx_GOTREF(__pyx_t_9);
15319     __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_update); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 14, __pyx_L1_error)
15320     __Pyx_GOTREF(__pyx_t_10);
15321     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15322     if (unlikely(__pyx_v___pyx_state == Py_None)) {
15323       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15324       __PYX_ERR(1, 14, __pyx_L1_error)
15325     }
15326     __pyx_t_9 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
15327     __Pyx_GOTREF(__pyx_t_9);
15328     __pyx_t_11 = NULL;
15329     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
15330       __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
15331       if (likely(__pyx_t_11)) {
15332         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
15333         __Pyx_INCREF(__pyx_t_11);
15334         __Pyx_INCREF(function);
15335         __Pyx_DECREF_SET(__pyx_t_10, function);
15336       }
15337     }
15338     __pyx_t_1 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9);
15339     __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
15340     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15341     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
15342     __Pyx_GOTREF(__pyx_t_1);
15343     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15344     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15345 
15346     /* "(tree fragment)":13
15347  * cdef __pyx_unpickle_StepCoeffCte__set_state(StepCoeffCte __pyx_result, tuple __pyx_state):
15348  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.n_t = __pyx_state[2]; __pyx_result.tlist = __pyx_state[3]; __pyx_result.y = __pyx_state[4]
15349  *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
15350  *         __pyx_result.__dict__.update(__pyx_state[5])
15351  */
15352   }
15353 
15354   /* "(tree fragment)":11
15355  *         __pyx_unpickle_StepCoeffCte__set_state(<StepCoeffCte> __pyx_result, __pyx_state)
15356  *     return __pyx_result
15357  * cdef __pyx_unpickle_StepCoeffCte__set_state(StepCoeffCte __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
15358  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.n_t = __pyx_state[2]; __pyx_result.tlist = __pyx_state[3]; __pyx_result.y = __pyx_state[4]
15359  *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):
15360  */
15361 
15362   /* function exit code */
15363   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15364   goto __pyx_L0;
15365   __pyx_L1_error:;
15366   __Pyx_XDECREF(__pyx_t_1);
15367   __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
15368   __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
15369   __Pyx_XDECREF(__pyx_t_9);
15370   __Pyx_XDECREF(__pyx_t_10);
15371   __Pyx_XDECREF(__pyx_t_11);
15372   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.__pyx_unpickle_StepCoeffCte__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
15373   __pyx_r = 0;
15374   __pyx_L0:;
15375   __Pyx_XGIVEREF(__pyx_r);
15376   __Pyx_RefNannyFinishContext();
15377   return __pyx_r;
15378 }
15379 
15380 /* "(tree fragment)":1
15381  * def __pyx_unpickle_StrCoeff(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
15382  *     cdef object __pyx_PickleError
15383  *     cdef object __pyx_result
15384  */
15385 
15386 /* Python wrapper */
15387 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_15__pyx_unpickle_StrCoeff(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
15388 static PyMethodDef __pyx_mdef_5qutip_2cy_15cqobjevo_factor_15__pyx_unpickle_StrCoeff = {"__pyx_unpickle_StrCoeff", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5qutip_2cy_15cqobjevo_factor_15__pyx_unpickle_StrCoeff, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_5qutip_2cy_15cqobjevo_factor_15__pyx_unpickle_StrCoeff(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)15389 static PyObject *__pyx_pw_5qutip_2cy_15cqobjevo_factor_15__pyx_unpickle_StrCoeff(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15390   PyObject *__pyx_v___pyx_type = 0;
15391   long __pyx_v___pyx_checksum;
15392   PyObject *__pyx_v___pyx_state = 0;
15393   int __pyx_lineno = 0;
15394   const char *__pyx_filename = NULL;
15395   int __pyx_clineno = 0;
15396   PyObject *__pyx_r = 0;
15397   __Pyx_RefNannyDeclarations
15398   __Pyx_RefNannySetupContext("__pyx_unpickle_StrCoeff (wrapper)", 0);
15399   {
15400     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
15401     PyObject* values[3] = {0,0,0};
15402     if (unlikely(__pyx_kwds)) {
15403       Py_ssize_t kw_args;
15404       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15405       switch (pos_args) {
15406         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15407         CYTHON_FALLTHROUGH;
15408         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15409         CYTHON_FALLTHROUGH;
15410         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15411         CYTHON_FALLTHROUGH;
15412         case  0: break;
15413         default: goto __pyx_L5_argtuple_error;
15414       }
15415       kw_args = PyDict_Size(__pyx_kwds);
15416       switch (pos_args) {
15417         case  0:
15418         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
15419         else goto __pyx_L5_argtuple_error;
15420         CYTHON_FALLTHROUGH;
15421         case  1:
15422         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
15423         else {
15424           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_StrCoeff", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
15425         }
15426         CYTHON_FALLTHROUGH;
15427         case  2:
15428         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
15429         else {
15430           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_StrCoeff", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
15431         }
15432       }
15433       if (unlikely(kw_args > 0)) {
15434         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_StrCoeff") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
15435       }
15436     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
15437       goto __pyx_L5_argtuple_error;
15438     } else {
15439       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15440       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15441       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15442     }
15443     __pyx_v___pyx_type = values[0];
15444     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
15445     __pyx_v___pyx_state = values[2];
15446   }
15447   goto __pyx_L4_argument_unpacking_done;
15448   __pyx_L5_argtuple_error:;
15449   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_StrCoeff", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
15450   __pyx_L3_error:;
15451   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.__pyx_unpickle_StrCoeff", __pyx_clineno, __pyx_lineno, __pyx_filename);
15452   __Pyx_RefNannyFinishContext();
15453   return NULL;
15454   __pyx_L4_argument_unpacking_done:;
15455   __pyx_r = __pyx_pf_5qutip_2cy_15cqobjevo_factor_14__pyx_unpickle_StrCoeff(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
15456 
15457   /* function exit code */
15458   __Pyx_RefNannyFinishContext();
15459   return __pyx_r;
15460 }
15461 
__pyx_pf_5qutip_2cy_15cqobjevo_factor_14__pyx_unpickle_StrCoeff(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)15462 static PyObject *__pyx_pf_5qutip_2cy_15cqobjevo_factor_14__pyx_unpickle_StrCoeff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
15463   PyObject *__pyx_v___pyx_PickleError = 0;
15464   PyObject *__pyx_v___pyx_result = 0;
15465   PyObject *__pyx_r = NULL;
15466   __Pyx_RefNannyDeclarations
15467   int __pyx_t_1;
15468   PyObject *__pyx_t_2 = NULL;
15469   PyObject *__pyx_t_3 = NULL;
15470   PyObject *__pyx_t_4 = NULL;
15471   PyObject *__pyx_t_5 = NULL;
15472   int __pyx_t_6;
15473   int __pyx_lineno = 0;
15474   const char *__pyx_filename = NULL;
15475   int __pyx_clineno = 0;
15476   __Pyx_RefNannySetupContext("__pyx_unpickle_StrCoeff", 0);
15477 
15478   /* "(tree fragment)":4
15479  *     cdef object __pyx_PickleError
15480  *     cdef object __pyx_result
15481  *     if __pyx_checksum != 0xea1f18a:             # <<<<<<<<<<<<<<
15482  *         from pickle import PickleError as __pyx_PickleError
15483  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xea1f18a = (_args, _dyn_args_list, _expect_op, _expect_vec, _mat_shape, _num_expect, _num_ops, _vec))" % __pyx_checksum)
15484  */
15485   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xea1f18a) != 0);
15486   if (__pyx_t_1) {
15487 
15488     /* "(tree fragment)":5
15489  *     cdef object __pyx_result
15490  *     if __pyx_checksum != 0xea1f18a:
15491  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
15492  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xea1f18a = (_args, _dyn_args_list, _expect_op, _expect_vec, _mat_shape, _num_expect, _num_ops, _vec))" % __pyx_checksum)
15493  *     __pyx_result = StrCoeff.__new__(__pyx_type)
15494  */
15495     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
15496     __Pyx_GOTREF(__pyx_t_2);
15497     __Pyx_INCREF(__pyx_n_s_PickleError);
15498     __Pyx_GIVEREF(__pyx_n_s_PickleError);
15499     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
15500     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
15501     __Pyx_GOTREF(__pyx_t_3);
15502     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15503     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
15504     __Pyx_GOTREF(__pyx_t_2);
15505     __Pyx_INCREF(__pyx_t_2);
15506     __pyx_v___pyx_PickleError = __pyx_t_2;
15507     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15508     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15509 
15510     /* "(tree fragment)":6
15511  *     if __pyx_checksum != 0xea1f18a:
15512  *         from pickle import PickleError as __pyx_PickleError
15513  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xea1f18a = (_args, _dyn_args_list, _expect_op, _expect_vec, _mat_shape, _num_expect, _num_ops, _vec))" % __pyx_checksum)             # <<<<<<<<<<<<<<
15514  *     __pyx_result = StrCoeff.__new__(__pyx_type)
15515  *     if __pyx_state is not None:
15516  */
15517     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
15518     __Pyx_GOTREF(__pyx_t_2);
15519     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xea, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
15520     __Pyx_GOTREF(__pyx_t_4);
15521     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15522     __Pyx_INCREF(__pyx_v___pyx_PickleError);
15523     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
15524     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
15525       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
15526       if (likely(__pyx_t_5)) {
15527         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
15528         __Pyx_INCREF(__pyx_t_5);
15529         __Pyx_INCREF(function);
15530         __Pyx_DECREF_SET(__pyx_t_2, function);
15531       }
15532     }
15533     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
15534     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15535     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15536     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
15537     __Pyx_GOTREF(__pyx_t_3);
15538     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15539     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
15540     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15541     __PYX_ERR(1, 6, __pyx_L1_error)
15542 
15543     /* "(tree fragment)":4
15544  *     cdef object __pyx_PickleError
15545  *     cdef object __pyx_result
15546  *     if __pyx_checksum != 0xea1f18a:             # <<<<<<<<<<<<<<
15547  *         from pickle import PickleError as __pyx_PickleError
15548  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xea1f18a = (_args, _dyn_args_list, _expect_op, _expect_vec, _mat_shape, _num_expect, _num_ops, _vec))" % __pyx_checksum)
15549  */
15550   }
15551 
15552   /* "(tree fragment)":7
15553  *         from pickle import PickleError as __pyx_PickleError
15554  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xea1f18a = (_args, _dyn_args_list, _expect_op, _expect_vec, _mat_shape, _num_expect, _num_ops, _vec))" % __pyx_checksum)
15555  *     __pyx_result = StrCoeff.__new__(__pyx_type)             # <<<<<<<<<<<<<<
15556  *     if __pyx_state is not None:
15557  *         __pyx_unpickle_StrCoeff__set_state(<StrCoeff> __pyx_result, __pyx_state)
15558  */
15559   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5qutip_2cy_15cqobjevo_factor_StrCoeff), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
15560   __Pyx_GOTREF(__pyx_t_2);
15561   __pyx_t_4 = NULL;
15562   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
15563     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
15564     if (likely(__pyx_t_4)) {
15565       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
15566       __Pyx_INCREF(__pyx_t_4);
15567       __Pyx_INCREF(function);
15568       __Pyx_DECREF_SET(__pyx_t_2, function);
15569     }
15570   }
15571   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
15572   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15573   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
15574   __Pyx_GOTREF(__pyx_t_3);
15575   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15576   __pyx_v___pyx_result = __pyx_t_3;
15577   __pyx_t_3 = 0;
15578 
15579   /* "(tree fragment)":8
15580  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xea1f18a = (_args, _dyn_args_list, _expect_op, _expect_vec, _mat_shape, _num_expect, _num_ops, _vec))" % __pyx_checksum)
15581  *     __pyx_result = StrCoeff.__new__(__pyx_type)
15582  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
15583  *         __pyx_unpickle_StrCoeff__set_state(<StrCoeff> __pyx_result, __pyx_state)
15584  *     return __pyx_result
15585  */
15586   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
15587   __pyx_t_6 = (__pyx_t_1 != 0);
15588   if (__pyx_t_6) {
15589 
15590     /* "(tree fragment)":9
15591  *     __pyx_result = StrCoeff.__new__(__pyx_type)
15592  *     if __pyx_state is not None:
15593  *         __pyx_unpickle_StrCoeff__set_state(<StrCoeff> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
15594  *     return __pyx_result
15595  * cdef __pyx_unpickle_StrCoeff__set_state(StrCoeff __pyx_result, tuple __pyx_state):
15596  */
15597     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
15598     __pyx_t_3 = __pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_StrCoeff__set_state(((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
15599     __Pyx_GOTREF(__pyx_t_3);
15600     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15601 
15602     /* "(tree fragment)":8
15603  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xea1f18a = (_args, _dyn_args_list, _expect_op, _expect_vec, _mat_shape, _num_expect, _num_ops, _vec))" % __pyx_checksum)
15604  *     __pyx_result = StrCoeff.__new__(__pyx_type)
15605  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
15606  *         __pyx_unpickle_StrCoeff__set_state(<StrCoeff> __pyx_result, __pyx_state)
15607  *     return __pyx_result
15608  */
15609   }
15610 
15611   /* "(tree fragment)":10
15612  *     if __pyx_state is not None:
15613  *         __pyx_unpickle_StrCoeff__set_state(<StrCoeff> __pyx_result, __pyx_state)
15614  *     return __pyx_result             # <<<<<<<<<<<<<<
15615  * cdef __pyx_unpickle_StrCoeff__set_state(StrCoeff __pyx_result, tuple __pyx_state):
15616  *     __pyx_result._args = __pyx_state[0]; __pyx_result._dyn_args_list = __pyx_state[1]; __pyx_result._expect_op = __pyx_state[2]; __pyx_result._expect_vec = __pyx_state[3]; __pyx_result._mat_shape = __pyx_state[4]; __pyx_result._num_expect = __pyx_state[5]; __pyx_result._num_ops = __pyx_state[6]; __pyx_result._vec = __pyx_state[7]
15617  */
15618   __Pyx_XDECREF(__pyx_r);
15619   __Pyx_INCREF(__pyx_v___pyx_result);
15620   __pyx_r = __pyx_v___pyx_result;
15621   goto __pyx_L0;
15622 
15623   /* "(tree fragment)":1
15624  * def __pyx_unpickle_StrCoeff(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
15625  *     cdef object __pyx_PickleError
15626  *     cdef object __pyx_result
15627  */
15628 
15629   /* function exit code */
15630   __pyx_L1_error:;
15631   __Pyx_XDECREF(__pyx_t_2);
15632   __Pyx_XDECREF(__pyx_t_3);
15633   __Pyx_XDECREF(__pyx_t_4);
15634   __Pyx_XDECREF(__pyx_t_5);
15635   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.__pyx_unpickle_StrCoeff", __pyx_clineno, __pyx_lineno, __pyx_filename);
15636   __pyx_r = NULL;
15637   __pyx_L0:;
15638   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
15639   __Pyx_XDECREF(__pyx_v___pyx_result);
15640   __Pyx_XGIVEREF(__pyx_r);
15641   __Pyx_RefNannyFinishContext();
15642   return __pyx_r;
15643 }
15644 
15645 /* "(tree fragment)":11
15646  *         __pyx_unpickle_StrCoeff__set_state(<StrCoeff> __pyx_result, __pyx_state)
15647  *     return __pyx_result
15648  * cdef __pyx_unpickle_StrCoeff__set_state(StrCoeff __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
15649  *     __pyx_result._args = __pyx_state[0]; __pyx_result._dyn_args_list = __pyx_state[1]; __pyx_result._expect_op = __pyx_state[2]; __pyx_result._expect_vec = __pyx_state[3]; __pyx_result._mat_shape = __pyx_state[4]; __pyx_result._num_expect = __pyx_state[5]; __pyx_result._num_ops = __pyx_state[6]; __pyx_result._vec = __pyx_state[7]
15650  *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):
15651  */
15652 
__pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_StrCoeff__set_state(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)15653 static PyObject *__pyx_f_5qutip_2cy_15cqobjevo_factor___pyx_unpickle_StrCoeff__set_state(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
15654   PyObject *__pyx_r = NULL;
15655   __Pyx_RefNannyDeclarations
15656   PyObject *__pyx_t_1 = NULL;
15657   __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
15658   int __pyx_t_3[2];
15659   int __pyx_t_4;
15660   int __pyx_t_5;
15661   Py_ssize_t __pyx_t_6;
15662   int __pyx_t_7;
15663   int __pyx_t_8;
15664   PyObject *__pyx_t_9 = NULL;
15665   PyObject *__pyx_t_10 = NULL;
15666   PyObject *__pyx_t_11 = NULL;
15667   int __pyx_lineno = 0;
15668   const char *__pyx_filename = NULL;
15669   int __pyx_clineno = 0;
15670   __Pyx_RefNannySetupContext("__pyx_unpickle_StrCoeff__set_state", 0);
15671 
15672   /* "(tree fragment)":12
15673  *     return __pyx_result
15674  * cdef __pyx_unpickle_StrCoeff__set_state(StrCoeff __pyx_result, tuple __pyx_state):
15675  *     __pyx_result._args = __pyx_state[0]; __pyx_result._dyn_args_list = __pyx_state[1]; __pyx_result._expect_op = __pyx_state[2]; __pyx_result._expect_vec = __pyx_state[3]; __pyx_result._mat_shape = __pyx_state[4]; __pyx_result._num_expect = __pyx_state[5]; __pyx_result._num_ops = __pyx_state[6]; __pyx_result._vec = __pyx_state[7]             # <<<<<<<<<<<<<<
15676  *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):
15677  *         __pyx_result.__dict__.update(__pyx_state[8])
15678  */
15679   if (unlikely(__pyx_v___pyx_state == Py_None)) {
15680     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15681     __PYX_ERR(1, 12, __pyx_L1_error)
15682   }
15683   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
15684   __Pyx_GOTREF(__pyx_t_1);
15685   if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
15686   __Pyx_GIVEREF(__pyx_t_1);
15687   __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base._args);
15688   __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base._args);
15689   __pyx_v___pyx_result->__pyx_base._args = ((PyObject*)__pyx_t_1);
15690   __pyx_t_1 = 0;
15691   if (unlikely(__pyx_v___pyx_state == Py_None)) {
15692     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15693     __PYX_ERR(1, 12, __pyx_L1_error)
15694   }
15695   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
15696   __Pyx_GOTREF(__pyx_t_1);
15697   if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
15698   __Pyx_GIVEREF(__pyx_t_1);
15699   __Pyx_GOTREF(__pyx_v___pyx_result->_dyn_args_list);
15700   __Pyx_DECREF(__pyx_v___pyx_result->_dyn_args_list);
15701   __pyx_v___pyx_result->_dyn_args_list = ((PyObject*)__pyx_t_1);
15702   __pyx_t_1 = 0;
15703   if (unlikely(__pyx_v___pyx_state == Py_None)) {
15704     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15705     __PYX_ERR(1, 12, __pyx_L1_error)
15706   }
15707   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
15708   __Pyx_GOTREF(__pyx_t_1);
15709   if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
15710   __Pyx_GIVEREF(__pyx_t_1);
15711   __Pyx_GOTREF(__pyx_v___pyx_result->_expect_op);
15712   __Pyx_DECREF(__pyx_v___pyx_result->_expect_op);
15713   __pyx_v___pyx_result->_expect_op = ((PyObject*)__pyx_t_1);
15714   __pyx_t_1 = 0;
15715   if (unlikely(__pyx_v___pyx_state == Py_None)) {
15716     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15717     __PYX_ERR(1, 12, __pyx_L1_error)
15718   }
15719   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
15720   __Pyx_GOTREF(__pyx_t_1);
15721   __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
15722   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15723   __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->_expect_vec, 0);
15724   __pyx_v___pyx_result->_expect_vec = __pyx_t_2;
15725   __pyx_t_2.memview = NULL;
15726   __pyx_t_2.data = NULL;
15727   if (unlikely(__pyx_v___pyx_state == Py_None)) {
15728     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15729     __PYX_ERR(1, 12, __pyx_L1_error)
15730   }
15731   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
15732   __Pyx_GOTREF(__pyx_t_1);
15733   if (unlikely(__Pyx_carray_from_py_int(__pyx_t_1, __pyx_t_3, 2) < 0)) __PYX_ERR(1, 12, __pyx_L1_error)
15734   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15735   memcpy(&(__pyx_v___pyx_result->_mat_shape[0]), __pyx_t_3, sizeof(__pyx_v___pyx_result->_mat_shape[0]) * (2));
15736   if (unlikely(__pyx_v___pyx_state == Py_None)) {
15737     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15738     __PYX_ERR(1, 12, __pyx_L1_error)
15739   }
15740   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
15741   __Pyx_GOTREF(__pyx_t_1);
15742   __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
15743   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15744   __pyx_v___pyx_result->_num_expect = __pyx_t_4;
15745   if (unlikely(__pyx_v___pyx_state == Py_None)) {
15746     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15747     __PYX_ERR(1, 12, __pyx_L1_error)
15748   }
15749   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
15750   __Pyx_GOTREF(__pyx_t_1);
15751   __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
15752   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15753   __pyx_v___pyx_result->__pyx_base._num_ops = __pyx_t_4;
15754   if (unlikely(__pyx_v___pyx_state == Py_None)) {
15755     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15756     __PYX_ERR(1, 12, __pyx_L1_error)
15757   }
15758   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
15759   __Pyx_GOTREF(__pyx_t_1);
15760   __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
15761   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15762   __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->_vec, 0);
15763   __pyx_v___pyx_result->_vec = __pyx_t_2;
15764   __pyx_t_2.memview = NULL;
15765   __pyx_t_2.data = NULL;
15766 
15767   /* "(tree fragment)":13
15768  * cdef __pyx_unpickle_StrCoeff__set_state(StrCoeff __pyx_result, tuple __pyx_state):
15769  *     __pyx_result._args = __pyx_state[0]; __pyx_result._dyn_args_list = __pyx_state[1]; __pyx_result._expect_op = __pyx_state[2]; __pyx_result._expect_vec = __pyx_state[3]; __pyx_result._mat_shape = __pyx_state[4]; __pyx_result._num_expect = __pyx_state[5]; __pyx_result._num_ops = __pyx_state[6]; __pyx_result._vec = __pyx_state[7]
15770  *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
15771  *         __pyx_result.__dict__.update(__pyx_state[8])
15772  */
15773   if (unlikely(__pyx_v___pyx_state == Py_None)) {
15774     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
15775     __PYX_ERR(1, 13, __pyx_L1_error)
15776   }
15777   __pyx_t_6 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
15778   __pyx_t_7 = ((__pyx_t_6 > 8) != 0);
15779   if (__pyx_t_7) {
15780   } else {
15781     __pyx_t_5 = __pyx_t_7;
15782     goto __pyx_L4_bool_binop_done;
15783   }
15784   __pyx_t_7 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
15785   __pyx_t_8 = (__pyx_t_7 != 0);
15786   __pyx_t_5 = __pyx_t_8;
15787   __pyx_L4_bool_binop_done:;
15788   if (__pyx_t_5) {
15789 
15790     /* "(tree fragment)":14
15791  *     __pyx_result._args = __pyx_state[0]; __pyx_result._dyn_args_list = __pyx_state[1]; __pyx_result._expect_op = __pyx_state[2]; __pyx_result._expect_vec = __pyx_state[3]; __pyx_result._mat_shape = __pyx_state[4]; __pyx_result._num_expect = __pyx_state[5]; __pyx_result._num_ops = __pyx_state[6]; __pyx_result._vec = __pyx_state[7]
15792  *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):
15793  *         __pyx_result.__dict__.update(__pyx_state[8])             # <<<<<<<<<<<<<<
15794  */
15795     __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
15796     __Pyx_GOTREF(__pyx_t_9);
15797     __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_update); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 14, __pyx_L1_error)
15798     __Pyx_GOTREF(__pyx_t_10);
15799     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15800     if (unlikely(__pyx_v___pyx_state == Py_None)) {
15801       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15802       __PYX_ERR(1, 14, __pyx_L1_error)
15803     }
15804     __pyx_t_9 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
15805     __Pyx_GOTREF(__pyx_t_9);
15806     __pyx_t_11 = NULL;
15807     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
15808       __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
15809       if (likely(__pyx_t_11)) {
15810         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
15811         __Pyx_INCREF(__pyx_t_11);
15812         __Pyx_INCREF(function);
15813         __Pyx_DECREF_SET(__pyx_t_10, function);
15814       }
15815     }
15816     __pyx_t_1 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9);
15817     __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
15818     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15819     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
15820     __Pyx_GOTREF(__pyx_t_1);
15821     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15822     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15823 
15824     /* "(tree fragment)":13
15825  * cdef __pyx_unpickle_StrCoeff__set_state(StrCoeff __pyx_result, tuple __pyx_state):
15826  *     __pyx_result._args = __pyx_state[0]; __pyx_result._dyn_args_list = __pyx_state[1]; __pyx_result._expect_op = __pyx_state[2]; __pyx_result._expect_vec = __pyx_state[3]; __pyx_result._mat_shape = __pyx_state[4]; __pyx_result._num_expect = __pyx_state[5]; __pyx_result._num_ops = __pyx_state[6]; __pyx_result._vec = __pyx_state[7]
15827  *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
15828  *         __pyx_result.__dict__.update(__pyx_state[8])
15829  */
15830   }
15831 
15832   /* "(tree fragment)":11
15833  *         __pyx_unpickle_StrCoeff__set_state(<StrCoeff> __pyx_result, __pyx_state)
15834  *     return __pyx_result
15835  * cdef __pyx_unpickle_StrCoeff__set_state(StrCoeff __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
15836  *     __pyx_result._args = __pyx_state[0]; __pyx_result._dyn_args_list = __pyx_state[1]; __pyx_result._expect_op = __pyx_state[2]; __pyx_result._expect_vec = __pyx_state[3]; __pyx_result._mat_shape = __pyx_state[4]; __pyx_result._num_expect = __pyx_state[5]; __pyx_result._num_ops = __pyx_state[6]; __pyx_result._vec = __pyx_state[7]
15837  *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):
15838  */
15839 
15840   /* function exit code */
15841   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15842   goto __pyx_L0;
15843   __pyx_L1_error:;
15844   __Pyx_XDECREF(__pyx_t_1);
15845   __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
15846   __Pyx_XDECREF(__pyx_t_9);
15847   __Pyx_XDECREF(__pyx_t_10);
15848   __Pyx_XDECREF(__pyx_t_11);
15849   __Pyx_AddTraceback("qutip.cy.cqobjevo_factor.__pyx_unpickle_StrCoeff__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
15850   __pyx_r = 0;
15851   __pyx_L0:;
15852   __Pyx_XGIVEREF(__pyx_r);
15853   __Pyx_RefNannyFinishContext();
15854   return __pyx_r;
15855 }
15856 
15857 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":734
15858  * ctypedef npy_cdouble     complex_t
15859  *
15860  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
15861  *     return PyArray_MultiIterNew(1, <void*>a)
15862  *
15863  */
15864 
__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject * __pyx_v_a)15865 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
15866   PyObject *__pyx_r = NULL;
15867   __Pyx_RefNannyDeclarations
15868   PyObject *__pyx_t_1 = NULL;
15869   int __pyx_lineno = 0;
15870   const char *__pyx_filename = NULL;
15871   int __pyx_clineno = 0;
15872   __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
15873 
15874   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":735
15875  *
15876  * cdef inline object PyArray_MultiIterNew1(a):
15877  *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
15878  *
15879  * cdef inline object PyArray_MultiIterNew2(a, b):
15880  */
15881   __Pyx_XDECREF(__pyx_r);
15882   __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 735, __pyx_L1_error)
15883   __Pyx_GOTREF(__pyx_t_1);
15884   __pyx_r = __pyx_t_1;
15885   __pyx_t_1 = 0;
15886   goto __pyx_L0;
15887 
15888   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":734
15889  * ctypedef npy_cdouble     complex_t
15890  *
15891  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
15892  *     return PyArray_MultiIterNew(1, <void*>a)
15893  *
15894  */
15895 
15896   /* function exit code */
15897   __pyx_L1_error:;
15898   __Pyx_XDECREF(__pyx_t_1);
15899   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
15900   __pyx_r = 0;
15901   __pyx_L0:;
15902   __Pyx_XGIVEREF(__pyx_r);
15903   __Pyx_RefNannyFinishContext();
15904   return __pyx_r;
15905 }
15906 
15907 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":737
15908  *     return PyArray_MultiIterNew(1, <void*>a)
15909  *
15910  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
15911  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
15912  *
15913  */
15914 
__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject * __pyx_v_a,PyObject * __pyx_v_b)15915 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
15916   PyObject *__pyx_r = NULL;
15917   __Pyx_RefNannyDeclarations
15918   PyObject *__pyx_t_1 = NULL;
15919   int __pyx_lineno = 0;
15920   const char *__pyx_filename = NULL;
15921   int __pyx_clineno = 0;
15922   __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
15923 
15924   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":738
15925  *
15926  * cdef inline object PyArray_MultiIterNew2(a, b):
15927  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
15928  *
15929  * cdef inline object PyArray_MultiIterNew3(a, b, c):
15930  */
15931   __Pyx_XDECREF(__pyx_r);
15932   __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 738, __pyx_L1_error)
15933   __Pyx_GOTREF(__pyx_t_1);
15934   __pyx_r = __pyx_t_1;
15935   __pyx_t_1 = 0;
15936   goto __pyx_L0;
15937 
15938   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":737
15939  *     return PyArray_MultiIterNew(1, <void*>a)
15940  *
15941  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
15942  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
15943  *
15944  */
15945 
15946   /* function exit code */
15947   __pyx_L1_error:;
15948   __Pyx_XDECREF(__pyx_t_1);
15949   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
15950   __pyx_r = 0;
15951   __pyx_L0:;
15952   __Pyx_XGIVEREF(__pyx_r);
15953   __Pyx_RefNannyFinishContext();
15954   return __pyx_r;
15955 }
15956 
15957 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":740
15958  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
15959  *
15960  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
15961  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
15962  *
15963  */
15964 
__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c)15965 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
15966   PyObject *__pyx_r = NULL;
15967   __Pyx_RefNannyDeclarations
15968   PyObject *__pyx_t_1 = NULL;
15969   int __pyx_lineno = 0;
15970   const char *__pyx_filename = NULL;
15971   int __pyx_clineno = 0;
15972   __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
15973 
15974   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":741
15975  *
15976  * cdef inline object PyArray_MultiIterNew3(a, b, c):
15977  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
15978  *
15979  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
15980  */
15981   __Pyx_XDECREF(__pyx_r);
15982   __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, 741, __pyx_L1_error)
15983   __Pyx_GOTREF(__pyx_t_1);
15984   __pyx_r = __pyx_t_1;
15985   __pyx_t_1 = 0;
15986   goto __pyx_L0;
15987 
15988   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":740
15989  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
15990  *
15991  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
15992  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
15993  *
15994  */
15995 
15996   /* function exit code */
15997   __pyx_L1_error:;
15998   __Pyx_XDECREF(__pyx_t_1);
15999   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
16000   __pyx_r = 0;
16001   __pyx_L0:;
16002   __Pyx_XGIVEREF(__pyx_r);
16003   __Pyx_RefNannyFinishContext();
16004   return __pyx_r;
16005 }
16006 
16007 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":743
16008  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
16009  *
16010  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
16011  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
16012  *
16013  */
16014 
__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d)16015 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
16016   PyObject *__pyx_r = NULL;
16017   __Pyx_RefNannyDeclarations
16018   PyObject *__pyx_t_1 = NULL;
16019   int __pyx_lineno = 0;
16020   const char *__pyx_filename = NULL;
16021   int __pyx_clineno = 0;
16022   __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
16023 
16024   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":744
16025  *
16026  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
16027  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
16028  *
16029  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
16030  */
16031   __Pyx_XDECREF(__pyx_r);
16032   __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, 744, __pyx_L1_error)
16033   __Pyx_GOTREF(__pyx_t_1);
16034   __pyx_r = __pyx_t_1;
16035   __pyx_t_1 = 0;
16036   goto __pyx_L0;
16037 
16038   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":743
16039  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
16040  *
16041  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
16042  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
16043  *
16044  */
16045 
16046   /* function exit code */
16047   __pyx_L1_error:;
16048   __Pyx_XDECREF(__pyx_t_1);
16049   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
16050   __pyx_r = 0;
16051   __pyx_L0:;
16052   __Pyx_XGIVEREF(__pyx_r);
16053   __Pyx_RefNannyFinishContext();
16054   return __pyx_r;
16055 }
16056 
16057 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":746
16058  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
16059  *
16060  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
16061  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
16062  *
16063  */
16064 
__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)16065 static 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) {
16066   PyObject *__pyx_r = NULL;
16067   __Pyx_RefNannyDeclarations
16068   PyObject *__pyx_t_1 = NULL;
16069   int __pyx_lineno = 0;
16070   const char *__pyx_filename = NULL;
16071   int __pyx_clineno = 0;
16072   __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
16073 
16074   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":747
16075  *
16076  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
16077  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
16078  *
16079  * cdef inline tuple PyDataType_SHAPE(dtype d):
16080  */
16081   __Pyx_XDECREF(__pyx_r);
16082   __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, 747, __pyx_L1_error)
16083   __Pyx_GOTREF(__pyx_t_1);
16084   __pyx_r = __pyx_t_1;
16085   __pyx_t_1 = 0;
16086   goto __pyx_L0;
16087 
16088   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":746
16089  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
16090  *
16091  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
16092  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
16093  *
16094  */
16095 
16096   /* function exit code */
16097   __pyx_L1_error:;
16098   __Pyx_XDECREF(__pyx_t_1);
16099   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
16100   __pyx_r = 0;
16101   __pyx_L0:;
16102   __Pyx_XGIVEREF(__pyx_r);
16103   __Pyx_RefNannyFinishContext();
16104   return __pyx_r;
16105 }
16106 
16107 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":749
16108  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
16109  *
16110  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
16111  *     if PyDataType_HASSUBARRAY(d):
16112  *         return <tuple>d.subarray.shape
16113  */
16114 
__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr * __pyx_v_d)16115 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
16116   PyObject *__pyx_r = NULL;
16117   __Pyx_RefNannyDeclarations
16118   int __pyx_t_1;
16119   __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
16120 
16121   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":750
16122  *
16123  * cdef inline tuple PyDataType_SHAPE(dtype d):
16124  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
16125  *         return <tuple>d.subarray.shape
16126  *     else:
16127  */
16128   __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
16129   if (__pyx_t_1) {
16130 
16131     /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":751
16132  * cdef inline tuple PyDataType_SHAPE(dtype d):
16133  *     if PyDataType_HASSUBARRAY(d):
16134  *         return <tuple>d.subarray.shape             # <<<<<<<<<<<<<<
16135  *     else:
16136  *         return ()
16137  */
16138     __Pyx_XDECREF(__pyx_r);
16139     __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
16140     __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
16141     goto __pyx_L0;
16142 
16143     /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":750
16144  *
16145  * cdef inline tuple PyDataType_SHAPE(dtype d):
16146  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
16147  *         return <tuple>d.subarray.shape
16148  *     else:
16149  */
16150   }
16151 
16152   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":753
16153  *         return <tuple>d.subarray.shape
16154  *     else:
16155  *         return ()             # <<<<<<<<<<<<<<
16156  *
16157  *
16158  */
16159   /*else*/ {
16160     __Pyx_XDECREF(__pyx_r);
16161     __Pyx_INCREF(__pyx_empty_tuple);
16162     __pyx_r = __pyx_empty_tuple;
16163     goto __pyx_L0;
16164   }
16165 
16166   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":749
16167  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
16168  *
16169  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
16170  *     if PyDataType_HASSUBARRAY(d):
16171  *         return <tuple>d.subarray.shape
16172  */
16173 
16174   /* function exit code */
16175   __pyx_L0:;
16176   __Pyx_XGIVEREF(__pyx_r);
16177   __Pyx_RefNannyFinishContext();
16178   return __pyx_r;
16179 }
16180 
16181 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":868
16182  *     int _import_umath() except -1
16183  *
16184  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
16185  *     Py_INCREF(base) # important to do this before stealing the reference below!
16186  *     PyArray_SetBaseObject(arr, base)
16187  */
16188 
__pyx_f_5numpy_set_array_base(PyArrayObject * __pyx_v_arr,PyObject * __pyx_v_base)16189 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
16190   __Pyx_RefNannyDeclarations
16191   __Pyx_RefNannySetupContext("set_array_base", 0);
16192 
16193   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":869
16194  *
16195  * cdef inline void set_array_base(ndarray arr, object base):
16196  *     Py_INCREF(base) # important to do this before stealing the reference below!             # <<<<<<<<<<<<<<
16197  *     PyArray_SetBaseObject(arr, base)
16198  *
16199  */
16200   Py_INCREF(__pyx_v_base);
16201 
16202   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":870
16203  * cdef inline void set_array_base(ndarray arr, object base):
16204  *     Py_INCREF(base) # important to do this before stealing the reference below!
16205  *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
16206  *
16207  * cdef inline object get_array_base(ndarray arr):
16208  */
16209   (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
16210 
16211   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":868
16212  *     int _import_umath() except -1
16213  *
16214  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
16215  *     Py_INCREF(base) # important to do this before stealing the reference below!
16216  *     PyArray_SetBaseObject(arr, base)
16217  */
16218 
16219   /* function exit code */
16220   __Pyx_RefNannyFinishContext();
16221 }
16222 
16223 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":872
16224  *     PyArray_SetBaseObject(arr, base)
16225  *
16226  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
16227  *     base = PyArray_BASE(arr)
16228  *     if base is NULL:
16229  */
16230 
__pyx_f_5numpy_get_array_base(PyArrayObject * __pyx_v_arr)16231 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
16232   PyObject *__pyx_v_base;
16233   PyObject *__pyx_r = NULL;
16234   __Pyx_RefNannyDeclarations
16235   int __pyx_t_1;
16236   __Pyx_RefNannySetupContext("get_array_base", 0);
16237 
16238   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":873
16239  *
16240  * cdef inline object get_array_base(ndarray arr):
16241  *     base = PyArray_BASE(arr)             # <<<<<<<<<<<<<<
16242  *     if base is NULL:
16243  *         return None
16244  */
16245   __pyx_v_base = PyArray_BASE(__pyx_v_arr);
16246 
16247   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":874
16248  * cdef inline object get_array_base(ndarray arr):
16249  *     base = PyArray_BASE(arr)
16250  *     if base is NULL:             # <<<<<<<<<<<<<<
16251  *         return None
16252  *     return <object>base
16253  */
16254   __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
16255   if (__pyx_t_1) {
16256 
16257     /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":875
16258  *     base = PyArray_BASE(arr)
16259  *     if base is NULL:
16260  *         return None             # <<<<<<<<<<<<<<
16261  *     return <object>base
16262  *
16263  */
16264     __Pyx_XDECREF(__pyx_r);
16265     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16266     goto __pyx_L0;
16267 
16268     /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":874
16269  * cdef inline object get_array_base(ndarray arr):
16270  *     base = PyArray_BASE(arr)
16271  *     if base is NULL:             # <<<<<<<<<<<<<<
16272  *         return None
16273  *     return <object>base
16274  */
16275   }
16276 
16277   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":876
16278  *     if base is NULL:
16279  *         return None
16280  *     return <object>base             # <<<<<<<<<<<<<<
16281  *
16282  * # Versions of the import_* functions which are more suitable for
16283  */
16284   __Pyx_XDECREF(__pyx_r);
16285   __Pyx_INCREF(((PyObject *)__pyx_v_base));
16286   __pyx_r = ((PyObject *)__pyx_v_base);
16287   goto __pyx_L0;
16288 
16289   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":872
16290  *     PyArray_SetBaseObject(arr, base)
16291  *
16292  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
16293  *     base = PyArray_BASE(arr)
16294  *     if base is NULL:
16295  */
16296 
16297   /* function exit code */
16298   __pyx_L0:;
16299   __Pyx_XGIVEREF(__pyx_r);
16300   __Pyx_RefNannyFinishContext();
16301   return __pyx_r;
16302 }
16303 
16304 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":880
16305  * # Versions of the import_* functions which are more suitable for
16306  * # Cython code.
16307  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
16308  *     try:
16309  *         __pyx_import_array()
16310  */
16311 
__pyx_f_5numpy_import_array(void)16312 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
16313   int __pyx_r;
16314   __Pyx_RefNannyDeclarations
16315   PyObject *__pyx_t_1 = NULL;
16316   PyObject *__pyx_t_2 = NULL;
16317   PyObject *__pyx_t_3 = NULL;
16318   int __pyx_t_4;
16319   PyObject *__pyx_t_5 = NULL;
16320   PyObject *__pyx_t_6 = NULL;
16321   PyObject *__pyx_t_7 = NULL;
16322   PyObject *__pyx_t_8 = NULL;
16323   int __pyx_lineno = 0;
16324   const char *__pyx_filename = NULL;
16325   int __pyx_clineno = 0;
16326   __Pyx_RefNannySetupContext("import_array", 0);
16327 
16328   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":881
16329  * # Cython code.
16330  * cdef inline int import_array() except -1:
16331  *     try:             # <<<<<<<<<<<<<<
16332  *         __pyx_import_array()
16333  *     except Exception:
16334  */
16335   {
16336     __Pyx_PyThreadState_declare
16337     __Pyx_PyThreadState_assign
16338     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
16339     __Pyx_XGOTREF(__pyx_t_1);
16340     __Pyx_XGOTREF(__pyx_t_2);
16341     __Pyx_XGOTREF(__pyx_t_3);
16342     /*try:*/ {
16343 
16344       /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":882
16345  * cdef inline int import_array() except -1:
16346  *     try:
16347  *         __pyx_import_array()             # <<<<<<<<<<<<<<
16348  *     except Exception:
16349  *         raise ImportError("numpy.core.multiarray failed to import")
16350  */
16351       __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 882, __pyx_L3_error)
16352 
16353       /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":881
16354  * # Cython code.
16355  * cdef inline int import_array() except -1:
16356  *     try:             # <<<<<<<<<<<<<<
16357  *         __pyx_import_array()
16358  *     except Exception:
16359  */
16360     }
16361     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
16362     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
16363     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16364     goto __pyx_L8_try_end;
16365     __pyx_L3_error:;
16366 
16367     /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":883
16368  *     try:
16369  *         __pyx_import_array()
16370  *     except Exception:             # <<<<<<<<<<<<<<
16371  *         raise ImportError("numpy.core.multiarray failed to import")
16372  *
16373  */
16374     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
16375     if (__pyx_t_4) {
16376       __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
16377       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 883, __pyx_L5_except_error)
16378       __Pyx_GOTREF(__pyx_t_5);
16379       __Pyx_GOTREF(__pyx_t_6);
16380       __Pyx_GOTREF(__pyx_t_7);
16381 
16382       /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":884
16383  *         __pyx_import_array()
16384  *     except Exception:
16385  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
16386  *
16387  * cdef inline int import_umath() except -1:
16388  */
16389       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 884, __pyx_L5_except_error)
16390       __Pyx_GOTREF(__pyx_t_8);
16391       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
16392       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16393       __PYX_ERR(2, 884, __pyx_L5_except_error)
16394     }
16395     goto __pyx_L5_except_error;
16396     __pyx_L5_except_error:;
16397 
16398     /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":881
16399  * # Cython code.
16400  * cdef inline int import_array() except -1:
16401  *     try:             # <<<<<<<<<<<<<<
16402  *         __pyx_import_array()
16403  *     except Exception:
16404  */
16405     __Pyx_XGIVEREF(__pyx_t_1);
16406     __Pyx_XGIVEREF(__pyx_t_2);
16407     __Pyx_XGIVEREF(__pyx_t_3);
16408     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16409     goto __pyx_L1_error;
16410     __pyx_L8_try_end:;
16411   }
16412 
16413   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":880
16414  * # Versions of the import_* functions which are more suitable for
16415  * # Cython code.
16416  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
16417  *     try:
16418  *         __pyx_import_array()
16419  */
16420 
16421   /* function exit code */
16422   __pyx_r = 0;
16423   goto __pyx_L0;
16424   __pyx_L1_error:;
16425   __Pyx_XDECREF(__pyx_t_5);
16426   __Pyx_XDECREF(__pyx_t_6);
16427   __Pyx_XDECREF(__pyx_t_7);
16428   __Pyx_XDECREF(__pyx_t_8);
16429   __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
16430   __pyx_r = -1;
16431   __pyx_L0:;
16432   __Pyx_RefNannyFinishContext();
16433   return __pyx_r;
16434 }
16435 
16436 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":886
16437  *         raise ImportError("numpy.core.multiarray failed to import")
16438  *
16439  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
16440  *     try:
16441  *         _import_umath()
16442  */
16443 
__pyx_f_5numpy_import_umath(void)16444 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
16445   int __pyx_r;
16446   __Pyx_RefNannyDeclarations
16447   PyObject *__pyx_t_1 = NULL;
16448   PyObject *__pyx_t_2 = NULL;
16449   PyObject *__pyx_t_3 = NULL;
16450   int __pyx_t_4;
16451   PyObject *__pyx_t_5 = NULL;
16452   PyObject *__pyx_t_6 = NULL;
16453   PyObject *__pyx_t_7 = NULL;
16454   PyObject *__pyx_t_8 = NULL;
16455   int __pyx_lineno = 0;
16456   const char *__pyx_filename = NULL;
16457   int __pyx_clineno = 0;
16458   __Pyx_RefNannySetupContext("import_umath", 0);
16459 
16460   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":887
16461  *
16462  * cdef inline int import_umath() except -1:
16463  *     try:             # <<<<<<<<<<<<<<
16464  *         _import_umath()
16465  *     except Exception:
16466  */
16467   {
16468     __Pyx_PyThreadState_declare
16469     __Pyx_PyThreadState_assign
16470     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
16471     __Pyx_XGOTREF(__pyx_t_1);
16472     __Pyx_XGOTREF(__pyx_t_2);
16473     __Pyx_XGOTREF(__pyx_t_3);
16474     /*try:*/ {
16475 
16476       /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":888
16477  * cdef inline int import_umath() except -1:
16478  *     try:
16479  *         _import_umath()             # <<<<<<<<<<<<<<
16480  *     except Exception:
16481  *         raise ImportError("numpy.core.umath failed to import")
16482  */
16483       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 888, __pyx_L3_error)
16484 
16485       /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":887
16486  *
16487  * cdef inline int import_umath() except -1:
16488  *     try:             # <<<<<<<<<<<<<<
16489  *         _import_umath()
16490  *     except Exception:
16491  */
16492     }
16493     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
16494     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
16495     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16496     goto __pyx_L8_try_end;
16497     __pyx_L3_error:;
16498 
16499     /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":889
16500  *     try:
16501  *         _import_umath()
16502  *     except Exception:             # <<<<<<<<<<<<<<
16503  *         raise ImportError("numpy.core.umath failed to import")
16504  *
16505  */
16506     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
16507     if (__pyx_t_4) {
16508       __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
16509       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 889, __pyx_L5_except_error)
16510       __Pyx_GOTREF(__pyx_t_5);
16511       __Pyx_GOTREF(__pyx_t_6);
16512       __Pyx_GOTREF(__pyx_t_7);
16513 
16514       /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":890
16515  *         _import_umath()
16516  *     except Exception:
16517  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
16518  *
16519  * cdef inline int import_ufunc() except -1:
16520  */
16521       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 890, __pyx_L5_except_error)
16522       __Pyx_GOTREF(__pyx_t_8);
16523       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
16524       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16525       __PYX_ERR(2, 890, __pyx_L5_except_error)
16526     }
16527     goto __pyx_L5_except_error;
16528     __pyx_L5_except_error:;
16529 
16530     /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":887
16531  *
16532  * cdef inline int import_umath() except -1:
16533  *     try:             # <<<<<<<<<<<<<<
16534  *         _import_umath()
16535  *     except Exception:
16536  */
16537     __Pyx_XGIVEREF(__pyx_t_1);
16538     __Pyx_XGIVEREF(__pyx_t_2);
16539     __Pyx_XGIVEREF(__pyx_t_3);
16540     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16541     goto __pyx_L1_error;
16542     __pyx_L8_try_end:;
16543   }
16544 
16545   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":886
16546  *         raise ImportError("numpy.core.multiarray failed to import")
16547  *
16548  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
16549  *     try:
16550  *         _import_umath()
16551  */
16552 
16553   /* function exit code */
16554   __pyx_r = 0;
16555   goto __pyx_L0;
16556   __pyx_L1_error:;
16557   __Pyx_XDECREF(__pyx_t_5);
16558   __Pyx_XDECREF(__pyx_t_6);
16559   __Pyx_XDECREF(__pyx_t_7);
16560   __Pyx_XDECREF(__pyx_t_8);
16561   __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
16562   __pyx_r = -1;
16563   __pyx_L0:;
16564   __Pyx_RefNannyFinishContext();
16565   return __pyx_r;
16566 }
16567 
16568 /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":892
16569  *         raise ImportError("numpy.core.umath failed to import")
16570  *
16571  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
16572  *     try:
16573  *         _import_umath()
16574  */
16575 
__pyx_f_5numpy_import_ufunc(void)16576 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
16577   int __pyx_r;
16578   __Pyx_RefNannyDeclarations
16579   PyObject *__pyx_t_1 = NULL;
16580   PyObject *__pyx_t_2 = NULL;
16581   PyObject *__pyx_t_3 = NULL;
16582   int __pyx_t_4;
16583   PyObject *__pyx_t_5 = NULL;
16584   PyObject *__pyx_t_6 = NULL;
16585   PyObject *__pyx_t_7 = NULL;
16586   PyObject *__pyx_t_8 = NULL;
16587   int __pyx_lineno = 0;
16588   const char *__pyx_filename = NULL;
16589   int __pyx_clineno = 0;
16590   __Pyx_RefNannySetupContext("import_ufunc", 0);
16591 
16592   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":893
16593  *
16594  * cdef inline int import_ufunc() except -1:
16595  *     try:             # <<<<<<<<<<<<<<
16596  *         _import_umath()
16597  *     except Exception:
16598  */
16599   {
16600     __Pyx_PyThreadState_declare
16601     __Pyx_PyThreadState_assign
16602     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
16603     __Pyx_XGOTREF(__pyx_t_1);
16604     __Pyx_XGOTREF(__pyx_t_2);
16605     __Pyx_XGOTREF(__pyx_t_3);
16606     /*try:*/ {
16607 
16608       /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":894
16609  * cdef inline int import_ufunc() except -1:
16610  *     try:
16611  *         _import_umath()             # <<<<<<<<<<<<<<
16612  *     except Exception:
16613  *         raise ImportError("numpy.core.umath failed to import")
16614  */
16615       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 894, __pyx_L3_error)
16616 
16617       /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":893
16618  *
16619  * cdef inline int import_ufunc() except -1:
16620  *     try:             # <<<<<<<<<<<<<<
16621  *         _import_umath()
16622  *     except Exception:
16623  */
16624     }
16625     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
16626     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
16627     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16628     goto __pyx_L8_try_end;
16629     __pyx_L3_error:;
16630 
16631     /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":895
16632  *     try:
16633  *         _import_umath()
16634  *     except Exception:             # <<<<<<<<<<<<<<
16635  *         raise ImportError("numpy.core.umath failed to import")
16636  *
16637  */
16638     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
16639     if (__pyx_t_4) {
16640       __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
16641       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 895, __pyx_L5_except_error)
16642       __Pyx_GOTREF(__pyx_t_5);
16643       __Pyx_GOTREF(__pyx_t_6);
16644       __Pyx_GOTREF(__pyx_t_7);
16645 
16646       /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":896
16647  *         _import_umath()
16648  *     except Exception:
16649  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
16650  *
16651  * cdef extern from *:
16652  */
16653       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 896, __pyx_L5_except_error)
16654       __Pyx_GOTREF(__pyx_t_8);
16655       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
16656       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16657       __PYX_ERR(2, 896, __pyx_L5_except_error)
16658     }
16659     goto __pyx_L5_except_error;
16660     __pyx_L5_except_error:;
16661 
16662     /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":893
16663  *
16664  * cdef inline int import_ufunc() except -1:
16665  *     try:             # <<<<<<<<<<<<<<
16666  *         _import_umath()
16667  *     except Exception:
16668  */
16669     __Pyx_XGIVEREF(__pyx_t_1);
16670     __Pyx_XGIVEREF(__pyx_t_2);
16671     __Pyx_XGIVEREF(__pyx_t_3);
16672     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16673     goto __pyx_L1_error;
16674     __pyx_L8_try_end:;
16675   }
16676 
16677   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":892
16678  *         raise ImportError("numpy.core.umath failed to import")
16679  *
16680  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
16681  *     try:
16682  *         _import_umath()
16683  */
16684 
16685   /* function exit code */
16686   __pyx_r = 0;
16687   goto __pyx_L0;
16688   __pyx_L1_error:;
16689   __Pyx_XDECREF(__pyx_t_5);
16690   __Pyx_XDECREF(__pyx_t_6);
16691   __Pyx_XDECREF(__pyx_t_7);
16692   __Pyx_XDECREF(__pyx_t_8);
16693   __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
16694   __pyx_r = -1;
16695   __pyx_L0:;
16696   __Pyx_RefNannyFinishContext();
16697   return __pyx_r;
16698 }
16699 
16700 /* "carray.to_py":112
16701  *
16702  * @cname("__Pyx_carray_to_py_int")
16703  * cdef inline list __Pyx_carray_to_py_int(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
16704  *     cdef size_t i
16705  *     cdef object value
16706  */
16707 
__Pyx_carray_to_py_int(int * __pyx_v_v,Py_ssize_t __pyx_v_length)16708 static CYTHON_INLINE PyObject *__Pyx_carray_to_py_int(int *__pyx_v_v, Py_ssize_t __pyx_v_length) {
16709   size_t __pyx_v_i;
16710   PyObject *__pyx_v_value = 0;
16711   PyObject *__pyx_v_l = NULL;
16712   PyObject *__pyx_r = NULL;
16713   __Pyx_RefNannyDeclarations
16714   PyObject *__pyx_t_1 = NULL;
16715   size_t __pyx_t_2;
16716   size_t __pyx_t_3;
16717   size_t __pyx_t_4;
16718   int __pyx_lineno = 0;
16719   const char *__pyx_filename = NULL;
16720   int __pyx_clineno = 0;
16721   __Pyx_RefNannySetupContext("__Pyx_carray_to_py_int", 0);
16722 
16723   /* "carray.to_py":115
16724  *     cdef size_t i
16725  *     cdef object value
16726  *     l = PyList_New(length)             # <<<<<<<<<<<<<<
16727  *     for i in range(<size_t>length):
16728  *         value = v[i]
16729  */
16730   __pyx_t_1 = PyList_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 115, __pyx_L1_error)
16731   __Pyx_GOTREF(__pyx_t_1);
16732   __pyx_v_l = ((PyObject*)__pyx_t_1);
16733   __pyx_t_1 = 0;
16734 
16735   /* "carray.to_py":116
16736  *     cdef object value
16737  *     l = PyList_New(length)
16738  *     for i in range(<size_t>length):             # <<<<<<<<<<<<<<
16739  *         value = v[i]
16740  *         Py_INCREF(value)
16741  */
16742   __pyx_t_2 = ((size_t)__pyx_v_length);
16743   __pyx_t_3 = __pyx_t_2;
16744   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16745     __pyx_v_i = __pyx_t_4;
16746 
16747     /* "carray.to_py":117
16748  *     l = PyList_New(length)
16749  *     for i in range(<size_t>length):
16750  *         value = v[i]             # <<<<<<<<<<<<<<
16751  *         Py_INCREF(value)
16752  *         PyList_SET_ITEM(l, i, value)
16753  */
16754     __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error)
16755     __Pyx_GOTREF(__pyx_t_1);
16756     __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
16757     __pyx_t_1 = 0;
16758 
16759     /* "carray.to_py":118
16760  *     for i in range(<size_t>length):
16761  *         value = v[i]
16762  *         Py_INCREF(value)             # <<<<<<<<<<<<<<
16763  *         PyList_SET_ITEM(l, i, value)
16764  *     return l
16765  */
16766     Py_INCREF(__pyx_v_value);
16767 
16768     /* "carray.to_py":119
16769  *         value = v[i]
16770  *         Py_INCREF(value)
16771  *         PyList_SET_ITEM(l, i, value)             # <<<<<<<<<<<<<<
16772  *     return l
16773  *
16774  */
16775     PyList_SET_ITEM(__pyx_v_l, __pyx_v_i, __pyx_v_value);
16776   }
16777 
16778   /* "carray.to_py":120
16779  *         Py_INCREF(value)
16780  *         PyList_SET_ITEM(l, i, value)
16781  *     return l             # <<<<<<<<<<<<<<
16782  *
16783  *
16784  */
16785   __Pyx_XDECREF(__pyx_r);
16786   __Pyx_INCREF(__pyx_v_l);
16787   __pyx_r = __pyx_v_l;
16788   goto __pyx_L0;
16789 
16790   /* "carray.to_py":112
16791  *
16792  * @cname("__Pyx_carray_to_py_int")
16793  * cdef inline list __Pyx_carray_to_py_int(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
16794  *     cdef size_t i
16795  *     cdef object value
16796  */
16797 
16798   /* function exit code */
16799   __pyx_L1_error:;
16800   __Pyx_XDECREF(__pyx_t_1);
16801   __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_py_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
16802   __pyx_r = 0;
16803   __pyx_L0:;
16804   __Pyx_XDECREF(__pyx_v_value);
16805   __Pyx_XDECREF(__pyx_v_l);
16806   __Pyx_XGIVEREF(__pyx_r);
16807   __Pyx_RefNannyFinishContext();
16808   return __pyx_r;
16809 }
16810 
16811 /* "carray.to_py":124
16812  *
16813  * @cname("__Pyx_carray_to_tuple_int")
16814  * cdef inline tuple __Pyx_carray_to_tuple_int(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
16815  *     cdef size_t i
16816  *     cdef object value
16817  */
16818 
__Pyx_carray_to_tuple_int(int * __pyx_v_v,Py_ssize_t __pyx_v_length)16819 static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_int(int *__pyx_v_v, Py_ssize_t __pyx_v_length) {
16820   size_t __pyx_v_i;
16821   PyObject *__pyx_v_value = 0;
16822   PyObject *__pyx_v_t = NULL;
16823   PyObject *__pyx_r = NULL;
16824   __Pyx_RefNannyDeclarations
16825   PyObject *__pyx_t_1 = NULL;
16826   size_t __pyx_t_2;
16827   size_t __pyx_t_3;
16828   size_t __pyx_t_4;
16829   int __pyx_lineno = 0;
16830   const char *__pyx_filename = NULL;
16831   int __pyx_clineno = 0;
16832   __Pyx_RefNannySetupContext("__Pyx_carray_to_tuple_int", 0);
16833 
16834   /* "carray.to_py":127
16835  *     cdef size_t i
16836  *     cdef object value
16837  *     t = PyTuple_New(length)             # <<<<<<<<<<<<<<
16838  *     for i in range(<size_t>length):
16839  *         value = v[i]
16840  */
16841   __pyx_t_1 = PyTuple_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 127, __pyx_L1_error)
16842   __Pyx_GOTREF(__pyx_t_1);
16843   __pyx_v_t = ((PyObject*)__pyx_t_1);
16844   __pyx_t_1 = 0;
16845 
16846   /* "carray.to_py":128
16847  *     cdef object value
16848  *     t = PyTuple_New(length)
16849  *     for i in range(<size_t>length):             # <<<<<<<<<<<<<<
16850  *         value = v[i]
16851  *         Py_INCREF(value)
16852  */
16853   __pyx_t_2 = ((size_t)__pyx_v_length);
16854   __pyx_t_3 = __pyx_t_2;
16855   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16856     __pyx_v_i = __pyx_t_4;
16857 
16858     /* "carray.to_py":129
16859  *     t = PyTuple_New(length)
16860  *     for i in range(<size_t>length):
16861  *         value = v[i]             # <<<<<<<<<<<<<<
16862  *         Py_INCREF(value)
16863  *         PyTuple_SET_ITEM(t, i, value)
16864  */
16865     __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error)
16866     __Pyx_GOTREF(__pyx_t_1);
16867     __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
16868     __pyx_t_1 = 0;
16869 
16870     /* "carray.to_py":130
16871  *     for i in range(<size_t>length):
16872  *         value = v[i]
16873  *         Py_INCREF(value)             # <<<<<<<<<<<<<<
16874  *         PyTuple_SET_ITEM(t, i, value)
16875  *     return t
16876  */
16877     Py_INCREF(__pyx_v_value);
16878 
16879     /* "carray.to_py":131
16880  *         value = v[i]
16881  *         Py_INCREF(value)
16882  *         PyTuple_SET_ITEM(t, i, value)             # <<<<<<<<<<<<<<
16883  *     return t
16884  */
16885     PyTuple_SET_ITEM(__pyx_v_t, __pyx_v_i, __pyx_v_value);
16886   }
16887 
16888   /* "carray.to_py":132
16889  *         Py_INCREF(value)
16890  *         PyTuple_SET_ITEM(t, i, value)
16891  *     return t             # <<<<<<<<<<<<<<
16892  */
16893   __Pyx_XDECREF(__pyx_r);
16894   __Pyx_INCREF(__pyx_v_t);
16895   __pyx_r = __pyx_v_t;
16896   goto __pyx_L0;
16897 
16898   /* "carray.to_py":124
16899  *
16900  * @cname("__Pyx_carray_to_tuple_int")
16901  * cdef inline tuple __Pyx_carray_to_tuple_int(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
16902  *     cdef size_t i
16903  *     cdef object value
16904  */
16905 
16906   /* function exit code */
16907   __pyx_L1_error:;
16908   __Pyx_XDECREF(__pyx_t_1);
16909   __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_tuple_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
16910   __pyx_r = 0;
16911   __pyx_L0:;
16912   __Pyx_XDECREF(__pyx_v_value);
16913   __Pyx_XDECREF(__pyx_v_t);
16914   __Pyx_XGIVEREF(__pyx_r);
16915   __Pyx_RefNannyFinishContext();
16916   return __pyx_r;
16917 }
16918 
16919 /* "carray.from_py":77
16920  *
16921  * @cname("__Pyx_carray_from_py_int")
16922  * cdef int __Pyx_carray_from_py_int(object o, base_type *v, Py_ssize_t length) except -1:             # <<<<<<<<<<<<<<
16923  *     cdef Py_ssize_t i = length
16924  *     try:
16925  */
16926 
__Pyx_carray_from_py_int(PyObject * __pyx_v_o,int * __pyx_v_v,Py_ssize_t __pyx_v_length)16927 static int __Pyx_carray_from_py_int(PyObject *__pyx_v_o, int *__pyx_v_v, Py_ssize_t __pyx_v_length) {
16928   Py_ssize_t __pyx_v_i;
16929   PyObject *__pyx_v_item = NULL;
16930   int __pyx_r;
16931   __Pyx_RefNannyDeclarations
16932   PyObject *__pyx_t_1 = NULL;
16933   PyObject *__pyx_t_2 = NULL;
16934   PyObject *__pyx_t_3 = NULL;
16935   Py_ssize_t __pyx_t_4;
16936   int __pyx_t_5;
16937   int __pyx_t_6;
16938   PyObject *__pyx_t_7 = NULL;
16939   Py_ssize_t __pyx_t_8;
16940   PyObject *(*__pyx_t_9)(PyObject *);
16941   PyObject *__pyx_t_10 = NULL;
16942   char const *__pyx_t_11;
16943   int __pyx_lineno = 0;
16944   const char *__pyx_filename = NULL;
16945   int __pyx_clineno = 0;
16946   __Pyx_RefNannySetupContext("__Pyx_carray_from_py_int", 0);
16947 
16948   /* "carray.from_py":78
16949  * @cname("__Pyx_carray_from_py_int")
16950  * cdef int __Pyx_carray_from_py_int(object o, base_type *v, Py_ssize_t length) except -1:
16951  *     cdef Py_ssize_t i = length             # <<<<<<<<<<<<<<
16952  *     try:
16953  *         i = len(o)
16954  */
16955   __pyx_v_i = __pyx_v_length;
16956 
16957   /* "carray.from_py":79
16958  * cdef int __Pyx_carray_from_py_int(object o, base_type *v, Py_ssize_t length) except -1:
16959  *     cdef Py_ssize_t i = length
16960  *     try:             # <<<<<<<<<<<<<<
16961  *         i = len(o)
16962  *     except (TypeError, OverflowError):
16963  */
16964   {
16965     __Pyx_PyThreadState_declare
16966     __Pyx_PyThreadState_assign
16967     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
16968     __Pyx_XGOTREF(__pyx_t_1);
16969     __Pyx_XGOTREF(__pyx_t_2);
16970     __Pyx_XGOTREF(__pyx_t_3);
16971     /*try:*/ {
16972 
16973       /* "carray.from_py":80
16974  *     cdef Py_ssize_t i = length
16975  *     try:
16976  *         i = len(o)             # <<<<<<<<<<<<<<
16977  *     except (TypeError, OverflowError):
16978  *         pass
16979  */
16980       __pyx_t_4 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 80, __pyx_L3_error)
16981       __pyx_v_i = __pyx_t_4;
16982 
16983       /* "carray.from_py":79
16984  * cdef int __Pyx_carray_from_py_int(object o, base_type *v, Py_ssize_t length) except -1:
16985  *     cdef Py_ssize_t i = length
16986  *     try:             # <<<<<<<<<<<<<<
16987  *         i = len(o)
16988  *     except (TypeError, OverflowError):
16989  */
16990     }
16991     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
16992     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
16993     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16994     goto __pyx_L8_try_end;
16995     __pyx_L3_error:;
16996 
16997     /* "carray.from_py":81
16998  *     try:
16999  *         i = len(o)
17000  *     except (TypeError, OverflowError):             # <<<<<<<<<<<<<<
17001  *         pass
17002  *     if i == length:
17003  */
17004     __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OverflowError);
17005     if (__pyx_t_5) {
17006       __Pyx_ErrRestore(0,0,0);
17007       goto __pyx_L4_exception_handled;
17008     }
17009     goto __pyx_L5_except_error;
17010     __pyx_L5_except_error:;
17011 
17012     /* "carray.from_py":79
17013  * cdef int __Pyx_carray_from_py_int(object o, base_type *v, Py_ssize_t length) except -1:
17014  *     cdef Py_ssize_t i = length
17015  *     try:             # <<<<<<<<<<<<<<
17016  *         i = len(o)
17017  *     except (TypeError, OverflowError):
17018  */
17019     __Pyx_XGIVEREF(__pyx_t_1);
17020     __Pyx_XGIVEREF(__pyx_t_2);
17021     __Pyx_XGIVEREF(__pyx_t_3);
17022     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17023     goto __pyx_L1_error;
17024     __pyx_L4_exception_handled:;
17025     __Pyx_XGIVEREF(__pyx_t_1);
17026     __Pyx_XGIVEREF(__pyx_t_2);
17027     __Pyx_XGIVEREF(__pyx_t_3);
17028     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17029     __pyx_L8_try_end:;
17030   }
17031 
17032   /* "carray.from_py":83
17033  *     except (TypeError, OverflowError):
17034  *         pass
17035  *     if i == length:             # <<<<<<<<<<<<<<
17036  *         for i, item in enumerate(o):
17037  *             if i >= length:
17038  */
17039   __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0);
17040   if (__pyx_t_6) {
17041 
17042     /* "carray.from_py":84
17043  *         pass
17044  *     if i == length:
17045  *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
17046  *             if i >= length:
17047  *                 break
17048  */
17049     __pyx_t_4 = 0;
17050     if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
17051       __pyx_t_7 = __pyx_v_o; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0;
17052       __pyx_t_9 = NULL;
17053     } else {
17054       __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 84, __pyx_L1_error)
17055       __Pyx_GOTREF(__pyx_t_7);
17056       __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 84, __pyx_L1_error)
17057     }
17058     for (;;) {
17059       if (likely(!__pyx_t_9)) {
17060         if (likely(PyList_CheckExact(__pyx_t_7))) {
17061           if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break;
17062           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17063           __pyx_t_10 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 84, __pyx_L1_error)
17064           #else
17065           __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 84, __pyx_L1_error)
17066           __Pyx_GOTREF(__pyx_t_10);
17067           #endif
17068         } else {
17069           if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
17070           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17071           __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 84, __pyx_L1_error)
17072           #else
17073           __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 84, __pyx_L1_error)
17074           __Pyx_GOTREF(__pyx_t_10);
17075           #endif
17076         }
17077       } else {
17078         __pyx_t_10 = __pyx_t_9(__pyx_t_7);
17079         if (unlikely(!__pyx_t_10)) {
17080           PyObject* exc_type = PyErr_Occurred();
17081           if (exc_type) {
17082             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
17083             else __PYX_ERR(1, 84, __pyx_L1_error)
17084           }
17085           break;
17086         }
17087         __Pyx_GOTREF(__pyx_t_10);
17088       }
17089       __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_10);
17090       __pyx_t_10 = 0;
17091       __pyx_v_i = __pyx_t_4;
17092       __pyx_t_4 = (__pyx_t_4 + 1);
17093 
17094       /* "carray.from_py":85
17095  *     if i == length:
17096  *         for i, item in enumerate(o):
17097  *             if i >= length:             # <<<<<<<<<<<<<<
17098  *                 break
17099  *             v[i] = item
17100  */
17101       __pyx_t_6 = ((__pyx_v_i >= __pyx_v_length) != 0);
17102       if (__pyx_t_6) {
17103 
17104         /* "carray.from_py":86
17105  *         for i, item in enumerate(o):
17106  *             if i >= length:
17107  *                 break             # <<<<<<<<<<<<<<
17108  *             v[i] = item
17109  *         else:
17110  */
17111         goto __pyx_L11_break;
17112 
17113         /* "carray.from_py":85
17114  *     if i == length:
17115  *         for i, item in enumerate(o):
17116  *             if i >= length:             # <<<<<<<<<<<<<<
17117  *                 break
17118  *             v[i] = item
17119  */
17120       }
17121 
17122       /* "carray.from_py":87
17123  *             if i >= length:
17124  *                 break
17125  *             v[i] = item             # <<<<<<<<<<<<<<
17126  *         else:
17127  *             i += 1  # convert index to length
17128  */
17129       __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_item); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 87, __pyx_L1_error)
17130       (__pyx_v_v[__pyx_v_i]) = __pyx_t_5;
17131 
17132       /* "carray.from_py":84
17133  *         pass
17134  *     if i == length:
17135  *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
17136  *             if i >= length:
17137  *                 break
17138  */
17139     }
17140     /*else*/ {
17141 
17142       /* "carray.from_py":89
17143  *             v[i] = item
17144  *         else:
17145  *             i += 1  # convert index to length             # <<<<<<<<<<<<<<
17146  *             if i == length:
17147  *                 return 0
17148  */
17149       __pyx_v_i = (__pyx_v_i + 1);
17150 
17151       /* "carray.from_py":90
17152  *         else:
17153  *             i += 1  # convert index to length
17154  *             if i == length:             # <<<<<<<<<<<<<<
17155  *                 return 0
17156  *
17157  */
17158       __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0);
17159       if (__pyx_t_6) {
17160 
17161         /* "carray.from_py":91
17162  *             i += 1  # convert index to length
17163  *             if i == length:
17164  *                 return 0             # <<<<<<<<<<<<<<
17165  *
17166  *     PyErr_Format(
17167  */
17168         __pyx_r = 0;
17169         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17170         goto __pyx_L0;
17171 
17172         /* "carray.from_py":90
17173  *         else:
17174  *             i += 1  # convert index to length
17175  *             if i == length:             # <<<<<<<<<<<<<<
17176  *                 return 0
17177  *
17178  */
17179       }
17180     }
17181 
17182     /* "carray.from_py":84
17183  *         pass
17184  *     if i == length:
17185  *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
17186  *             if i >= length:
17187  *                 break
17188  */
17189     __pyx_L11_break:;
17190     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17191 
17192     /* "carray.from_py":83
17193  *     except (TypeError, OverflowError):
17194  *         pass
17195  *     if i == length:             # <<<<<<<<<<<<<<
17196  *         for i, item in enumerate(o):
17197  *             if i >= length:
17198  */
17199   }
17200 
17201   /* "carray.from_py":96
17202  *         IndexError,
17203  *         ("too many values found during array assignment, expected %zd"
17204  *          if i >= length else             # <<<<<<<<<<<<<<
17205  *          "not enough values found during array assignment, expected %zd, got %zd"),
17206  *         length, i)
17207  */
17208   if (((__pyx_v_i >= __pyx_v_length) != 0)) {
17209     __pyx_t_11 = ((char const *)"too many values found during array assignment, expected %zd");
17210   } else {
17211     __pyx_t_11 = ((char const *)"not enough values found during array assignment, expected %zd, got %zd");
17212   }
17213 
17214   /* "carray.from_py":93
17215  *                 return 0
17216  *
17217  *     PyErr_Format(             # <<<<<<<<<<<<<<
17218  *         IndexError,
17219  *         ("too many values found during array assignment, expected %zd"
17220  */
17221   __pyx_t_7 = PyErr_Format(__pyx_builtin_IndexError, __pyx_t_11, __pyx_v_length, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 93, __pyx_L1_error)
17222   __Pyx_GOTREF(__pyx_t_7);
17223   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17224 
17225   /* "carray.from_py":77
17226  *
17227  * @cname("__Pyx_carray_from_py_int")
17228  * cdef int __Pyx_carray_from_py_int(object o, base_type *v, Py_ssize_t length) except -1:             # <<<<<<<<<<<<<<
17229  *     cdef Py_ssize_t i = length
17230  *     try:
17231  */
17232 
17233   /* function exit code */
17234   __pyx_r = 0;
17235   goto __pyx_L0;
17236   __pyx_L1_error:;
17237   __Pyx_XDECREF(__pyx_t_7);
17238   __Pyx_XDECREF(__pyx_t_10);
17239   __Pyx_AddTraceback("carray.from_py.__Pyx_carray_from_py_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
17240   __pyx_r = -1;
17241   __pyx_L0:;
17242   __Pyx_XDECREF(__pyx_v_item);
17243   __Pyx_RefNannyFinishContext();
17244   return __pyx_r;
17245 }
17246 
17247 /* "View.MemoryView":122
17248  *         cdef bint dtype_is_object
17249  *
17250  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
17251  *                   mode="c", bint allocate_buffer=True):
17252  *
17253  */
17254 
17255 /* Python wrapper */
17256 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_array___cinit__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)17257 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17258   PyObject *__pyx_v_shape = 0;
17259   Py_ssize_t __pyx_v_itemsize;
17260   PyObject *__pyx_v_format = 0;
17261   PyObject *__pyx_v_mode = 0;
17262   int __pyx_v_allocate_buffer;
17263   int __pyx_lineno = 0;
17264   const char *__pyx_filename = NULL;
17265   int __pyx_clineno = 0;
17266   int __pyx_r;
17267   __Pyx_RefNannyDeclarations
17268   __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
17269   {
17270     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
17271     PyObject* values[5] = {0,0,0,0,0};
17272     values[3] = ((PyObject *)__pyx_n_s_c);
17273     if (unlikely(__pyx_kwds)) {
17274       Py_ssize_t kw_args;
17275       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17276       switch (pos_args) {
17277         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
17278         CYTHON_FALLTHROUGH;
17279         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17280         CYTHON_FALLTHROUGH;
17281         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17282         CYTHON_FALLTHROUGH;
17283         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17284         CYTHON_FALLTHROUGH;
17285         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17286         CYTHON_FALLTHROUGH;
17287         case  0: break;
17288         default: goto __pyx_L5_argtuple_error;
17289       }
17290       kw_args = PyDict_Size(__pyx_kwds);
17291       switch (pos_args) {
17292         case  0:
17293         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
17294         else goto __pyx_L5_argtuple_error;
17295         CYTHON_FALLTHROUGH;
17296         case  1:
17297         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
17298         else {
17299           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
17300         }
17301         CYTHON_FALLTHROUGH;
17302         case  2:
17303         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
17304         else {
17305           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
17306         }
17307         CYTHON_FALLTHROUGH;
17308         case  3:
17309         if (kw_args > 0) {
17310           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
17311           if (value) { values[3] = value; kw_args--; }
17312         }
17313         CYTHON_FALLTHROUGH;
17314         case  4:
17315         if (kw_args > 0) {
17316           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
17317           if (value) { values[4] = value; kw_args--; }
17318         }
17319       }
17320       if (unlikely(kw_args > 0)) {
17321         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
17322       }
17323     } else {
17324       switch (PyTuple_GET_SIZE(__pyx_args)) {
17325         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
17326         CYTHON_FALLTHROUGH;
17327         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17328         CYTHON_FALLTHROUGH;
17329         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17330         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17331         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17332         break;
17333         default: goto __pyx_L5_argtuple_error;
17334       }
17335     }
17336     __pyx_v_shape = ((PyObject*)values[0]);
17337     __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
17338     __pyx_v_format = values[2];
17339     __pyx_v_mode = values[3];
17340     if (values[4]) {
17341       __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
17342     } else {
17343 
17344       /* "View.MemoryView":123
17345  *
17346  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
17347  *                   mode="c", bint allocate_buffer=True):             # <<<<<<<<<<<<<<
17348  *
17349  *         cdef int idx
17350  */
17351       __pyx_v_allocate_buffer = ((int)1);
17352     }
17353   }
17354   goto __pyx_L4_argument_unpacking_done;
17355   __pyx_L5_argtuple_error:;
17356   __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
17357   __pyx_L3_error:;
17358   __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17359   __Pyx_RefNannyFinishContext();
17360   return -1;
17361   __pyx_L4_argument_unpacking_done:;
17362   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
17363   if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
17364     PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 122, __pyx_L1_error)
17365   }
17366   __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);
17367 
17368   /* "View.MemoryView":122
17369  *         cdef bint dtype_is_object
17370  *
17371  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
17372  *                   mode="c", bint allocate_buffer=True):
17373  *
17374  */
17375 
17376   /* function exit code */
17377   goto __pyx_L0;
17378   __pyx_L1_error:;
17379   __pyx_r = -1;
17380   __pyx_L0:;
17381   __Pyx_RefNannyFinishContext();
17382   return __pyx_r;
17383 }
17384 
__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)17385 static 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) {
17386   int __pyx_v_idx;
17387   Py_ssize_t __pyx_v_i;
17388   Py_ssize_t __pyx_v_dim;
17389   PyObject **__pyx_v_p;
17390   char __pyx_v_order;
17391   int __pyx_r;
17392   __Pyx_RefNannyDeclarations
17393   Py_ssize_t __pyx_t_1;
17394   int __pyx_t_2;
17395   PyObject *__pyx_t_3 = NULL;
17396   int __pyx_t_4;
17397   PyObject *__pyx_t_5 = NULL;
17398   PyObject *__pyx_t_6 = NULL;
17399   char *__pyx_t_7;
17400   int __pyx_t_8;
17401   Py_ssize_t __pyx_t_9;
17402   PyObject *__pyx_t_10 = NULL;
17403   Py_ssize_t __pyx_t_11;
17404   int __pyx_lineno = 0;
17405   const char *__pyx_filename = NULL;
17406   int __pyx_clineno = 0;
17407   __Pyx_RefNannySetupContext("__cinit__", 0);
17408   __Pyx_INCREF(__pyx_v_format);
17409 
17410   /* "View.MemoryView":129
17411  *         cdef PyObject **p
17412  *
17413  *         self.ndim = <int> len(shape)             # <<<<<<<<<<<<<<
17414  *         self.itemsize = itemsize
17415  *
17416  */
17417   if (unlikely(__pyx_v_shape == Py_None)) {
17418     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
17419     __PYX_ERR(1, 129, __pyx_L1_error)
17420   }
17421   __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
17422   __pyx_v_self->ndim = ((int)__pyx_t_1);
17423 
17424   /* "View.MemoryView":130
17425  *
17426  *         self.ndim = <int> len(shape)
17427  *         self.itemsize = itemsize             # <<<<<<<<<<<<<<
17428  *
17429  *         if not self.ndim:
17430  */
17431   __pyx_v_self->itemsize = __pyx_v_itemsize;
17432 
17433   /* "View.MemoryView":132
17434  *         self.itemsize = itemsize
17435  *
17436  *         if not self.ndim:             # <<<<<<<<<<<<<<
17437  *             raise ValueError("Empty shape tuple for cython.array")
17438  *
17439  */
17440   __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
17441   if (unlikely(__pyx_t_2)) {
17442 
17443     /* "View.MemoryView":133
17444  *
17445  *         if not self.ndim:
17446  *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
17447  *
17448  *         if itemsize <= 0:
17449  */
17450     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
17451     __Pyx_GOTREF(__pyx_t_3);
17452     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17453     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17454     __PYX_ERR(1, 133, __pyx_L1_error)
17455 
17456     /* "View.MemoryView":132
17457  *         self.itemsize = itemsize
17458  *
17459  *         if not self.ndim:             # <<<<<<<<<<<<<<
17460  *             raise ValueError("Empty shape tuple for cython.array")
17461  *
17462  */
17463   }
17464 
17465   /* "View.MemoryView":135
17466  *             raise ValueError("Empty shape tuple for cython.array")
17467  *
17468  *         if itemsize <= 0:             # <<<<<<<<<<<<<<
17469  *             raise ValueError("itemsize <= 0 for cython.array")
17470  *
17471  */
17472   __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
17473   if (unlikely(__pyx_t_2)) {
17474 
17475     /* "View.MemoryView":136
17476  *
17477  *         if itemsize <= 0:
17478  *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
17479  *
17480  *         if not isinstance(format, bytes):
17481  */
17482     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
17483     __Pyx_GOTREF(__pyx_t_3);
17484     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17485     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17486     __PYX_ERR(1, 136, __pyx_L1_error)
17487 
17488     /* "View.MemoryView":135
17489  *             raise ValueError("Empty shape tuple for cython.array")
17490  *
17491  *         if itemsize <= 0:             # <<<<<<<<<<<<<<
17492  *             raise ValueError("itemsize <= 0 for cython.array")
17493  *
17494  */
17495   }
17496 
17497   /* "View.MemoryView":138
17498  *             raise ValueError("itemsize <= 0 for cython.array")
17499  *
17500  *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
17501  *             format = format.encode('ASCII')
17502  *         self._format = format  # keep a reference to the byte string
17503  */
17504   __pyx_t_2 = PyBytes_Check(__pyx_v_format);
17505   __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
17506   if (__pyx_t_4) {
17507 
17508     /* "View.MemoryView":139
17509  *
17510  *         if not isinstance(format, bytes):
17511  *             format = format.encode('ASCII')             # <<<<<<<<<<<<<<
17512  *         self._format = format  # keep a reference to the byte string
17513  *         self.format = self._format
17514  */
17515     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
17516     __Pyx_GOTREF(__pyx_t_5);
17517     __pyx_t_6 = NULL;
17518     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
17519       __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
17520       if (likely(__pyx_t_6)) {
17521         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
17522         __Pyx_INCREF(__pyx_t_6);
17523         __Pyx_INCREF(function);
17524         __Pyx_DECREF_SET(__pyx_t_5, function);
17525       }
17526     }
17527     __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
17528     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
17529     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
17530     __Pyx_GOTREF(__pyx_t_3);
17531     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17532     __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
17533     __pyx_t_3 = 0;
17534 
17535     /* "View.MemoryView":138
17536  *             raise ValueError("itemsize <= 0 for cython.array")
17537  *
17538  *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
17539  *             format = format.encode('ASCII')
17540  *         self._format = format  # keep a reference to the byte string
17541  */
17542   }
17543 
17544   /* "View.MemoryView":140
17545  *         if not isinstance(format, bytes):
17546  *             format = format.encode('ASCII')
17547  *         self._format = format  # keep a reference to the byte string             # <<<<<<<<<<<<<<
17548  *         self.format = self._format
17549  *
17550  */
17551   if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
17552   __pyx_t_3 = __pyx_v_format;
17553   __Pyx_INCREF(__pyx_t_3);
17554   __Pyx_GIVEREF(__pyx_t_3);
17555   __Pyx_GOTREF(__pyx_v_self->_format);
17556   __Pyx_DECREF(__pyx_v_self->_format);
17557   __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
17558   __pyx_t_3 = 0;
17559 
17560   /* "View.MemoryView":141
17561  *             format = format.encode('ASCII')
17562  *         self._format = format  # keep a reference to the byte string
17563  *         self.format = self._format             # <<<<<<<<<<<<<<
17564  *
17565  *
17566  */
17567   if (unlikely(__pyx_v_self->_format == Py_None)) {
17568     PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
17569     __PYX_ERR(1, 141, __pyx_L1_error)
17570   }
17571   __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
17572   __pyx_v_self->format = __pyx_t_7;
17573 
17574   /* "View.MemoryView":144
17575  *
17576  *
17577  *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)             # <<<<<<<<<<<<<<
17578  *         self._strides = self._shape + self.ndim
17579  *
17580  */
17581   __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
17582 
17583   /* "View.MemoryView":145
17584  *
17585  *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
17586  *         self._strides = self._shape + self.ndim             # <<<<<<<<<<<<<<
17587  *
17588  *         if not self._shape:
17589  */
17590   __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
17591 
17592   /* "View.MemoryView":147
17593  *         self._strides = self._shape + self.ndim
17594  *
17595  *         if not self._shape:             # <<<<<<<<<<<<<<
17596  *             raise MemoryError("unable to allocate shape and strides.")
17597  *
17598  */
17599   __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
17600   if (unlikely(__pyx_t_4)) {
17601 
17602     /* "View.MemoryView":148
17603  *
17604  *         if not self._shape:
17605  *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
17606  *
17607  *
17608  */
17609     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
17610     __Pyx_GOTREF(__pyx_t_3);
17611     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17612     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17613     __PYX_ERR(1, 148, __pyx_L1_error)
17614 
17615     /* "View.MemoryView":147
17616  *         self._strides = self._shape + self.ndim
17617  *
17618  *         if not self._shape:             # <<<<<<<<<<<<<<
17619  *             raise MemoryError("unable to allocate shape and strides.")
17620  *
17621  */
17622   }
17623 
17624   /* "View.MemoryView":151
17625  *
17626  *
17627  *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
17628  *             if dim <= 0:
17629  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
17630  */
17631   __pyx_t_8 = 0;
17632   __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
17633   for (;;) {
17634     if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
17635     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17636     __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
17637     #else
17638     __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
17639     __Pyx_GOTREF(__pyx_t_5);
17640     #endif
17641     __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
17642     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17643     __pyx_v_dim = __pyx_t_9;
17644     __pyx_v_idx = __pyx_t_8;
17645     __pyx_t_8 = (__pyx_t_8 + 1);
17646 
17647     /* "View.MemoryView":152
17648  *
17649  *         for idx, dim in enumerate(shape):
17650  *             if dim <= 0:             # <<<<<<<<<<<<<<
17651  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
17652  *             self._shape[idx] = dim
17653  */
17654     __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
17655     if (unlikely(__pyx_t_4)) {
17656 
17657       /* "View.MemoryView":153
17658  *         for idx, dim in enumerate(shape):
17659  *             if dim <= 0:
17660  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))             # <<<<<<<<<<<<<<
17661  *             self._shape[idx] = dim
17662  *
17663  */
17664       __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
17665       __Pyx_GOTREF(__pyx_t_5);
17666       __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
17667       __Pyx_GOTREF(__pyx_t_6);
17668       __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
17669       __Pyx_GOTREF(__pyx_t_10);
17670       __Pyx_GIVEREF(__pyx_t_5);
17671       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
17672       __Pyx_GIVEREF(__pyx_t_6);
17673       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
17674       __pyx_t_5 = 0;
17675       __pyx_t_6 = 0;
17676       __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
17677       __Pyx_GOTREF(__pyx_t_6);
17678       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17679       __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
17680       __Pyx_GOTREF(__pyx_t_10);
17681       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17682       __Pyx_Raise(__pyx_t_10, 0, 0, 0);
17683       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17684       __PYX_ERR(1, 153, __pyx_L1_error)
17685 
17686       /* "View.MemoryView":152
17687  *
17688  *         for idx, dim in enumerate(shape):
17689  *             if dim <= 0:             # <<<<<<<<<<<<<<
17690  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
17691  *             self._shape[idx] = dim
17692  */
17693     }
17694 
17695     /* "View.MemoryView":154
17696  *             if dim <= 0:
17697  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
17698  *             self._shape[idx] = dim             # <<<<<<<<<<<<<<
17699  *
17700  *         cdef char order
17701  */
17702     (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
17703 
17704     /* "View.MemoryView":151
17705  *
17706  *
17707  *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
17708  *             if dim <= 0:
17709  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
17710  */
17711   }
17712   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17713 
17714   /* "View.MemoryView":157
17715  *
17716  *         cdef char order
17717  *         if mode == 'fortran':             # <<<<<<<<<<<<<<
17718  *             order = b'F'
17719  *             self.mode = u'fortran'
17720  */
17721   __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
17722   if (__pyx_t_4) {
17723 
17724     /* "View.MemoryView":158
17725  *         cdef char order
17726  *         if mode == 'fortran':
17727  *             order = b'F'             # <<<<<<<<<<<<<<
17728  *             self.mode = u'fortran'
17729  *         elif mode == 'c':
17730  */
17731     __pyx_v_order = 'F';
17732 
17733     /* "View.MemoryView":159
17734  *         if mode == 'fortran':
17735  *             order = b'F'
17736  *             self.mode = u'fortran'             # <<<<<<<<<<<<<<
17737  *         elif mode == 'c':
17738  *             order = b'C'
17739  */
17740     __Pyx_INCREF(__pyx_n_u_fortran);
17741     __Pyx_GIVEREF(__pyx_n_u_fortran);
17742     __Pyx_GOTREF(__pyx_v_self->mode);
17743     __Pyx_DECREF(__pyx_v_self->mode);
17744     __pyx_v_self->mode = __pyx_n_u_fortran;
17745 
17746     /* "View.MemoryView":157
17747  *
17748  *         cdef char order
17749  *         if mode == 'fortran':             # <<<<<<<<<<<<<<
17750  *             order = b'F'
17751  *             self.mode = u'fortran'
17752  */
17753     goto __pyx_L10;
17754   }
17755 
17756   /* "View.MemoryView":160
17757  *             order = b'F'
17758  *             self.mode = u'fortran'
17759  *         elif mode == 'c':             # <<<<<<<<<<<<<<
17760  *             order = b'C'
17761  *             self.mode = u'c'
17762  */
17763   __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
17764   if (likely(__pyx_t_4)) {
17765 
17766     /* "View.MemoryView":161
17767  *             self.mode = u'fortran'
17768  *         elif mode == 'c':
17769  *             order = b'C'             # <<<<<<<<<<<<<<
17770  *             self.mode = u'c'
17771  *         else:
17772  */
17773     __pyx_v_order = 'C';
17774 
17775     /* "View.MemoryView":162
17776  *         elif mode == 'c':
17777  *             order = b'C'
17778  *             self.mode = u'c'             # <<<<<<<<<<<<<<
17779  *         else:
17780  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
17781  */
17782     __Pyx_INCREF(__pyx_n_u_c);
17783     __Pyx_GIVEREF(__pyx_n_u_c);
17784     __Pyx_GOTREF(__pyx_v_self->mode);
17785     __Pyx_DECREF(__pyx_v_self->mode);
17786     __pyx_v_self->mode = __pyx_n_u_c;
17787 
17788     /* "View.MemoryView":160
17789  *             order = b'F'
17790  *             self.mode = u'fortran'
17791  *         elif mode == 'c':             # <<<<<<<<<<<<<<
17792  *             order = b'C'
17793  *             self.mode = u'c'
17794  */
17795     goto __pyx_L10;
17796   }
17797 
17798   /* "View.MemoryView":164
17799  *             self.mode = u'c'
17800  *         else:
17801  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)             # <<<<<<<<<<<<<<
17802  *
17803  *         self.len = fill_contig_strides_array(self._shape, self._strides,
17804  */
17805   /*else*/ {
17806     __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
17807     __Pyx_GOTREF(__pyx_t_3);
17808     __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
17809     __Pyx_GOTREF(__pyx_t_10);
17810     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17811     __Pyx_Raise(__pyx_t_10, 0, 0, 0);
17812     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17813     __PYX_ERR(1, 164, __pyx_L1_error)
17814   }
17815   __pyx_L10:;
17816 
17817   /* "View.MemoryView":166
17818  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
17819  *
17820  *         self.len = fill_contig_strides_array(self._shape, self._strides,             # <<<<<<<<<<<<<<
17821  *                                              itemsize, self.ndim, order)
17822  *
17823  */
17824   __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);
17825 
17826   /* "View.MemoryView":169
17827  *                                              itemsize, self.ndim, order)
17828  *
17829  *         self.free_data = allocate_buffer             # <<<<<<<<<<<<<<
17830  *         self.dtype_is_object = format == b'O'
17831  *         if allocate_buffer:
17832  */
17833   __pyx_v_self->free_data = __pyx_v_allocate_buffer;
17834 
17835   /* "View.MemoryView":170
17836  *
17837  *         self.free_data = allocate_buffer
17838  *         self.dtype_is_object = format == b'O'             # <<<<<<<<<<<<<<
17839  *         if allocate_buffer:
17840  *
17841  */
17842   __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
17843   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
17844   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17845   __pyx_v_self->dtype_is_object = __pyx_t_4;
17846 
17847   /* "View.MemoryView":171
17848  *         self.free_data = allocate_buffer
17849  *         self.dtype_is_object = format == b'O'
17850  *         if allocate_buffer:             # <<<<<<<<<<<<<<
17851  *
17852  *
17853  */
17854   __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
17855   if (__pyx_t_4) {
17856 
17857     /* "View.MemoryView":174
17858  *
17859  *
17860  *             self.data = <char *>malloc(self.len)             # <<<<<<<<<<<<<<
17861  *             if not self.data:
17862  *                 raise MemoryError("unable to allocate array data.")
17863  */
17864     __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
17865 
17866     /* "View.MemoryView":175
17867  *
17868  *             self.data = <char *>malloc(self.len)
17869  *             if not self.data:             # <<<<<<<<<<<<<<
17870  *                 raise MemoryError("unable to allocate array data.")
17871  *
17872  */
17873     __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
17874     if (unlikely(__pyx_t_4)) {
17875 
17876       /* "View.MemoryView":176
17877  *             self.data = <char *>malloc(self.len)
17878  *             if not self.data:
17879  *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
17880  *
17881  *             if self.dtype_is_object:
17882  */
17883       __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
17884       __Pyx_GOTREF(__pyx_t_10);
17885       __Pyx_Raise(__pyx_t_10, 0, 0, 0);
17886       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17887       __PYX_ERR(1, 176, __pyx_L1_error)
17888 
17889       /* "View.MemoryView":175
17890  *
17891  *             self.data = <char *>malloc(self.len)
17892  *             if not self.data:             # <<<<<<<<<<<<<<
17893  *                 raise MemoryError("unable to allocate array data.")
17894  *
17895  */
17896     }
17897 
17898     /* "View.MemoryView":178
17899  *                 raise MemoryError("unable to allocate array data.")
17900  *
17901  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
17902  *                 p = <PyObject **> self.data
17903  *                 for i in range(self.len / itemsize):
17904  */
17905     __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
17906     if (__pyx_t_4) {
17907 
17908       /* "View.MemoryView":179
17909  *
17910  *             if self.dtype_is_object:
17911  *                 p = <PyObject **> self.data             # <<<<<<<<<<<<<<
17912  *                 for i in range(self.len / itemsize):
17913  *                     p[i] = Py_None
17914  */
17915       __pyx_v_p = ((PyObject **)__pyx_v_self->data);
17916 
17917       /* "View.MemoryView":180
17918  *             if self.dtype_is_object:
17919  *                 p = <PyObject **> self.data
17920  *                 for i in range(self.len / itemsize):             # <<<<<<<<<<<<<<
17921  *                     p[i] = Py_None
17922  *                     Py_INCREF(Py_None)
17923  */
17924       if (unlikely(__pyx_v_itemsize == 0)) {
17925         PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
17926         __PYX_ERR(1, 180, __pyx_L1_error)
17927       }
17928       else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
17929         PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
17930         __PYX_ERR(1, 180, __pyx_L1_error)
17931       }
17932       __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
17933       __pyx_t_9 = __pyx_t_1;
17934       for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
17935         __pyx_v_i = __pyx_t_11;
17936 
17937         /* "View.MemoryView":181
17938  *                 p = <PyObject **> self.data
17939  *                 for i in range(self.len / itemsize):
17940  *                     p[i] = Py_None             # <<<<<<<<<<<<<<
17941  *                     Py_INCREF(Py_None)
17942  *
17943  */
17944         (__pyx_v_p[__pyx_v_i]) = Py_None;
17945 
17946         /* "View.MemoryView":182
17947  *                 for i in range(self.len / itemsize):
17948  *                     p[i] = Py_None
17949  *                     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
17950  *
17951  *     @cname('getbuffer')
17952  */
17953         Py_INCREF(Py_None);
17954       }
17955 
17956       /* "View.MemoryView":178
17957  *                 raise MemoryError("unable to allocate array data.")
17958  *
17959  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
17960  *                 p = <PyObject **> self.data
17961  *                 for i in range(self.len / itemsize):
17962  */
17963     }
17964 
17965     /* "View.MemoryView":171
17966  *         self.free_data = allocate_buffer
17967  *         self.dtype_is_object = format == b'O'
17968  *         if allocate_buffer:             # <<<<<<<<<<<<<<
17969  *
17970  *
17971  */
17972   }
17973 
17974   /* "View.MemoryView":122
17975  *         cdef bint dtype_is_object
17976  *
17977  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
17978  *                   mode="c", bint allocate_buffer=True):
17979  *
17980  */
17981 
17982   /* function exit code */
17983   __pyx_r = 0;
17984   goto __pyx_L0;
17985   __pyx_L1_error:;
17986   __Pyx_XDECREF(__pyx_t_3);
17987   __Pyx_XDECREF(__pyx_t_5);
17988   __Pyx_XDECREF(__pyx_t_6);
17989   __Pyx_XDECREF(__pyx_t_10);
17990   __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17991   __pyx_r = -1;
17992   __pyx_L0:;
17993   __Pyx_XDECREF(__pyx_v_format);
17994   __Pyx_RefNannyFinishContext();
17995   return __pyx_r;
17996 }
17997 
17998 /* "View.MemoryView":185
17999  *
18000  *     @cname('getbuffer')
18001  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
18002  *         cdef int bufmode = -1
18003  *         if self.mode == u"c":
18004  */
18005 
18006 /* Python wrapper */
18007 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
__pyx_array_getbuffer(PyObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)18008 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
18009   int __pyx_r;
18010   __Pyx_RefNannyDeclarations
18011   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
18012   __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));
18013 
18014   /* function exit code */
18015   __Pyx_RefNannyFinishContext();
18016   return __pyx_r;
18017 }
18018 
__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)18019 static 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) {
18020   int __pyx_v_bufmode;
18021   int __pyx_r;
18022   __Pyx_RefNannyDeclarations
18023   int __pyx_t_1;
18024   int __pyx_t_2;
18025   PyObject *__pyx_t_3 = NULL;
18026   char *__pyx_t_4;
18027   Py_ssize_t __pyx_t_5;
18028   int __pyx_t_6;
18029   Py_ssize_t *__pyx_t_7;
18030   int __pyx_lineno = 0;
18031   const char *__pyx_filename = NULL;
18032   int __pyx_clineno = 0;
18033   if (__pyx_v_info == NULL) {
18034     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
18035     return -1;
18036   }
18037   __Pyx_RefNannySetupContext("__getbuffer__", 0);
18038   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
18039   __Pyx_GIVEREF(__pyx_v_info->obj);
18040 
18041   /* "View.MemoryView":186
18042  *     @cname('getbuffer')
18043  *     def __getbuffer__(self, Py_buffer *info, int flags):
18044  *         cdef int bufmode = -1             # <<<<<<<<<<<<<<
18045  *         if self.mode == u"c":
18046  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
18047  */
18048   __pyx_v_bufmode = -1;
18049 
18050   /* "View.MemoryView":187
18051  *     def __getbuffer__(self, Py_buffer *info, int flags):
18052  *         cdef int bufmode = -1
18053  *         if self.mode == u"c":             # <<<<<<<<<<<<<<
18054  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
18055  *         elif self.mode == u"fortran":
18056  */
18057   __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
18058   __pyx_t_2 = (__pyx_t_1 != 0);
18059   if (__pyx_t_2) {
18060 
18061     /* "View.MemoryView":188
18062  *         cdef int bufmode = -1
18063  *         if self.mode == u"c":
18064  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
18065  *         elif self.mode == u"fortran":
18066  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
18067  */
18068     __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
18069 
18070     /* "View.MemoryView":187
18071  *     def __getbuffer__(self, Py_buffer *info, int flags):
18072  *         cdef int bufmode = -1
18073  *         if self.mode == u"c":             # <<<<<<<<<<<<<<
18074  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
18075  *         elif self.mode == u"fortran":
18076  */
18077     goto __pyx_L3;
18078   }
18079 
18080   /* "View.MemoryView":189
18081  *         if self.mode == u"c":
18082  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
18083  *         elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
18084  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
18085  *         if not (flags & bufmode):
18086  */
18087   __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
18088   __pyx_t_1 = (__pyx_t_2 != 0);
18089   if (__pyx_t_1) {
18090 
18091     /* "View.MemoryView":190
18092  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
18093  *         elif self.mode == u"fortran":
18094  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
18095  *         if not (flags & bufmode):
18096  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
18097  */
18098     __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
18099 
18100     /* "View.MemoryView":189
18101  *         if self.mode == u"c":
18102  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
18103  *         elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
18104  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
18105  *         if not (flags & bufmode):
18106  */
18107   }
18108   __pyx_L3:;
18109 
18110   /* "View.MemoryView":191
18111  *         elif self.mode == u"fortran":
18112  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
18113  *         if not (flags & bufmode):             # <<<<<<<<<<<<<<
18114  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
18115  *         info.buf = self.data
18116  */
18117   __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
18118   if (unlikely(__pyx_t_1)) {
18119 
18120     /* "View.MemoryView":192
18121  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
18122  *         if not (flags & bufmode):
18123  *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
18124  *         info.buf = self.data
18125  *         info.len = self.len
18126  */
18127     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
18128     __Pyx_GOTREF(__pyx_t_3);
18129     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
18130     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18131     __PYX_ERR(1, 192, __pyx_L1_error)
18132 
18133     /* "View.MemoryView":191
18134  *         elif self.mode == u"fortran":
18135  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
18136  *         if not (flags & bufmode):             # <<<<<<<<<<<<<<
18137  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
18138  *         info.buf = self.data
18139  */
18140   }
18141 
18142   /* "View.MemoryView":193
18143  *         if not (flags & bufmode):
18144  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
18145  *         info.buf = self.data             # <<<<<<<<<<<<<<
18146  *         info.len = self.len
18147  *         info.ndim = self.ndim
18148  */
18149   __pyx_t_4 = __pyx_v_self->data;
18150   __pyx_v_info->buf = __pyx_t_4;
18151 
18152   /* "View.MemoryView":194
18153  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
18154  *         info.buf = self.data
18155  *         info.len = self.len             # <<<<<<<<<<<<<<
18156  *         info.ndim = self.ndim
18157  *         info.shape = self._shape
18158  */
18159   __pyx_t_5 = __pyx_v_self->len;
18160   __pyx_v_info->len = __pyx_t_5;
18161 
18162   /* "View.MemoryView":195
18163  *         info.buf = self.data
18164  *         info.len = self.len
18165  *         info.ndim = self.ndim             # <<<<<<<<<<<<<<
18166  *         info.shape = self._shape
18167  *         info.strides = self._strides
18168  */
18169   __pyx_t_6 = __pyx_v_self->ndim;
18170   __pyx_v_info->ndim = __pyx_t_6;
18171 
18172   /* "View.MemoryView":196
18173  *         info.len = self.len
18174  *         info.ndim = self.ndim
18175  *         info.shape = self._shape             # <<<<<<<<<<<<<<
18176  *         info.strides = self._strides
18177  *         info.suboffsets = NULL
18178  */
18179   __pyx_t_7 = __pyx_v_self->_shape;
18180   __pyx_v_info->shape = __pyx_t_7;
18181 
18182   /* "View.MemoryView":197
18183  *         info.ndim = self.ndim
18184  *         info.shape = self._shape
18185  *         info.strides = self._strides             # <<<<<<<<<<<<<<
18186  *         info.suboffsets = NULL
18187  *         info.itemsize = self.itemsize
18188  */
18189   __pyx_t_7 = __pyx_v_self->_strides;
18190   __pyx_v_info->strides = __pyx_t_7;
18191 
18192   /* "View.MemoryView":198
18193  *         info.shape = self._shape
18194  *         info.strides = self._strides
18195  *         info.suboffsets = NULL             # <<<<<<<<<<<<<<
18196  *         info.itemsize = self.itemsize
18197  *         info.readonly = 0
18198  */
18199   __pyx_v_info->suboffsets = NULL;
18200 
18201   /* "View.MemoryView":199
18202  *         info.strides = self._strides
18203  *         info.suboffsets = NULL
18204  *         info.itemsize = self.itemsize             # <<<<<<<<<<<<<<
18205  *         info.readonly = 0
18206  *
18207  */
18208   __pyx_t_5 = __pyx_v_self->itemsize;
18209   __pyx_v_info->itemsize = __pyx_t_5;
18210 
18211   /* "View.MemoryView":200
18212  *         info.suboffsets = NULL
18213  *         info.itemsize = self.itemsize
18214  *         info.readonly = 0             # <<<<<<<<<<<<<<
18215  *
18216  *         if flags & PyBUF_FORMAT:
18217  */
18218   __pyx_v_info->readonly = 0;
18219 
18220   /* "View.MemoryView":202
18221  *         info.readonly = 0
18222  *
18223  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
18224  *             info.format = self.format
18225  *         else:
18226  */
18227   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
18228   if (__pyx_t_1) {
18229 
18230     /* "View.MemoryView":203
18231  *
18232  *         if flags & PyBUF_FORMAT:
18233  *             info.format = self.format             # <<<<<<<<<<<<<<
18234  *         else:
18235  *             info.format = NULL
18236  */
18237     __pyx_t_4 = __pyx_v_self->format;
18238     __pyx_v_info->format = __pyx_t_4;
18239 
18240     /* "View.MemoryView":202
18241  *         info.readonly = 0
18242  *
18243  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
18244  *             info.format = self.format
18245  *         else:
18246  */
18247     goto __pyx_L5;
18248   }
18249 
18250   /* "View.MemoryView":205
18251  *             info.format = self.format
18252  *         else:
18253  *             info.format = NULL             # <<<<<<<<<<<<<<
18254  *
18255  *         info.obj = self
18256  */
18257   /*else*/ {
18258     __pyx_v_info->format = NULL;
18259   }
18260   __pyx_L5:;
18261 
18262   /* "View.MemoryView":207
18263  *             info.format = NULL
18264  *
18265  *         info.obj = self             # <<<<<<<<<<<<<<
18266  *
18267  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
18268  */
18269   __Pyx_INCREF(((PyObject *)__pyx_v_self));
18270   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
18271   __Pyx_GOTREF(__pyx_v_info->obj);
18272   __Pyx_DECREF(__pyx_v_info->obj);
18273   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
18274 
18275   /* "View.MemoryView":185
18276  *
18277  *     @cname('getbuffer')
18278  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
18279  *         cdef int bufmode = -1
18280  *         if self.mode == u"c":
18281  */
18282 
18283   /* function exit code */
18284   __pyx_r = 0;
18285   goto __pyx_L0;
18286   __pyx_L1_error:;
18287   __Pyx_XDECREF(__pyx_t_3);
18288   __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18289   __pyx_r = -1;
18290   if (__pyx_v_info->obj != NULL) {
18291     __Pyx_GOTREF(__pyx_v_info->obj);
18292     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
18293   }
18294   goto __pyx_L2;
18295   __pyx_L0:;
18296   if (__pyx_v_info->obj == Py_None) {
18297     __Pyx_GOTREF(__pyx_v_info->obj);
18298     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
18299   }
18300   __pyx_L2:;
18301   __Pyx_RefNannyFinishContext();
18302   return __pyx_r;
18303 }
18304 
18305 /* "View.MemoryView":211
18306  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
18307  *
18308  *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
18309  *         if self.callback_free_data != NULL:
18310  *             self.callback_free_data(self.data)
18311  */
18312 
18313 /* Python wrapper */
18314 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_array___dealloc__(PyObject * __pyx_v_self)18315 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
18316   __Pyx_RefNannyDeclarations
18317   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
18318   __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
18319 
18320   /* function exit code */
18321   __Pyx_RefNannyFinishContext();
18322 }
18323 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj * __pyx_v_self)18324 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
18325   __Pyx_RefNannyDeclarations
18326   int __pyx_t_1;
18327   __Pyx_RefNannySetupContext("__dealloc__", 0);
18328 
18329   /* "View.MemoryView":212
18330  *
18331  *     def __dealloc__(array self):
18332  *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
18333  *             self.callback_free_data(self.data)
18334  *         elif self.free_data:
18335  */
18336   __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
18337   if (__pyx_t_1) {
18338 
18339     /* "View.MemoryView":213
18340  *     def __dealloc__(array self):
18341  *         if self.callback_free_data != NULL:
18342  *             self.callback_free_data(self.data)             # <<<<<<<<<<<<<<
18343  *         elif self.free_data:
18344  *             if self.dtype_is_object:
18345  */
18346     __pyx_v_self->callback_free_data(__pyx_v_self->data);
18347 
18348     /* "View.MemoryView":212
18349  *
18350  *     def __dealloc__(array self):
18351  *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
18352  *             self.callback_free_data(self.data)
18353  *         elif self.free_data:
18354  */
18355     goto __pyx_L3;
18356   }
18357 
18358   /* "View.MemoryView":214
18359  *         if self.callback_free_data != NULL:
18360  *             self.callback_free_data(self.data)
18361  *         elif self.free_data:             # <<<<<<<<<<<<<<
18362  *             if self.dtype_is_object:
18363  *                 refcount_objects_in_slice(self.data, self._shape,
18364  */
18365   __pyx_t_1 = (__pyx_v_self->free_data != 0);
18366   if (__pyx_t_1) {
18367 
18368     /* "View.MemoryView":215
18369  *             self.callback_free_data(self.data)
18370  *         elif self.free_data:
18371  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
18372  *                 refcount_objects_in_slice(self.data, self._shape,
18373  *                                           self._strides, self.ndim, False)
18374  */
18375     __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
18376     if (__pyx_t_1) {
18377 
18378       /* "View.MemoryView":216
18379  *         elif self.free_data:
18380  *             if self.dtype_is_object:
18381  *                 refcount_objects_in_slice(self.data, self._shape,             # <<<<<<<<<<<<<<
18382  *                                           self._strides, self.ndim, False)
18383  *             free(self.data)
18384  */
18385       __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
18386 
18387       /* "View.MemoryView":215
18388  *             self.callback_free_data(self.data)
18389  *         elif self.free_data:
18390  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
18391  *                 refcount_objects_in_slice(self.data, self._shape,
18392  *                                           self._strides, self.ndim, False)
18393  */
18394     }
18395 
18396     /* "View.MemoryView":218
18397  *                 refcount_objects_in_slice(self.data, self._shape,
18398  *                                           self._strides, self.ndim, False)
18399  *             free(self.data)             # <<<<<<<<<<<<<<
18400  *         PyObject_Free(self._shape)
18401  *
18402  */
18403     free(__pyx_v_self->data);
18404 
18405     /* "View.MemoryView":214
18406  *         if self.callback_free_data != NULL:
18407  *             self.callback_free_data(self.data)
18408  *         elif self.free_data:             # <<<<<<<<<<<<<<
18409  *             if self.dtype_is_object:
18410  *                 refcount_objects_in_slice(self.data, self._shape,
18411  */
18412   }
18413   __pyx_L3:;
18414 
18415   /* "View.MemoryView":219
18416  *                                           self._strides, self.ndim, False)
18417  *             free(self.data)
18418  *         PyObject_Free(self._shape)             # <<<<<<<<<<<<<<
18419  *
18420  *     @property
18421  */
18422   PyObject_Free(__pyx_v_self->_shape);
18423 
18424   /* "View.MemoryView":211
18425  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
18426  *
18427  *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
18428  *         if self.callback_free_data != NULL:
18429  *             self.callback_free_data(self.data)
18430  */
18431 
18432   /* function exit code */
18433   __Pyx_RefNannyFinishContext();
18434 }
18435 
18436 /* "View.MemoryView":222
18437  *
18438  *     @property
18439  *     def memview(self):             # <<<<<<<<<<<<<<
18440  *         return self.get_memview()
18441  *
18442  */
18443 
18444 /* Python wrapper */
18445 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject * __pyx_v_self)18446 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
18447   PyObject *__pyx_r = 0;
18448   __Pyx_RefNannyDeclarations
18449   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
18450   __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
18451 
18452   /* function exit code */
18453   __Pyx_RefNannyFinishContext();
18454   return __pyx_r;
18455 }
18456 
__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj * __pyx_v_self)18457 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
18458   PyObject *__pyx_r = NULL;
18459   __Pyx_RefNannyDeclarations
18460   PyObject *__pyx_t_1 = NULL;
18461   int __pyx_lineno = 0;
18462   const char *__pyx_filename = NULL;
18463   int __pyx_clineno = 0;
18464   __Pyx_RefNannySetupContext("__get__", 0);
18465 
18466   /* "View.MemoryView":223
18467  *     @property
18468  *     def memview(self):
18469  *         return self.get_memview()             # <<<<<<<<<<<<<<
18470  *
18471  *     @cname('get_memview')
18472  */
18473   __Pyx_XDECREF(__pyx_r);
18474   __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
18475   __Pyx_GOTREF(__pyx_t_1);
18476   __pyx_r = __pyx_t_1;
18477   __pyx_t_1 = 0;
18478   goto __pyx_L0;
18479 
18480   /* "View.MemoryView":222
18481  *
18482  *     @property
18483  *     def memview(self):             # <<<<<<<<<<<<<<
18484  *         return self.get_memview()
18485  *
18486  */
18487 
18488   /* function exit code */
18489   __pyx_L1_error:;
18490   __Pyx_XDECREF(__pyx_t_1);
18491   __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18492   __pyx_r = NULL;
18493   __pyx_L0:;
18494   __Pyx_XGIVEREF(__pyx_r);
18495   __Pyx_RefNannyFinishContext();
18496   return __pyx_r;
18497 }
18498 
18499 /* "View.MemoryView":226
18500  *
18501  *     @cname('get_memview')
18502  *     cdef get_memview(self):             # <<<<<<<<<<<<<<
18503  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
18504  *         return  memoryview(self, flags, self.dtype_is_object)
18505  */
18506 
__pyx_array_get_memview(struct __pyx_array_obj * __pyx_v_self)18507 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
18508   int __pyx_v_flags;
18509   PyObject *__pyx_r = NULL;
18510   __Pyx_RefNannyDeclarations
18511   PyObject *__pyx_t_1 = NULL;
18512   PyObject *__pyx_t_2 = NULL;
18513   PyObject *__pyx_t_3 = NULL;
18514   int __pyx_lineno = 0;
18515   const char *__pyx_filename = NULL;
18516   int __pyx_clineno = 0;
18517   __Pyx_RefNannySetupContext("get_memview", 0);
18518 
18519   /* "View.MemoryView":227
18520  *     @cname('get_memview')
18521  *     cdef get_memview(self):
18522  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE             # <<<<<<<<<<<<<<
18523  *         return  memoryview(self, flags, self.dtype_is_object)
18524  *
18525  */
18526   __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
18527 
18528   /* "View.MemoryView":228
18529  *     cdef get_memview(self):
18530  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
18531  *         return  memoryview(self, flags, self.dtype_is_object)             # <<<<<<<<<<<<<<
18532  *
18533  *     def __len__(self):
18534  */
18535   __Pyx_XDECREF(__pyx_r);
18536   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
18537   __Pyx_GOTREF(__pyx_t_1);
18538   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
18539   __Pyx_GOTREF(__pyx_t_2);
18540   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
18541   __Pyx_GOTREF(__pyx_t_3);
18542   __Pyx_INCREF(((PyObject *)__pyx_v_self));
18543   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
18544   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
18545   __Pyx_GIVEREF(__pyx_t_1);
18546   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
18547   __Pyx_GIVEREF(__pyx_t_2);
18548   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
18549   __pyx_t_1 = 0;
18550   __pyx_t_2 = 0;
18551   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
18552   __Pyx_GOTREF(__pyx_t_2);
18553   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18554   __pyx_r = __pyx_t_2;
18555   __pyx_t_2 = 0;
18556   goto __pyx_L0;
18557 
18558   /* "View.MemoryView":226
18559  *
18560  *     @cname('get_memview')
18561  *     cdef get_memview(self):             # <<<<<<<<<<<<<<
18562  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
18563  *         return  memoryview(self, flags, self.dtype_is_object)
18564  */
18565 
18566   /* function exit code */
18567   __pyx_L1_error:;
18568   __Pyx_XDECREF(__pyx_t_1);
18569   __Pyx_XDECREF(__pyx_t_2);
18570   __Pyx_XDECREF(__pyx_t_3);
18571   __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
18572   __pyx_r = 0;
18573   __pyx_L0:;
18574   __Pyx_XGIVEREF(__pyx_r);
18575   __Pyx_RefNannyFinishContext();
18576   return __pyx_r;
18577 }
18578 
18579 /* "View.MemoryView":230
18580  *         return  memoryview(self, flags, self.dtype_is_object)
18581  *
18582  *     def __len__(self):             # <<<<<<<<<<<<<<
18583  *         return self._shape[0]
18584  *
18585  */
18586 
18587 /* Python wrapper */
18588 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
__pyx_array___len__(PyObject * __pyx_v_self)18589 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
18590   Py_ssize_t __pyx_r;
18591   __Pyx_RefNannyDeclarations
18592   __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
18593   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
18594 
18595   /* function exit code */
18596   __Pyx_RefNannyFinishContext();
18597   return __pyx_r;
18598 }
18599 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj * __pyx_v_self)18600 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
18601   Py_ssize_t __pyx_r;
18602   __Pyx_RefNannyDeclarations
18603   __Pyx_RefNannySetupContext("__len__", 0);
18604 
18605   /* "View.MemoryView":231
18606  *
18607  *     def __len__(self):
18608  *         return self._shape[0]             # <<<<<<<<<<<<<<
18609  *
18610  *     def __getattr__(self, attr):
18611  */
18612   __pyx_r = (__pyx_v_self->_shape[0]);
18613   goto __pyx_L0;
18614 
18615   /* "View.MemoryView":230
18616  *         return  memoryview(self, flags, self.dtype_is_object)
18617  *
18618  *     def __len__(self):             # <<<<<<<<<<<<<<
18619  *         return self._shape[0]
18620  *
18621  */
18622 
18623   /* function exit code */
18624   __pyx_L0:;
18625   __Pyx_RefNannyFinishContext();
18626   return __pyx_r;
18627 }
18628 
18629 /* "View.MemoryView":233
18630  *         return self._shape[0]
18631  *
18632  *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
18633  *         return getattr(self.memview, attr)
18634  *
18635  */
18636 
18637 /* Python wrapper */
18638 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
__pyx_array___getattr__(PyObject * __pyx_v_self,PyObject * __pyx_v_attr)18639 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
18640   PyObject *__pyx_r = 0;
18641   __Pyx_RefNannyDeclarations
18642   __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
18643   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
18644 
18645   /* function exit code */
18646   __Pyx_RefNannyFinishContext();
18647   return __pyx_r;
18648 }
18649 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_attr)18650 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
18651   PyObject *__pyx_r = NULL;
18652   __Pyx_RefNannyDeclarations
18653   PyObject *__pyx_t_1 = NULL;
18654   PyObject *__pyx_t_2 = NULL;
18655   int __pyx_lineno = 0;
18656   const char *__pyx_filename = NULL;
18657   int __pyx_clineno = 0;
18658   __Pyx_RefNannySetupContext("__getattr__", 0);
18659 
18660   /* "View.MemoryView":234
18661  *
18662  *     def __getattr__(self, attr):
18663  *         return getattr(self.memview, attr)             # <<<<<<<<<<<<<<
18664  *
18665  *     def __getitem__(self, item):
18666  */
18667   __Pyx_XDECREF(__pyx_r);
18668   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
18669   __Pyx_GOTREF(__pyx_t_1);
18670   __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
18671   __Pyx_GOTREF(__pyx_t_2);
18672   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18673   __pyx_r = __pyx_t_2;
18674   __pyx_t_2 = 0;
18675   goto __pyx_L0;
18676 
18677   /* "View.MemoryView":233
18678  *         return self._shape[0]
18679  *
18680  *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
18681  *         return getattr(self.memview, attr)
18682  *
18683  */
18684 
18685   /* function exit code */
18686   __pyx_L1_error:;
18687   __Pyx_XDECREF(__pyx_t_1);
18688   __Pyx_XDECREF(__pyx_t_2);
18689   __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18690   __pyx_r = NULL;
18691   __pyx_L0:;
18692   __Pyx_XGIVEREF(__pyx_r);
18693   __Pyx_RefNannyFinishContext();
18694   return __pyx_r;
18695 }
18696 
18697 /* "View.MemoryView":236
18698  *         return getattr(self.memview, attr)
18699  *
18700  *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
18701  *         return self.memview[item]
18702  *
18703  */
18704 
18705 /* Python wrapper */
18706 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
__pyx_array___getitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_item)18707 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
18708   PyObject *__pyx_r = 0;
18709   __Pyx_RefNannyDeclarations
18710   __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
18711   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
18712 
18713   /* function exit code */
18714   __Pyx_RefNannyFinishContext();
18715   return __pyx_r;
18716 }
18717 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_item)18718 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
18719   PyObject *__pyx_r = NULL;
18720   __Pyx_RefNannyDeclarations
18721   PyObject *__pyx_t_1 = NULL;
18722   PyObject *__pyx_t_2 = NULL;
18723   int __pyx_lineno = 0;
18724   const char *__pyx_filename = NULL;
18725   int __pyx_clineno = 0;
18726   __Pyx_RefNannySetupContext("__getitem__", 0);
18727 
18728   /* "View.MemoryView":237
18729  *
18730  *     def __getitem__(self, item):
18731  *         return self.memview[item]             # <<<<<<<<<<<<<<
18732  *
18733  *     def __setitem__(self, item, value):
18734  */
18735   __Pyx_XDECREF(__pyx_r);
18736   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
18737   __Pyx_GOTREF(__pyx_t_1);
18738   __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
18739   __Pyx_GOTREF(__pyx_t_2);
18740   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18741   __pyx_r = __pyx_t_2;
18742   __pyx_t_2 = 0;
18743   goto __pyx_L0;
18744 
18745   /* "View.MemoryView":236
18746  *         return getattr(self.memview, attr)
18747  *
18748  *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
18749  *         return self.memview[item]
18750  *
18751  */
18752 
18753   /* function exit code */
18754   __pyx_L1_error:;
18755   __Pyx_XDECREF(__pyx_t_1);
18756   __Pyx_XDECREF(__pyx_t_2);
18757   __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18758   __pyx_r = NULL;
18759   __pyx_L0:;
18760   __Pyx_XGIVEREF(__pyx_r);
18761   __Pyx_RefNannyFinishContext();
18762   return __pyx_r;
18763 }
18764 
18765 /* "View.MemoryView":239
18766  *         return self.memview[item]
18767  *
18768  *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
18769  *         self.memview[item] = value
18770  *
18771  */
18772 
18773 /* Python wrapper */
18774 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
__pyx_array___setitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_item,PyObject * __pyx_v_value)18775 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
18776   int __pyx_r;
18777   __Pyx_RefNannyDeclarations
18778   __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
18779   __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));
18780 
18781   /* function exit code */
18782   __Pyx_RefNannyFinishContext();
18783   return __pyx_r;
18784 }
18785 
__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)18786 static 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) {
18787   int __pyx_r;
18788   __Pyx_RefNannyDeclarations
18789   PyObject *__pyx_t_1 = NULL;
18790   int __pyx_lineno = 0;
18791   const char *__pyx_filename = NULL;
18792   int __pyx_clineno = 0;
18793   __Pyx_RefNannySetupContext("__setitem__", 0);
18794 
18795   /* "View.MemoryView":240
18796  *
18797  *     def __setitem__(self, item, value):
18798  *         self.memview[item] = value             # <<<<<<<<<<<<<<
18799  *
18800  *
18801  */
18802   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
18803   __Pyx_GOTREF(__pyx_t_1);
18804   if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
18805   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18806 
18807   /* "View.MemoryView":239
18808  *         return self.memview[item]
18809  *
18810  *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
18811  *         self.memview[item] = value
18812  *
18813  */
18814 
18815   /* function exit code */
18816   __pyx_r = 0;
18817   goto __pyx_L0;
18818   __pyx_L1_error:;
18819   __Pyx_XDECREF(__pyx_t_1);
18820   __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18821   __pyx_r = -1;
18822   __pyx_L0:;
18823   __Pyx_RefNannyFinishContext();
18824   return __pyx_r;
18825 }
18826 
18827 /* "(tree fragment)":1
18828  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
18829  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18830  * def __setstate_cython__(self, __pyx_state):
18831  */
18832 
18833 /* Python wrapper */
18834 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw___pyx_array_1__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)18835 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18836   PyObject *__pyx_r = 0;
18837   __Pyx_RefNannyDeclarations
18838   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
18839   __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
18840 
18841   /* function exit code */
18842   __Pyx_RefNannyFinishContext();
18843   return __pyx_r;
18844 }
18845 
__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj * __pyx_v_self)18846 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
18847   PyObject *__pyx_r = NULL;
18848   __Pyx_RefNannyDeclarations
18849   PyObject *__pyx_t_1 = NULL;
18850   int __pyx_lineno = 0;
18851   const char *__pyx_filename = NULL;
18852   int __pyx_clineno = 0;
18853   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
18854 
18855   /* "(tree fragment)":2
18856  * def __reduce_cython__(self):
18857  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
18858  * def __setstate_cython__(self, __pyx_state):
18859  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18860  */
18861   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
18862   __Pyx_GOTREF(__pyx_t_1);
18863   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18864   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18865   __PYX_ERR(1, 2, __pyx_L1_error)
18866 
18867   /* "(tree fragment)":1
18868  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
18869  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18870  * def __setstate_cython__(self, __pyx_state):
18871  */
18872 
18873   /* function exit code */
18874   __pyx_L1_error:;
18875   __Pyx_XDECREF(__pyx_t_1);
18876   __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18877   __pyx_r = NULL;
18878   __Pyx_XGIVEREF(__pyx_r);
18879   __Pyx_RefNannyFinishContext();
18880   return __pyx_r;
18881 }
18882 
18883 /* "(tree fragment)":3
18884  * def __reduce_cython__(self):
18885  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18886  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
18887  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18888  */
18889 
18890 /* Python wrapper */
18891 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw___pyx_array_3__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)18892 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
18893   PyObject *__pyx_r = 0;
18894   __Pyx_RefNannyDeclarations
18895   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
18896   __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
18897 
18898   /* function exit code */
18899   __Pyx_RefNannyFinishContext();
18900   return __pyx_r;
18901 }
18902 
__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)18903 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
18904   PyObject *__pyx_r = NULL;
18905   __Pyx_RefNannyDeclarations
18906   PyObject *__pyx_t_1 = NULL;
18907   int __pyx_lineno = 0;
18908   const char *__pyx_filename = NULL;
18909   int __pyx_clineno = 0;
18910   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
18911 
18912   /* "(tree fragment)":4
18913  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18914  * def __setstate_cython__(self, __pyx_state):
18915  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
18916  */
18917   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
18918   __Pyx_GOTREF(__pyx_t_1);
18919   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18920   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18921   __PYX_ERR(1, 4, __pyx_L1_error)
18922 
18923   /* "(tree fragment)":3
18924  * def __reduce_cython__(self):
18925  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18926  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
18927  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18928  */
18929 
18930   /* function exit code */
18931   __pyx_L1_error:;
18932   __Pyx_XDECREF(__pyx_t_1);
18933   __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18934   __pyx_r = NULL;
18935   __Pyx_XGIVEREF(__pyx_r);
18936   __Pyx_RefNannyFinishContext();
18937   return __pyx_r;
18938 }
18939 
18940 /* "View.MemoryView":244
18941  *
18942  * @cname("__pyx_array_new")
18943  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
18944  *                           char *mode, char *buf):
18945  *     cdef array result
18946  */
18947 
__pyx_array_new(PyObject * __pyx_v_shape,Py_ssize_t __pyx_v_itemsize,char * __pyx_v_format,char * __pyx_v_mode,char * __pyx_v_buf)18948 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
18949   struct __pyx_array_obj *__pyx_v_result = 0;
18950   struct __pyx_array_obj *__pyx_r = NULL;
18951   __Pyx_RefNannyDeclarations
18952   int __pyx_t_1;
18953   PyObject *__pyx_t_2 = NULL;
18954   PyObject *__pyx_t_3 = NULL;
18955   PyObject *__pyx_t_4 = NULL;
18956   PyObject *__pyx_t_5 = NULL;
18957   int __pyx_lineno = 0;
18958   const char *__pyx_filename = NULL;
18959   int __pyx_clineno = 0;
18960   __Pyx_RefNannySetupContext("array_cwrapper", 0);
18961 
18962   /* "View.MemoryView":248
18963  *     cdef array result
18964  *
18965  *     if buf == NULL:             # <<<<<<<<<<<<<<
18966  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
18967  *     else:
18968  */
18969   __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
18970   if (__pyx_t_1) {
18971 
18972     /* "View.MemoryView":249
18973  *
18974  *     if buf == NULL:
18975  *         result = array(shape, itemsize, format, mode.decode('ASCII'))             # <<<<<<<<<<<<<<
18976  *     else:
18977  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
18978  */
18979     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
18980     __Pyx_GOTREF(__pyx_t_2);
18981     __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
18982     __Pyx_GOTREF(__pyx_t_3);
18983     __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
18984     __Pyx_GOTREF(__pyx_t_4);
18985     __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
18986     __Pyx_GOTREF(__pyx_t_5);
18987     __Pyx_INCREF(__pyx_v_shape);
18988     __Pyx_GIVEREF(__pyx_v_shape);
18989     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
18990     __Pyx_GIVEREF(__pyx_t_2);
18991     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
18992     __Pyx_GIVEREF(__pyx_t_3);
18993     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
18994     __Pyx_GIVEREF(__pyx_t_4);
18995     PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
18996     __pyx_t_2 = 0;
18997     __pyx_t_3 = 0;
18998     __pyx_t_4 = 0;
18999     __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
19000     __Pyx_GOTREF(__pyx_t_4);
19001     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19002     __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
19003     __pyx_t_4 = 0;
19004 
19005     /* "View.MemoryView":248
19006  *     cdef array result
19007  *
19008  *     if buf == NULL:             # <<<<<<<<<<<<<<
19009  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
19010  *     else:
19011  */
19012     goto __pyx_L3;
19013   }
19014 
19015   /* "View.MemoryView":251
19016  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
19017  *     else:
19018  *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
19019  *                        allocate_buffer=False)
19020  *         result.data = buf
19021  */
19022   /*else*/ {
19023     __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
19024     __Pyx_GOTREF(__pyx_t_4);
19025     __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
19026     __Pyx_GOTREF(__pyx_t_5);
19027     __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
19028     __Pyx_GOTREF(__pyx_t_3);
19029     __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
19030     __Pyx_GOTREF(__pyx_t_2);
19031     __Pyx_INCREF(__pyx_v_shape);
19032     __Pyx_GIVEREF(__pyx_v_shape);
19033     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
19034     __Pyx_GIVEREF(__pyx_t_4);
19035     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
19036     __Pyx_GIVEREF(__pyx_t_5);
19037     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
19038     __Pyx_GIVEREF(__pyx_t_3);
19039     PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
19040     __pyx_t_4 = 0;
19041     __pyx_t_5 = 0;
19042     __pyx_t_3 = 0;
19043 
19044     /* "View.MemoryView":252
19045  *     else:
19046  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
19047  *                        allocate_buffer=False)             # <<<<<<<<<<<<<<
19048  *         result.data = buf
19049  *
19050  */
19051     __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
19052     __Pyx_GOTREF(__pyx_t_3);
19053     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
19054 
19055     /* "View.MemoryView":251
19056  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
19057  *     else:
19058  *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
19059  *                        allocate_buffer=False)
19060  *         result.data = buf
19061  */
19062     __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
19063     __Pyx_GOTREF(__pyx_t_5);
19064     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19065     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19066     __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
19067     __pyx_t_5 = 0;
19068 
19069     /* "View.MemoryView":253
19070  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
19071  *                        allocate_buffer=False)
19072  *         result.data = buf             # <<<<<<<<<<<<<<
19073  *
19074  *     return result
19075  */
19076     __pyx_v_result->data = __pyx_v_buf;
19077   }
19078   __pyx_L3:;
19079 
19080   /* "View.MemoryView":255
19081  *         result.data = buf
19082  *
19083  *     return result             # <<<<<<<<<<<<<<
19084  *
19085  *
19086  */
19087   __Pyx_XDECREF(((PyObject *)__pyx_r));
19088   __Pyx_INCREF(((PyObject *)__pyx_v_result));
19089   __pyx_r = __pyx_v_result;
19090   goto __pyx_L0;
19091 
19092   /* "View.MemoryView":244
19093  *
19094  * @cname("__pyx_array_new")
19095  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
19096  *                           char *mode, char *buf):
19097  *     cdef array result
19098  */
19099 
19100   /* function exit code */
19101   __pyx_L1_error:;
19102   __Pyx_XDECREF(__pyx_t_2);
19103   __Pyx_XDECREF(__pyx_t_3);
19104   __Pyx_XDECREF(__pyx_t_4);
19105   __Pyx_XDECREF(__pyx_t_5);
19106   __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
19107   __pyx_r = 0;
19108   __pyx_L0:;
19109   __Pyx_XDECREF((PyObject *)__pyx_v_result);
19110   __Pyx_XGIVEREF((PyObject *)__pyx_r);
19111   __Pyx_RefNannyFinishContext();
19112   return __pyx_r;
19113 }
19114 
19115 /* "View.MemoryView":281
19116  * cdef class Enum(object):
19117  *     cdef object name
19118  *     def __init__(self, name):             # <<<<<<<<<<<<<<
19119  *         self.name = name
19120  *     def __repr__(self):
19121  */
19122 
19123 /* Python wrapper */
19124 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_MemviewEnum___init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)19125 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19126   PyObject *__pyx_v_name = 0;
19127   int __pyx_lineno = 0;
19128   const char *__pyx_filename = NULL;
19129   int __pyx_clineno = 0;
19130   int __pyx_r;
19131   __Pyx_RefNannyDeclarations
19132   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
19133   {
19134     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
19135     PyObject* values[1] = {0};
19136     if (unlikely(__pyx_kwds)) {
19137       Py_ssize_t kw_args;
19138       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19139       switch (pos_args) {
19140         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19141         CYTHON_FALLTHROUGH;
19142         case  0: break;
19143         default: goto __pyx_L5_argtuple_error;
19144       }
19145       kw_args = PyDict_Size(__pyx_kwds);
19146       switch (pos_args) {
19147         case  0:
19148         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
19149         else goto __pyx_L5_argtuple_error;
19150       }
19151       if (unlikely(kw_args > 0)) {
19152         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
19153       }
19154     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
19155       goto __pyx_L5_argtuple_error;
19156     } else {
19157       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19158     }
19159     __pyx_v_name = values[0];
19160   }
19161   goto __pyx_L4_argument_unpacking_done;
19162   __pyx_L5_argtuple_error:;
19163   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
19164   __pyx_L3_error:;
19165   __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19166   __Pyx_RefNannyFinishContext();
19167   return -1;
19168   __pyx_L4_argument_unpacking_done:;
19169   __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
19170 
19171   /* function exit code */
19172   __Pyx_RefNannyFinishContext();
19173   return __pyx_r;
19174 }
19175 
__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj * __pyx_v_self,PyObject * __pyx_v_name)19176 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
19177   int __pyx_r;
19178   __Pyx_RefNannyDeclarations
19179   __Pyx_RefNannySetupContext("__init__", 0);
19180 
19181   /* "View.MemoryView":282
19182  *     cdef object name
19183  *     def __init__(self, name):
19184  *         self.name = name             # <<<<<<<<<<<<<<
19185  *     def __repr__(self):
19186  *         return self.name
19187  */
19188   __Pyx_INCREF(__pyx_v_name);
19189   __Pyx_GIVEREF(__pyx_v_name);
19190   __Pyx_GOTREF(__pyx_v_self->name);
19191   __Pyx_DECREF(__pyx_v_self->name);
19192   __pyx_v_self->name = __pyx_v_name;
19193 
19194   /* "View.MemoryView":281
19195  * cdef class Enum(object):
19196  *     cdef object name
19197  *     def __init__(self, name):             # <<<<<<<<<<<<<<
19198  *         self.name = name
19199  *     def __repr__(self):
19200  */
19201 
19202   /* function exit code */
19203   __pyx_r = 0;
19204   __Pyx_RefNannyFinishContext();
19205   return __pyx_r;
19206 }
19207 
19208 /* "View.MemoryView":283
19209  *     def __init__(self, name):
19210  *         self.name = name
19211  *     def __repr__(self):             # <<<<<<<<<<<<<<
19212  *         return self.name
19213  *
19214  */
19215 
19216 /* Python wrapper */
19217 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_MemviewEnum___repr__(PyObject * __pyx_v_self)19218 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
19219   PyObject *__pyx_r = 0;
19220   __Pyx_RefNannyDeclarations
19221   __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
19222   __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
19223 
19224   /* function exit code */
19225   __Pyx_RefNannyFinishContext();
19226   return __pyx_r;
19227 }
19228 
__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj * __pyx_v_self)19229 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
19230   PyObject *__pyx_r = NULL;
19231   __Pyx_RefNannyDeclarations
19232   __Pyx_RefNannySetupContext("__repr__", 0);
19233 
19234   /* "View.MemoryView":284
19235  *         self.name = name
19236  *     def __repr__(self):
19237  *         return self.name             # <<<<<<<<<<<<<<
19238  *
19239  * cdef generic = Enum("<strided and direct or indirect>")
19240  */
19241   __Pyx_XDECREF(__pyx_r);
19242   __Pyx_INCREF(__pyx_v_self->name);
19243   __pyx_r = __pyx_v_self->name;
19244   goto __pyx_L0;
19245 
19246   /* "View.MemoryView":283
19247  *     def __init__(self, name):
19248  *         self.name = name
19249  *     def __repr__(self):             # <<<<<<<<<<<<<<
19250  *         return self.name
19251  *
19252  */
19253 
19254   /* function exit code */
19255   __pyx_L0:;
19256   __Pyx_XGIVEREF(__pyx_r);
19257   __Pyx_RefNannyFinishContext();
19258   return __pyx_r;
19259 }
19260 
19261 /* "(tree fragment)":1
19262  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
19263  *     cdef tuple state
19264  *     cdef object _dict
19265  */
19266 
19267 /* Python wrapper */
19268 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)19269 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
19270   PyObject *__pyx_r = 0;
19271   __Pyx_RefNannyDeclarations
19272   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
19273   __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
19274 
19275   /* function exit code */
19276   __Pyx_RefNannyFinishContext();
19277   return __pyx_r;
19278 }
19279 
__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj * __pyx_v_self)19280 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
19281   PyObject *__pyx_v_state = 0;
19282   PyObject *__pyx_v__dict = 0;
19283   int __pyx_v_use_setstate;
19284   PyObject *__pyx_r = NULL;
19285   __Pyx_RefNannyDeclarations
19286   PyObject *__pyx_t_1 = NULL;
19287   int __pyx_t_2;
19288   int __pyx_t_3;
19289   PyObject *__pyx_t_4 = NULL;
19290   PyObject *__pyx_t_5 = NULL;
19291   int __pyx_lineno = 0;
19292   const char *__pyx_filename = NULL;
19293   int __pyx_clineno = 0;
19294   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
19295 
19296   /* "(tree fragment)":5
19297  *     cdef object _dict
19298  *     cdef bint use_setstate
19299  *     state = (self.name,)             # <<<<<<<<<<<<<<
19300  *     _dict = getattr(self, '__dict__', None)
19301  *     if _dict is not None:
19302  */
19303   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
19304   __Pyx_GOTREF(__pyx_t_1);
19305   __Pyx_INCREF(__pyx_v_self->name);
19306   __Pyx_GIVEREF(__pyx_v_self->name);
19307   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
19308   __pyx_v_state = ((PyObject*)__pyx_t_1);
19309   __pyx_t_1 = 0;
19310 
19311   /* "(tree fragment)":6
19312  *     cdef bint use_setstate
19313  *     state = (self.name,)
19314  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
19315  *     if _dict is not None:
19316  *         state += (_dict,)
19317  */
19318   __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
19319   __Pyx_GOTREF(__pyx_t_1);
19320   __pyx_v__dict = __pyx_t_1;
19321   __pyx_t_1 = 0;
19322 
19323   /* "(tree fragment)":7
19324  *     state = (self.name,)
19325  *     _dict = getattr(self, '__dict__', None)
19326  *     if _dict is not None:             # <<<<<<<<<<<<<<
19327  *         state += (_dict,)
19328  *         use_setstate = True
19329  */
19330   __pyx_t_2 = (__pyx_v__dict != Py_None);
19331   __pyx_t_3 = (__pyx_t_2 != 0);
19332   if (__pyx_t_3) {
19333 
19334     /* "(tree fragment)":8
19335  *     _dict = getattr(self, '__dict__', None)
19336  *     if _dict is not None:
19337  *         state += (_dict,)             # <<<<<<<<<<<<<<
19338  *         use_setstate = True
19339  *     else:
19340  */
19341     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
19342     __Pyx_GOTREF(__pyx_t_1);
19343     __Pyx_INCREF(__pyx_v__dict);
19344     __Pyx_GIVEREF(__pyx_v__dict);
19345     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
19346     __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
19347     __Pyx_GOTREF(__pyx_t_4);
19348     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19349     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
19350     __pyx_t_4 = 0;
19351 
19352     /* "(tree fragment)":9
19353  *     if _dict is not None:
19354  *         state += (_dict,)
19355  *         use_setstate = True             # <<<<<<<<<<<<<<
19356  *     else:
19357  *         use_setstate = self.name is not None
19358  */
19359     __pyx_v_use_setstate = 1;
19360 
19361     /* "(tree fragment)":7
19362  *     state = (self.name,)
19363  *     _dict = getattr(self, '__dict__', None)
19364  *     if _dict is not None:             # <<<<<<<<<<<<<<
19365  *         state += (_dict,)
19366  *         use_setstate = True
19367  */
19368     goto __pyx_L3;
19369   }
19370 
19371   /* "(tree fragment)":11
19372  *         use_setstate = True
19373  *     else:
19374  *         use_setstate = self.name is not None             # <<<<<<<<<<<<<<
19375  *     if use_setstate:
19376  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
19377  */
19378   /*else*/ {
19379     __pyx_t_3 = (__pyx_v_self->name != Py_None);
19380     __pyx_v_use_setstate = __pyx_t_3;
19381   }
19382   __pyx_L3:;
19383 
19384   /* "(tree fragment)":12
19385  *     else:
19386  *         use_setstate = self.name is not None
19387  *     if use_setstate:             # <<<<<<<<<<<<<<
19388  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
19389  *     else:
19390  */
19391   __pyx_t_3 = (__pyx_v_use_setstate != 0);
19392   if (__pyx_t_3) {
19393 
19394     /* "(tree fragment)":13
19395  *         use_setstate = self.name is not None
19396  *     if use_setstate:
19397  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state             # <<<<<<<<<<<<<<
19398  *     else:
19399  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
19400  */
19401     __Pyx_XDECREF(__pyx_r);
19402     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
19403     __Pyx_GOTREF(__pyx_t_4);
19404     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
19405     __Pyx_GOTREF(__pyx_t_1);
19406     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
19407     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
19408     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
19409     __Pyx_INCREF(__pyx_int_184977713);
19410     __Pyx_GIVEREF(__pyx_int_184977713);
19411     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
19412     __Pyx_INCREF(Py_None);
19413     __Pyx_GIVEREF(Py_None);
19414     PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
19415     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
19416     __Pyx_GOTREF(__pyx_t_5);
19417     __Pyx_GIVEREF(__pyx_t_4);
19418     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
19419     __Pyx_GIVEREF(__pyx_t_1);
19420     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
19421     __Pyx_INCREF(__pyx_v_state);
19422     __Pyx_GIVEREF(__pyx_v_state);
19423     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
19424     __pyx_t_4 = 0;
19425     __pyx_t_1 = 0;
19426     __pyx_r = __pyx_t_5;
19427     __pyx_t_5 = 0;
19428     goto __pyx_L0;
19429 
19430     /* "(tree fragment)":12
19431  *     else:
19432  *         use_setstate = self.name is not None
19433  *     if use_setstate:             # <<<<<<<<<<<<<<
19434  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
19435  *     else:
19436  */
19437   }
19438 
19439   /* "(tree fragment)":15
19440  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
19441  *     else:
19442  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)             # <<<<<<<<<<<<<<
19443  * def __setstate_cython__(self, __pyx_state):
19444  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
19445  */
19446   /*else*/ {
19447     __Pyx_XDECREF(__pyx_r);
19448     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
19449     __Pyx_GOTREF(__pyx_t_5);
19450     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
19451     __Pyx_GOTREF(__pyx_t_1);
19452     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
19453     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
19454     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
19455     __Pyx_INCREF(__pyx_int_184977713);
19456     __Pyx_GIVEREF(__pyx_int_184977713);
19457     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
19458     __Pyx_INCREF(__pyx_v_state);
19459     __Pyx_GIVEREF(__pyx_v_state);
19460     PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
19461     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
19462     __Pyx_GOTREF(__pyx_t_4);
19463     __Pyx_GIVEREF(__pyx_t_5);
19464     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
19465     __Pyx_GIVEREF(__pyx_t_1);
19466     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
19467     __pyx_t_5 = 0;
19468     __pyx_t_1 = 0;
19469     __pyx_r = __pyx_t_4;
19470     __pyx_t_4 = 0;
19471     goto __pyx_L0;
19472   }
19473 
19474   /* "(tree fragment)":1
19475  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
19476  *     cdef tuple state
19477  *     cdef object _dict
19478  */
19479 
19480   /* function exit code */
19481   __pyx_L1_error:;
19482   __Pyx_XDECREF(__pyx_t_1);
19483   __Pyx_XDECREF(__pyx_t_4);
19484   __Pyx_XDECREF(__pyx_t_5);
19485   __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19486   __pyx_r = NULL;
19487   __pyx_L0:;
19488   __Pyx_XDECREF(__pyx_v_state);
19489   __Pyx_XDECREF(__pyx_v__dict);
19490   __Pyx_XGIVEREF(__pyx_r);
19491   __Pyx_RefNannyFinishContext();
19492   return __pyx_r;
19493 }
19494 
19495 /* "(tree fragment)":16
19496  *     else:
19497  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
19498  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
19499  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
19500  */
19501 
19502 /* Python wrapper */
19503 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)19504 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
19505   PyObject *__pyx_r = 0;
19506   __Pyx_RefNannyDeclarations
19507   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
19508   __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
19509 
19510   /* function exit code */
19511   __Pyx_RefNannyFinishContext();
19512   return __pyx_r;
19513 }
19514 
__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj * __pyx_v_self,PyObject * __pyx_v___pyx_state)19515 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
19516   PyObject *__pyx_r = NULL;
19517   __Pyx_RefNannyDeclarations
19518   PyObject *__pyx_t_1 = NULL;
19519   int __pyx_lineno = 0;
19520   const char *__pyx_filename = NULL;
19521   int __pyx_clineno = 0;
19522   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
19523 
19524   /* "(tree fragment)":17
19525  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
19526  * def __setstate_cython__(self, __pyx_state):
19527  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
19528  */
19529   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
19530   __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
19531   __Pyx_GOTREF(__pyx_t_1);
19532   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19533 
19534   /* "(tree fragment)":16
19535  *     else:
19536  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
19537  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
19538  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
19539  */
19540 
19541   /* function exit code */
19542   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19543   goto __pyx_L0;
19544   __pyx_L1_error:;
19545   __Pyx_XDECREF(__pyx_t_1);
19546   __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19547   __pyx_r = NULL;
19548   __pyx_L0:;
19549   __Pyx_XGIVEREF(__pyx_r);
19550   __Pyx_RefNannyFinishContext();
19551   return __pyx_r;
19552 }
19553 
19554 /* "View.MemoryView":298
19555  *
19556  * @cname('__pyx_align_pointer')
19557  * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
19558  *     "Align pointer memory on a given boundary"
19559  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
19560  */
19561 
__pyx_align_pointer(void * __pyx_v_memory,size_t __pyx_v_alignment)19562 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
19563   Py_intptr_t __pyx_v_aligned_p;
19564   size_t __pyx_v_offset;
19565   void *__pyx_r;
19566   int __pyx_t_1;
19567 
19568   /* "View.MemoryView":300
19569  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
19570  *     "Align pointer memory on a given boundary"
19571  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory             # <<<<<<<<<<<<<<
19572  *     cdef size_t offset
19573  *
19574  */
19575   __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
19576 
19577   /* "View.MemoryView":304
19578  *
19579  *     with cython.cdivision(True):
19580  *         offset = aligned_p % alignment             # <<<<<<<<<<<<<<
19581  *
19582  *     if offset > 0:
19583  */
19584   __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
19585 
19586   /* "View.MemoryView":306
19587  *         offset = aligned_p % alignment
19588  *
19589  *     if offset > 0:             # <<<<<<<<<<<<<<
19590  *         aligned_p += alignment - offset
19591  *
19592  */
19593   __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
19594   if (__pyx_t_1) {
19595 
19596     /* "View.MemoryView":307
19597  *
19598  *     if offset > 0:
19599  *         aligned_p += alignment - offset             # <<<<<<<<<<<<<<
19600  *
19601  *     return <void *> aligned_p
19602  */
19603     __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
19604 
19605     /* "View.MemoryView":306
19606  *         offset = aligned_p % alignment
19607  *
19608  *     if offset > 0:             # <<<<<<<<<<<<<<
19609  *         aligned_p += alignment - offset
19610  *
19611  */
19612   }
19613 
19614   /* "View.MemoryView":309
19615  *         aligned_p += alignment - offset
19616  *
19617  *     return <void *> aligned_p             # <<<<<<<<<<<<<<
19618  *
19619  *
19620  */
19621   __pyx_r = ((void *)__pyx_v_aligned_p);
19622   goto __pyx_L0;
19623 
19624   /* "View.MemoryView":298
19625  *
19626  * @cname('__pyx_align_pointer')
19627  * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
19628  *     "Align pointer memory on a given boundary"
19629  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
19630  */
19631 
19632   /* function exit code */
19633   __pyx_L0:;
19634   return __pyx_r;
19635 }
19636 
19637 /* "View.MemoryView":345
19638  *     cdef __Pyx_TypeInfo *typeinfo
19639  *
19640  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
19641  *         self.obj = obj
19642  *         self.flags = flags
19643  */
19644 
19645 /* Python wrapper */
19646 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_memoryview___cinit__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)19647 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19648   PyObject *__pyx_v_obj = 0;
19649   int __pyx_v_flags;
19650   int __pyx_v_dtype_is_object;
19651   int __pyx_lineno = 0;
19652   const char *__pyx_filename = NULL;
19653   int __pyx_clineno = 0;
19654   int __pyx_r;
19655   __Pyx_RefNannyDeclarations
19656   __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
19657   {
19658     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
19659     PyObject* values[3] = {0,0,0};
19660     if (unlikely(__pyx_kwds)) {
19661       Py_ssize_t kw_args;
19662       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19663       switch (pos_args) {
19664         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19665         CYTHON_FALLTHROUGH;
19666         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19667         CYTHON_FALLTHROUGH;
19668         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19669         CYTHON_FALLTHROUGH;
19670         case  0: break;
19671         default: goto __pyx_L5_argtuple_error;
19672       }
19673       kw_args = PyDict_Size(__pyx_kwds);
19674       switch (pos_args) {
19675         case  0:
19676         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
19677         else goto __pyx_L5_argtuple_error;
19678         CYTHON_FALLTHROUGH;
19679         case  1:
19680         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
19681         else {
19682           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
19683         }
19684         CYTHON_FALLTHROUGH;
19685         case  2:
19686         if (kw_args > 0) {
19687           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
19688           if (value) { values[2] = value; kw_args--; }
19689         }
19690       }
19691       if (unlikely(kw_args > 0)) {
19692         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
19693       }
19694     } else {
19695       switch (PyTuple_GET_SIZE(__pyx_args)) {
19696         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19697         CYTHON_FALLTHROUGH;
19698         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19699         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19700         break;
19701         default: goto __pyx_L5_argtuple_error;
19702       }
19703     }
19704     __pyx_v_obj = values[0];
19705     __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
19706     if (values[2]) {
19707       __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
19708     } else {
19709       __pyx_v_dtype_is_object = ((int)0);
19710     }
19711   }
19712   goto __pyx_L4_argument_unpacking_done;
19713   __pyx_L5_argtuple_error:;
19714   __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
19715   __pyx_L3_error:;
19716   __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19717   __Pyx_RefNannyFinishContext();
19718   return -1;
19719   __pyx_L4_argument_unpacking_done:;
19720   __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);
19721 
19722   /* function exit code */
19723   __Pyx_RefNannyFinishContext();
19724   return __pyx_r;
19725 }
19726 
__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)19727 static 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) {
19728   int __pyx_r;
19729   __Pyx_RefNannyDeclarations
19730   int __pyx_t_1;
19731   int __pyx_t_2;
19732   int __pyx_t_3;
19733   int __pyx_t_4;
19734   int __pyx_lineno = 0;
19735   const char *__pyx_filename = NULL;
19736   int __pyx_clineno = 0;
19737   __Pyx_RefNannySetupContext("__cinit__", 0);
19738 
19739   /* "View.MemoryView":346
19740  *
19741  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
19742  *         self.obj = obj             # <<<<<<<<<<<<<<
19743  *         self.flags = flags
19744  *         if type(self) is memoryview or obj is not None:
19745  */
19746   __Pyx_INCREF(__pyx_v_obj);
19747   __Pyx_GIVEREF(__pyx_v_obj);
19748   __Pyx_GOTREF(__pyx_v_self->obj);
19749   __Pyx_DECREF(__pyx_v_self->obj);
19750   __pyx_v_self->obj = __pyx_v_obj;
19751 
19752   /* "View.MemoryView":347
19753  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
19754  *         self.obj = obj
19755  *         self.flags = flags             # <<<<<<<<<<<<<<
19756  *         if type(self) is memoryview or obj is not None:
19757  *             __Pyx_GetBuffer(obj, &self.view, flags)
19758  */
19759   __pyx_v_self->flags = __pyx_v_flags;
19760 
19761   /* "View.MemoryView":348
19762  *         self.obj = obj
19763  *         self.flags = flags
19764  *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
19765  *             __Pyx_GetBuffer(obj, &self.view, flags)
19766  *             if <PyObject *> self.view.obj == NULL:
19767  */
19768   __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
19769   __pyx_t_3 = (__pyx_t_2 != 0);
19770   if (!__pyx_t_3) {
19771   } else {
19772     __pyx_t_1 = __pyx_t_3;
19773     goto __pyx_L4_bool_binop_done;
19774   }
19775   __pyx_t_3 = (__pyx_v_obj != Py_None);
19776   __pyx_t_2 = (__pyx_t_3 != 0);
19777   __pyx_t_1 = __pyx_t_2;
19778   __pyx_L4_bool_binop_done:;
19779   if (__pyx_t_1) {
19780 
19781     /* "View.MemoryView":349
19782  *         self.flags = flags
19783  *         if type(self) is memoryview or obj is not None:
19784  *             __Pyx_GetBuffer(obj, &self.view, flags)             # <<<<<<<<<<<<<<
19785  *             if <PyObject *> self.view.obj == NULL:
19786  *                 (<__pyx_buffer *> &self.view).obj = Py_None
19787  */
19788     __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
19789 
19790     /* "View.MemoryView":350
19791  *         if type(self) is memoryview or obj is not None:
19792  *             __Pyx_GetBuffer(obj, &self.view, flags)
19793  *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
19794  *                 (<__pyx_buffer *> &self.view).obj = Py_None
19795  *                 Py_INCREF(Py_None)
19796  */
19797     __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
19798     if (__pyx_t_1) {
19799 
19800       /* "View.MemoryView":351
19801  *             __Pyx_GetBuffer(obj, &self.view, flags)
19802  *             if <PyObject *> self.view.obj == NULL:
19803  *                 (<__pyx_buffer *> &self.view).obj = Py_None             # <<<<<<<<<<<<<<
19804  *                 Py_INCREF(Py_None)
19805  *
19806  */
19807       ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
19808 
19809       /* "View.MemoryView":352
19810  *             if <PyObject *> self.view.obj == NULL:
19811  *                 (<__pyx_buffer *> &self.view).obj = Py_None
19812  *                 Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
19813  *
19814  *         global __pyx_memoryview_thread_locks_used
19815  */
19816       Py_INCREF(Py_None);
19817 
19818       /* "View.MemoryView":350
19819  *         if type(self) is memoryview or obj is not None:
19820  *             __Pyx_GetBuffer(obj, &self.view, flags)
19821  *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
19822  *                 (<__pyx_buffer *> &self.view).obj = Py_None
19823  *                 Py_INCREF(Py_None)
19824  */
19825     }
19826 
19827     /* "View.MemoryView":348
19828  *         self.obj = obj
19829  *         self.flags = flags
19830  *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
19831  *             __Pyx_GetBuffer(obj, &self.view, flags)
19832  *             if <PyObject *> self.view.obj == NULL:
19833  */
19834   }
19835 
19836   /* "View.MemoryView":355
19837  *
19838  *         global __pyx_memoryview_thread_locks_used
19839  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:             # <<<<<<<<<<<<<<
19840  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
19841  *             __pyx_memoryview_thread_locks_used += 1
19842  */
19843   __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
19844   if (__pyx_t_1) {
19845 
19846     /* "View.MemoryView":356
19847  *         global __pyx_memoryview_thread_locks_used
19848  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
19849  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]             # <<<<<<<<<<<<<<
19850  *             __pyx_memoryview_thread_locks_used += 1
19851  *         if self.lock is NULL:
19852  */
19853     __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
19854 
19855     /* "View.MemoryView":357
19856  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
19857  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
19858  *             __pyx_memoryview_thread_locks_used += 1             # <<<<<<<<<<<<<<
19859  *         if self.lock is NULL:
19860  *             self.lock = PyThread_allocate_lock()
19861  */
19862     __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
19863 
19864     /* "View.MemoryView":355
19865  *
19866  *         global __pyx_memoryview_thread_locks_used
19867  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:             # <<<<<<<<<<<<<<
19868  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
19869  *             __pyx_memoryview_thread_locks_used += 1
19870  */
19871   }
19872 
19873   /* "View.MemoryView":358
19874  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
19875  *             __pyx_memoryview_thread_locks_used += 1
19876  *         if self.lock is NULL:             # <<<<<<<<<<<<<<
19877  *             self.lock = PyThread_allocate_lock()
19878  *             if self.lock is NULL:
19879  */
19880   __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
19881   if (__pyx_t_1) {
19882 
19883     /* "View.MemoryView":359
19884  *             __pyx_memoryview_thread_locks_used += 1
19885  *         if self.lock is NULL:
19886  *             self.lock = PyThread_allocate_lock()             # <<<<<<<<<<<<<<
19887  *             if self.lock is NULL:
19888  *                 raise MemoryError
19889  */
19890     __pyx_v_self->lock = PyThread_allocate_lock();
19891 
19892     /* "View.MemoryView":360
19893  *         if self.lock is NULL:
19894  *             self.lock = PyThread_allocate_lock()
19895  *             if self.lock is NULL:             # <<<<<<<<<<<<<<
19896  *                 raise MemoryError
19897  *
19898  */
19899     __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
19900     if (unlikely(__pyx_t_1)) {
19901 
19902       /* "View.MemoryView":361
19903  *             self.lock = PyThread_allocate_lock()
19904  *             if self.lock is NULL:
19905  *                 raise MemoryError             # <<<<<<<<<<<<<<
19906  *
19907  *         if flags & PyBUF_FORMAT:
19908  */
19909       PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
19910 
19911       /* "View.MemoryView":360
19912  *         if self.lock is NULL:
19913  *             self.lock = PyThread_allocate_lock()
19914  *             if self.lock is NULL:             # <<<<<<<<<<<<<<
19915  *                 raise MemoryError
19916  *
19917  */
19918     }
19919 
19920     /* "View.MemoryView":358
19921  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
19922  *             __pyx_memoryview_thread_locks_used += 1
19923  *         if self.lock is NULL:             # <<<<<<<<<<<<<<
19924  *             self.lock = PyThread_allocate_lock()
19925  *             if self.lock is NULL:
19926  */
19927   }
19928 
19929   /* "View.MemoryView":363
19930  *                 raise MemoryError
19931  *
19932  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
19933  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
19934  *         else:
19935  */
19936   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
19937   if (__pyx_t_1) {
19938 
19939     /* "View.MemoryView":364
19940  *
19941  *         if flags & PyBUF_FORMAT:
19942  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')             # <<<<<<<<<<<<<<
19943  *         else:
19944  *             self.dtype_is_object = dtype_is_object
19945  */
19946     __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
19947     if (__pyx_t_2) {
19948     } else {
19949       __pyx_t_1 = __pyx_t_2;
19950       goto __pyx_L11_bool_binop_done;
19951     }
19952     __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
19953     __pyx_t_1 = __pyx_t_2;
19954     __pyx_L11_bool_binop_done:;
19955     __pyx_v_self->dtype_is_object = __pyx_t_1;
19956 
19957     /* "View.MemoryView":363
19958  *                 raise MemoryError
19959  *
19960  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
19961  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
19962  *         else:
19963  */
19964     goto __pyx_L10;
19965   }
19966 
19967   /* "View.MemoryView":366
19968  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
19969  *         else:
19970  *             self.dtype_is_object = dtype_is_object             # <<<<<<<<<<<<<<
19971  *
19972  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
19973  */
19974   /*else*/ {
19975     __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
19976   }
19977   __pyx_L10:;
19978 
19979   /* "View.MemoryView":368
19980  *             self.dtype_is_object = dtype_is_object
19981  *
19982  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(             # <<<<<<<<<<<<<<
19983  *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
19984  *         self.typeinfo = NULL
19985  */
19986   __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
19987 
19988   /* "View.MemoryView":370
19989  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
19990  *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
19991  *         self.typeinfo = NULL             # <<<<<<<<<<<<<<
19992  *
19993  *     def __dealloc__(memoryview self):
19994  */
19995   __pyx_v_self->typeinfo = NULL;
19996 
19997   /* "View.MemoryView":345
19998  *     cdef __Pyx_TypeInfo *typeinfo
19999  *
20000  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
20001  *         self.obj = obj
20002  *         self.flags = flags
20003  */
20004 
20005   /* function exit code */
20006   __pyx_r = 0;
20007   goto __pyx_L0;
20008   __pyx_L1_error:;
20009   __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20010   __pyx_r = -1;
20011   __pyx_L0:;
20012   __Pyx_RefNannyFinishContext();
20013   return __pyx_r;
20014 }
20015 
20016 /* "View.MemoryView":372
20017  *         self.typeinfo = NULL
20018  *
20019  *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
20020  *         if self.obj is not None:
20021  *             __Pyx_ReleaseBuffer(&self.view)
20022  */
20023 
20024 /* Python wrapper */
20025 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___dealloc__(PyObject * __pyx_v_self)20026 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
20027   __Pyx_RefNannyDeclarations
20028   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
20029   __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
20030 
20031   /* function exit code */
20032   __Pyx_RefNannyFinishContext();
20033 }
20034 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj * __pyx_v_self)20035 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
20036   int __pyx_v_i;
20037   __Pyx_RefNannyDeclarations
20038   int __pyx_t_1;
20039   int __pyx_t_2;
20040   int __pyx_t_3;
20041   int __pyx_t_4;
20042   int __pyx_t_5;
20043   PyThread_type_lock __pyx_t_6;
20044   PyThread_type_lock __pyx_t_7;
20045   __Pyx_RefNannySetupContext("__dealloc__", 0);
20046 
20047   /* "View.MemoryView":373
20048  *
20049  *     def __dealloc__(memoryview self):
20050  *         if self.obj is not None:             # <<<<<<<<<<<<<<
20051  *             __Pyx_ReleaseBuffer(&self.view)
20052  *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
20053  */
20054   __pyx_t_1 = (__pyx_v_self->obj != Py_None);
20055   __pyx_t_2 = (__pyx_t_1 != 0);
20056   if (__pyx_t_2) {
20057 
20058     /* "View.MemoryView":374
20059  *     def __dealloc__(memoryview self):
20060  *         if self.obj is not None:
20061  *             __Pyx_ReleaseBuffer(&self.view)             # <<<<<<<<<<<<<<
20062  *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
20063  *
20064  */
20065     __Pyx_ReleaseBuffer((&__pyx_v_self->view));
20066 
20067     /* "View.MemoryView":373
20068  *
20069  *     def __dealloc__(memoryview self):
20070  *         if self.obj is not None:             # <<<<<<<<<<<<<<
20071  *             __Pyx_ReleaseBuffer(&self.view)
20072  *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
20073  */
20074     goto __pyx_L3;
20075   }
20076 
20077   /* "View.MemoryView":375
20078  *         if self.obj is not None:
20079  *             __Pyx_ReleaseBuffer(&self.view)
20080  *         elif (<__pyx_buffer *> &self.view).obj == Py_None:             # <<<<<<<<<<<<<<
20081  *
20082  *             (<__pyx_buffer *> &self.view).obj = NULL
20083  */
20084   __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
20085   if (__pyx_t_2) {
20086 
20087     /* "View.MemoryView":377
20088  *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
20089  *
20090  *             (<__pyx_buffer *> &self.view).obj = NULL             # <<<<<<<<<<<<<<
20091  *             Py_DECREF(Py_None)
20092  *
20093  */
20094     ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
20095 
20096     /* "View.MemoryView":378
20097  *
20098  *             (<__pyx_buffer *> &self.view).obj = NULL
20099  *             Py_DECREF(Py_None)             # <<<<<<<<<<<<<<
20100  *
20101  *         cdef int i
20102  */
20103     Py_DECREF(Py_None);
20104 
20105     /* "View.MemoryView":375
20106  *         if self.obj is not None:
20107  *             __Pyx_ReleaseBuffer(&self.view)
20108  *         elif (<__pyx_buffer *> &self.view).obj == Py_None:             # <<<<<<<<<<<<<<
20109  *
20110  *             (<__pyx_buffer *> &self.view).obj = NULL
20111  */
20112   }
20113   __pyx_L3:;
20114 
20115   /* "View.MemoryView":382
20116  *         cdef int i
20117  *         global __pyx_memoryview_thread_locks_used
20118  *         if self.lock != NULL:             # <<<<<<<<<<<<<<
20119  *             for i in range(__pyx_memoryview_thread_locks_used):
20120  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
20121  */
20122   __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
20123   if (__pyx_t_2) {
20124 
20125     /* "View.MemoryView":383
20126  *         global __pyx_memoryview_thread_locks_used
20127  *         if self.lock != NULL:
20128  *             for i in range(__pyx_memoryview_thread_locks_used):             # <<<<<<<<<<<<<<
20129  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
20130  *                     __pyx_memoryview_thread_locks_used -= 1
20131  */
20132     __pyx_t_3 = __pyx_memoryview_thread_locks_used;
20133     __pyx_t_4 = __pyx_t_3;
20134     for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
20135       __pyx_v_i = __pyx_t_5;
20136 
20137       /* "View.MemoryView":384
20138  *         if self.lock != NULL:
20139  *             for i in range(__pyx_memoryview_thread_locks_used):
20140  *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
20141  *                     __pyx_memoryview_thread_locks_used -= 1
20142  *                     if i != __pyx_memoryview_thread_locks_used:
20143  */
20144       __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
20145       if (__pyx_t_2) {
20146 
20147         /* "View.MemoryView":385
20148  *             for i in range(__pyx_memoryview_thread_locks_used):
20149  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
20150  *                     __pyx_memoryview_thread_locks_used -= 1             # <<<<<<<<<<<<<<
20151  *                     if i != __pyx_memoryview_thread_locks_used:
20152  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
20153  */
20154         __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
20155 
20156         /* "View.MemoryView":386
20157  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
20158  *                     __pyx_memoryview_thread_locks_used -= 1
20159  *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
20160  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
20161  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
20162  */
20163         __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
20164         if (__pyx_t_2) {
20165 
20166           /* "View.MemoryView":388
20167  *                     if i != __pyx_memoryview_thread_locks_used:
20168  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
20169  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])             # <<<<<<<<<<<<<<
20170  *                     break
20171  *             else:
20172  */
20173           __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
20174           __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
20175 
20176           /* "View.MemoryView":387
20177  *                     __pyx_memoryview_thread_locks_used -= 1
20178  *                     if i != __pyx_memoryview_thread_locks_used:
20179  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (             # <<<<<<<<<<<<<<
20180  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
20181  *                     break
20182  */
20183           (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
20184           (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
20185 
20186           /* "View.MemoryView":386
20187  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
20188  *                     __pyx_memoryview_thread_locks_used -= 1
20189  *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
20190  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
20191  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
20192  */
20193         }
20194 
20195         /* "View.MemoryView":389
20196  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
20197  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
20198  *                     break             # <<<<<<<<<<<<<<
20199  *             else:
20200  *                 PyThread_free_lock(self.lock)
20201  */
20202         goto __pyx_L6_break;
20203 
20204         /* "View.MemoryView":384
20205  *         if self.lock != NULL:
20206  *             for i in range(__pyx_memoryview_thread_locks_used):
20207  *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
20208  *                     __pyx_memoryview_thread_locks_used -= 1
20209  *                     if i != __pyx_memoryview_thread_locks_used:
20210  */
20211       }
20212     }
20213     /*else*/ {
20214 
20215       /* "View.MemoryView":391
20216  *                     break
20217  *             else:
20218  *                 PyThread_free_lock(self.lock)             # <<<<<<<<<<<<<<
20219  *
20220  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
20221  */
20222       PyThread_free_lock(__pyx_v_self->lock);
20223     }
20224     __pyx_L6_break:;
20225 
20226     /* "View.MemoryView":382
20227  *         cdef int i
20228  *         global __pyx_memoryview_thread_locks_used
20229  *         if self.lock != NULL:             # <<<<<<<<<<<<<<
20230  *             for i in range(__pyx_memoryview_thread_locks_used):
20231  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
20232  */
20233   }
20234 
20235   /* "View.MemoryView":372
20236  *         self.typeinfo = NULL
20237  *
20238  *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
20239  *         if self.obj is not None:
20240  *             __Pyx_ReleaseBuffer(&self.view)
20241  */
20242 
20243   /* function exit code */
20244   __Pyx_RefNannyFinishContext();
20245 }
20246 
20247 /* "View.MemoryView":393
20248  *                 PyThread_free_lock(self.lock)
20249  *
20250  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
20251  *         cdef Py_ssize_t dim
20252  *         cdef char *itemp = <char *> self.view.buf
20253  */
20254 
__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index)20255 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
20256   Py_ssize_t __pyx_v_dim;
20257   char *__pyx_v_itemp;
20258   PyObject *__pyx_v_idx = NULL;
20259   char *__pyx_r;
20260   __Pyx_RefNannyDeclarations
20261   Py_ssize_t __pyx_t_1;
20262   PyObject *__pyx_t_2 = NULL;
20263   Py_ssize_t __pyx_t_3;
20264   PyObject *(*__pyx_t_4)(PyObject *);
20265   PyObject *__pyx_t_5 = NULL;
20266   Py_ssize_t __pyx_t_6;
20267   char *__pyx_t_7;
20268   int __pyx_lineno = 0;
20269   const char *__pyx_filename = NULL;
20270   int __pyx_clineno = 0;
20271   __Pyx_RefNannySetupContext("get_item_pointer", 0);
20272 
20273   /* "View.MemoryView":395
20274  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
20275  *         cdef Py_ssize_t dim
20276  *         cdef char *itemp = <char *> self.view.buf             # <<<<<<<<<<<<<<
20277  *
20278  *         for dim, idx in enumerate(index):
20279  */
20280   __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
20281 
20282   /* "View.MemoryView":397
20283  *         cdef char *itemp = <char *> self.view.buf
20284  *
20285  *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
20286  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
20287  *
20288  */
20289   __pyx_t_1 = 0;
20290   if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
20291     __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
20292     __pyx_t_4 = NULL;
20293   } else {
20294     __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
20295     __Pyx_GOTREF(__pyx_t_2);
20296     __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
20297   }
20298   for (;;) {
20299     if (likely(!__pyx_t_4)) {
20300       if (likely(PyList_CheckExact(__pyx_t_2))) {
20301         if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
20302         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
20303         __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
20304         #else
20305         __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
20306         __Pyx_GOTREF(__pyx_t_5);
20307         #endif
20308       } else {
20309         if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
20310         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
20311         __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
20312         #else
20313         __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
20314         __Pyx_GOTREF(__pyx_t_5);
20315         #endif
20316       }
20317     } else {
20318       __pyx_t_5 = __pyx_t_4(__pyx_t_2);
20319       if (unlikely(!__pyx_t_5)) {
20320         PyObject* exc_type = PyErr_Occurred();
20321         if (exc_type) {
20322           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
20323           else __PYX_ERR(1, 397, __pyx_L1_error)
20324         }
20325         break;
20326       }
20327       __Pyx_GOTREF(__pyx_t_5);
20328     }
20329     __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
20330     __pyx_t_5 = 0;
20331     __pyx_v_dim = __pyx_t_1;
20332     __pyx_t_1 = (__pyx_t_1 + 1);
20333 
20334     /* "View.MemoryView":398
20335  *
20336  *         for dim, idx in enumerate(index):
20337  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)             # <<<<<<<<<<<<<<
20338  *
20339  *         return itemp
20340  */
20341     __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error)
20342     __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error)
20343     __pyx_v_itemp = __pyx_t_7;
20344 
20345     /* "View.MemoryView":397
20346  *         cdef char *itemp = <char *> self.view.buf
20347  *
20348  *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
20349  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
20350  *
20351  */
20352   }
20353   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20354 
20355   /* "View.MemoryView":400
20356  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
20357  *
20358  *         return itemp             # <<<<<<<<<<<<<<
20359  *
20360  *
20361  */
20362   __pyx_r = __pyx_v_itemp;
20363   goto __pyx_L0;
20364 
20365   /* "View.MemoryView":393
20366  *                 PyThread_free_lock(self.lock)
20367  *
20368  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
20369  *         cdef Py_ssize_t dim
20370  *         cdef char *itemp = <char *> self.view.buf
20371  */
20372 
20373   /* function exit code */
20374   __pyx_L1_error:;
20375   __Pyx_XDECREF(__pyx_t_2);
20376   __Pyx_XDECREF(__pyx_t_5);
20377   __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
20378   __pyx_r = NULL;
20379   __pyx_L0:;
20380   __Pyx_XDECREF(__pyx_v_idx);
20381   __Pyx_RefNannyFinishContext();
20382   return __pyx_r;
20383 }
20384 
20385 /* "View.MemoryView":403
20386  *
20387  *
20388  *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
20389  *         if index is Ellipsis:
20390  *             return self
20391  */
20392 
20393 /* Python wrapper */
20394 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
__pyx_memoryview___getitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_index)20395 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
20396   PyObject *__pyx_r = 0;
20397   __Pyx_RefNannyDeclarations
20398   __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
20399   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
20400 
20401   /* function exit code */
20402   __Pyx_RefNannyFinishContext();
20403   return __pyx_r;
20404 }
20405 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index)20406 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
20407   PyObject *__pyx_v_have_slices = NULL;
20408   PyObject *__pyx_v_indices = NULL;
20409   char *__pyx_v_itemp;
20410   PyObject *__pyx_r = NULL;
20411   __Pyx_RefNannyDeclarations
20412   int __pyx_t_1;
20413   int __pyx_t_2;
20414   PyObject *__pyx_t_3 = NULL;
20415   PyObject *__pyx_t_4 = NULL;
20416   PyObject *__pyx_t_5 = NULL;
20417   char *__pyx_t_6;
20418   int __pyx_lineno = 0;
20419   const char *__pyx_filename = NULL;
20420   int __pyx_clineno = 0;
20421   __Pyx_RefNannySetupContext("__getitem__", 0);
20422 
20423   /* "View.MemoryView":404
20424  *
20425  *     def __getitem__(memoryview self, object index):
20426  *         if index is Ellipsis:             # <<<<<<<<<<<<<<
20427  *             return self
20428  *
20429  */
20430   __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
20431   __pyx_t_2 = (__pyx_t_1 != 0);
20432   if (__pyx_t_2) {
20433 
20434     /* "View.MemoryView":405
20435  *     def __getitem__(memoryview self, object index):
20436  *         if index is Ellipsis:
20437  *             return self             # <<<<<<<<<<<<<<
20438  *
20439  *         have_slices, indices = _unellipsify(index, self.view.ndim)
20440  */
20441     __Pyx_XDECREF(__pyx_r);
20442     __Pyx_INCREF(((PyObject *)__pyx_v_self));
20443     __pyx_r = ((PyObject *)__pyx_v_self);
20444     goto __pyx_L0;
20445 
20446     /* "View.MemoryView":404
20447  *
20448  *     def __getitem__(memoryview self, object index):
20449  *         if index is Ellipsis:             # <<<<<<<<<<<<<<
20450  *             return self
20451  *
20452  */
20453   }
20454 
20455   /* "View.MemoryView":407
20456  *             return self
20457  *
20458  *         have_slices, indices = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
20459  *
20460  *         cdef char *itemp
20461  */
20462   __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
20463   __Pyx_GOTREF(__pyx_t_3);
20464   if (likely(__pyx_t_3 != Py_None)) {
20465     PyObject* sequence = __pyx_t_3;
20466     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
20467     if (unlikely(size != 2)) {
20468       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
20469       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
20470       __PYX_ERR(1, 407, __pyx_L1_error)
20471     }
20472     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
20473     __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
20474     __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
20475     __Pyx_INCREF(__pyx_t_4);
20476     __Pyx_INCREF(__pyx_t_5);
20477     #else
20478     __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error)
20479     __Pyx_GOTREF(__pyx_t_4);
20480     __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error)
20481     __Pyx_GOTREF(__pyx_t_5);
20482     #endif
20483     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20484   } else {
20485     __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
20486   }
20487   __pyx_v_have_slices = __pyx_t_4;
20488   __pyx_t_4 = 0;
20489   __pyx_v_indices = __pyx_t_5;
20490   __pyx_t_5 = 0;
20491 
20492   /* "View.MemoryView":410
20493  *
20494  *         cdef char *itemp
20495  *         if have_slices:             # <<<<<<<<<<<<<<
20496  *             return memview_slice(self, indices)
20497  *         else:
20498  */
20499   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
20500   if (__pyx_t_2) {
20501 
20502     /* "View.MemoryView":411
20503  *         cdef char *itemp
20504  *         if have_slices:
20505  *             return memview_slice(self, indices)             # <<<<<<<<<<<<<<
20506  *         else:
20507  *             itemp = self.get_item_pointer(indices)
20508  */
20509     __Pyx_XDECREF(__pyx_r);
20510     __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
20511     __Pyx_GOTREF(__pyx_t_3);
20512     __pyx_r = __pyx_t_3;
20513     __pyx_t_3 = 0;
20514     goto __pyx_L0;
20515 
20516     /* "View.MemoryView":410
20517  *
20518  *         cdef char *itemp
20519  *         if have_slices:             # <<<<<<<<<<<<<<
20520  *             return memview_slice(self, indices)
20521  *         else:
20522  */
20523   }
20524 
20525   /* "View.MemoryView":413
20526  *             return memview_slice(self, indices)
20527  *         else:
20528  *             itemp = self.get_item_pointer(indices)             # <<<<<<<<<<<<<<
20529  *             return self.convert_item_to_object(itemp)
20530  *
20531  */
20532   /*else*/ {
20533     __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error)
20534     __pyx_v_itemp = __pyx_t_6;
20535 
20536     /* "View.MemoryView":414
20537  *         else:
20538  *             itemp = self.get_item_pointer(indices)
20539  *             return self.convert_item_to_object(itemp)             # <<<<<<<<<<<<<<
20540  *
20541  *     def __setitem__(memoryview self, object index, object value):
20542  */
20543     __Pyx_XDECREF(__pyx_r);
20544     __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error)
20545     __Pyx_GOTREF(__pyx_t_3);
20546     __pyx_r = __pyx_t_3;
20547     __pyx_t_3 = 0;
20548     goto __pyx_L0;
20549   }
20550 
20551   /* "View.MemoryView":403
20552  *
20553  *
20554  *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
20555  *         if index is Ellipsis:
20556  *             return self
20557  */
20558 
20559   /* function exit code */
20560   __pyx_L1_error:;
20561   __Pyx_XDECREF(__pyx_t_3);
20562   __Pyx_XDECREF(__pyx_t_4);
20563   __Pyx_XDECREF(__pyx_t_5);
20564   __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20565   __pyx_r = NULL;
20566   __pyx_L0:;
20567   __Pyx_XDECREF(__pyx_v_have_slices);
20568   __Pyx_XDECREF(__pyx_v_indices);
20569   __Pyx_XGIVEREF(__pyx_r);
20570   __Pyx_RefNannyFinishContext();
20571   return __pyx_r;
20572 }
20573 
20574 /* "View.MemoryView":416
20575  *             return self.convert_item_to_object(itemp)
20576  *
20577  *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
20578  *         if self.view.readonly:
20579  *             raise TypeError("Cannot assign to read-only memoryview")
20580  */
20581 
20582 /* Python wrapper */
20583 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
__pyx_memoryview___setitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_index,PyObject * __pyx_v_value)20584 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
20585   int __pyx_r;
20586   __Pyx_RefNannyDeclarations
20587   __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
20588   __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));
20589 
20590   /* function exit code */
20591   __Pyx_RefNannyFinishContext();
20592   return __pyx_r;
20593 }
20594 
__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)20595 static 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) {
20596   PyObject *__pyx_v_have_slices = NULL;
20597   PyObject *__pyx_v_obj = NULL;
20598   int __pyx_r;
20599   __Pyx_RefNannyDeclarations
20600   int __pyx_t_1;
20601   PyObject *__pyx_t_2 = NULL;
20602   PyObject *__pyx_t_3 = NULL;
20603   PyObject *__pyx_t_4 = NULL;
20604   int __pyx_lineno = 0;
20605   const char *__pyx_filename = NULL;
20606   int __pyx_clineno = 0;
20607   __Pyx_RefNannySetupContext("__setitem__", 0);
20608   __Pyx_INCREF(__pyx_v_index);
20609 
20610   /* "View.MemoryView":417
20611  *
20612  *     def __setitem__(memoryview self, object index, object value):
20613  *         if self.view.readonly:             # <<<<<<<<<<<<<<
20614  *             raise TypeError("Cannot assign to read-only memoryview")
20615  *
20616  */
20617   __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
20618   if (unlikely(__pyx_t_1)) {
20619 
20620     /* "View.MemoryView":418
20621  *     def __setitem__(memoryview self, object index, object value):
20622  *         if self.view.readonly:
20623  *             raise TypeError("Cannot assign to read-only memoryview")             # <<<<<<<<<<<<<<
20624  *
20625  *         have_slices, index = _unellipsify(index, self.view.ndim)
20626  */
20627     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
20628     __Pyx_GOTREF(__pyx_t_2);
20629     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
20630     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20631     __PYX_ERR(1, 418, __pyx_L1_error)
20632 
20633     /* "View.MemoryView":417
20634  *
20635  *     def __setitem__(memoryview self, object index, object value):
20636  *         if self.view.readonly:             # <<<<<<<<<<<<<<
20637  *             raise TypeError("Cannot assign to read-only memoryview")
20638  *
20639  */
20640   }
20641 
20642   /* "View.MemoryView":420
20643  *             raise TypeError("Cannot assign to read-only memoryview")
20644  *
20645  *         have_slices, index = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
20646  *
20647  *         if have_slices:
20648  */
20649   __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
20650   __Pyx_GOTREF(__pyx_t_2);
20651   if (likely(__pyx_t_2 != Py_None)) {
20652     PyObject* sequence = __pyx_t_2;
20653     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
20654     if (unlikely(size != 2)) {
20655       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
20656       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
20657       __PYX_ERR(1, 420, __pyx_L1_error)
20658     }
20659     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
20660     __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
20661     __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
20662     __Pyx_INCREF(__pyx_t_3);
20663     __Pyx_INCREF(__pyx_t_4);
20664     #else
20665     __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error)
20666     __Pyx_GOTREF(__pyx_t_3);
20667     __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
20668     __Pyx_GOTREF(__pyx_t_4);
20669     #endif
20670     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20671   } else {
20672     __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
20673   }
20674   __pyx_v_have_slices = __pyx_t_3;
20675   __pyx_t_3 = 0;
20676   __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
20677   __pyx_t_4 = 0;
20678 
20679   /* "View.MemoryView":422
20680  *         have_slices, index = _unellipsify(index, self.view.ndim)
20681  *
20682  *         if have_slices:             # <<<<<<<<<<<<<<
20683  *             obj = self.is_slice(value)
20684  *             if obj:
20685  */
20686   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
20687   if (__pyx_t_1) {
20688 
20689     /* "View.MemoryView":423
20690  *
20691  *         if have_slices:
20692  *             obj = self.is_slice(value)             # <<<<<<<<<<<<<<
20693  *             if obj:
20694  *                 self.setitem_slice_assignment(self[index], obj)
20695  */
20696     __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
20697     __Pyx_GOTREF(__pyx_t_2);
20698     __pyx_v_obj = __pyx_t_2;
20699     __pyx_t_2 = 0;
20700 
20701     /* "View.MemoryView":424
20702  *         if have_slices:
20703  *             obj = self.is_slice(value)
20704  *             if obj:             # <<<<<<<<<<<<<<
20705  *                 self.setitem_slice_assignment(self[index], obj)
20706  *             else:
20707  */
20708     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
20709     if (__pyx_t_1) {
20710 
20711       /* "View.MemoryView":425
20712  *             obj = self.is_slice(value)
20713  *             if obj:
20714  *                 self.setitem_slice_assignment(self[index], obj)             # <<<<<<<<<<<<<<
20715  *             else:
20716  *                 self.setitem_slice_assign_scalar(self[index], value)
20717  */
20718       __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
20719       __Pyx_GOTREF(__pyx_t_2);
20720       __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error)
20721       __Pyx_GOTREF(__pyx_t_4);
20722       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20723       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20724 
20725       /* "View.MemoryView":424
20726  *         if have_slices:
20727  *             obj = self.is_slice(value)
20728  *             if obj:             # <<<<<<<<<<<<<<
20729  *                 self.setitem_slice_assignment(self[index], obj)
20730  *             else:
20731  */
20732       goto __pyx_L5;
20733     }
20734 
20735     /* "View.MemoryView":427
20736  *                 self.setitem_slice_assignment(self[index], obj)
20737  *             else:
20738  *                 self.setitem_slice_assign_scalar(self[index], value)             # <<<<<<<<<<<<<<
20739  *         else:
20740  *             self.setitem_indexed(index, value)
20741  */
20742     /*else*/ {
20743       __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
20744       __Pyx_GOTREF(__pyx_t_4);
20745       if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error)
20746       __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
20747       __Pyx_GOTREF(__pyx_t_2);
20748       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20749       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20750     }
20751     __pyx_L5:;
20752 
20753     /* "View.MemoryView":422
20754  *         have_slices, index = _unellipsify(index, self.view.ndim)
20755  *
20756  *         if have_slices:             # <<<<<<<<<<<<<<
20757  *             obj = self.is_slice(value)
20758  *             if obj:
20759  */
20760     goto __pyx_L4;
20761   }
20762 
20763   /* "View.MemoryView":429
20764  *                 self.setitem_slice_assign_scalar(self[index], value)
20765  *         else:
20766  *             self.setitem_indexed(index, value)             # <<<<<<<<<<<<<<
20767  *
20768  *     cdef is_slice(self, obj):
20769  */
20770   /*else*/ {
20771     __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
20772     __Pyx_GOTREF(__pyx_t_2);
20773     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20774   }
20775   __pyx_L4:;
20776 
20777   /* "View.MemoryView":416
20778  *             return self.convert_item_to_object(itemp)
20779  *
20780  *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
20781  *         if self.view.readonly:
20782  *             raise TypeError("Cannot assign to read-only memoryview")
20783  */
20784 
20785   /* function exit code */
20786   __pyx_r = 0;
20787   goto __pyx_L0;
20788   __pyx_L1_error:;
20789   __Pyx_XDECREF(__pyx_t_2);
20790   __Pyx_XDECREF(__pyx_t_3);
20791   __Pyx_XDECREF(__pyx_t_4);
20792   __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20793   __pyx_r = -1;
20794   __pyx_L0:;
20795   __Pyx_XDECREF(__pyx_v_have_slices);
20796   __Pyx_XDECREF(__pyx_v_obj);
20797   __Pyx_XDECREF(__pyx_v_index);
20798   __Pyx_RefNannyFinishContext();
20799   return __pyx_r;
20800 }
20801 
20802 /* "View.MemoryView":431
20803  *             self.setitem_indexed(index, value)
20804  *
20805  *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
20806  *         if not isinstance(obj, memoryview):
20807  *             try:
20808  */
20809 
__pyx_memoryview_is_slice(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_obj)20810 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
20811   PyObject *__pyx_r = NULL;
20812   __Pyx_RefNannyDeclarations
20813   int __pyx_t_1;
20814   int __pyx_t_2;
20815   PyObject *__pyx_t_3 = NULL;
20816   PyObject *__pyx_t_4 = NULL;
20817   PyObject *__pyx_t_5 = NULL;
20818   PyObject *__pyx_t_6 = NULL;
20819   PyObject *__pyx_t_7 = NULL;
20820   PyObject *__pyx_t_8 = NULL;
20821   int __pyx_t_9;
20822   int __pyx_lineno = 0;
20823   const char *__pyx_filename = NULL;
20824   int __pyx_clineno = 0;
20825   __Pyx_RefNannySetupContext("is_slice", 0);
20826   __Pyx_INCREF(__pyx_v_obj);
20827 
20828   /* "View.MemoryView":432
20829  *
20830  *     cdef is_slice(self, obj):
20831  *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
20832  *             try:
20833  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
20834  */
20835   __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
20836   __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
20837   if (__pyx_t_2) {
20838 
20839     /* "View.MemoryView":433
20840  *     cdef is_slice(self, obj):
20841  *         if not isinstance(obj, memoryview):
20842  *             try:             # <<<<<<<<<<<<<<
20843  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
20844  *                                  self.dtype_is_object)
20845  */
20846     {
20847       __Pyx_PyThreadState_declare
20848       __Pyx_PyThreadState_assign
20849       __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
20850       __Pyx_XGOTREF(__pyx_t_3);
20851       __Pyx_XGOTREF(__pyx_t_4);
20852       __Pyx_XGOTREF(__pyx_t_5);
20853       /*try:*/ {
20854 
20855         /* "View.MemoryView":434
20856  *         if not isinstance(obj, memoryview):
20857  *             try:
20858  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
20859  *                                  self.dtype_is_object)
20860  *             except TypeError:
20861  */
20862         __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error)
20863         __Pyx_GOTREF(__pyx_t_6);
20864 
20865         /* "View.MemoryView":435
20866  *             try:
20867  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
20868  *                                  self.dtype_is_object)             # <<<<<<<<<<<<<<
20869  *             except TypeError:
20870  *                 return None
20871  */
20872         __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error)
20873         __Pyx_GOTREF(__pyx_t_7);
20874 
20875         /* "View.MemoryView":434
20876  *         if not isinstance(obj, memoryview):
20877  *             try:
20878  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
20879  *                                  self.dtype_is_object)
20880  *             except TypeError:
20881  */
20882         __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error)
20883         __Pyx_GOTREF(__pyx_t_8);
20884         __Pyx_INCREF(__pyx_v_obj);
20885         __Pyx_GIVEREF(__pyx_v_obj);
20886         PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
20887         __Pyx_GIVEREF(__pyx_t_6);
20888         PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
20889         __Pyx_GIVEREF(__pyx_t_7);
20890         PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
20891         __pyx_t_6 = 0;
20892         __pyx_t_7 = 0;
20893         __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error)
20894         __Pyx_GOTREF(__pyx_t_7);
20895         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20896         __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
20897         __pyx_t_7 = 0;
20898 
20899         /* "View.MemoryView":433
20900  *     cdef is_slice(self, obj):
20901  *         if not isinstance(obj, memoryview):
20902  *             try:             # <<<<<<<<<<<<<<
20903  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
20904  *                                  self.dtype_is_object)
20905  */
20906       }
20907       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20908       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
20909       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20910       goto __pyx_L9_try_end;
20911       __pyx_L4_error:;
20912       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
20913       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
20914       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
20915 
20916       /* "View.MemoryView":436
20917  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
20918  *                                  self.dtype_is_object)
20919  *             except TypeError:             # <<<<<<<<<<<<<<
20920  *                 return None
20921  *
20922  */
20923       __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
20924       if (__pyx_t_9) {
20925         __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
20926         if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error)
20927         __Pyx_GOTREF(__pyx_t_7);
20928         __Pyx_GOTREF(__pyx_t_8);
20929         __Pyx_GOTREF(__pyx_t_6);
20930 
20931         /* "View.MemoryView":437
20932  *                                  self.dtype_is_object)
20933  *             except TypeError:
20934  *                 return None             # <<<<<<<<<<<<<<
20935  *
20936  *         return obj
20937  */
20938         __Pyx_XDECREF(__pyx_r);
20939         __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20940         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20941         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20942         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20943         goto __pyx_L7_except_return;
20944       }
20945       goto __pyx_L6_except_error;
20946       __pyx_L6_except_error:;
20947 
20948       /* "View.MemoryView":433
20949  *     cdef is_slice(self, obj):
20950  *         if not isinstance(obj, memoryview):
20951  *             try:             # <<<<<<<<<<<<<<
20952  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
20953  *                                  self.dtype_is_object)
20954  */
20955       __Pyx_XGIVEREF(__pyx_t_3);
20956       __Pyx_XGIVEREF(__pyx_t_4);
20957       __Pyx_XGIVEREF(__pyx_t_5);
20958       __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
20959       goto __pyx_L1_error;
20960       __pyx_L7_except_return:;
20961       __Pyx_XGIVEREF(__pyx_t_3);
20962       __Pyx_XGIVEREF(__pyx_t_4);
20963       __Pyx_XGIVEREF(__pyx_t_5);
20964       __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
20965       goto __pyx_L0;
20966       __pyx_L9_try_end:;
20967     }
20968 
20969     /* "View.MemoryView":432
20970  *
20971  *     cdef is_slice(self, obj):
20972  *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
20973  *             try:
20974  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
20975  */
20976   }
20977 
20978   /* "View.MemoryView":439
20979  *                 return None
20980  *
20981  *         return obj             # <<<<<<<<<<<<<<
20982  *
20983  *     cdef setitem_slice_assignment(self, dst, src):
20984  */
20985   __Pyx_XDECREF(__pyx_r);
20986   __Pyx_INCREF(__pyx_v_obj);
20987   __pyx_r = __pyx_v_obj;
20988   goto __pyx_L0;
20989 
20990   /* "View.MemoryView":431
20991  *             self.setitem_indexed(index, value)
20992  *
20993  *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
20994  *         if not isinstance(obj, memoryview):
20995  *             try:
20996  */
20997 
20998   /* function exit code */
20999   __pyx_L1_error:;
21000   __Pyx_XDECREF(__pyx_t_6);
21001   __Pyx_XDECREF(__pyx_t_7);
21002   __Pyx_XDECREF(__pyx_t_8);
21003   __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
21004   __pyx_r = 0;
21005   __pyx_L0:;
21006   __Pyx_XDECREF(__pyx_v_obj);
21007   __Pyx_XGIVEREF(__pyx_r);
21008   __Pyx_RefNannyFinishContext();
21009   return __pyx_r;
21010 }
21011 
21012 /* "View.MemoryView":441
21013  *         return obj
21014  *
21015  *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
21016  *         cdef __Pyx_memviewslice dst_slice
21017  *         cdef __Pyx_memviewslice src_slice
21018  */
21019 
__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_dst,PyObject * __pyx_v_src)21020 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
21021   __Pyx_memviewslice __pyx_v_dst_slice;
21022   __Pyx_memviewslice __pyx_v_src_slice;
21023   PyObject *__pyx_r = NULL;
21024   __Pyx_RefNannyDeclarations
21025   __Pyx_memviewslice *__pyx_t_1;
21026   __Pyx_memviewslice *__pyx_t_2;
21027   PyObject *__pyx_t_3 = NULL;
21028   int __pyx_t_4;
21029   int __pyx_t_5;
21030   int __pyx_t_6;
21031   int __pyx_lineno = 0;
21032   const char *__pyx_filename = NULL;
21033   int __pyx_clineno = 0;
21034   __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
21035 
21036   /* "View.MemoryView":445
21037  *         cdef __Pyx_memviewslice src_slice
21038  *
21039  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
21040  *                                  get_slice_from_memview(dst, &dst_slice)[0],
21041  *                                  src.ndim, dst.ndim, self.dtype_is_object)
21042  */
21043   if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error)
21044   __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 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
21045 
21046   /* "View.MemoryView":446
21047  *
21048  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
21049  *                                  get_slice_from_memview(dst, &dst_slice)[0],             # <<<<<<<<<<<<<<
21050  *                                  src.ndim, dst.ndim, self.dtype_is_object)
21051  *
21052  */
21053   if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error)
21054   __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error)
21055 
21056   /* "View.MemoryView":447
21057  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
21058  *                                  get_slice_from_memview(dst, &dst_slice)[0],
21059  *                                  src.ndim, dst.ndim, self.dtype_is_object)             # <<<<<<<<<<<<<<
21060  *
21061  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
21062  */
21063   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
21064   __Pyx_GOTREF(__pyx_t_3);
21065   __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
21066   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21067   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
21068   __Pyx_GOTREF(__pyx_t_3);
21069   __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
21070   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21071 
21072   /* "View.MemoryView":445
21073  *         cdef __Pyx_memviewslice src_slice
21074  *
21075  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
21076  *                                  get_slice_from_memview(dst, &dst_slice)[0],
21077  *                                  src.ndim, dst.ndim, self.dtype_is_object)
21078  */
21079   __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 445, __pyx_L1_error)
21080 
21081   /* "View.MemoryView":441
21082  *         return obj
21083  *
21084  *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
21085  *         cdef __Pyx_memviewslice dst_slice
21086  *         cdef __Pyx_memviewslice src_slice
21087  */
21088 
21089   /* function exit code */
21090   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21091   goto __pyx_L0;
21092   __pyx_L1_error:;
21093   __Pyx_XDECREF(__pyx_t_3);
21094   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
21095   __pyx_r = 0;
21096   __pyx_L0:;
21097   __Pyx_XGIVEREF(__pyx_r);
21098   __Pyx_RefNannyFinishContext();
21099   return __pyx_r;
21100 }
21101 
21102 /* "View.MemoryView":449
21103  *                                  src.ndim, dst.ndim, self.dtype_is_object)
21104  *
21105  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
21106  *         cdef int array[128]
21107  *         cdef void *tmp = NULL
21108  */
21109 
__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj * __pyx_v_self,struct __pyx_memoryview_obj * __pyx_v_dst,PyObject * __pyx_v_value)21110 static 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) {
21111   int __pyx_v_array[0x80];
21112   void *__pyx_v_tmp;
21113   void *__pyx_v_item;
21114   __Pyx_memviewslice *__pyx_v_dst_slice;
21115   __Pyx_memviewslice __pyx_v_tmp_slice;
21116   PyObject *__pyx_r = NULL;
21117   __Pyx_RefNannyDeclarations
21118   __Pyx_memviewslice *__pyx_t_1;
21119   int __pyx_t_2;
21120   PyObject *__pyx_t_3 = NULL;
21121   int __pyx_t_4;
21122   int __pyx_t_5;
21123   char const *__pyx_t_6;
21124   PyObject *__pyx_t_7 = NULL;
21125   PyObject *__pyx_t_8 = NULL;
21126   PyObject *__pyx_t_9 = NULL;
21127   PyObject *__pyx_t_10 = NULL;
21128   PyObject *__pyx_t_11 = NULL;
21129   PyObject *__pyx_t_12 = NULL;
21130   int __pyx_lineno = 0;
21131   const char *__pyx_filename = NULL;
21132   int __pyx_clineno = 0;
21133   __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
21134 
21135   /* "View.MemoryView":451
21136  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
21137  *         cdef int array[128]
21138  *         cdef void *tmp = NULL             # <<<<<<<<<<<<<<
21139  *         cdef void *item
21140  *
21141  */
21142   __pyx_v_tmp = NULL;
21143 
21144   /* "View.MemoryView":456
21145  *         cdef __Pyx_memviewslice *dst_slice
21146  *         cdef __Pyx_memviewslice tmp_slice
21147  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)             # <<<<<<<<<<<<<<
21148  *
21149  *         if <size_t>self.view.itemsize > sizeof(array):
21150  */
21151   __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error)
21152   __pyx_v_dst_slice = __pyx_t_1;
21153 
21154   /* "View.MemoryView":458
21155  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
21156  *
21157  *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
21158  *             tmp = PyMem_Malloc(self.view.itemsize)
21159  *             if tmp == NULL:
21160  */
21161   __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
21162   if (__pyx_t_2) {
21163 
21164     /* "View.MemoryView":459
21165  *
21166  *         if <size_t>self.view.itemsize > sizeof(array):
21167  *             tmp = PyMem_Malloc(self.view.itemsize)             # <<<<<<<<<<<<<<
21168  *             if tmp == NULL:
21169  *                 raise MemoryError
21170  */
21171     __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
21172 
21173     /* "View.MemoryView":460
21174  *         if <size_t>self.view.itemsize > sizeof(array):
21175  *             tmp = PyMem_Malloc(self.view.itemsize)
21176  *             if tmp == NULL:             # <<<<<<<<<<<<<<
21177  *                 raise MemoryError
21178  *             item = tmp
21179  */
21180     __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
21181     if (unlikely(__pyx_t_2)) {
21182 
21183       /* "View.MemoryView":461
21184  *             tmp = PyMem_Malloc(self.view.itemsize)
21185  *             if tmp == NULL:
21186  *                 raise MemoryError             # <<<<<<<<<<<<<<
21187  *             item = tmp
21188  *         else:
21189  */
21190       PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
21191 
21192       /* "View.MemoryView":460
21193  *         if <size_t>self.view.itemsize > sizeof(array):
21194  *             tmp = PyMem_Malloc(self.view.itemsize)
21195  *             if tmp == NULL:             # <<<<<<<<<<<<<<
21196  *                 raise MemoryError
21197  *             item = tmp
21198  */
21199     }
21200 
21201     /* "View.MemoryView":462
21202  *             if tmp == NULL:
21203  *                 raise MemoryError
21204  *             item = tmp             # <<<<<<<<<<<<<<
21205  *         else:
21206  *             item = <void *> array
21207  */
21208     __pyx_v_item = __pyx_v_tmp;
21209 
21210     /* "View.MemoryView":458
21211  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
21212  *
21213  *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
21214  *             tmp = PyMem_Malloc(self.view.itemsize)
21215  *             if tmp == NULL:
21216  */
21217     goto __pyx_L3;
21218   }
21219 
21220   /* "View.MemoryView":464
21221  *             item = tmp
21222  *         else:
21223  *             item = <void *> array             # <<<<<<<<<<<<<<
21224  *
21225  *         try:
21226  */
21227   /*else*/ {
21228     __pyx_v_item = ((void *)__pyx_v_array);
21229   }
21230   __pyx_L3:;
21231 
21232   /* "View.MemoryView":466
21233  *             item = <void *> array
21234  *
21235  *         try:             # <<<<<<<<<<<<<<
21236  *             if self.dtype_is_object:
21237  *                 (<PyObject **> item)[0] = <PyObject *> value
21238  */
21239   /*try:*/ {
21240 
21241     /* "View.MemoryView":467
21242  *
21243  *         try:
21244  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
21245  *                 (<PyObject **> item)[0] = <PyObject *> value
21246  *             else:
21247  */
21248     __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
21249     if (__pyx_t_2) {
21250 
21251       /* "View.MemoryView":468
21252  *         try:
21253  *             if self.dtype_is_object:
21254  *                 (<PyObject **> item)[0] = <PyObject *> value             # <<<<<<<<<<<<<<
21255  *             else:
21256  *                 self.assign_item_from_object(<char *> item, value)
21257  */
21258       (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
21259 
21260       /* "View.MemoryView":467
21261  *
21262  *         try:
21263  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
21264  *                 (<PyObject **> item)[0] = <PyObject *> value
21265  *             else:
21266  */
21267       goto __pyx_L8;
21268     }
21269 
21270     /* "View.MemoryView":470
21271  *                 (<PyObject **> item)[0] = <PyObject *> value
21272  *             else:
21273  *                 self.assign_item_from_object(<char *> item, value)             # <<<<<<<<<<<<<<
21274  *
21275  *
21276  */
21277     /*else*/ {
21278       __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, 470, __pyx_L6_error)
21279       __Pyx_GOTREF(__pyx_t_3);
21280       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21281     }
21282     __pyx_L8:;
21283 
21284     /* "View.MemoryView":474
21285  *
21286  *
21287  *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
21288  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
21289  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
21290  */
21291     __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
21292     if (__pyx_t_2) {
21293 
21294       /* "View.MemoryView":475
21295  *
21296  *             if self.view.suboffsets != NULL:
21297  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)             # <<<<<<<<<<<<<<
21298  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
21299  *                                 item, self.dtype_is_object)
21300  */
21301       __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error)
21302       __Pyx_GOTREF(__pyx_t_3);
21303       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21304 
21305       /* "View.MemoryView":474
21306  *
21307  *
21308  *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
21309  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
21310  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
21311  */
21312     }
21313 
21314     /* "View.MemoryView":476
21315  *             if self.view.suboffsets != NULL:
21316  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
21317  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,             # <<<<<<<<<<<<<<
21318  *                                 item, self.dtype_is_object)
21319  *         finally:
21320  */
21321     __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
21322   }
21323 
21324   /* "View.MemoryView":479
21325  *                                 item, self.dtype_is_object)
21326  *         finally:
21327  *             PyMem_Free(tmp)             # <<<<<<<<<<<<<<
21328  *
21329  *     cdef setitem_indexed(self, index, value):
21330  */
21331   /*finally:*/ {
21332     /*normal exit:*/{
21333       PyMem_Free(__pyx_v_tmp);
21334       goto __pyx_L7;
21335     }
21336     __pyx_L6_error:;
21337     /*exception exit:*/{
21338       __Pyx_PyThreadState_declare
21339       __Pyx_PyThreadState_assign
21340       __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
21341       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21342       if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
21343       if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
21344       __Pyx_XGOTREF(__pyx_t_7);
21345       __Pyx_XGOTREF(__pyx_t_8);
21346       __Pyx_XGOTREF(__pyx_t_9);
21347       __Pyx_XGOTREF(__pyx_t_10);
21348       __Pyx_XGOTREF(__pyx_t_11);
21349       __Pyx_XGOTREF(__pyx_t_12);
21350       __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
21351       {
21352         PyMem_Free(__pyx_v_tmp);
21353       }
21354       if (PY_MAJOR_VERSION >= 3) {
21355         __Pyx_XGIVEREF(__pyx_t_10);
21356         __Pyx_XGIVEREF(__pyx_t_11);
21357         __Pyx_XGIVEREF(__pyx_t_12);
21358         __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
21359       }
21360       __Pyx_XGIVEREF(__pyx_t_7);
21361       __Pyx_XGIVEREF(__pyx_t_8);
21362       __Pyx_XGIVEREF(__pyx_t_9);
21363       __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
21364       __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
21365       __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
21366       goto __pyx_L1_error;
21367     }
21368     __pyx_L7:;
21369   }
21370 
21371   /* "View.MemoryView":449
21372  *                                  src.ndim, dst.ndim, self.dtype_is_object)
21373  *
21374  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
21375  *         cdef int array[128]
21376  *         cdef void *tmp = NULL
21377  */
21378 
21379   /* function exit code */
21380   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21381   goto __pyx_L0;
21382   __pyx_L1_error:;
21383   __Pyx_XDECREF(__pyx_t_3);
21384   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
21385   __pyx_r = 0;
21386   __pyx_L0:;
21387   __Pyx_XGIVEREF(__pyx_r);
21388   __Pyx_RefNannyFinishContext();
21389   return __pyx_r;
21390 }
21391 
21392 /* "View.MemoryView":481
21393  *             PyMem_Free(tmp)
21394  *
21395  *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
21396  *         cdef char *itemp = self.get_item_pointer(index)
21397  *         self.assign_item_from_object(itemp, value)
21398  */
21399 
__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index,PyObject * __pyx_v_value)21400 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
21401   char *__pyx_v_itemp;
21402   PyObject *__pyx_r = NULL;
21403   __Pyx_RefNannyDeclarations
21404   char *__pyx_t_1;
21405   PyObject *__pyx_t_2 = NULL;
21406   int __pyx_lineno = 0;
21407   const char *__pyx_filename = NULL;
21408   int __pyx_clineno = 0;
21409   __Pyx_RefNannySetupContext("setitem_indexed", 0);
21410 
21411   /* "View.MemoryView":482
21412  *
21413  *     cdef setitem_indexed(self, index, value):
21414  *         cdef char *itemp = self.get_item_pointer(index)             # <<<<<<<<<<<<<<
21415  *         self.assign_item_from_object(itemp, value)
21416  *
21417  */
21418   __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error)
21419   __pyx_v_itemp = __pyx_t_1;
21420 
21421   /* "View.MemoryView":483
21422  *     cdef setitem_indexed(self, index, value):
21423  *         cdef char *itemp = self.get_item_pointer(index)
21424  *         self.assign_item_from_object(itemp, value)             # <<<<<<<<<<<<<<
21425  *
21426  *     cdef convert_item_to_object(self, char *itemp):
21427  */
21428   __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, 483, __pyx_L1_error)
21429   __Pyx_GOTREF(__pyx_t_2);
21430   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21431 
21432   /* "View.MemoryView":481
21433  *             PyMem_Free(tmp)
21434  *
21435  *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
21436  *         cdef char *itemp = self.get_item_pointer(index)
21437  *         self.assign_item_from_object(itemp, value)
21438  */
21439 
21440   /* function exit code */
21441   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21442   goto __pyx_L0;
21443   __pyx_L1_error:;
21444   __Pyx_XDECREF(__pyx_t_2);
21445   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
21446   __pyx_r = 0;
21447   __pyx_L0:;
21448   __Pyx_XGIVEREF(__pyx_r);
21449   __Pyx_RefNannyFinishContext();
21450   return __pyx_r;
21451 }
21452 
21453 /* "View.MemoryView":485
21454  *         self.assign_item_from_object(itemp, value)
21455  *
21456  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
21457  *         """Only used if instantiated manually by the user, or if Cython doesn't
21458  *         know how to convert the type"""
21459  */
21460 
__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj * __pyx_v_self,char * __pyx_v_itemp)21461 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
21462   PyObject *__pyx_v_struct = NULL;
21463   PyObject *__pyx_v_bytesitem = 0;
21464   PyObject *__pyx_v_result = NULL;
21465   PyObject *__pyx_r = NULL;
21466   __Pyx_RefNannyDeclarations
21467   PyObject *__pyx_t_1 = NULL;
21468   PyObject *__pyx_t_2 = NULL;
21469   PyObject *__pyx_t_3 = NULL;
21470   PyObject *__pyx_t_4 = NULL;
21471   PyObject *__pyx_t_5 = NULL;
21472   PyObject *__pyx_t_6 = NULL;
21473   PyObject *__pyx_t_7 = NULL;
21474   int __pyx_t_8;
21475   PyObject *__pyx_t_9 = NULL;
21476   size_t __pyx_t_10;
21477   int __pyx_t_11;
21478   int __pyx_lineno = 0;
21479   const char *__pyx_filename = NULL;
21480   int __pyx_clineno = 0;
21481   __Pyx_RefNannySetupContext("convert_item_to_object", 0);
21482 
21483   /* "View.MemoryView":488
21484  *         """Only used if instantiated manually by the user, or if Cython doesn't
21485  *         know how to convert the type"""
21486  *         import struct             # <<<<<<<<<<<<<<
21487  *         cdef bytes bytesitem
21488  *
21489  */
21490   __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error)
21491   __Pyx_GOTREF(__pyx_t_1);
21492   __pyx_v_struct = __pyx_t_1;
21493   __pyx_t_1 = 0;
21494 
21495   /* "View.MemoryView":491
21496  *         cdef bytes bytesitem
21497  *
21498  *         bytesitem = itemp[:self.view.itemsize]             # <<<<<<<<<<<<<<
21499  *         try:
21500  *             result = struct.unpack(self.view.format, bytesitem)
21501  */
21502   __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error)
21503   __Pyx_GOTREF(__pyx_t_1);
21504   __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
21505   __pyx_t_1 = 0;
21506 
21507   /* "View.MemoryView":492
21508  *
21509  *         bytesitem = itemp[:self.view.itemsize]
21510  *         try:             # <<<<<<<<<<<<<<
21511  *             result = struct.unpack(self.view.format, bytesitem)
21512  *         except struct.error:
21513  */
21514   {
21515     __Pyx_PyThreadState_declare
21516     __Pyx_PyThreadState_assign
21517     __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
21518     __Pyx_XGOTREF(__pyx_t_2);
21519     __Pyx_XGOTREF(__pyx_t_3);
21520     __Pyx_XGOTREF(__pyx_t_4);
21521     /*try:*/ {
21522 
21523       /* "View.MemoryView":493
21524  *         bytesitem = itemp[:self.view.itemsize]
21525  *         try:
21526  *             result = struct.unpack(self.view.format, bytesitem)             # <<<<<<<<<<<<<<
21527  *         except struct.error:
21528  *             raise ValueError("Unable to convert item to object")
21529  */
21530       __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error)
21531       __Pyx_GOTREF(__pyx_t_5);
21532       __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error)
21533       __Pyx_GOTREF(__pyx_t_6);
21534       __pyx_t_7 = NULL;
21535       __pyx_t_8 = 0;
21536       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
21537         __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
21538         if (likely(__pyx_t_7)) {
21539           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
21540           __Pyx_INCREF(__pyx_t_7);
21541           __Pyx_INCREF(function);
21542           __Pyx_DECREF_SET(__pyx_t_5, function);
21543           __pyx_t_8 = 1;
21544         }
21545       }
21546       #if CYTHON_FAST_PYCALL
21547       if (PyFunction_Check(__pyx_t_5)) {
21548         PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
21549         __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
21550         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
21551         __Pyx_GOTREF(__pyx_t_1);
21552         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21553       } else
21554       #endif
21555       #if CYTHON_FAST_PYCCALL
21556       if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
21557         PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
21558         __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
21559         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
21560         __Pyx_GOTREF(__pyx_t_1);
21561         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21562       } else
21563       #endif
21564       {
21565         __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error)
21566         __Pyx_GOTREF(__pyx_t_9);
21567         if (__pyx_t_7) {
21568           __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
21569         }
21570         __Pyx_GIVEREF(__pyx_t_6);
21571         PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
21572         __Pyx_INCREF(__pyx_v_bytesitem);
21573         __Pyx_GIVEREF(__pyx_v_bytesitem);
21574         PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
21575         __pyx_t_6 = 0;
21576         __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
21577         __Pyx_GOTREF(__pyx_t_1);
21578         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21579       }
21580       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21581       __pyx_v_result = __pyx_t_1;
21582       __pyx_t_1 = 0;
21583 
21584       /* "View.MemoryView":492
21585  *
21586  *         bytesitem = itemp[:self.view.itemsize]
21587  *         try:             # <<<<<<<<<<<<<<
21588  *             result = struct.unpack(self.view.format, bytesitem)
21589  *         except struct.error:
21590  */
21591     }
21592 
21593     /* "View.MemoryView":497
21594  *             raise ValueError("Unable to convert item to object")
21595  *         else:
21596  *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
21597  *                 return result[0]
21598  *             return result
21599  */
21600     /*else:*/ {
21601       __pyx_t_10 = strlen(__pyx_v_self->view.format);
21602       __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
21603       if (__pyx_t_11) {
21604 
21605         /* "View.MemoryView":498
21606  *         else:
21607  *             if len(self.view.format) == 1:
21608  *                 return result[0]             # <<<<<<<<<<<<<<
21609  *             return result
21610  *
21611  */
21612         __Pyx_XDECREF(__pyx_r);
21613         __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error)
21614         __Pyx_GOTREF(__pyx_t_1);
21615         __pyx_r = __pyx_t_1;
21616         __pyx_t_1 = 0;
21617         goto __pyx_L6_except_return;
21618 
21619         /* "View.MemoryView":497
21620  *             raise ValueError("Unable to convert item to object")
21621  *         else:
21622  *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
21623  *                 return result[0]
21624  *             return result
21625  */
21626       }
21627 
21628       /* "View.MemoryView":499
21629  *             if len(self.view.format) == 1:
21630  *                 return result[0]
21631  *             return result             # <<<<<<<<<<<<<<
21632  *
21633  *     cdef assign_item_from_object(self, char *itemp, object value):
21634  */
21635       __Pyx_XDECREF(__pyx_r);
21636       __Pyx_INCREF(__pyx_v_result);
21637       __pyx_r = __pyx_v_result;
21638       goto __pyx_L6_except_return;
21639     }
21640     __pyx_L3_error:;
21641     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21642     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21643     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
21644     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
21645     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
21646 
21647     /* "View.MemoryView":494
21648  *         try:
21649  *             result = struct.unpack(self.view.format, bytesitem)
21650  *         except struct.error:             # <<<<<<<<<<<<<<
21651  *             raise ValueError("Unable to convert item to object")
21652  *         else:
21653  */
21654     __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
21655     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error)
21656     __Pyx_GOTREF(__pyx_t_6);
21657     __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
21658     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21659     __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
21660     __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
21661     if (__pyx_t_8) {
21662       __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
21663       if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error)
21664       __Pyx_GOTREF(__pyx_t_9);
21665       __Pyx_GOTREF(__pyx_t_5);
21666       __Pyx_GOTREF(__pyx_t_1);
21667 
21668       /* "View.MemoryView":495
21669  *             result = struct.unpack(self.view.format, bytesitem)
21670  *         except struct.error:
21671  *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
21672  *         else:
21673  *             if len(self.view.format) == 1:
21674  */
21675       __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error)
21676       __Pyx_GOTREF(__pyx_t_6);
21677       __Pyx_Raise(__pyx_t_6, 0, 0, 0);
21678       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21679       __PYX_ERR(1, 495, __pyx_L5_except_error)
21680     }
21681     goto __pyx_L5_except_error;
21682     __pyx_L5_except_error:;
21683 
21684     /* "View.MemoryView":492
21685  *
21686  *         bytesitem = itemp[:self.view.itemsize]
21687  *         try:             # <<<<<<<<<<<<<<
21688  *             result = struct.unpack(self.view.format, bytesitem)
21689  *         except struct.error:
21690  */
21691     __Pyx_XGIVEREF(__pyx_t_2);
21692     __Pyx_XGIVEREF(__pyx_t_3);
21693     __Pyx_XGIVEREF(__pyx_t_4);
21694     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
21695     goto __pyx_L1_error;
21696     __pyx_L6_except_return:;
21697     __Pyx_XGIVEREF(__pyx_t_2);
21698     __Pyx_XGIVEREF(__pyx_t_3);
21699     __Pyx_XGIVEREF(__pyx_t_4);
21700     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
21701     goto __pyx_L0;
21702   }
21703 
21704   /* "View.MemoryView":485
21705  *         self.assign_item_from_object(itemp, value)
21706  *
21707  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
21708  *         """Only used if instantiated manually by the user, or if Cython doesn't
21709  *         know how to convert the type"""
21710  */
21711 
21712   /* function exit code */
21713   __pyx_L1_error:;
21714   __Pyx_XDECREF(__pyx_t_1);
21715   __Pyx_XDECREF(__pyx_t_5);
21716   __Pyx_XDECREF(__pyx_t_6);
21717   __Pyx_XDECREF(__pyx_t_7);
21718   __Pyx_XDECREF(__pyx_t_9);
21719   __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
21720   __pyx_r = 0;
21721   __pyx_L0:;
21722   __Pyx_XDECREF(__pyx_v_struct);
21723   __Pyx_XDECREF(__pyx_v_bytesitem);
21724   __Pyx_XDECREF(__pyx_v_result);
21725   __Pyx_XGIVEREF(__pyx_r);
21726   __Pyx_RefNannyFinishContext();
21727   return __pyx_r;
21728 }
21729 
21730 /* "View.MemoryView":501
21731  *             return result
21732  *
21733  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
21734  *         """Only used if instantiated manually by the user, or if Cython doesn't
21735  *         know how to convert the type"""
21736  */
21737 
__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj * __pyx_v_self,char * __pyx_v_itemp,PyObject * __pyx_v_value)21738 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
21739   PyObject *__pyx_v_struct = NULL;
21740   char __pyx_v_c;
21741   PyObject *__pyx_v_bytesvalue = 0;
21742   Py_ssize_t __pyx_v_i;
21743   PyObject *__pyx_r = NULL;
21744   __Pyx_RefNannyDeclarations
21745   PyObject *__pyx_t_1 = NULL;
21746   int __pyx_t_2;
21747   int __pyx_t_3;
21748   PyObject *__pyx_t_4 = NULL;
21749   PyObject *__pyx_t_5 = NULL;
21750   PyObject *__pyx_t_6 = NULL;
21751   int __pyx_t_7;
21752   PyObject *__pyx_t_8 = NULL;
21753   Py_ssize_t __pyx_t_9;
21754   PyObject *__pyx_t_10 = NULL;
21755   char *__pyx_t_11;
21756   char *__pyx_t_12;
21757   char *__pyx_t_13;
21758   char *__pyx_t_14;
21759   int __pyx_lineno = 0;
21760   const char *__pyx_filename = NULL;
21761   int __pyx_clineno = 0;
21762   __Pyx_RefNannySetupContext("assign_item_from_object", 0);
21763 
21764   /* "View.MemoryView":504
21765  *         """Only used if instantiated manually by the user, or if Cython doesn't
21766  *         know how to convert the type"""
21767  *         import struct             # <<<<<<<<<<<<<<
21768  *         cdef char c
21769  *         cdef bytes bytesvalue
21770  */
21771   __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
21772   __Pyx_GOTREF(__pyx_t_1);
21773   __pyx_v_struct = __pyx_t_1;
21774   __pyx_t_1 = 0;
21775 
21776   /* "View.MemoryView":509
21777  *         cdef Py_ssize_t i
21778  *
21779  *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
21780  *             bytesvalue = struct.pack(self.view.format, *value)
21781  *         else:
21782  */
21783   __pyx_t_2 = PyTuple_Check(__pyx_v_value);
21784   __pyx_t_3 = (__pyx_t_2 != 0);
21785   if (__pyx_t_3) {
21786 
21787     /* "View.MemoryView":510
21788  *
21789  *         if isinstance(value, tuple):
21790  *             bytesvalue = struct.pack(self.view.format, *value)             # <<<<<<<<<<<<<<
21791  *         else:
21792  *             bytesvalue = struct.pack(self.view.format, value)
21793  */
21794     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error)
21795     __Pyx_GOTREF(__pyx_t_1);
21796     __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
21797     __Pyx_GOTREF(__pyx_t_4);
21798     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error)
21799     __Pyx_GOTREF(__pyx_t_5);
21800     __Pyx_GIVEREF(__pyx_t_4);
21801     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
21802     __pyx_t_4 = 0;
21803     __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
21804     __Pyx_GOTREF(__pyx_t_4);
21805     __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error)
21806     __Pyx_GOTREF(__pyx_t_6);
21807     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21808     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21809     __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
21810     __Pyx_GOTREF(__pyx_t_4);
21811     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21812     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21813     if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error)
21814     __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
21815     __pyx_t_4 = 0;
21816 
21817     /* "View.MemoryView":509
21818  *         cdef Py_ssize_t i
21819  *
21820  *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
21821  *             bytesvalue = struct.pack(self.view.format, *value)
21822  *         else:
21823  */
21824     goto __pyx_L3;
21825   }
21826 
21827   /* "View.MemoryView":512
21828  *             bytesvalue = struct.pack(self.view.format, *value)
21829  *         else:
21830  *             bytesvalue = struct.pack(self.view.format, value)             # <<<<<<<<<<<<<<
21831  *
21832  *         for i, c in enumerate(bytesvalue):
21833  */
21834   /*else*/ {
21835     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
21836     __Pyx_GOTREF(__pyx_t_6);
21837     __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
21838     __Pyx_GOTREF(__pyx_t_1);
21839     __pyx_t_5 = NULL;
21840     __pyx_t_7 = 0;
21841     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
21842       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
21843       if (likely(__pyx_t_5)) {
21844         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
21845         __Pyx_INCREF(__pyx_t_5);
21846         __Pyx_INCREF(function);
21847         __Pyx_DECREF_SET(__pyx_t_6, function);
21848         __pyx_t_7 = 1;
21849       }
21850     }
21851     #if CYTHON_FAST_PYCALL
21852     if (PyFunction_Check(__pyx_t_6)) {
21853       PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
21854       __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
21855       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21856       __Pyx_GOTREF(__pyx_t_4);
21857       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21858     } else
21859     #endif
21860     #if CYTHON_FAST_PYCCALL
21861     if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
21862       PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
21863       __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
21864       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21865       __Pyx_GOTREF(__pyx_t_4);
21866       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21867     } else
21868     #endif
21869     {
21870       __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error)
21871       __Pyx_GOTREF(__pyx_t_8);
21872       if (__pyx_t_5) {
21873         __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
21874       }
21875       __Pyx_GIVEREF(__pyx_t_1);
21876       PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
21877       __Pyx_INCREF(__pyx_v_value);
21878       __Pyx_GIVEREF(__pyx_v_value);
21879       PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
21880       __pyx_t_1 = 0;
21881       __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
21882       __Pyx_GOTREF(__pyx_t_4);
21883       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21884     }
21885     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21886     if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
21887     __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
21888     __pyx_t_4 = 0;
21889   }
21890   __pyx_L3:;
21891 
21892   /* "View.MemoryView":514
21893  *             bytesvalue = struct.pack(self.view.format, value)
21894  *
21895  *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
21896  *             itemp[i] = c
21897  *
21898  */
21899   __pyx_t_9 = 0;
21900   if (unlikely(__pyx_v_bytesvalue == Py_None)) {
21901     PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
21902     __PYX_ERR(1, 514, __pyx_L1_error)
21903   }
21904   __Pyx_INCREF(__pyx_v_bytesvalue);
21905   __pyx_t_10 = __pyx_v_bytesvalue;
21906   __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
21907   __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
21908   for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
21909     __pyx_t_11 = __pyx_t_14;
21910     __pyx_v_c = (__pyx_t_11[0]);
21911 
21912     /* "View.MemoryView":515
21913  *
21914  *         for i, c in enumerate(bytesvalue):
21915  *             itemp[i] = c             # <<<<<<<<<<<<<<
21916  *
21917  *     @cname('getbuffer')
21918  */
21919     __pyx_v_i = __pyx_t_9;
21920 
21921     /* "View.MemoryView":514
21922  *             bytesvalue = struct.pack(self.view.format, value)
21923  *
21924  *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
21925  *             itemp[i] = c
21926  *
21927  */
21928     __pyx_t_9 = (__pyx_t_9 + 1);
21929 
21930     /* "View.MemoryView":515
21931  *
21932  *         for i, c in enumerate(bytesvalue):
21933  *             itemp[i] = c             # <<<<<<<<<<<<<<
21934  *
21935  *     @cname('getbuffer')
21936  */
21937     (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
21938   }
21939   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21940 
21941   /* "View.MemoryView":501
21942  *             return result
21943  *
21944  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
21945  *         """Only used if instantiated manually by the user, or if Cython doesn't
21946  *         know how to convert the type"""
21947  */
21948 
21949   /* function exit code */
21950   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21951   goto __pyx_L0;
21952   __pyx_L1_error:;
21953   __Pyx_XDECREF(__pyx_t_1);
21954   __Pyx_XDECREF(__pyx_t_4);
21955   __Pyx_XDECREF(__pyx_t_5);
21956   __Pyx_XDECREF(__pyx_t_6);
21957   __Pyx_XDECREF(__pyx_t_8);
21958   __Pyx_XDECREF(__pyx_t_10);
21959   __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
21960   __pyx_r = 0;
21961   __pyx_L0:;
21962   __Pyx_XDECREF(__pyx_v_struct);
21963   __Pyx_XDECREF(__pyx_v_bytesvalue);
21964   __Pyx_XGIVEREF(__pyx_r);
21965   __Pyx_RefNannyFinishContext();
21966   return __pyx_r;
21967 }
21968 
21969 /* "View.MemoryView":518
21970  *
21971  *     @cname('getbuffer')
21972  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
21973  *         if flags & PyBUF_WRITABLE and self.view.readonly:
21974  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
21975  */
21976 
21977 /* Python wrapper */
21978 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
__pyx_memoryview_getbuffer(PyObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)21979 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
21980   int __pyx_r;
21981   __Pyx_RefNannyDeclarations
21982   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
21983   __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));
21984 
21985   /* function exit code */
21986   __Pyx_RefNannyFinishContext();
21987   return __pyx_r;
21988 }
21989 
__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)21990 static 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) {
21991   int __pyx_r;
21992   __Pyx_RefNannyDeclarations
21993   int __pyx_t_1;
21994   int __pyx_t_2;
21995   PyObject *__pyx_t_3 = NULL;
21996   Py_ssize_t *__pyx_t_4;
21997   char *__pyx_t_5;
21998   void *__pyx_t_6;
21999   int __pyx_t_7;
22000   Py_ssize_t __pyx_t_8;
22001   int __pyx_lineno = 0;
22002   const char *__pyx_filename = NULL;
22003   int __pyx_clineno = 0;
22004   if (__pyx_v_info == NULL) {
22005     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
22006     return -1;
22007   }
22008   __Pyx_RefNannySetupContext("__getbuffer__", 0);
22009   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
22010   __Pyx_GIVEREF(__pyx_v_info->obj);
22011 
22012   /* "View.MemoryView":519
22013  *     @cname('getbuffer')
22014  *     def __getbuffer__(self, Py_buffer *info, int flags):
22015  *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
22016  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
22017  *
22018  */
22019   __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
22020   if (__pyx_t_2) {
22021   } else {
22022     __pyx_t_1 = __pyx_t_2;
22023     goto __pyx_L4_bool_binop_done;
22024   }
22025   __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
22026   __pyx_t_1 = __pyx_t_2;
22027   __pyx_L4_bool_binop_done:;
22028   if (unlikely(__pyx_t_1)) {
22029 
22030     /* "View.MemoryView":520
22031  *     def __getbuffer__(self, Py_buffer *info, int flags):
22032  *         if flags & PyBUF_WRITABLE and self.view.readonly:
22033  *             raise ValueError("Cannot create writable memory view from read-only memoryview")             # <<<<<<<<<<<<<<
22034  *
22035  *         if flags & PyBUF_ND:
22036  */
22037     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
22038     __Pyx_GOTREF(__pyx_t_3);
22039     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
22040     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22041     __PYX_ERR(1, 520, __pyx_L1_error)
22042 
22043     /* "View.MemoryView":519
22044  *     @cname('getbuffer')
22045  *     def __getbuffer__(self, Py_buffer *info, int flags):
22046  *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
22047  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
22048  *
22049  */
22050   }
22051 
22052   /* "View.MemoryView":522
22053  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
22054  *
22055  *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
22056  *             info.shape = self.view.shape
22057  *         else:
22058  */
22059   __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
22060   if (__pyx_t_1) {
22061 
22062     /* "View.MemoryView":523
22063  *
22064  *         if flags & PyBUF_ND:
22065  *             info.shape = self.view.shape             # <<<<<<<<<<<<<<
22066  *         else:
22067  *             info.shape = NULL
22068  */
22069     __pyx_t_4 = __pyx_v_self->view.shape;
22070     __pyx_v_info->shape = __pyx_t_4;
22071 
22072     /* "View.MemoryView":522
22073  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
22074  *
22075  *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
22076  *             info.shape = self.view.shape
22077  *         else:
22078  */
22079     goto __pyx_L6;
22080   }
22081 
22082   /* "View.MemoryView":525
22083  *             info.shape = self.view.shape
22084  *         else:
22085  *             info.shape = NULL             # <<<<<<<<<<<<<<
22086  *
22087  *         if flags & PyBUF_STRIDES:
22088  */
22089   /*else*/ {
22090     __pyx_v_info->shape = NULL;
22091   }
22092   __pyx_L6:;
22093 
22094   /* "View.MemoryView":527
22095  *             info.shape = NULL
22096  *
22097  *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
22098  *             info.strides = self.view.strides
22099  *         else:
22100  */
22101   __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
22102   if (__pyx_t_1) {
22103 
22104     /* "View.MemoryView":528
22105  *
22106  *         if flags & PyBUF_STRIDES:
22107  *             info.strides = self.view.strides             # <<<<<<<<<<<<<<
22108  *         else:
22109  *             info.strides = NULL
22110  */
22111     __pyx_t_4 = __pyx_v_self->view.strides;
22112     __pyx_v_info->strides = __pyx_t_4;
22113 
22114     /* "View.MemoryView":527
22115  *             info.shape = NULL
22116  *
22117  *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
22118  *             info.strides = self.view.strides
22119  *         else:
22120  */
22121     goto __pyx_L7;
22122   }
22123 
22124   /* "View.MemoryView":530
22125  *             info.strides = self.view.strides
22126  *         else:
22127  *             info.strides = NULL             # <<<<<<<<<<<<<<
22128  *
22129  *         if flags & PyBUF_INDIRECT:
22130  */
22131   /*else*/ {
22132     __pyx_v_info->strides = NULL;
22133   }
22134   __pyx_L7:;
22135 
22136   /* "View.MemoryView":532
22137  *             info.strides = NULL
22138  *
22139  *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
22140  *             info.suboffsets = self.view.suboffsets
22141  *         else:
22142  */
22143   __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
22144   if (__pyx_t_1) {
22145 
22146     /* "View.MemoryView":533
22147  *
22148  *         if flags & PyBUF_INDIRECT:
22149  *             info.suboffsets = self.view.suboffsets             # <<<<<<<<<<<<<<
22150  *         else:
22151  *             info.suboffsets = NULL
22152  */
22153     __pyx_t_4 = __pyx_v_self->view.suboffsets;
22154     __pyx_v_info->suboffsets = __pyx_t_4;
22155 
22156     /* "View.MemoryView":532
22157  *             info.strides = NULL
22158  *
22159  *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
22160  *             info.suboffsets = self.view.suboffsets
22161  *         else:
22162  */
22163     goto __pyx_L8;
22164   }
22165 
22166   /* "View.MemoryView":535
22167  *             info.suboffsets = self.view.suboffsets
22168  *         else:
22169  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
22170  *
22171  *         if flags & PyBUF_FORMAT:
22172  */
22173   /*else*/ {
22174     __pyx_v_info->suboffsets = NULL;
22175   }
22176   __pyx_L8:;
22177 
22178   /* "View.MemoryView":537
22179  *             info.suboffsets = NULL
22180  *
22181  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
22182  *             info.format = self.view.format
22183  *         else:
22184  */
22185   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
22186   if (__pyx_t_1) {
22187 
22188     /* "View.MemoryView":538
22189  *
22190  *         if flags & PyBUF_FORMAT:
22191  *             info.format = self.view.format             # <<<<<<<<<<<<<<
22192  *         else:
22193  *             info.format = NULL
22194  */
22195     __pyx_t_5 = __pyx_v_self->view.format;
22196     __pyx_v_info->format = __pyx_t_5;
22197 
22198     /* "View.MemoryView":537
22199  *             info.suboffsets = NULL
22200  *
22201  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
22202  *             info.format = self.view.format
22203  *         else:
22204  */
22205     goto __pyx_L9;
22206   }
22207 
22208   /* "View.MemoryView":540
22209  *             info.format = self.view.format
22210  *         else:
22211  *             info.format = NULL             # <<<<<<<<<<<<<<
22212  *
22213  *         info.buf = self.view.buf
22214  */
22215   /*else*/ {
22216     __pyx_v_info->format = NULL;
22217   }
22218   __pyx_L9:;
22219 
22220   /* "View.MemoryView":542
22221  *             info.format = NULL
22222  *
22223  *         info.buf = self.view.buf             # <<<<<<<<<<<<<<
22224  *         info.ndim = self.view.ndim
22225  *         info.itemsize = self.view.itemsize
22226  */
22227   __pyx_t_6 = __pyx_v_self->view.buf;
22228   __pyx_v_info->buf = __pyx_t_6;
22229 
22230   /* "View.MemoryView":543
22231  *
22232  *         info.buf = self.view.buf
22233  *         info.ndim = self.view.ndim             # <<<<<<<<<<<<<<
22234  *         info.itemsize = self.view.itemsize
22235  *         info.len = self.view.len
22236  */
22237   __pyx_t_7 = __pyx_v_self->view.ndim;
22238   __pyx_v_info->ndim = __pyx_t_7;
22239 
22240   /* "View.MemoryView":544
22241  *         info.buf = self.view.buf
22242  *         info.ndim = self.view.ndim
22243  *         info.itemsize = self.view.itemsize             # <<<<<<<<<<<<<<
22244  *         info.len = self.view.len
22245  *         info.readonly = self.view.readonly
22246  */
22247   __pyx_t_8 = __pyx_v_self->view.itemsize;
22248   __pyx_v_info->itemsize = __pyx_t_8;
22249 
22250   /* "View.MemoryView":545
22251  *         info.ndim = self.view.ndim
22252  *         info.itemsize = self.view.itemsize
22253  *         info.len = self.view.len             # <<<<<<<<<<<<<<
22254  *         info.readonly = self.view.readonly
22255  *         info.obj = self
22256  */
22257   __pyx_t_8 = __pyx_v_self->view.len;
22258   __pyx_v_info->len = __pyx_t_8;
22259 
22260   /* "View.MemoryView":546
22261  *         info.itemsize = self.view.itemsize
22262  *         info.len = self.view.len
22263  *         info.readonly = self.view.readonly             # <<<<<<<<<<<<<<
22264  *         info.obj = self
22265  *
22266  */
22267   __pyx_t_1 = __pyx_v_self->view.readonly;
22268   __pyx_v_info->readonly = __pyx_t_1;
22269 
22270   /* "View.MemoryView":547
22271  *         info.len = self.view.len
22272  *         info.readonly = self.view.readonly
22273  *         info.obj = self             # <<<<<<<<<<<<<<
22274  *
22275  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
22276  */
22277   __Pyx_INCREF(((PyObject *)__pyx_v_self));
22278   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
22279   __Pyx_GOTREF(__pyx_v_info->obj);
22280   __Pyx_DECREF(__pyx_v_info->obj);
22281   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
22282 
22283   /* "View.MemoryView":518
22284  *
22285  *     @cname('getbuffer')
22286  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
22287  *         if flags & PyBUF_WRITABLE and self.view.readonly:
22288  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
22289  */
22290 
22291   /* function exit code */
22292   __pyx_r = 0;
22293   goto __pyx_L0;
22294   __pyx_L1_error:;
22295   __Pyx_XDECREF(__pyx_t_3);
22296   __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22297   __pyx_r = -1;
22298   if (__pyx_v_info->obj != NULL) {
22299     __Pyx_GOTREF(__pyx_v_info->obj);
22300     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
22301   }
22302   goto __pyx_L2;
22303   __pyx_L0:;
22304   if (__pyx_v_info->obj == Py_None) {
22305     __Pyx_GOTREF(__pyx_v_info->obj);
22306     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
22307   }
22308   __pyx_L2:;
22309   __Pyx_RefNannyFinishContext();
22310   return __pyx_r;
22311 }
22312 
22313 /* "View.MemoryView":553
22314  *
22315  *     @property
22316  *     def T(self):             # <<<<<<<<<<<<<<
22317  *         cdef _memoryviewslice result = memoryview_copy(self)
22318  *         transpose_memslice(&result.from_slice)
22319  */
22320 
22321 /* Python wrapper */
22322 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject * __pyx_v_self)22323 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
22324   PyObject *__pyx_r = 0;
22325   __Pyx_RefNannyDeclarations
22326   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
22327   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
22328 
22329   /* function exit code */
22330   __Pyx_RefNannyFinishContext();
22331   return __pyx_r;
22332 }
22333 
__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj * __pyx_v_self)22334 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
22335   struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
22336   PyObject *__pyx_r = NULL;
22337   __Pyx_RefNannyDeclarations
22338   PyObject *__pyx_t_1 = NULL;
22339   int __pyx_t_2;
22340   int __pyx_lineno = 0;
22341   const char *__pyx_filename = NULL;
22342   int __pyx_clineno = 0;
22343   __Pyx_RefNannySetupContext("__get__", 0);
22344 
22345   /* "View.MemoryView":554
22346  *     @property
22347  *     def T(self):
22348  *         cdef _memoryviewslice result = memoryview_copy(self)             # <<<<<<<<<<<<<<
22349  *         transpose_memslice(&result.from_slice)
22350  *         return result
22351  */
22352   __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
22353   __Pyx_GOTREF(__pyx_t_1);
22354   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error)
22355   __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
22356   __pyx_t_1 = 0;
22357 
22358   /* "View.MemoryView":555
22359  *     def T(self):
22360  *         cdef _memoryviewslice result = memoryview_copy(self)
22361  *         transpose_memslice(&result.from_slice)             # <<<<<<<<<<<<<<
22362  *         return result
22363  *
22364  */
22365   __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 555, __pyx_L1_error)
22366 
22367   /* "View.MemoryView":556
22368  *         cdef _memoryviewslice result = memoryview_copy(self)
22369  *         transpose_memslice(&result.from_slice)
22370  *         return result             # <<<<<<<<<<<<<<
22371  *
22372  *     @property
22373  */
22374   __Pyx_XDECREF(__pyx_r);
22375   __Pyx_INCREF(((PyObject *)__pyx_v_result));
22376   __pyx_r = ((PyObject *)__pyx_v_result);
22377   goto __pyx_L0;
22378 
22379   /* "View.MemoryView":553
22380  *
22381  *     @property
22382  *     def T(self):             # <<<<<<<<<<<<<<
22383  *         cdef _memoryviewslice result = memoryview_copy(self)
22384  *         transpose_memslice(&result.from_slice)
22385  */
22386 
22387   /* function exit code */
22388   __pyx_L1_error:;
22389   __Pyx_XDECREF(__pyx_t_1);
22390   __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22391   __pyx_r = NULL;
22392   __pyx_L0:;
22393   __Pyx_XDECREF((PyObject *)__pyx_v_result);
22394   __Pyx_XGIVEREF(__pyx_r);
22395   __Pyx_RefNannyFinishContext();
22396   return __pyx_r;
22397 }
22398 
22399 /* "View.MemoryView":559
22400  *
22401  *     @property
22402  *     def base(self):             # <<<<<<<<<<<<<<
22403  *         return self.obj
22404  *
22405  */
22406 
22407 /* Python wrapper */
22408 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject * __pyx_v_self)22409 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
22410   PyObject *__pyx_r = 0;
22411   __Pyx_RefNannyDeclarations
22412   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
22413   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
22414 
22415   /* function exit code */
22416   __Pyx_RefNannyFinishContext();
22417   return __pyx_r;
22418 }
22419 
__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj * __pyx_v_self)22420 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
22421   PyObject *__pyx_r = NULL;
22422   __Pyx_RefNannyDeclarations
22423   __Pyx_RefNannySetupContext("__get__", 0);
22424 
22425   /* "View.MemoryView":560
22426  *     @property
22427  *     def base(self):
22428  *         return self.obj             # <<<<<<<<<<<<<<
22429  *
22430  *     @property
22431  */
22432   __Pyx_XDECREF(__pyx_r);
22433   __Pyx_INCREF(__pyx_v_self->obj);
22434   __pyx_r = __pyx_v_self->obj;
22435   goto __pyx_L0;
22436 
22437   /* "View.MemoryView":559
22438  *
22439  *     @property
22440  *     def base(self):             # <<<<<<<<<<<<<<
22441  *         return self.obj
22442  *
22443  */
22444 
22445   /* function exit code */
22446   __pyx_L0:;
22447   __Pyx_XGIVEREF(__pyx_r);
22448   __Pyx_RefNannyFinishContext();
22449   return __pyx_r;
22450 }
22451 
22452 /* "View.MemoryView":563
22453  *
22454  *     @property
22455  *     def shape(self):             # <<<<<<<<<<<<<<
22456  *         return tuple([length for length in self.view.shape[:self.view.ndim]])
22457  *
22458  */
22459 
22460 /* Python wrapper */
22461 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject * __pyx_v_self)22462 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
22463   PyObject *__pyx_r = 0;
22464   __Pyx_RefNannyDeclarations
22465   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
22466   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
22467 
22468   /* function exit code */
22469   __Pyx_RefNannyFinishContext();
22470   return __pyx_r;
22471 }
22472 
__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj * __pyx_v_self)22473 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
22474   Py_ssize_t __pyx_v_length;
22475   PyObject *__pyx_r = NULL;
22476   __Pyx_RefNannyDeclarations
22477   PyObject *__pyx_t_1 = NULL;
22478   Py_ssize_t *__pyx_t_2;
22479   Py_ssize_t *__pyx_t_3;
22480   Py_ssize_t *__pyx_t_4;
22481   PyObject *__pyx_t_5 = NULL;
22482   int __pyx_lineno = 0;
22483   const char *__pyx_filename = NULL;
22484   int __pyx_clineno = 0;
22485   __Pyx_RefNannySetupContext("__get__", 0);
22486 
22487   /* "View.MemoryView":564
22488  *     @property
22489  *     def shape(self):
22490  *         return tuple([length for length in self.view.shape[:self.view.ndim]])             # <<<<<<<<<<<<<<
22491  *
22492  *     @property
22493  */
22494   __Pyx_XDECREF(__pyx_r);
22495   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error)
22496   __Pyx_GOTREF(__pyx_t_1);
22497   __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
22498   for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
22499     __pyx_t_2 = __pyx_t_4;
22500     __pyx_v_length = (__pyx_t_2[0]);
22501     __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
22502     __Pyx_GOTREF(__pyx_t_5);
22503     if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error)
22504     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22505   }
22506   __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
22507   __Pyx_GOTREF(__pyx_t_5);
22508   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22509   __pyx_r = __pyx_t_5;
22510   __pyx_t_5 = 0;
22511   goto __pyx_L0;
22512 
22513   /* "View.MemoryView":563
22514  *
22515  *     @property
22516  *     def shape(self):             # <<<<<<<<<<<<<<
22517  *         return tuple([length for length in self.view.shape[:self.view.ndim]])
22518  *
22519  */
22520 
22521   /* function exit code */
22522   __pyx_L1_error:;
22523   __Pyx_XDECREF(__pyx_t_1);
22524   __Pyx_XDECREF(__pyx_t_5);
22525   __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22526   __pyx_r = NULL;
22527   __pyx_L0:;
22528   __Pyx_XGIVEREF(__pyx_r);
22529   __Pyx_RefNannyFinishContext();
22530   return __pyx_r;
22531 }
22532 
22533 /* "View.MemoryView":567
22534  *
22535  *     @property
22536  *     def strides(self):             # <<<<<<<<<<<<<<
22537  *         if self.view.strides == NULL:
22538  *
22539  */
22540 
22541 /* Python wrapper */
22542 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject * __pyx_v_self)22543 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
22544   PyObject *__pyx_r = 0;
22545   __Pyx_RefNannyDeclarations
22546   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
22547   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
22548 
22549   /* function exit code */
22550   __Pyx_RefNannyFinishContext();
22551   return __pyx_r;
22552 }
22553 
__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj * __pyx_v_self)22554 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
22555   Py_ssize_t __pyx_v_stride;
22556   PyObject *__pyx_r = NULL;
22557   __Pyx_RefNannyDeclarations
22558   int __pyx_t_1;
22559   PyObject *__pyx_t_2 = NULL;
22560   Py_ssize_t *__pyx_t_3;
22561   Py_ssize_t *__pyx_t_4;
22562   Py_ssize_t *__pyx_t_5;
22563   PyObject *__pyx_t_6 = NULL;
22564   int __pyx_lineno = 0;
22565   const char *__pyx_filename = NULL;
22566   int __pyx_clineno = 0;
22567   __Pyx_RefNannySetupContext("__get__", 0);
22568 
22569   /* "View.MemoryView":568
22570  *     @property
22571  *     def strides(self):
22572  *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
22573  *
22574  *             raise ValueError("Buffer view does not expose strides")
22575  */
22576   __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
22577   if (unlikely(__pyx_t_1)) {
22578 
22579     /* "View.MemoryView":570
22580  *         if self.view.strides == NULL:
22581  *
22582  *             raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
22583  *
22584  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
22585  */
22586     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
22587     __Pyx_GOTREF(__pyx_t_2);
22588     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
22589     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22590     __PYX_ERR(1, 570, __pyx_L1_error)
22591 
22592     /* "View.MemoryView":568
22593  *     @property
22594  *     def strides(self):
22595  *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
22596  *
22597  *             raise ValueError("Buffer view does not expose strides")
22598  */
22599   }
22600 
22601   /* "View.MemoryView":572
22602  *             raise ValueError("Buffer view does not expose strides")
22603  *
22604  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])             # <<<<<<<<<<<<<<
22605  *
22606  *     @property
22607  */
22608   __Pyx_XDECREF(__pyx_r);
22609   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
22610   __Pyx_GOTREF(__pyx_t_2);
22611   __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
22612   for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
22613     __pyx_t_3 = __pyx_t_5;
22614     __pyx_v_stride = (__pyx_t_3[0]);
22615     __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
22616     __Pyx_GOTREF(__pyx_t_6);
22617     if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error)
22618     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22619   }
22620   __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
22621   __Pyx_GOTREF(__pyx_t_6);
22622   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22623   __pyx_r = __pyx_t_6;
22624   __pyx_t_6 = 0;
22625   goto __pyx_L0;
22626 
22627   /* "View.MemoryView":567
22628  *
22629  *     @property
22630  *     def strides(self):             # <<<<<<<<<<<<<<
22631  *         if self.view.strides == NULL:
22632  *
22633  */
22634 
22635   /* function exit code */
22636   __pyx_L1_error:;
22637   __Pyx_XDECREF(__pyx_t_2);
22638   __Pyx_XDECREF(__pyx_t_6);
22639   __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22640   __pyx_r = NULL;
22641   __pyx_L0:;
22642   __Pyx_XGIVEREF(__pyx_r);
22643   __Pyx_RefNannyFinishContext();
22644   return __pyx_r;
22645 }
22646 
22647 /* "View.MemoryView":575
22648  *
22649  *     @property
22650  *     def suboffsets(self):             # <<<<<<<<<<<<<<
22651  *         if self.view.suboffsets == NULL:
22652  *             return (-1,) * self.view.ndim
22653  */
22654 
22655 /* Python wrapper */
22656 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject * __pyx_v_self)22657 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
22658   PyObject *__pyx_r = 0;
22659   __Pyx_RefNannyDeclarations
22660   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
22661   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
22662 
22663   /* function exit code */
22664   __Pyx_RefNannyFinishContext();
22665   return __pyx_r;
22666 }
22667 
__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj * __pyx_v_self)22668 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
22669   Py_ssize_t __pyx_v_suboffset;
22670   PyObject *__pyx_r = NULL;
22671   __Pyx_RefNannyDeclarations
22672   int __pyx_t_1;
22673   PyObject *__pyx_t_2 = NULL;
22674   PyObject *__pyx_t_3 = NULL;
22675   Py_ssize_t *__pyx_t_4;
22676   Py_ssize_t *__pyx_t_5;
22677   Py_ssize_t *__pyx_t_6;
22678   int __pyx_lineno = 0;
22679   const char *__pyx_filename = NULL;
22680   int __pyx_clineno = 0;
22681   __Pyx_RefNannySetupContext("__get__", 0);
22682 
22683   /* "View.MemoryView":576
22684  *     @property
22685  *     def suboffsets(self):
22686  *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
22687  *             return (-1,) * self.view.ndim
22688  *
22689  */
22690   __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
22691   if (__pyx_t_1) {
22692 
22693     /* "View.MemoryView":577
22694  *     def suboffsets(self):
22695  *         if self.view.suboffsets == NULL:
22696  *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
22697  *
22698  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
22699  */
22700     __Pyx_XDECREF(__pyx_r);
22701     __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
22702     __Pyx_GOTREF(__pyx_t_2);
22703     __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__20, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
22704     __Pyx_GOTREF(__pyx_t_3);
22705     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22706     __pyx_r = __pyx_t_3;
22707     __pyx_t_3 = 0;
22708     goto __pyx_L0;
22709 
22710     /* "View.MemoryView":576
22711  *     @property
22712  *     def suboffsets(self):
22713  *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
22714  *             return (-1,) * self.view.ndim
22715  *
22716  */
22717   }
22718 
22719   /* "View.MemoryView":579
22720  *             return (-1,) * self.view.ndim
22721  *
22722  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])             # <<<<<<<<<<<<<<
22723  *
22724  *     @property
22725  */
22726   __Pyx_XDECREF(__pyx_r);
22727   __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
22728   __Pyx_GOTREF(__pyx_t_3);
22729   __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
22730   for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
22731     __pyx_t_4 = __pyx_t_6;
22732     __pyx_v_suboffset = (__pyx_t_4[0]);
22733     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
22734     __Pyx_GOTREF(__pyx_t_2);
22735     if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error)
22736     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22737   }
22738   __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
22739   __Pyx_GOTREF(__pyx_t_2);
22740   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22741   __pyx_r = __pyx_t_2;
22742   __pyx_t_2 = 0;
22743   goto __pyx_L0;
22744 
22745   /* "View.MemoryView":575
22746  *
22747  *     @property
22748  *     def suboffsets(self):             # <<<<<<<<<<<<<<
22749  *         if self.view.suboffsets == NULL:
22750  *             return (-1,) * self.view.ndim
22751  */
22752 
22753   /* function exit code */
22754   __pyx_L1_error:;
22755   __Pyx_XDECREF(__pyx_t_2);
22756   __Pyx_XDECREF(__pyx_t_3);
22757   __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22758   __pyx_r = NULL;
22759   __pyx_L0:;
22760   __Pyx_XGIVEREF(__pyx_r);
22761   __Pyx_RefNannyFinishContext();
22762   return __pyx_r;
22763 }
22764 
22765 /* "View.MemoryView":582
22766  *
22767  *     @property
22768  *     def ndim(self):             # <<<<<<<<<<<<<<
22769  *         return self.view.ndim
22770  *
22771  */
22772 
22773 /* Python wrapper */
22774 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject * __pyx_v_self)22775 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
22776   PyObject *__pyx_r = 0;
22777   __Pyx_RefNannyDeclarations
22778   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
22779   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
22780 
22781   /* function exit code */
22782   __Pyx_RefNannyFinishContext();
22783   return __pyx_r;
22784 }
22785 
__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj * __pyx_v_self)22786 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
22787   PyObject *__pyx_r = NULL;
22788   __Pyx_RefNannyDeclarations
22789   PyObject *__pyx_t_1 = NULL;
22790   int __pyx_lineno = 0;
22791   const char *__pyx_filename = NULL;
22792   int __pyx_clineno = 0;
22793   __Pyx_RefNannySetupContext("__get__", 0);
22794 
22795   /* "View.MemoryView":583
22796  *     @property
22797  *     def ndim(self):
22798  *         return self.view.ndim             # <<<<<<<<<<<<<<
22799  *
22800  *     @property
22801  */
22802   __Pyx_XDECREF(__pyx_r);
22803   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
22804   __Pyx_GOTREF(__pyx_t_1);
22805   __pyx_r = __pyx_t_1;
22806   __pyx_t_1 = 0;
22807   goto __pyx_L0;
22808 
22809   /* "View.MemoryView":582
22810  *
22811  *     @property
22812  *     def ndim(self):             # <<<<<<<<<<<<<<
22813  *         return self.view.ndim
22814  *
22815  */
22816 
22817   /* function exit code */
22818   __pyx_L1_error:;
22819   __Pyx_XDECREF(__pyx_t_1);
22820   __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22821   __pyx_r = NULL;
22822   __pyx_L0:;
22823   __Pyx_XGIVEREF(__pyx_r);
22824   __Pyx_RefNannyFinishContext();
22825   return __pyx_r;
22826 }
22827 
22828 /* "View.MemoryView":586
22829  *
22830  *     @property
22831  *     def itemsize(self):             # <<<<<<<<<<<<<<
22832  *         return self.view.itemsize
22833  *
22834  */
22835 
22836 /* Python wrapper */
22837 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject * __pyx_v_self)22838 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
22839   PyObject *__pyx_r = 0;
22840   __Pyx_RefNannyDeclarations
22841   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
22842   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
22843 
22844   /* function exit code */
22845   __Pyx_RefNannyFinishContext();
22846   return __pyx_r;
22847 }
22848 
__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj * __pyx_v_self)22849 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
22850   PyObject *__pyx_r = NULL;
22851   __Pyx_RefNannyDeclarations
22852   PyObject *__pyx_t_1 = NULL;
22853   int __pyx_lineno = 0;
22854   const char *__pyx_filename = NULL;
22855   int __pyx_clineno = 0;
22856   __Pyx_RefNannySetupContext("__get__", 0);
22857 
22858   /* "View.MemoryView":587
22859  *     @property
22860  *     def itemsize(self):
22861  *         return self.view.itemsize             # <<<<<<<<<<<<<<
22862  *
22863  *     @property
22864  */
22865   __Pyx_XDECREF(__pyx_r);
22866   __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
22867   __Pyx_GOTREF(__pyx_t_1);
22868   __pyx_r = __pyx_t_1;
22869   __pyx_t_1 = 0;
22870   goto __pyx_L0;
22871 
22872   /* "View.MemoryView":586
22873  *
22874  *     @property
22875  *     def itemsize(self):             # <<<<<<<<<<<<<<
22876  *         return self.view.itemsize
22877  *
22878  */
22879 
22880   /* function exit code */
22881   __pyx_L1_error:;
22882   __Pyx_XDECREF(__pyx_t_1);
22883   __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22884   __pyx_r = NULL;
22885   __pyx_L0:;
22886   __Pyx_XGIVEREF(__pyx_r);
22887   __Pyx_RefNannyFinishContext();
22888   return __pyx_r;
22889 }
22890 
22891 /* "View.MemoryView":590
22892  *
22893  *     @property
22894  *     def nbytes(self):             # <<<<<<<<<<<<<<
22895  *         return self.size * self.view.itemsize
22896  *
22897  */
22898 
22899 /* Python wrapper */
22900 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject * __pyx_v_self)22901 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
22902   PyObject *__pyx_r = 0;
22903   __Pyx_RefNannyDeclarations
22904   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
22905   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
22906 
22907   /* function exit code */
22908   __Pyx_RefNannyFinishContext();
22909   return __pyx_r;
22910 }
22911 
__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj * __pyx_v_self)22912 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
22913   PyObject *__pyx_r = NULL;
22914   __Pyx_RefNannyDeclarations
22915   PyObject *__pyx_t_1 = NULL;
22916   PyObject *__pyx_t_2 = NULL;
22917   PyObject *__pyx_t_3 = NULL;
22918   int __pyx_lineno = 0;
22919   const char *__pyx_filename = NULL;
22920   int __pyx_clineno = 0;
22921   __Pyx_RefNannySetupContext("__get__", 0);
22922 
22923   /* "View.MemoryView":591
22924  *     @property
22925  *     def nbytes(self):
22926  *         return self.size * self.view.itemsize             # <<<<<<<<<<<<<<
22927  *
22928  *     @property
22929  */
22930   __Pyx_XDECREF(__pyx_r);
22931   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
22932   __Pyx_GOTREF(__pyx_t_1);
22933   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
22934   __Pyx_GOTREF(__pyx_t_2);
22935   __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error)
22936   __Pyx_GOTREF(__pyx_t_3);
22937   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22938   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22939   __pyx_r = __pyx_t_3;
22940   __pyx_t_3 = 0;
22941   goto __pyx_L0;
22942 
22943   /* "View.MemoryView":590
22944  *
22945  *     @property
22946  *     def nbytes(self):             # <<<<<<<<<<<<<<
22947  *         return self.size * self.view.itemsize
22948  *
22949  */
22950 
22951   /* function exit code */
22952   __pyx_L1_error:;
22953   __Pyx_XDECREF(__pyx_t_1);
22954   __Pyx_XDECREF(__pyx_t_2);
22955   __Pyx_XDECREF(__pyx_t_3);
22956   __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22957   __pyx_r = NULL;
22958   __pyx_L0:;
22959   __Pyx_XGIVEREF(__pyx_r);
22960   __Pyx_RefNannyFinishContext();
22961   return __pyx_r;
22962 }
22963 
22964 /* "View.MemoryView":594
22965  *
22966  *     @property
22967  *     def size(self):             # <<<<<<<<<<<<<<
22968  *         if self._size is None:
22969  *             result = 1
22970  */
22971 
22972 /* Python wrapper */
22973 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject * __pyx_v_self)22974 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
22975   PyObject *__pyx_r = 0;
22976   __Pyx_RefNannyDeclarations
22977   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
22978   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
22979 
22980   /* function exit code */
22981   __Pyx_RefNannyFinishContext();
22982   return __pyx_r;
22983 }
22984 
__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj * __pyx_v_self)22985 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
22986   PyObject *__pyx_v_result = NULL;
22987   PyObject *__pyx_v_length = NULL;
22988   PyObject *__pyx_r = NULL;
22989   __Pyx_RefNannyDeclarations
22990   int __pyx_t_1;
22991   int __pyx_t_2;
22992   Py_ssize_t *__pyx_t_3;
22993   Py_ssize_t *__pyx_t_4;
22994   Py_ssize_t *__pyx_t_5;
22995   PyObject *__pyx_t_6 = NULL;
22996   int __pyx_lineno = 0;
22997   const char *__pyx_filename = NULL;
22998   int __pyx_clineno = 0;
22999   __Pyx_RefNannySetupContext("__get__", 0);
23000 
23001   /* "View.MemoryView":595
23002  *     @property
23003  *     def size(self):
23004  *         if self._size is None:             # <<<<<<<<<<<<<<
23005  *             result = 1
23006  *
23007  */
23008   __pyx_t_1 = (__pyx_v_self->_size == Py_None);
23009   __pyx_t_2 = (__pyx_t_1 != 0);
23010   if (__pyx_t_2) {
23011 
23012     /* "View.MemoryView":596
23013  *     def size(self):
23014  *         if self._size is None:
23015  *             result = 1             # <<<<<<<<<<<<<<
23016  *
23017  *             for length in self.view.shape[:self.view.ndim]:
23018  */
23019     __Pyx_INCREF(__pyx_int_1);
23020     __pyx_v_result = __pyx_int_1;
23021 
23022     /* "View.MemoryView":598
23023  *             result = 1
23024  *
23025  *             for length in self.view.shape[:self.view.ndim]:             # <<<<<<<<<<<<<<
23026  *                 result *= length
23027  *
23028  */
23029     __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
23030     for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
23031       __pyx_t_3 = __pyx_t_5;
23032       __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
23033       __Pyx_GOTREF(__pyx_t_6);
23034       __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
23035       __pyx_t_6 = 0;
23036 
23037       /* "View.MemoryView":599
23038  *
23039  *             for length in self.view.shape[:self.view.ndim]:
23040  *                 result *= length             # <<<<<<<<<<<<<<
23041  *
23042  *             self._size = result
23043  */
23044       __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
23045       __Pyx_GOTREF(__pyx_t_6);
23046       __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
23047       __pyx_t_6 = 0;
23048     }
23049 
23050     /* "View.MemoryView":601
23051  *                 result *= length
23052  *
23053  *             self._size = result             # <<<<<<<<<<<<<<
23054  *
23055  *         return self._size
23056  */
23057     __Pyx_INCREF(__pyx_v_result);
23058     __Pyx_GIVEREF(__pyx_v_result);
23059     __Pyx_GOTREF(__pyx_v_self->_size);
23060     __Pyx_DECREF(__pyx_v_self->_size);
23061     __pyx_v_self->_size = __pyx_v_result;
23062 
23063     /* "View.MemoryView":595
23064  *     @property
23065  *     def size(self):
23066  *         if self._size is None:             # <<<<<<<<<<<<<<
23067  *             result = 1
23068  *
23069  */
23070   }
23071 
23072   /* "View.MemoryView":603
23073  *             self._size = result
23074  *
23075  *         return self._size             # <<<<<<<<<<<<<<
23076  *
23077  *     def __len__(self):
23078  */
23079   __Pyx_XDECREF(__pyx_r);
23080   __Pyx_INCREF(__pyx_v_self->_size);
23081   __pyx_r = __pyx_v_self->_size;
23082   goto __pyx_L0;
23083 
23084   /* "View.MemoryView":594
23085  *
23086  *     @property
23087  *     def size(self):             # <<<<<<<<<<<<<<
23088  *         if self._size is None:
23089  *             result = 1
23090  */
23091 
23092   /* function exit code */
23093   __pyx_L1_error:;
23094   __Pyx_XDECREF(__pyx_t_6);
23095   __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23096   __pyx_r = NULL;
23097   __pyx_L0:;
23098   __Pyx_XDECREF(__pyx_v_result);
23099   __Pyx_XDECREF(__pyx_v_length);
23100   __Pyx_XGIVEREF(__pyx_r);
23101   __Pyx_RefNannyFinishContext();
23102   return __pyx_r;
23103 }
23104 
23105 /* "View.MemoryView":605
23106  *         return self._size
23107  *
23108  *     def __len__(self):             # <<<<<<<<<<<<<<
23109  *         if self.view.ndim >= 1:
23110  *             return self.view.shape[0]
23111  */
23112 
23113 /* Python wrapper */
23114 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___len__(PyObject * __pyx_v_self)23115 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
23116   Py_ssize_t __pyx_r;
23117   __Pyx_RefNannyDeclarations
23118   __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
23119   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
23120 
23121   /* function exit code */
23122   __Pyx_RefNannyFinishContext();
23123   return __pyx_r;
23124 }
23125 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj * __pyx_v_self)23126 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
23127   Py_ssize_t __pyx_r;
23128   __Pyx_RefNannyDeclarations
23129   int __pyx_t_1;
23130   __Pyx_RefNannySetupContext("__len__", 0);
23131 
23132   /* "View.MemoryView":606
23133  *
23134  *     def __len__(self):
23135  *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
23136  *             return self.view.shape[0]
23137  *
23138  */
23139   __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
23140   if (__pyx_t_1) {
23141 
23142     /* "View.MemoryView":607
23143  *     def __len__(self):
23144  *         if self.view.ndim >= 1:
23145  *             return self.view.shape[0]             # <<<<<<<<<<<<<<
23146  *
23147  *         return 0
23148  */
23149     __pyx_r = (__pyx_v_self->view.shape[0]);
23150     goto __pyx_L0;
23151 
23152     /* "View.MemoryView":606
23153  *
23154  *     def __len__(self):
23155  *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
23156  *             return self.view.shape[0]
23157  *
23158  */
23159   }
23160 
23161   /* "View.MemoryView":609
23162  *             return self.view.shape[0]
23163  *
23164  *         return 0             # <<<<<<<<<<<<<<
23165  *
23166  *     def __repr__(self):
23167  */
23168   __pyx_r = 0;
23169   goto __pyx_L0;
23170 
23171   /* "View.MemoryView":605
23172  *         return self._size
23173  *
23174  *     def __len__(self):             # <<<<<<<<<<<<<<
23175  *         if self.view.ndim >= 1:
23176  *             return self.view.shape[0]
23177  */
23178 
23179   /* function exit code */
23180   __pyx_L0:;
23181   __Pyx_RefNannyFinishContext();
23182   return __pyx_r;
23183 }
23184 
23185 /* "View.MemoryView":611
23186  *         return 0
23187  *
23188  *     def __repr__(self):             # <<<<<<<<<<<<<<
23189  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
23190  *                                                id(self))
23191  */
23192 
23193 /* Python wrapper */
23194 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___repr__(PyObject * __pyx_v_self)23195 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
23196   PyObject *__pyx_r = 0;
23197   __Pyx_RefNannyDeclarations
23198   __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
23199   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
23200 
23201   /* function exit code */
23202   __Pyx_RefNannyFinishContext();
23203   return __pyx_r;
23204 }
23205 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj * __pyx_v_self)23206 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
23207   PyObject *__pyx_r = NULL;
23208   __Pyx_RefNannyDeclarations
23209   PyObject *__pyx_t_1 = NULL;
23210   PyObject *__pyx_t_2 = NULL;
23211   PyObject *__pyx_t_3 = NULL;
23212   int __pyx_lineno = 0;
23213   const char *__pyx_filename = NULL;
23214   int __pyx_clineno = 0;
23215   __Pyx_RefNannySetupContext("__repr__", 0);
23216 
23217   /* "View.MemoryView":612
23218  *
23219  *     def __repr__(self):
23220  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
23221  *                                                id(self))
23222  *
23223  */
23224   __Pyx_XDECREF(__pyx_r);
23225   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
23226   __Pyx_GOTREF(__pyx_t_1);
23227   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
23228   __Pyx_GOTREF(__pyx_t_2);
23229   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23230   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
23231   __Pyx_GOTREF(__pyx_t_1);
23232   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23233 
23234   /* "View.MemoryView":613
23235  *     def __repr__(self):
23236  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
23237  *                                                id(self))             # <<<<<<<<<<<<<<
23238  *
23239  *     def __str__(self):
23240  */
23241   __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error)
23242   __Pyx_GOTREF(__pyx_t_2);
23243 
23244   /* "View.MemoryView":612
23245  *
23246  *     def __repr__(self):
23247  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
23248  *                                                id(self))
23249  *
23250  */
23251   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
23252   __Pyx_GOTREF(__pyx_t_3);
23253   __Pyx_GIVEREF(__pyx_t_1);
23254   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
23255   __Pyx_GIVEREF(__pyx_t_2);
23256   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
23257   __pyx_t_1 = 0;
23258   __pyx_t_2 = 0;
23259   __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
23260   __Pyx_GOTREF(__pyx_t_2);
23261   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23262   __pyx_r = __pyx_t_2;
23263   __pyx_t_2 = 0;
23264   goto __pyx_L0;
23265 
23266   /* "View.MemoryView":611
23267  *         return 0
23268  *
23269  *     def __repr__(self):             # <<<<<<<<<<<<<<
23270  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
23271  *                                                id(self))
23272  */
23273 
23274   /* function exit code */
23275   __pyx_L1_error:;
23276   __Pyx_XDECREF(__pyx_t_1);
23277   __Pyx_XDECREF(__pyx_t_2);
23278   __Pyx_XDECREF(__pyx_t_3);
23279   __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23280   __pyx_r = NULL;
23281   __pyx_L0:;
23282   __Pyx_XGIVEREF(__pyx_r);
23283   __Pyx_RefNannyFinishContext();
23284   return __pyx_r;
23285 }
23286 
23287 /* "View.MemoryView":615
23288  *                                                id(self))
23289  *
23290  *     def __str__(self):             # <<<<<<<<<<<<<<
23291  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
23292  *
23293  */
23294 
23295 /* Python wrapper */
23296 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___str__(PyObject * __pyx_v_self)23297 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
23298   PyObject *__pyx_r = 0;
23299   __Pyx_RefNannyDeclarations
23300   __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
23301   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
23302 
23303   /* function exit code */
23304   __Pyx_RefNannyFinishContext();
23305   return __pyx_r;
23306 }
23307 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj * __pyx_v_self)23308 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
23309   PyObject *__pyx_r = NULL;
23310   __Pyx_RefNannyDeclarations
23311   PyObject *__pyx_t_1 = NULL;
23312   PyObject *__pyx_t_2 = NULL;
23313   int __pyx_lineno = 0;
23314   const char *__pyx_filename = NULL;
23315   int __pyx_clineno = 0;
23316   __Pyx_RefNannySetupContext("__str__", 0);
23317 
23318   /* "View.MemoryView":616
23319  *
23320  *     def __str__(self):
23321  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)             # <<<<<<<<<<<<<<
23322  *
23323  *
23324  */
23325   __Pyx_XDECREF(__pyx_r);
23326   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
23327   __Pyx_GOTREF(__pyx_t_1);
23328   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
23329   __Pyx_GOTREF(__pyx_t_2);
23330   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23331   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
23332   __Pyx_GOTREF(__pyx_t_1);
23333   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23334   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
23335   __Pyx_GOTREF(__pyx_t_2);
23336   __Pyx_GIVEREF(__pyx_t_1);
23337   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
23338   __pyx_t_1 = 0;
23339   __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
23340   __Pyx_GOTREF(__pyx_t_1);
23341   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23342   __pyx_r = __pyx_t_1;
23343   __pyx_t_1 = 0;
23344   goto __pyx_L0;
23345 
23346   /* "View.MemoryView":615
23347  *                                                id(self))
23348  *
23349  *     def __str__(self):             # <<<<<<<<<<<<<<
23350  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
23351  *
23352  */
23353 
23354   /* function exit code */
23355   __pyx_L1_error:;
23356   __Pyx_XDECREF(__pyx_t_1);
23357   __Pyx_XDECREF(__pyx_t_2);
23358   __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23359   __pyx_r = NULL;
23360   __pyx_L0:;
23361   __Pyx_XGIVEREF(__pyx_r);
23362   __Pyx_RefNannyFinishContext();
23363   return __pyx_r;
23364 }
23365 
23366 /* "View.MemoryView":619
23367  *
23368  *
23369  *     def is_c_contig(self):             # <<<<<<<<<<<<<<
23370  *         cdef __Pyx_memviewslice *mslice
23371  *         cdef __Pyx_memviewslice tmp
23372  */
23373 
23374 /* Python wrapper */
23375 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_memoryview_is_c_contig(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)23376 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
23377   PyObject *__pyx_r = 0;
23378   __Pyx_RefNannyDeclarations
23379   __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
23380   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
23381 
23382   /* function exit code */
23383   __Pyx_RefNannyFinishContext();
23384   return __pyx_r;
23385 }
23386 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj * __pyx_v_self)23387 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
23388   __Pyx_memviewslice *__pyx_v_mslice;
23389   __Pyx_memviewslice __pyx_v_tmp;
23390   PyObject *__pyx_r = NULL;
23391   __Pyx_RefNannyDeclarations
23392   __Pyx_memviewslice *__pyx_t_1;
23393   PyObject *__pyx_t_2 = NULL;
23394   int __pyx_lineno = 0;
23395   const char *__pyx_filename = NULL;
23396   int __pyx_clineno = 0;
23397   __Pyx_RefNannySetupContext("is_c_contig", 0);
23398 
23399   /* "View.MemoryView":622
23400  *         cdef __Pyx_memviewslice *mslice
23401  *         cdef __Pyx_memviewslice tmp
23402  *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
23403  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
23404  *
23405  */
23406   __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error)
23407   __pyx_v_mslice = __pyx_t_1;
23408 
23409   /* "View.MemoryView":623
23410  *         cdef __Pyx_memviewslice tmp
23411  *         mslice = get_slice_from_memview(self, &tmp)
23412  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)             # <<<<<<<<<<<<<<
23413  *
23414  *     def is_f_contig(self):
23415  */
23416   __Pyx_XDECREF(__pyx_r);
23417   __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, 623, __pyx_L1_error)
23418   __Pyx_GOTREF(__pyx_t_2);
23419   __pyx_r = __pyx_t_2;
23420   __pyx_t_2 = 0;
23421   goto __pyx_L0;
23422 
23423   /* "View.MemoryView":619
23424  *
23425  *
23426  *     def is_c_contig(self):             # <<<<<<<<<<<<<<
23427  *         cdef __Pyx_memviewslice *mslice
23428  *         cdef __Pyx_memviewslice tmp
23429  */
23430 
23431   /* function exit code */
23432   __pyx_L1_error:;
23433   __Pyx_XDECREF(__pyx_t_2);
23434   __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
23435   __pyx_r = NULL;
23436   __pyx_L0:;
23437   __Pyx_XGIVEREF(__pyx_r);
23438   __Pyx_RefNannyFinishContext();
23439   return __pyx_r;
23440 }
23441 
23442 /* "View.MemoryView":625
23443  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
23444  *
23445  *     def is_f_contig(self):             # <<<<<<<<<<<<<<
23446  *         cdef __Pyx_memviewslice *mslice
23447  *         cdef __Pyx_memviewslice tmp
23448  */
23449 
23450 /* Python wrapper */
23451 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_memoryview_is_f_contig(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)23452 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
23453   PyObject *__pyx_r = 0;
23454   __Pyx_RefNannyDeclarations
23455   __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
23456   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
23457 
23458   /* function exit code */
23459   __Pyx_RefNannyFinishContext();
23460   return __pyx_r;
23461 }
23462 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj * __pyx_v_self)23463 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
23464   __Pyx_memviewslice *__pyx_v_mslice;
23465   __Pyx_memviewslice __pyx_v_tmp;
23466   PyObject *__pyx_r = NULL;
23467   __Pyx_RefNannyDeclarations
23468   __Pyx_memviewslice *__pyx_t_1;
23469   PyObject *__pyx_t_2 = NULL;
23470   int __pyx_lineno = 0;
23471   const char *__pyx_filename = NULL;
23472   int __pyx_clineno = 0;
23473   __Pyx_RefNannySetupContext("is_f_contig", 0);
23474 
23475   /* "View.MemoryView":628
23476  *         cdef __Pyx_memviewslice *mslice
23477  *         cdef __Pyx_memviewslice tmp
23478  *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
23479  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
23480  *
23481  */
23482   __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error)
23483   __pyx_v_mslice = __pyx_t_1;
23484 
23485   /* "View.MemoryView":629
23486  *         cdef __Pyx_memviewslice tmp
23487  *         mslice = get_slice_from_memview(self, &tmp)
23488  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)             # <<<<<<<<<<<<<<
23489  *
23490  *     def copy(self):
23491  */
23492   __Pyx_XDECREF(__pyx_r);
23493   __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, 629, __pyx_L1_error)
23494   __Pyx_GOTREF(__pyx_t_2);
23495   __pyx_r = __pyx_t_2;
23496   __pyx_t_2 = 0;
23497   goto __pyx_L0;
23498 
23499   /* "View.MemoryView":625
23500  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
23501  *
23502  *     def is_f_contig(self):             # <<<<<<<<<<<<<<
23503  *         cdef __Pyx_memviewslice *mslice
23504  *         cdef __Pyx_memviewslice tmp
23505  */
23506 
23507   /* function exit code */
23508   __pyx_L1_error:;
23509   __Pyx_XDECREF(__pyx_t_2);
23510   __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
23511   __pyx_r = NULL;
23512   __pyx_L0:;
23513   __Pyx_XGIVEREF(__pyx_r);
23514   __Pyx_RefNannyFinishContext();
23515   return __pyx_r;
23516 }
23517 
23518 /* "View.MemoryView":631
23519  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
23520  *
23521  *     def copy(self):             # <<<<<<<<<<<<<<
23522  *         cdef __Pyx_memviewslice mslice
23523  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
23524  */
23525 
23526 /* Python wrapper */
23527 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_memoryview_copy(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)23528 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
23529   PyObject *__pyx_r = 0;
23530   __Pyx_RefNannyDeclarations
23531   __Pyx_RefNannySetupContext("copy (wrapper)", 0);
23532   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
23533 
23534   /* function exit code */
23535   __Pyx_RefNannyFinishContext();
23536   return __pyx_r;
23537 }
23538 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj * __pyx_v_self)23539 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
23540   __Pyx_memviewslice __pyx_v_mslice;
23541   int __pyx_v_flags;
23542   PyObject *__pyx_r = NULL;
23543   __Pyx_RefNannyDeclarations
23544   __Pyx_memviewslice __pyx_t_1;
23545   PyObject *__pyx_t_2 = NULL;
23546   int __pyx_lineno = 0;
23547   const char *__pyx_filename = NULL;
23548   int __pyx_clineno = 0;
23549   __Pyx_RefNannySetupContext("copy", 0);
23550 
23551   /* "View.MemoryView":633
23552  *     def copy(self):
23553  *         cdef __Pyx_memviewslice mslice
23554  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS             # <<<<<<<<<<<<<<
23555  *
23556  *         slice_copy(self, &mslice)
23557  */
23558   __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
23559 
23560   /* "View.MemoryView":635
23561  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
23562  *
23563  *         slice_copy(self, &mslice)             # <<<<<<<<<<<<<<
23564  *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
23565  *                                    self.view.itemsize,
23566  */
23567   __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
23568 
23569   /* "View.MemoryView":636
23570  *
23571  *         slice_copy(self, &mslice)
23572  *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,             # <<<<<<<<<<<<<<
23573  *                                    self.view.itemsize,
23574  *                                    flags|PyBUF_C_CONTIGUOUS,
23575  */
23576   __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"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, 636, __pyx_L1_error)
23577   __pyx_v_mslice = __pyx_t_1;
23578 
23579   /* "View.MemoryView":641
23580  *                                    self.dtype_is_object)
23581  *
23582  *         return memoryview_copy_from_slice(self, &mslice)             # <<<<<<<<<<<<<<
23583  *
23584  *     def copy_fortran(self):
23585  */
23586   __Pyx_XDECREF(__pyx_r);
23587   __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error)
23588   __Pyx_GOTREF(__pyx_t_2);
23589   __pyx_r = __pyx_t_2;
23590   __pyx_t_2 = 0;
23591   goto __pyx_L0;
23592 
23593   /* "View.MemoryView":631
23594  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
23595  *
23596  *     def copy(self):             # <<<<<<<<<<<<<<
23597  *         cdef __Pyx_memviewslice mslice
23598  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
23599  */
23600 
23601   /* function exit code */
23602   __pyx_L1_error:;
23603   __Pyx_XDECREF(__pyx_t_2);
23604   __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
23605   __pyx_r = NULL;
23606   __pyx_L0:;
23607   __Pyx_XGIVEREF(__pyx_r);
23608   __Pyx_RefNannyFinishContext();
23609   return __pyx_r;
23610 }
23611 
23612 /* "View.MemoryView":643
23613  *         return memoryview_copy_from_slice(self, &mslice)
23614  *
23615  *     def copy_fortran(self):             # <<<<<<<<<<<<<<
23616  *         cdef __Pyx_memviewslice src, dst
23617  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
23618  */
23619 
23620 /* Python wrapper */
23621 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_memoryview_copy_fortran(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)23622 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
23623   PyObject *__pyx_r = 0;
23624   __Pyx_RefNannyDeclarations
23625   __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
23626   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
23627 
23628   /* function exit code */
23629   __Pyx_RefNannyFinishContext();
23630   return __pyx_r;
23631 }
23632 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj * __pyx_v_self)23633 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
23634   __Pyx_memviewslice __pyx_v_src;
23635   __Pyx_memviewslice __pyx_v_dst;
23636   int __pyx_v_flags;
23637   PyObject *__pyx_r = NULL;
23638   __Pyx_RefNannyDeclarations
23639   __Pyx_memviewslice __pyx_t_1;
23640   PyObject *__pyx_t_2 = NULL;
23641   int __pyx_lineno = 0;
23642   const char *__pyx_filename = NULL;
23643   int __pyx_clineno = 0;
23644   __Pyx_RefNannySetupContext("copy_fortran", 0);
23645 
23646   /* "View.MemoryView":645
23647  *     def copy_fortran(self):
23648  *         cdef __Pyx_memviewslice src, dst
23649  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS             # <<<<<<<<<<<<<<
23650  *
23651  *         slice_copy(self, &src)
23652  */
23653   __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
23654 
23655   /* "View.MemoryView":647
23656  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
23657  *
23658  *         slice_copy(self, &src)             # <<<<<<<<<<<<<<
23659  *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,
23660  *                                 self.view.itemsize,
23661  */
23662   __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
23663 
23664   /* "View.MemoryView":648
23665  *
23666  *         slice_copy(self, &src)
23667  *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,             # <<<<<<<<<<<<<<
23668  *                                 self.view.itemsize,
23669  *                                 flags|PyBUF_F_CONTIGUOUS,
23670  */
23671   __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"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, 648, __pyx_L1_error)
23672   __pyx_v_dst = __pyx_t_1;
23673 
23674   /* "View.MemoryView":653
23675  *                                 self.dtype_is_object)
23676  *
23677  *         return memoryview_copy_from_slice(self, &dst)             # <<<<<<<<<<<<<<
23678  *
23679  *
23680  */
23681   __Pyx_XDECREF(__pyx_r);
23682   __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
23683   __Pyx_GOTREF(__pyx_t_2);
23684   __pyx_r = __pyx_t_2;
23685   __pyx_t_2 = 0;
23686   goto __pyx_L0;
23687 
23688   /* "View.MemoryView":643
23689  *         return memoryview_copy_from_slice(self, &mslice)
23690  *
23691  *     def copy_fortran(self):             # <<<<<<<<<<<<<<
23692  *         cdef __Pyx_memviewslice src, dst
23693  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
23694  */
23695 
23696   /* function exit code */
23697   __pyx_L1_error:;
23698   __Pyx_XDECREF(__pyx_t_2);
23699   __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
23700   __pyx_r = NULL;
23701   __pyx_L0:;
23702   __Pyx_XGIVEREF(__pyx_r);
23703   __Pyx_RefNannyFinishContext();
23704   return __pyx_r;
23705 }
23706 
23707 /* "(tree fragment)":1
23708  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
23709  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23710  * def __setstate_cython__(self, __pyx_state):
23711  */
23712 
23713 /* Python wrapper */
23714 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)23715 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
23716   PyObject *__pyx_r = 0;
23717   __Pyx_RefNannyDeclarations
23718   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
23719   __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
23720 
23721   /* function exit code */
23722   __Pyx_RefNannyFinishContext();
23723   return __pyx_r;
23724 }
23725 
__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj * __pyx_v_self)23726 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
23727   PyObject *__pyx_r = NULL;
23728   __Pyx_RefNannyDeclarations
23729   PyObject *__pyx_t_1 = NULL;
23730   int __pyx_lineno = 0;
23731   const char *__pyx_filename = NULL;
23732   int __pyx_clineno = 0;
23733   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
23734 
23735   /* "(tree fragment)":2
23736  * def __reduce_cython__(self):
23737  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
23738  * def __setstate_cython__(self, __pyx_state):
23739  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23740  */
23741   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
23742   __Pyx_GOTREF(__pyx_t_1);
23743   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
23744   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23745   __PYX_ERR(1, 2, __pyx_L1_error)
23746 
23747   /* "(tree fragment)":1
23748  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
23749  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23750  * def __setstate_cython__(self, __pyx_state):
23751  */
23752 
23753   /* function exit code */
23754   __pyx_L1_error:;
23755   __Pyx_XDECREF(__pyx_t_1);
23756   __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23757   __pyx_r = NULL;
23758   __Pyx_XGIVEREF(__pyx_r);
23759   __Pyx_RefNannyFinishContext();
23760   return __pyx_r;
23761 }
23762 
23763 /* "(tree fragment)":3
23764  * def __reduce_cython__(self):
23765  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23766  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
23767  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23768  */
23769 
23770 /* Python wrapper */
23771 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)23772 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
23773   PyObject *__pyx_r = 0;
23774   __Pyx_RefNannyDeclarations
23775   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
23776   __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
23777 
23778   /* function exit code */
23779   __Pyx_RefNannyFinishContext();
23780   return __pyx_r;
23781 }
23782 
__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)23783 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
23784   PyObject *__pyx_r = NULL;
23785   __Pyx_RefNannyDeclarations
23786   PyObject *__pyx_t_1 = NULL;
23787   int __pyx_lineno = 0;
23788   const char *__pyx_filename = NULL;
23789   int __pyx_clineno = 0;
23790   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
23791 
23792   /* "(tree fragment)":4
23793  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23794  * def __setstate_cython__(self, __pyx_state):
23795  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
23796  */
23797   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
23798   __Pyx_GOTREF(__pyx_t_1);
23799   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
23800   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23801   __PYX_ERR(1, 4, __pyx_L1_error)
23802 
23803   /* "(tree fragment)":3
23804  * def __reduce_cython__(self):
23805  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23806  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
23807  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23808  */
23809 
23810   /* function exit code */
23811   __pyx_L1_error:;
23812   __Pyx_XDECREF(__pyx_t_1);
23813   __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23814   __pyx_r = NULL;
23815   __Pyx_XGIVEREF(__pyx_r);
23816   __Pyx_RefNannyFinishContext();
23817   return __pyx_r;
23818 }
23819 
23820 /* "View.MemoryView":657
23821  *
23822  * @cname('__pyx_memoryview_new')
23823  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
23824  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
23825  *     result.typeinfo = typeinfo
23826  */
23827 
__pyx_memoryview_new(PyObject * __pyx_v_o,int __pyx_v_flags,int __pyx_v_dtype_is_object,__Pyx_TypeInfo * __pyx_v_typeinfo)23828 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
23829   struct __pyx_memoryview_obj *__pyx_v_result = 0;
23830   PyObject *__pyx_r = NULL;
23831   __Pyx_RefNannyDeclarations
23832   PyObject *__pyx_t_1 = NULL;
23833   PyObject *__pyx_t_2 = NULL;
23834   PyObject *__pyx_t_3 = NULL;
23835   int __pyx_lineno = 0;
23836   const char *__pyx_filename = NULL;
23837   int __pyx_clineno = 0;
23838   __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
23839 
23840   /* "View.MemoryView":658
23841  * @cname('__pyx_memoryview_new')
23842  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
23843  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)             # <<<<<<<<<<<<<<
23844  *     result.typeinfo = typeinfo
23845  *     return result
23846  */
23847   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
23848   __Pyx_GOTREF(__pyx_t_1);
23849   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
23850   __Pyx_GOTREF(__pyx_t_2);
23851   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error)
23852   __Pyx_GOTREF(__pyx_t_3);
23853   __Pyx_INCREF(__pyx_v_o);
23854   __Pyx_GIVEREF(__pyx_v_o);
23855   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
23856   __Pyx_GIVEREF(__pyx_t_1);
23857   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
23858   __Pyx_GIVEREF(__pyx_t_2);
23859   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
23860   __pyx_t_1 = 0;
23861   __pyx_t_2 = 0;
23862   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
23863   __Pyx_GOTREF(__pyx_t_2);
23864   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23865   __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
23866   __pyx_t_2 = 0;
23867 
23868   /* "View.MemoryView":659
23869  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
23870  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
23871  *     result.typeinfo = typeinfo             # <<<<<<<<<<<<<<
23872  *     return result
23873  *
23874  */
23875   __pyx_v_result->typeinfo = __pyx_v_typeinfo;
23876 
23877   /* "View.MemoryView":660
23878  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
23879  *     result.typeinfo = typeinfo
23880  *     return result             # <<<<<<<<<<<<<<
23881  *
23882  * @cname('__pyx_memoryview_check')
23883  */
23884   __Pyx_XDECREF(__pyx_r);
23885   __Pyx_INCREF(((PyObject *)__pyx_v_result));
23886   __pyx_r = ((PyObject *)__pyx_v_result);
23887   goto __pyx_L0;
23888 
23889   /* "View.MemoryView":657
23890  *
23891  * @cname('__pyx_memoryview_new')
23892  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
23893  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
23894  *     result.typeinfo = typeinfo
23895  */
23896 
23897   /* function exit code */
23898   __pyx_L1_error:;
23899   __Pyx_XDECREF(__pyx_t_1);
23900   __Pyx_XDECREF(__pyx_t_2);
23901   __Pyx_XDECREF(__pyx_t_3);
23902   __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
23903   __pyx_r = 0;
23904   __pyx_L0:;
23905   __Pyx_XDECREF((PyObject *)__pyx_v_result);
23906   __Pyx_XGIVEREF(__pyx_r);
23907   __Pyx_RefNannyFinishContext();
23908   return __pyx_r;
23909 }
23910 
23911 /* "View.MemoryView":663
23912  *
23913  * @cname('__pyx_memoryview_check')
23914  * cdef inline bint memoryview_check(object o):             # <<<<<<<<<<<<<<
23915  *     return isinstance(o, memoryview)
23916  *
23917  */
23918 
__pyx_memoryview_check(PyObject * __pyx_v_o)23919 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
23920   int __pyx_r;
23921   __Pyx_RefNannyDeclarations
23922   int __pyx_t_1;
23923   __Pyx_RefNannySetupContext("memoryview_check", 0);
23924 
23925   /* "View.MemoryView":664
23926  * @cname('__pyx_memoryview_check')
23927  * cdef inline bint memoryview_check(object o):
23928  *     return isinstance(o, memoryview)             # <<<<<<<<<<<<<<
23929  *
23930  * cdef tuple _unellipsify(object index, int ndim):
23931  */
23932   __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
23933   __pyx_r = __pyx_t_1;
23934   goto __pyx_L0;
23935 
23936   /* "View.MemoryView":663
23937  *
23938  * @cname('__pyx_memoryview_check')
23939  * cdef inline bint memoryview_check(object o):             # <<<<<<<<<<<<<<
23940  *     return isinstance(o, memoryview)
23941  *
23942  */
23943 
23944   /* function exit code */
23945   __pyx_L0:;
23946   __Pyx_RefNannyFinishContext();
23947   return __pyx_r;
23948 }
23949 
23950 /* "View.MemoryView":666
23951  *     return isinstance(o, memoryview)
23952  *
23953  * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
23954  *     """
23955  *     Replace all ellipses with full slices and fill incomplete indices with
23956  */
23957 
_unellipsify(PyObject * __pyx_v_index,int __pyx_v_ndim)23958 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
23959   PyObject *__pyx_v_tup = NULL;
23960   PyObject *__pyx_v_result = NULL;
23961   int __pyx_v_have_slices;
23962   int __pyx_v_seen_ellipsis;
23963   CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
23964   PyObject *__pyx_v_item = NULL;
23965   Py_ssize_t __pyx_v_nslices;
23966   PyObject *__pyx_r = NULL;
23967   __Pyx_RefNannyDeclarations
23968   int __pyx_t_1;
23969   int __pyx_t_2;
23970   PyObject *__pyx_t_3 = NULL;
23971   PyObject *__pyx_t_4 = NULL;
23972   Py_ssize_t __pyx_t_5;
23973   PyObject *(*__pyx_t_6)(PyObject *);
23974   PyObject *__pyx_t_7 = NULL;
23975   Py_ssize_t __pyx_t_8;
23976   int __pyx_t_9;
23977   int __pyx_t_10;
23978   PyObject *__pyx_t_11 = NULL;
23979   int __pyx_lineno = 0;
23980   const char *__pyx_filename = NULL;
23981   int __pyx_clineno = 0;
23982   __Pyx_RefNannySetupContext("_unellipsify", 0);
23983 
23984   /* "View.MemoryView":671
23985  *     full slices.
23986  *     """
23987  *     if not isinstance(index, tuple):             # <<<<<<<<<<<<<<
23988  *         tup = (index,)
23989  *     else:
23990  */
23991   __pyx_t_1 = PyTuple_Check(__pyx_v_index);
23992   __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
23993   if (__pyx_t_2) {
23994 
23995     /* "View.MemoryView":672
23996  *     """
23997  *     if not isinstance(index, tuple):
23998  *         tup = (index,)             # <<<<<<<<<<<<<<
23999  *     else:
24000  *         tup = index
24001  */
24002     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
24003     __Pyx_GOTREF(__pyx_t_3);
24004     __Pyx_INCREF(__pyx_v_index);
24005     __Pyx_GIVEREF(__pyx_v_index);
24006     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
24007     __pyx_v_tup = __pyx_t_3;
24008     __pyx_t_3 = 0;
24009 
24010     /* "View.MemoryView":671
24011  *     full slices.
24012  *     """
24013  *     if not isinstance(index, tuple):             # <<<<<<<<<<<<<<
24014  *         tup = (index,)
24015  *     else:
24016  */
24017     goto __pyx_L3;
24018   }
24019 
24020   /* "View.MemoryView":674
24021  *         tup = (index,)
24022  *     else:
24023  *         tup = index             # <<<<<<<<<<<<<<
24024  *
24025  *     result = []
24026  */
24027   /*else*/ {
24028     __Pyx_INCREF(__pyx_v_index);
24029     __pyx_v_tup = __pyx_v_index;
24030   }
24031   __pyx_L3:;
24032 
24033   /* "View.MemoryView":676
24034  *         tup = index
24035  *
24036  *     result = []             # <<<<<<<<<<<<<<
24037  *     have_slices = False
24038  *     seen_ellipsis = False
24039  */
24040   __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error)
24041   __Pyx_GOTREF(__pyx_t_3);
24042   __pyx_v_result = ((PyObject*)__pyx_t_3);
24043   __pyx_t_3 = 0;
24044 
24045   /* "View.MemoryView":677
24046  *
24047  *     result = []
24048  *     have_slices = False             # <<<<<<<<<<<<<<
24049  *     seen_ellipsis = False
24050  *     for idx, item in enumerate(tup):
24051  */
24052   __pyx_v_have_slices = 0;
24053 
24054   /* "View.MemoryView":678
24055  *     result = []
24056  *     have_slices = False
24057  *     seen_ellipsis = False             # <<<<<<<<<<<<<<
24058  *     for idx, item in enumerate(tup):
24059  *         if item is Ellipsis:
24060  */
24061   __pyx_v_seen_ellipsis = 0;
24062 
24063   /* "View.MemoryView":679
24064  *     have_slices = False
24065  *     seen_ellipsis = False
24066  *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
24067  *         if item is Ellipsis:
24068  *             if not seen_ellipsis:
24069  */
24070   __Pyx_INCREF(__pyx_int_0);
24071   __pyx_t_3 = __pyx_int_0;
24072   if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
24073     __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
24074     __pyx_t_6 = NULL;
24075   } else {
24076     __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
24077     __Pyx_GOTREF(__pyx_t_4);
24078     __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error)
24079   }
24080   for (;;) {
24081     if (likely(!__pyx_t_6)) {
24082       if (likely(PyList_CheckExact(__pyx_t_4))) {
24083         if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
24084         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24085         __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
24086         #else
24087         __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
24088         __Pyx_GOTREF(__pyx_t_7);
24089         #endif
24090       } else {
24091         if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
24092         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24093         __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
24094         #else
24095         __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
24096         __Pyx_GOTREF(__pyx_t_7);
24097         #endif
24098       }
24099     } else {
24100       __pyx_t_7 = __pyx_t_6(__pyx_t_4);
24101       if (unlikely(!__pyx_t_7)) {
24102         PyObject* exc_type = PyErr_Occurred();
24103         if (exc_type) {
24104           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
24105           else __PYX_ERR(1, 679, __pyx_L1_error)
24106         }
24107         break;
24108       }
24109       __Pyx_GOTREF(__pyx_t_7);
24110     }
24111     __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
24112     __pyx_t_7 = 0;
24113     __Pyx_INCREF(__pyx_t_3);
24114     __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
24115     __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
24116     __Pyx_GOTREF(__pyx_t_7);
24117     __Pyx_DECREF(__pyx_t_3);
24118     __pyx_t_3 = __pyx_t_7;
24119     __pyx_t_7 = 0;
24120 
24121     /* "View.MemoryView":680
24122  *     seen_ellipsis = False
24123  *     for idx, item in enumerate(tup):
24124  *         if item is Ellipsis:             # <<<<<<<<<<<<<<
24125  *             if not seen_ellipsis:
24126  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
24127  */
24128     __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
24129     __pyx_t_1 = (__pyx_t_2 != 0);
24130     if (__pyx_t_1) {
24131 
24132       /* "View.MemoryView":681
24133  *     for idx, item in enumerate(tup):
24134  *         if item is Ellipsis:
24135  *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
24136  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
24137  *                 seen_ellipsis = True
24138  */
24139       __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
24140       if (__pyx_t_1) {
24141 
24142         /* "View.MemoryView":682
24143  *         if item is Ellipsis:
24144  *             if not seen_ellipsis:
24145  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))             # <<<<<<<<<<<<<<
24146  *                 seen_ellipsis = True
24147  *             else:
24148  */
24149         __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
24150         __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error)
24151         __Pyx_GOTREF(__pyx_t_7);
24152         { Py_ssize_t __pyx_temp;
24153           for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
24154             __Pyx_INCREF(__pyx_slice__23);
24155             __Pyx_GIVEREF(__pyx_slice__23);
24156             PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__23);
24157           }
24158         }
24159         __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
24160         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24161 
24162         /* "View.MemoryView":683
24163  *             if not seen_ellipsis:
24164  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
24165  *                 seen_ellipsis = True             # <<<<<<<<<<<<<<
24166  *             else:
24167  *                 result.append(slice(None))
24168  */
24169         __pyx_v_seen_ellipsis = 1;
24170 
24171         /* "View.MemoryView":681
24172  *     for idx, item in enumerate(tup):
24173  *         if item is Ellipsis:
24174  *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
24175  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
24176  *                 seen_ellipsis = True
24177  */
24178         goto __pyx_L7;
24179       }
24180 
24181       /* "View.MemoryView":685
24182  *                 seen_ellipsis = True
24183  *             else:
24184  *                 result.append(slice(None))             # <<<<<<<<<<<<<<
24185  *             have_slices = True
24186  *         else:
24187  */
24188       /*else*/ {
24189         __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__23); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
24190       }
24191       __pyx_L7:;
24192 
24193       /* "View.MemoryView":686
24194  *             else:
24195  *                 result.append(slice(None))
24196  *             have_slices = True             # <<<<<<<<<<<<<<
24197  *         else:
24198  *             if not isinstance(item, slice) and not PyIndex_Check(item):
24199  */
24200       __pyx_v_have_slices = 1;
24201 
24202       /* "View.MemoryView":680
24203  *     seen_ellipsis = False
24204  *     for idx, item in enumerate(tup):
24205  *         if item is Ellipsis:             # <<<<<<<<<<<<<<
24206  *             if not seen_ellipsis:
24207  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
24208  */
24209       goto __pyx_L6;
24210     }
24211 
24212     /* "View.MemoryView":688
24213  *             have_slices = True
24214  *         else:
24215  *             if not isinstance(item, slice) and not PyIndex_Check(item):             # <<<<<<<<<<<<<<
24216  *                 raise TypeError("Cannot index with type '%s'" % type(item))
24217  *
24218  */
24219     /*else*/ {
24220       __pyx_t_2 = PySlice_Check(__pyx_v_item);
24221       __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
24222       if (__pyx_t_10) {
24223       } else {
24224         __pyx_t_1 = __pyx_t_10;
24225         goto __pyx_L9_bool_binop_done;
24226       }
24227       __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
24228       __pyx_t_1 = __pyx_t_10;
24229       __pyx_L9_bool_binop_done:;
24230       if (unlikely(__pyx_t_1)) {
24231 
24232         /* "View.MemoryView":689
24233  *         else:
24234  *             if not isinstance(item, slice) and not PyIndex_Check(item):
24235  *                 raise TypeError("Cannot index with type '%s'" % type(item))             # <<<<<<<<<<<<<<
24236  *
24237  *             have_slices = have_slices or isinstance(item, slice)
24238  */
24239         __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error)
24240         __Pyx_GOTREF(__pyx_t_7);
24241         __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error)
24242         __Pyx_GOTREF(__pyx_t_11);
24243         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24244         __Pyx_Raise(__pyx_t_11, 0, 0, 0);
24245         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
24246         __PYX_ERR(1, 689, __pyx_L1_error)
24247 
24248         /* "View.MemoryView":688
24249  *             have_slices = True
24250  *         else:
24251  *             if not isinstance(item, slice) and not PyIndex_Check(item):             # <<<<<<<<<<<<<<
24252  *                 raise TypeError("Cannot index with type '%s'" % type(item))
24253  *
24254  */
24255       }
24256 
24257       /* "View.MemoryView":691
24258  *                 raise TypeError("Cannot index with type '%s'" % type(item))
24259  *
24260  *             have_slices = have_slices or isinstance(item, slice)             # <<<<<<<<<<<<<<
24261  *             result.append(item)
24262  *
24263  */
24264       __pyx_t_10 = (__pyx_v_have_slices != 0);
24265       if (!__pyx_t_10) {
24266       } else {
24267         __pyx_t_1 = __pyx_t_10;
24268         goto __pyx_L11_bool_binop_done;
24269       }
24270       __pyx_t_10 = PySlice_Check(__pyx_v_item);
24271       __pyx_t_2 = (__pyx_t_10 != 0);
24272       __pyx_t_1 = __pyx_t_2;
24273       __pyx_L11_bool_binop_done:;
24274       __pyx_v_have_slices = __pyx_t_1;
24275 
24276       /* "View.MemoryView":692
24277  *
24278  *             have_slices = have_slices or isinstance(item, slice)
24279  *             result.append(item)             # <<<<<<<<<<<<<<
24280  *
24281  *     nslices = ndim - len(result)
24282  */
24283       __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
24284     }
24285     __pyx_L6:;
24286 
24287     /* "View.MemoryView":679
24288  *     have_slices = False
24289  *     seen_ellipsis = False
24290  *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
24291  *         if item is Ellipsis:
24292  *             if not seen_ellipsis:
24293  */
24294   }
24295   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24296   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24297 
24298   /* "View.MemoryView":694
24299  *             result.append(item)
24300  *
24301  *     nslices = ndim - len(result)             # <<<<<<<<<<<<<<
24302  *     if nslices:
24303  *         result.extend([slice(None)] * nslices)
24304  */
24305   __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
24306   __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
24307 
24308   /* "View.MemoryView":695
24309  *
24310  *     nslices = ndim - len(result)
24311  *     if nslices:             # <<<<<<<<<<<<<<
24312  *         result.extend([slice(None)] * nslices)
24313  *
24314  */
24315   __pyx_t_1 = (__pyx_v_nslices != 0);
24316   if (__pyx_t_1) {
24317 
24318     /* "View.MemoryView":696
24319  *     nslices = ndim - len(result)
24320  *     if nslices:
24321  *         result.extend([slice(None)] * nslices)             # <<<<<<<<<<<<<<
24322  *
24323  *     return have_slices or nslices, tuple(result)
24324  */
24325     __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error)
24326     __Pyx_GOTREF(__pyx_t_3);
24327     { Py_ssize_t __pyx_temp;
24328       for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
24329         __Pyx_INCREF(__pyx_slice__23);
24330         __Pyx_GIVEREF(__pyx_slice__23);
24331         PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__23);
24332       }
24333     }
24334     __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
24335     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24336 
24337     /* "View.MemoryView":695
24338  *
24339  *     nslices = ndim - len(result)
24340  *     if nslices:             # <<<<<<<<<<<<<<
24341  *         result.extend([slice(None)] * nslices)
24342  *
24343  */
24344   }
24345 
24346   /* "View.MemoryView":698
24347  *         result.extend([slice(None)] * nslices)
24348  *
24349  *     return have_slices or nslices, tuple(result)             # <<<<<<<<<<<<<<
24350  *
24351  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
24352  */
24353   __Pyx_XDECREF(__pyx_r);
24354   if (!__pyx_v_have_slices) {
24355   } else {
24356     __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
24357     __Pyx_GOTREF(__pyx_t_4);
24358     __pyx_t_3 = __pyx_t_4;
24359     __pyx_t_4 = 0;
24360     goto __pyx_L14_bool_binop_done;
24361   }
24362   __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
24363   __Pyx_GOTREF(__pyx_t_4);
24364   __pyx_t_3 = __pyx_t_4;
24365   __pyx_t_4 = 0;
24366   __pyx_L14_bool_binop_done:;
24367   __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
24368   __Pyx_GOTREF(__pyx_t_4);
24369   __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error)
24370   __Pyx_GOTREF(__pyx_t_11);
24371   __Pyx_GIVEREF(__pyx_t_3);
24372   PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
24373   __Pyx_GIVEREF(__pyx_t_4);
24374   PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
24375   __pyx_t_3 = 0;
24376   __pyx_t_4 = 0;
24377   __pyx_r = ((PyObject*)__pyx_t_11);
24378   __pyx_t_11 = 0;
24379   goto __pyx_L0;
24380 
24381   /* "View.MemoryView":666
24382  *     return isinstance(o, memoryview)
24383  *
24384  * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
24385  *     """
24386  *     Replace all ellipses with full slices and fill incomplete indices with
24387  */
24388 
24389   /* function exit code */
24390   __pyx_L1_error:;
24391   __Pyx_XDECREF(__pyx_t_3);
24392   __Pyx_XDECREF(__pyx_t_4);
24393   __Pyx_XDECREF(__pyx_t_7);
24394   __Pyx_XDECREF(__pyx_t_11);
24395   __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
24396   __pyx_r = 0;
24397   __pyx_L0:;
24398   __Pyx_XDECREF(__pyx_v_tup);
24399   __Pyx_XDECREF(__pyx_v_result);
24400   __Pyx_XDECREF(__pyx_v_idx);
24401   __Pyx_XDECREF(__pyx_v_item);
24402   __Pyx_XGIVEREF(__pyx_r);
24403   __Pyx_RefNannyFinishContext();
24404   return __pyx_r;
24405 }
24406 
24407 /* "View.MemoryView":700
24408  *     return have_slices or nslices, tuple(result)
24409  *
24410  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
24411  *     for suboffset in suboffsets[:ndim]:
24412  *         if suboffset >= 0:
24413  */
24414 
assert_direct_dimensions(Py_ssize_t * __pyx_v_suboffsets,int __pyx_v_ndim)24415 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
24416   Py_ssize_t __pyx_v_suboffset;
24417   PyObject *__pyx_r = NULL;
24418   __Pyx_RefNannyDeclarations
24419   Py_ssize_t *__pyx_t_1;
24420   Py_ssize_t *__pyx_t_2;
24421   Py_ssize_t *__pyx_t_3;
24422   int __pyx_t_4;
24423   PyObject *__pyx_t_5 = NULL;
24424   int __pyx_lineno = 0;
24425   const char *__pyx_filename = NULL;
24426   int __pyx_clineno = 0;
24427   __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
24428 
24429   /* "View.MemoryView":701
24430  *
24431  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
24432  *     for suboffset in suboffsets[:ndim]:             # <<<<<<<<<<<<<<
24433  *         if suboffset >= 0:
24434  *             raise ValueError("Indirect dimensions not supported")
24435  */
24436   __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
24437   for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
24438     __pyx_t_1 = __pyx_t_3;
24439     __pyx_v_suboffset = (__pyx_t_1[0]);
24440 
24441     /* "View.MemoryView":702
24442  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
24443  *     for suboffset in suboffsets[:ndim]:
24444  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
24445  *             raise ValueError("Indirect dimensions not supported")
24446  *
24447  */
24448     __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
24449     if (unlikely(__pyx_t_4)) {
24450 
24451       /* "View.MemoryView":703
24452  *     for suboffset in suboffsets[:ndim]:
24453  *         if suboffset >= 0:
24454  *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
24455  *
24456  *
24457  */
24458       __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
24459       __Pyx_GOTREF(__pyx_t_5);
24460       __Pyx_Raise(__pyx_t_5, 0, 0, 0);
24461       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24462       __PYX_ERR(1, 703, __pyx_L1_error)
24463 
24464       /* "View.MemoryView":702
24465  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
24466  *     for suboffset in suboffsets[:ndim]:
24467  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
24468  *             raise ValueError("Indirect dimensions not supported")
24469  *
24470  */
24471     }
24472   }
24473 
24474   /* "View.MemoryView":700
24475  *     return have_slices or nslices, tuple(result)
24476  *
24477  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
24478  *     for suboffset in suboffsets[:ndim]:
24479  *         if suboffset >= 0:
24480  */
24481 
24482   /* function exit code */
24483   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24484   goto __pyx_L0;
24485   __pyx_L1_error:;
24486   __Pyx_XDECREF(__pyx_t_5);
24487   __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
24488   __pyx_r = 0;
24489   __pyx_L0:;
24490   __Pyx_XGIVEREF(__pyx_r);
24491   __Pyx_RefNannyFinishContext();
24492   return __pyx_r;
24493 }
24494 
24495 /* "View.MemoryView":710
24496  *
24497  * @cname('__pyx_memview_slice')
24498  * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
24499  *     cdef int new_ndim = 0, suboffset_dim = -1, dim
24500  *     cdef bint negative_step
24501  */
24502 
__pyx_memview_slice(struct __pyx_memoryview_obj * __pyx_v_memview,PyObject * __pyx_v_indices)24503 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
24504   int __pyx_v_new_ndim;
24505   int __pyx_v_suboffset_dim;
24506   int __pyx_v_dim;
24507   __Pyx_memviewslice __pyx_v_src;
24508   __Pyx_memviewslice __pyx_v_dst;
24509   __Pyx_memviewslice *__pyx_v_p_src;
24510   struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
24511   __Pyx_memviewslice *__pyx_v_p_dst;
24512   int *__pyx_v_p_suboffset_dim;
24513   Py_ssize_t __pyx_v_start;
24514   Py_ssize_t __pyx_v_stop;
24515   Py_ssize_t __pyx_v_step;
24516   int __pyx_v_have_start;
24517   int __pyx_v_have_stop;
24518   int __pyx_v_have_step;
24519   PyObject *__pyx_v_index = NULL;
24520   struct __pyx_memoryview_obj *__pyx_r = NULL;
24521   __Pyx_RefNannyDeclarations
24522   int __pyx_t_1;
24523   int __pyx_t_2;
24524   PyObject *__pyx_t_3 = NULL;
24525   struct __pyx_memoryview_obj *__pyx_t_4;
24526   char *__pyx_t_5;
24527   int __pyx_t_6;
24528   Py_ssize_t __pyx_t_7;
24529   PyObject *(*__pyx_t_8)(PyObject *);
24530   PyObject *__pyx_t_9 = NULL;
24531   Py_ssize_t __pyx_t_10;
24532   int __pyx_t_11;
24533   Py_ssize_t __pyx_t_12;
24534   int __pyx_lineno = 0;
24535   const char *__pyx_filename = NULL;
24536   int __pyx_clineno = 0;
24537   __Pyx_RefNannySetupContext("memview_slice", 0);
24538 
24539   /* "View.MemoryView":711
24540  * @cname('__pyx_memview_slice')
24541  * cdef memoryview memview_slice(memoryview memview, object indices):
24542  *     cdef int new_ndim = 0, suboffset_dim = -1, dim             # <<<<<<<<<<<<<<
24543  *     cdef bint negative_step
24544  *     cdef __Pyx_memviewslice src, dst
24545  */
24546   __pyx_v_new_ndim = 0;
24547   __pyx_v_suboffset_dim = -1;
24548 
24549   /* "View.MemoryView":718
24550  *
24551  *
24552  *     memset(&dst, 0, sizeof(dst))             # <<<<<<<<<<<<<<
24553  *
24554  *     cdef _memoryviewslice memviewsliceobj
24555  */
24556   (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
24557 
24558   /* "View.MemoryView":722
24559  *     cdef _memoryviewslice memviewsliceobj
24560  *
24561  *     assert memview.view.ndim > 0             # <<<<<<<<<<<<<<
24562  *
24563  *     if isinstance(memview, _memoryviewslice):
24564  */
24565   #ifndef CYTHON_WITHOUT_ASSERTIONS
24566   if (unlikely(!Py_OptimizeFlag)) {
24567     if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
24568       PyErr_SetNone(PyExc_AssertionError);
24569       __PYX_ERR(1, 722, __pyx_L1_error)
24570     }
24571   }
24572   #endif
24573 
24574   /* "View.MemoryView":724
24575  *     assert memview.view.ndim > 0
24576  *
24577  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
24578  *         memviewsliceobj = memview
24579  *         p_src = &memviewsliceobj.from_slice
24580  */
24581   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
24582   __pyx_t_2 = (__pyx_t_1 != 0);
24583   if (__pyx_t_2) {
24584 
24585     /* "View.MemoryView":725
24586  *
24587  *     if isinstance(memview, _memoryviewslice):
24588  *         memviewsliceobj = memview             # <<<<<<<<<<<<<<
24589  *         p_src = &memviewsliceobj.from_slice
24590  *     else:
24591  */
24592     if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error)
24593     __pyx_t_3 = ((PyObject *)__pyx_v_memview);
24594     __Pyx_INCREF(__pyx_t_3);
24595     __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
24596     __pyx_t_3 = 0;
24597 
24598     /* "View.MemoryView":726
24599  *     if isinstance(memview, _memoryviewslice):
24600  *         memviewsliceobj = memview
24601  *         p_src = &memviewsliceobj.from_slice             # <<<<<<<<<<<<<<
24602  *     else:
24603  *         slice_copy(memview, &src)
24604  */
24605     __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
24606 
24607     /* "View.MemoryView":724
24608  *     assert memview.view.ndim > 0
24609  *
24610  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
24611  *         memviewsliceobj = memview
24612  *         p_src = &memviewsliceobj.from_slice
24613  */
24614     goto __pyx_L3;
24615   }
24616 
24617   /* "View.MemoryView":728
24618  *         p_src = &memviewsliceobj.from_slice
24619  *     else:
24620  *         slice_copy(memview, &src)             # <<<<<<<<<<<<<<
24621  *         p_src = &src
24622  *
24623  */
24624   /*else*/ {
24625     __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
24626 
24627     /* "View.MemoryView":729
24628  *     else:
24629  *         slice_copy(memview, &src)
24630  *         p_src = &src             # <<<<<<<<<<<<<<
24631  *
24632  *
24633  */
24634     __pyx_v_p_src = (&__pyx_v_src);
24635   }
24636   __pyx_L3:;
24637 
24638   /* "View.MemoryView":735
24639  *
24640  *
24641  *     dst.memview = p_src.memview             # <<<<<<<<<<<<<<
24642  *     dst.data = p_src.data
24643  *
24644  */
24645   __pyx_t_4 = __pyx_v_p_src->memview;
24646   __pyx_v_dst.memview = __pyx_t_4;
24647 
24648   /* "View.MemoryView":736
24649  *
24650  *     dst.memview = p_src.memview
24651  *     dst.data = p_src.data             # <<<<<<<<<<<<<<
24652  *
24653  *
24654  */
24655   __pyx_t_5 = __pyx_v_p_src->data;
24656   __pyx_v_dst.data = __pyx_t_5;
24657 
24658   /* "View.MemoryView":741
24659  *
24660  *
24661  *     cdef __Pyx_memviewslice *p_dst = &dst             # <<<<<<<<<<<<<<
24662  *     cdef int *p_suboffset_dim = &suboffset_dim
24663  *     cdef Py_ssize_t start, stop, step
24664  */
24665   __pyx_v_p_dst = (&__pyx_v_dst);
24666 
24667   /* "View.MemoryView":742
24668  *
24669  *     cdef __Pyx_memviewslice *p_dst = &dst
24670  *     cdef int *p_suboffset_dim = &suboffset_dim             # <<<<<<<<<<<<<<
24671  *     cdef Py_ssize_t start, stop, step
24672  *     cdef bint have_start, have_stop, have_step
24673  */
24674   __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
24675 
24676   /* "View.MemoryView":746
24677  *     cdef bint have_start, have_stop, have_step
24678  *
24679  *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
24680  *         if PyIndex_Check(index):
24681  *             slice_memviewslice(
24682  */
24683   __pyx_t_6 = 0;
24684   if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
24685     __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
24686     __pyx_t_8 = NULL;
24687   } else {
24688     __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
24689     __Pyx_GOTREF(__pyx_t_3);
24690     __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error)
24691   }
24692   for (;;) {
24693     if (likely(!__pyx_t_8)) {
24694       if (likely(PyList_CheckExact(__pyx_t_3))) {
24695         if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
24696         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24697         __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
24698         #else
24699         __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
24700         __Pyx_GOTREF(__pyx_t_9);
24701         #endif
24702       } else {
24703         if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
24704         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24705         __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
24706         #else
24707         __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
24708         __Pyx_GOTREF(__pyx_t_9);
24709         #endif
24710       }
24711     } else {
24712       __pyx_t_9 = __pyx_t_8(__pyx_t_3);
24713       if (unlikely(!__pyx_t_9)) {
24714         PyObject* exc_type = PyErr_Occurred();
24715         if (exc_type) {
24716           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
24717           else __PYX_ERR(1, 746, __pyx_L1_error)
24718         }
24719         break;
24720       }
24721       __Pyx_GOTREF(__pyx_t_9);
24722     }
24723     __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
24724     __pyx_t_9 = 0;
24725     __pyx_v_dim = __pyx_t_6;
24726     __pyx_t_6 = (__pyx_t_6 + 1);
24727 
24728     /* "View.MemoryView":747
24729  *
24730  *     for dim, index in enumerate(indices):
24731  *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
24732  *             slice_memviewslice(
24733  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
24734  */
24735     __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
24736     if (__pyx_t_2) {
24737 
24738       /* "View.MemoryView":751
24739  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
24740  *                 dim, new_ndim, p_suboffset_dim,
24741  *                 index, 0, 0, # start, stop, step             # <<<<<<<<<<<<<<
24742  *                 0, 0, 0, # have_{start,stop,step}
24743  *                 False)
24744  */
24745       __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error)
24746 
24747       /* "View.MemoryView":748
24748  *     for dim, index in enumerate(indices):
24749  *         if PyIndex_Check(index):
24750  *             slice_memviewslice(             # <<<<<<<<<<<<<<
24751  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
24752  *                 dim, new_ndim, p_suboffset_dim,
24753  */
24754       __pyx_t_11 = __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_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 748, __pyx_L1_error)
24755 
24756       /* "View.MemoryView":747
24757  *
24758  *     for dim, index in enumerate(indices):
24759  *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
24760  *             slice_memviewslice(
24761  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
24762  */
24763       goto __pyx_L6;
24764     }
24765 
24766     /* "View.MemoryView":754
24767  *                 0, 0, 0, # have_{start,stop,step}
24768  *                 False)
24769  *         elif index is None:             # <<<<<<<<<<<<<<
24770  *             p_dst.shape[new_ndim] = 1
24771  *             p_dst.strides[new_ndim] = 0
24772  */
24773     __pyx_t_2 = (__pyx_v_index == Py_None);
24774     __pyx_t_1 = (__pyx_t_2 != 0);
24775     if (__pyx_t_1) {
24776 
24777       /* "View.MemoryView":755
24778  *                 False)
24779  *         elif index is None:
24780  *             p_dst.shape[new_ndim] = 1             # <<<<<<<<<<<<<<
24781  *             p_dst.strides[new_ndim] = 0
24782  *             p_dst.suboffsets[new_ndim] = -1
24783  */
24784       (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
24785 
24786       /* "View.MemoryView":756
24787  *         elif index is None:
24788  *             p_dst.shape[new_ndim] = 1
24789  *             p_dst.strides[new_ndim] = 0             # <<<<<<<<<<<<<<
24790  *             p_dst.suboffsets[new_ndim] = -1
24791  *             new_ndim += 1
24792  */
24793       (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
24794 
24795       /* "View.MemoryView":757
24796  *             p_dst.shape[new_ndim] = 1
24797  *             p_dst.strides[new_ndim] = 0
24798  *             p_dst.suboffsets[new_ndim] = -1             # <<<<<<<<<<<<<<
24799  *             new_ndim += 1
24800  *         else:
24801  */
24802       (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
24803 
24804       /* "View.MemoryView":758
24805  *             p_dst.strides[new_ndim] = 0
24806  *             p_dst.suboffsets[new_ndim] = -1
24807  *             new_ndim += 1             # <<<<<<<<<<<<<<
24808  *         else:
24809  *             start = index.start or 0
24810  */
24811       __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
24812 
24813       /* "View.MemoryView":754
24814  *                 0, 0, 0, # have_{start,stop,step}
24815  *                 False)
24816  *         elif index is None:             # <<<<<<<<<<<<<<
24817  *             p_dst.shape[new_ndim] = 1
24818  *             p_dst.strides[new_ndim] = 0
24819  */
24820       goto __pyx_L6;
24821     }
24822 
24823     /* "View.MemoryView":760
24824  *             new_ndim += 1
24825  *         else:
24826  *             start = index.start or 0             # <<<<<<<<<<<<<<
24827  *             stop = index.stop or 0
24828  *             step = index.step or 0
24829  */
24830     /*else*/ {
24831       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
24832       __Pyx_GOTREF(__pyx_t_9);
24833       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error)
24834       if (!__pyx_t_1) {
24835         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
24836       } else {
24837         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error)
24838         __pyx_t_10 = __pyx_t_12;
24839         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
24840         goto __pyx_L7_bool_binop_done;
24841       }
24842       __pyx_t_10 = 0;
24843       __pyx_L7_bool_binop_done:;
24844       __pyx_v_start = __pyx_t_10;
24845 
24846       /* "View.MemoryView":761
24847  *         else:
24848  *             start = index.start or 0
24849  *             stop = index.stop or 0             # <<<<<<<<<<<<<<
24850  *             step = index.step or 0
24851  *
24852  */
24853       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
24854       __Pyx_GOTREF(__pyx_t_9);
24855       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error)
24856       if (!__pyx_t_1) {
24857         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
24858       } else {
24859         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error)
24860         __pyx_t_10 = __pyx_t_12;
24861         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
24862         goto __pyx_L9_bool_binop_done;
24863       }
24864       __pyx_t_10 = 0;
24865       __pyx_L9_bool_binop_done:;
24866       __pyx_v_stop = __pyx_t_10;
24867 
24868       /* "View.MemoryView":762
24869  *             start = index.start or 0
24870  *             stop = index.stop or 0
24871  *             step = index.step or 0             # <<<<<<<<<<<<<<
24872  *
24873  *             have_start = index.start is not None
24874  */
24875       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
24876       __Pyx_GOTREF(__pyx_t_9);
24877       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
24878       if (!__pyx_t_1) {
24879         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
24880       } else {
24881         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
24882         __pyx_t_10 = __pyx_t_12;
24883         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
24884         goto __pyx_L11_bool_binop_done;
24885       }
24886       __pyx_t_10 = 0;
24887       __pyx_L11_bool_binop_done:;
24888       __pyx_v_step = __pyx_t_10;
24889 
24890       /* "View.MemoryView":764
24891  *             step = index.step or 0
24892  *
24893  *             have_start = index.start is not None             # <<<<<<<<<<<<<<
24894  *             have_stop = index.stop is not None
24895  *             have_step = index.step is not None
24896  */
24897       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
24898       __Pyx_GOTREF(__pyx_t_9);
24899       __pyx_t_1 = (__pyx_t_9 != Py_None);
24900       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
24901       __pyx_v_have_start = __pyx_t_1;
24902 
24903       /* "View.MemoryView":765
24904  *
24905  *             have_start = index.start is not None
24906  *             have_stop = index.stop is not None             # <<<<<<<<<<<<<<
24907  *             have_step = index.step is not None
24908  *
24909  */
24910       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error)
24911       __Pyx_GOTREF(__pyx_t_9);
24912       __pyx_t_1 = (__pyx_t_9 != Py_None);
24913       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
24914       __pyx_v_have_stop = __pyx_t_1;
24915 
24916       /* "View.MemoryView":766
24917  *             have_start = index.start is not None
24918  *             have_stop = index.stop is not None
24919  *             have_step = index.step is not None             # <<<<<<<<<<<<<<
24920  *
24921  *             slice_memviewslice(
24922  */
24923       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
24924       __Pyx_GOTREF(__pyx_t_9);
24925       __pyx_t_1 = (__pyx_t_9 != Py_None);
24926       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
24927       __pyx_v_have_step = __pyx_t_1;
24928 
24929       /* "View.MemoryView":768
24930  *             have_step = index.step is not None
24931  *
24932  *             slice_memviewslice(             # <<<<<<<<<<<<<<
24933  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
24934  *                 dim, new_ndim, p_suboffset_dim,
24935  */
24936       __pyx_t_11 = __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_11 == ((int)-1))) __PYX_ERR(1, 768, __pyx_L1_error)
24937 
24938       /* "View.MemoryView":774
24939  *                 have_start, have_stop, have_step,
24940  *                 True)
24941  *             new_ndim += 1             # <<<<<<<<<<<<<<
24942  *
24943  *     if isinstance(memview, _memoryviewslice):
24944  */
24945       __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
24946     }
24947     __pyx_L6:;
24948 
24949     /* "View.MemoryView":746
24950  *     cdef bint have_start, have_stop, have_step
24951  *
24952  *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
24953  *         if PyIndex_Check(index):
24954  *             slice_memviewslice(
24955  */
24956   }
24957   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24958 
24959   /* "View.MemoryView":776
24960  *             new_ndim += 1
24961  *
24962  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
24963  *         return memoryview_fromslice(dst, new_ndim,
24964  *                                     memviewsliceobj.to_object_func,
24965  */
24966   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
24967   __pyx_t_2 = (__pyx_t_1 != 0);
24968   if (__pyx_t_2) {
24969 
24970     /* "View.MemoryView":777
24971  *
24972  *     if isinstance(memview, _memoryviewslice):
24973  *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
24974  *                                     memviewsliceobj.to_object_func,
24975  *                                     memviewsliceobj.to_dtype_func,
24976  */
24977     __Pyx_XDECREF(((PyObject *)__pyx_r));
24978 
24979     /* "View.MemoryView":778
24980  *     if isinstance(memview, _memoryviewslice):
24981  *         return memoryview_fromslice(dst, new_ndim,
24982  *                                     memviewsliceobj.to_object_func,             # <<<<<<<<<<<<<<
24983  *                                     memviewsliceobj.to_dtype_func,
24984  *                                     memview.dtype_is_object)
24985  */
24986     if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
24987 
24988     /* "View.MemoryView":779
24989  *         return memoryview_fromslice(dst, new_ndim,
24990  *                                     memviewsliceobj.to_object_func,
24991  *                                     memviewsliceobj.to_dtype_func,             # <<<<<<<<<<<<<<
24992  *                                     memview.dtype_is_object)
24993  *     else:
24994  */
24995     if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
24996 
24997     /* "View.MemoryView":777
24998  *
24999  *     if isinstance(memview, _memoryviewslice):
25000  *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
25001  *                                     memviewsliceobj.to_object_func,
25002  *                                     memviewsliceobj.to_dtype_func,
25003  */
25004     __pyx_t_3 = __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_3)) __PYX_ERR(1, 777, __pyx_L1_error)
25005     __Pyx_GOTREF(__pyx_t_3);
25006     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
25007     __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
25008     __pyx_t_3 = 0;
25009     goto __pyx_L0;
25010 
25011     /* "View.MemoryView":776
25012  *             new_ndim += 1
25013  *
25014  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
25015  *         return memoryview_fromslice(dst, new_ndim,
25016  *                                     memviewsliceobj.to_object_func,
25017  */
25018   }
25019 
25020   /* "View.MemoryView":782
25021  *                                     memview.dtype_is_object)
25022  *     else:
25023  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
25024  *                                     memview.dtype_is_object)
25025  *
25026  */
25027   /*else*/ {
25028     __Pyx_XDECREF(((PyObject *)__pyx_r));
25029 
25030     /* "View.MemoryView":783
25031  *     else:
25032  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,
25033  *                                     memview.dtype_is_object)             # <<<<<<<<<<<<<<
25034  *
25035  *
25036  */
25037     __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error)
25038     __Pyx_GOTREF(__pyx_t_3);
25039 
25040     /* "View.MemoryView":782
25041  *                                     memview.dtype_is_object)
25042  *     else:
25043  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
25044  *                                     memview.dtype_is_object)
25045  *
25046  */
25047     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error)
25048     __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
25049     __pyx_t_3 = 0;
25050     goto __pyx_L0;
25051   }
25052 
25053   /* "View.MemoryView":710
25054  *
25055  * @cname('__pyx_memview_slice')
25056  * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
25057  *     cdef int new_ndim = 0, suboffset_dim = -1, dim
25058  *     cdef bint negative_step
25059  */
25060 
25061   /* function exit code */
25062   __pyx_L1_error:;
25063   __Pyx_XDECREF(__pyx_t_3);
25064   __Pyx_XDECREF(__pyx_t_9);
25065   __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
25066   __pyx_r = 0;
25067   __pyx_L0:;
25068   __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
25069   __Pyx_XDECREF(__pyx_v_index);
25070   __Pyx_XGIVEREF((PyObject *)__pyx_r);
25071   __Pyx_RefNannyFinishContext();
25072   return __pyx_r;
25073 }
25074 
25075 /* "View.MemoryView":807
25076  *
25077  * @cname('__pyx_memoryview_slice_memviewslice')
25078  * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
25079  *         __Pyx_memviewslice *dst,
25080  *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
25081  */
25082 
__pyx_memoryview_slice_memviewslice(__Pyx_memviewslice * __pyx_v_dst,Py_ssize_t __pyx_v_shape,Py_ssize_t __pyx_v_stride,Py_ssize_t __pyx_v_suboffset,int __pyx_v_dim,int __pyx_v_new_ndim,int * __pyx_v_suboffset_dim,Py_ssize_t __pyx_v_start,Py_ssize_t __pyx_v_stop,Py_ssize_t __pyx_v_step,int __pyx_v_have_start,int __pyx_v_have_stop,int __pyx_v_have_step,int __pyx_v_is_slice)25083 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
25084   Py_ssize_t __pyx_v_new_shape;
25085   int __pyx_v_negative_step;
25086   int __pyx_r;
25087   int __pyx_t_1;
25088   int __pyx_t_2;
25089   int __pyx_t_3;
25090   int __pyx_lineno = 0;
25091   const char *__pyx_filename = NULL;
25092   int __pyx_clineno = 0;
25093 
25094   /* "View.MemoryView":827
25095  *     cdef bint negative_step
25096  *
25097  *     if not is_slice:             # <<<<<<<<<<<<<<
25098  *
25099  *         if start < 0:
25100  */
25101   __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
25102   if (__pyx_t_1) {
25103 
25104     /* "View.MemoryView":829
25105  *     if not is_slice:
25106  *
25107  *         if start < 0:             # <<<<<<<<<<<<<<
25108  *             start += shape
25109  *         if not 0 <= start < shape:
25110  */
25111     __pyx_t_1 = ((__pyx_v_start < 0) != 0);
25112     if (__pyx_t_1) {
25113 
25114       /* "View.MemoryView":830
25115  *
25116  *         if start < 0:
25117  *             start += shape             # <<<<<<<<<<<<<<
25118  *         if not 0 <= start < shape:
25119  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
25120  */
25121       __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
25122 
25123       /* "View.MemoryView":829
25124  *     if not is_slice:
25125  *
25126  *         if start < 0:             # <<<<<<<<<<<<<<
25127  *             start += shape
25128  *         if not 0 <= start < shape:
25129  */
25130     }
25131 
25132     /* "View.MemoryView":831
25133  *         if start < 0:
25134  *             start += shape
25135  *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
25136  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
25137  *     else:
25138  */
25139     __pyx_t_1 = (0 <= __pyx_v_start);
25140     if (__pyx_t_1) {
25141       __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
25142     }
25143     __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
25144     if (__pyx_t_2) {
25145 
25146       /* "View.MemoryView":832
25147  *             start += shape
25148  *         if not 0 <= start < shape:
25149  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)             # <<<<<<<<<<<<<<
25150  *     else:
25151  *
25152  */
25153       __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 832, __pyx_L1_error)
25154 
25155       /* "View.MemoryView":831
25156  *         if start < 0:
25157  *             start += shape
25158  *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
25159  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
25160  *     else:
25161  */
25162     }
25163 
25164     /* "View.MemoryView":827
25165  *     cdef bint negative_step
25166  *
25167  *     if not is_slice:             # <<<<<<<<<<<<<<
25168  *
25169  *         if start < 0:
25170  */
25171     goto __pyx_L3;
25172   }
25173 
25174   /* "View.MemoryView":835
25175  *     else:
25176  *
25177  *         negative_step = have_step != 0 and step < 0             # <<<<<<<<<<<<<<
25178  *
25179  *         if have_step and step == 0:
25180  */
25181   /*else*/ {
25182     __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
25183     if (__pyx_t_1) {
25184     } else {
25185       __pyx_t_2 = __pyx_t_1;
25186       goto __pyx_L6_bool_binop_done;
25187     }
25188     __pyx_t_1 = ((__pyx_v_step < 0) != 0);
25189     __pyx_t_2 = __pyx_t_1;
25190     __pyx_L6_bool_binop_done:;
25191     __pyx_v_negative_step = __pyx_t_2;
25192 
25193     /* "View.MemoryView":837
25194  *         negative_step = have_step != 0 and step < 0
25195  *
25196  *         if have_step and step == 0:             # <<<<<<<<<<<<<<
25197  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
25198  *
25199  */
25200     __pyx_t_1 = (__pyx_v_have_step != 0);
25201     if (__pyx_t_1) {
25202     } else {
25203       __pyx_t_2 = __pyx_t_1;
25204       goto __pyx_L9_bool_binop_done;
25205     }
25206     __pyx_t_1 = ((__pyx_v_step == 0) != 0);
25207     __pyx_t_2 = __pyx_t_1;
25208     __pyx_L9_bool_binop_done:;
25209     if (__pyx_t_2) {
25210 
25211       /* "View.MemoryView":838
25212  *
25213  *         if have_step and step == 0:
25214  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)             # <<<<<<<<<<<<<<
25215  *
25216  *
25217  */
25218       __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 838, __pyx_L1_error)
25219 
25220       /* "View.MemoryView":837
25221  *         negative_step = have_step != 0 and step < 0
25222  *
25223  *         if have_step and step == 0:             # <<<<<<<<<<<<<<
25224  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
25225  *
25226  */
25227     }
25228 
25229     /* "View.MemoryView":841
25230  *
25231  *
25232  *         if have_start:             # <<<<<<<<<<<<<<
25233  *             if start < 0:
25234  *                 start += shape
25235  */
25236     __pyx_t_2 = (__pyx_v_have_start != 0);
25237     if (__pyx_t_2) {
25238 
25239       /* "View.MemoryView":842
25240  *
25241  *         if have_start:
25242  *             if start < 0:             # <<<<<<<<<<<<<<
25243  *                 start += shape
25244  *                 if start < 0:
25245  */
25246       __pyx_t_2 = ((__pyx_v_start < 0) != 0);
25247       if (__pyx_t_2) {
25248 
25249         /* "View.MemoryView":843
25250  *         if have_start:
25251  *             if start < 0:
25252  *                 start += shape             # <<<<<<<<<<<<<<
25253  *                 if start < 0:
25254  *                     start = 0
25255  */
25256         __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
25257 
25258         /* "View.MemoryView":844
25259  *             if start < 0:
25260  *                 start += shape
25261  *                 if start < 0:             # <<<<<<<<<<<<<<
25262  *                     start = 0
25263  *             elif start >= shape:
25264  */
25265         __pyx_t_2 = ((__pyx_v_start < 0) != 0);
25266         if (__pyx_t_2) {
25267 
25268           /* "View.MemoryView":845
25269  *                 start += shape
25270  *                 if start < 0:
25271  *                     start = 0             # <<<<<<<<<<<<<<
25272  *             elif start >= shape:
25273  *                 if negative_step:
25274  */
25275           __pyx_v_start = 0;
25276 
25277           /* "View.MemoryView":844
25278  *             if start < 0:
25279  *                 start += shape
25280  *                 if start < 0:             # <<<<<<<<<<<<<<
25281  *                     start = 0
25282  *             elif start >= shape:
25283  */
25284         }
25285 
25286         /* "View.MemoryView":842
25287  *
25288  *         if have_start:
25289  *             if start < 0:             # <<<<<<<<<<<<<<
25290  *                 start += shape
25291  *                 if start < 0:
25292  */
25293         goto __pyx_L12;
25294       }
25295 
25296       /* "View.MemoryView":846
25297  *                 if start < 0:
25298  *                     start = 0
25299  *             elif start >= shape:             # <<<<<<<<<<<<<<
25300  *                 if negative_step:
25301  *                     start = shape - 1
25302  */
25303       __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
25304       if (__pyx_t_2) {
25305 
25306         /* "View.MemoryView":847
25307  *                     start = 0
25308  *             elif start >= shape:
25309  *                 if negative_step:             # <<<<<<<<<<<<<<
25310  *                     start = shape - 1
25311  *                 else:
25312  */
25313         __pyx_t_2 = (__pyx_v_negative_step != 0);
25314         if (__pyx_t_2) {
25315 
25316           /* "View.MemoryView":848
25317  *             elif start >= shape:
25318  *                 if negative_step:
25319  *                     start = shape - 1             # <<<<<<<<<<<<<<
25320  *                 else:
25321  *                     start = shape
25322  */
25323           __pyx_v_start = (__pyx_v_shape - 1);
25324 
25325           /* "View.MemoryView":847
25326  *                     start = 0
25327  *             elif start >= shape:
25328  *                 if negative_step:             # <<<<<<<<<<<<<<
25329  *                     start = shape - 1
25330  *                 else:
25331  */
25332           goto __pyx_L14;
25333         }
25334 
25335         /* "View.MemoryView":850
25336  *                     start = shape - 1
25337  *                 else:
25338  *                     start = shape             # <<<<<<<<<<<<<<
25339  *         else:
25340  *             if negative_step:
25341  */
25342         /*else*/ {
25343           __pyx_v_start = __pyx_v_shape;
25344         }
25345         __pyx_L14:;
25346 
25347         /* "View.MemoryView":846
25348  *                 if start < 0:
25349  *                     start = 0
25350  *             elif start >= shape:             # <<<<<<<<<<<<<<
25351  *                 if negative_step:
25352  *                     start = shape - 1
25353  */
25354       }
25355       __pyx_L12:;
25356 
25357       /* "View.MemoryView":841
25358  *
25359  *
25360  *         if have_start:             # <<<<<<<<<<<<<<
25361  *             if start < 0:
25362  *                 start += shape
25363  */
25364       goto __pyx_L11;
25365     }
25366 
25367     /* "View.MemoryView":852
25368  *                     start = shape
25369  *         else:
25370  *             if negative_step:             # <<<<<<<<<<<<<<
25371  *                 start = shape - 1
25372  *             else:
25373  */
25374     /*else*/ {
25375       __pyx_t_2 = (__pyx_v_negative_step != 0);
25376       if (__pyx_t_2) {
25377 
25378         /* "View.MemoryView":853
25379  *         else:
25380  *             if negative_step:
25381  *                 start = shape - 1             # <<<<<<<<<<<<<<
25382  *             else:
25383  *                 start = 0
25384  */
25385         __pyx_v_start = (__pyx_v_shape - 1);
25386 
25387         /* "View.MemoryView":852
25388  *                     start = shape
25389  *         else:
25390  *             if negative_step:             # <<<<<<<<<<<<<<
25391  *                 start = shape - 1
25392  *             else:
25393  */
25394         goto __pyx_L15;
25395       }
25396 
25397       /* "View.MemoryView":855
25398  *                 start = shape - 1
25399  *             else:
25400  *                 start = 0             # <<<<<<<<<<<<<<
25401  *
25402  *         if have_stop:
25403  */
25404       /*else*/ {
25405         __pyx_v_start = 0;
25406       }
25407       __pyx_L15:;
25408     }
25409     __pyx_L11:;
25410 
25411     /* "View.MemoryView":857
25412  *                 start = 0
25413  *
25414  *         if have_stop:             # <<<<<<<<<<<<<<
25415  *             if stop < 0:
25416  *                 stop += shape
25417  */
25418     __pyx_t_2 = (__pyx_v_have_stop != 0);
25419     if (__pyx_t_2) {
25420 
25421       /* "View.MemoryView":858
25422  *
25423  *         if have_stop:
25424  *             if stop < 0:             # <<<<<<<<<<<<<<
25425  *                 stop += shape
25426  *                 if stop < 0:
25427  */
25428       __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
25429       if (__pyx_t_2) {
25430 
25431         /* "View.MemoryView":859
25432  *         if have_stop:
25433  *             if stop < 0:
25434  *                 stop += shape             # <<<<<<<<<<<<<<
25435  *                 if stop < 0:
25436  *                     stop = 0
25437  */
25438         __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
25439 
25440         /* "View.MemoryView":860
25441  *             if stop < 0:
25442  *                 stop += shape
25443  *                 if stop < 0:             # <<<<<<<<<<<<<<
25444  *                     stop = 0
25445  *             elif stop > shape:
25446  */
25447         __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
25448         if (__pyx_t_2) {
25449 
25450           /* "View.MemoryView":861
25451  *                 stop += shape
25452  *                 if stop < 0:
25453  *                     stop = 0             # <<<<<<<<<<<<<<
25454  *             elif stop > shape:
25455  *                 stop = shape
25456  */
25457           __pyx_v_stop = 0;
25458 
25459           /* "View.MemoryView":860
25460  *             if stop < 0:
25461  *                 stop += shape
25462  *                 if stop < 0:             # <<<<<<<<<<<<<<
25463  *                     stop = 0
25464  *             elif stop > shape:
25465  */
25466         }
25467 
25468         /* "View.MemoryView":858
25469  *
25470  *         if have_stop:
25471  *             if stop < 0:             # <<<<<<<<<<<<<<
25472  *                 stop += shape
25473  *                 if stop < 0:
25474  */
25475         goto __pyx_L17;
25476       }
25477 
25478       /* "View.MemoryView":862
25479  *                 if stop < 0:
25480  *                     stop = 0
25481  *             elif stop > shape:             # <<<<<<<<<<<<<<
25482  *                 stop = shape
25483  *         else:
25484  */
25485       __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
25486       if (__pyx_t_2) {
25487 
25488         /* "View.MemoryView":863
25489  *                     stop = 0
25490  *             elif stop > shape:
25491  *                 stop = shape             # <<<<<<<<<<<<<<
25492  *         else:
25493  *             if negative_step:
25494  */
25495         __pyx_v_stop = __pyx_v_shape;
25496 
25497         /* "View.MemoryView":862
25498  *                 if stop < 0:
25499  *                     stop = 0
25500  *             elif stop > shape:             # <<<<<<<<<<<<<<
25501  *                 stop = shape
25502  *         else:
25503  */
25504       }
25505       __pyx_L17:;
25506 
25507       /* "View.MemoryView":857
25508  *                 start = 0
25509  *
25510  *         if have_stop:             # <<<<<<<<<<<<<<
25511  *             if stop < 0:
25512  *                 stop += shape
25513  */
25514       goto __pyx_L16;
25515     }
25516 
25517     /* "View.MemoryView":865
25518  *                 stop = shape
25519  *         else:
25520  *             if negative_step:             # <<<<<<<<<<<<<<
25521  *                 stop = -1
25522  *             else:
25523  */
25524     /*else*/ {
25525       __pyx_t_2 = (__pyx_v_negative_step != 0);
25526       if (__pyx_t_2) {
25527 
25528         /* "View.MemoryView":866
25529  *         else:
25530  *             if negative_step:
25531  *                 stop = -1             # <<<<<<<<<<<<<<
25532  *             else:
25533  *                 stop = shape
25534  */
25535         __pyx_v_stop = -1L;
25536 
25537         /* "View.MemoryView":865
25538  *                 stop = shape
25539  *         else:
25540  *             if negative_step:             # <<<<<<<<<<<<<<
25541  *                 stop = -1
25542  *             else:
25543  */
25544         goto __pyx_L19;
25545       }
25546 
25547       /* "View.MemoryView":868
25548  *                 stop = -1
25549  *             else:
25550  *                 stop = shape             # <<<<<<<<<<<<<<
25551  *
25552  *         if not have_step:
25553  */
25554       /*else*/ {
25555         __pyx_v_stop = __pyx_v_shape;
25556       }
25557       __pyx_L19:;
25558     }
25559     __pyx_L16:;
25560 
25561     /* "View.MemoryView":870
25562  *                 stop = shape
25563  *
25564  *         if not have_step:             # <<<<<<<<<<<<<<
25565  *             step = 1
25566  *
25567  */
25568     __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
25569     if (__pyx_t_2) {
25570 
25571       /* "View.MemoryView":871
25572  *
25573  *         if not have_step:
25574  *             step = 1             # <<<<<<<<<<<<<<
25575  *
25576  *
25577  */
25578       __pyx_v_step = 1;
25579 
25580       /* "View.MemoryView":870
25581  *                 stop = shape
25582  *
25583  *         if not have_step:             # <<<<<<<<<<<<<<
25584  *             step = 1
25585  *
25586  */
25587     }
25588 
25589     /* "View.MemoryView":875
25590  *
25591  *         with cython.cdivision(True):
25592  *             new_shape = (stop - start) // step             # <<<<<<<<<<<<<<
25593  *
25594  *             if (stop - start) - step * new_shape:
25595  */
25596     __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
25597 
25598     /* "View.MemoryView":877
25599  *             new_shape = (stop - start) // step
25600  *
25601  *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
25602  *                 new_shape += 1
25603  *
25604  */
25605     __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
25606     if (__pyx_t_2) {
25607 
25608       /* "View.MemoryView":878
25609  *
25610  *             if (stop - start) - step * new_shape:
25611  *                 new_shape += 1             # <<<<<<<<<<<<<<
25612  *
25613  *         if new_shape < 0:
25614  */
25615       __pyx_v_new_shape = (__pyx_v_new_shape + 1);
25616 
25617       /* "View.MemoryView":877
25618  *             new_shape = (stop - start) // step
25619  *
25620  *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
25621  *                 new_shape += 1
25622  *
25623  */
25624     }
25625 
25626     /* "View.MemoryView":880
25627  *                 new_shape += 1
25628  *
25629  *         if new_shape < 0:             # <<<<<<<<<<<<<<
25630  *             new_shape = 0
25631  *
25632  */
25633     __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
25634     if (__pyx_t_2) {
25635 
25636       /* "View.MemoryView":881
25637  *
25638  *         if new_shape < 0:
25639  *             new_shape = 0             # <<<<<<<<<<<<<<
25640  *
25641  *
25642  */
25643       __pyx_v_new_shape = 0;
25644 
25645       /* "View.MemoryView":880
25646  *                 new_shape += 1
25647  *
25648  *         if new_shape < 0:             # <<<<<<<<<<<<<<
25649  *             new_shape = 0
25650  *
25651  */
25652     }
25653 
25654     /* "View.MemoryView":884
25655  *
25656  *
25657  *         dst.strides[new_ndim] = stride * step             # <<<<<<<<<<<<<<
25658  *         dst.shape[new_ndim] = new_shape
25659  *         dst.suboffsets[new_ndim] = suboffset
25660  */
25661     (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
25662 
25663     /* "View.MemoryView":885
25664  *
25665  *         dst.strides[new_ndim] = stride * step
25666  *         dst.shape[new_ndim] = new_shape             # <<<<<<<<<<<<<<
25667  *         dst.suboffsets[new_ndim] = suboffset
25668  *
25669  */
25670     (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
25671 
25672     /* "View.MemoryView":886
25673  *         dst.strides[new_ndim] = stride * step
25674  *         dst.shape[new_ndim] = new_shape
25675  *         dst.suboffsets[new_ndim] = suboffset             # <<<<<<<<<<<<<<
25676  *
25677  *
25678  */
25679     (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
25680   }
25681   __pyx_L3:;
25682 
25683   /* "View.MemoryView":889
25684  *
25685  *
25686  *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
25687  *         dst.data += start * stride
25688  *     else:
25689  */
25690   __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
25691   if (__pyx_t_2) {
25692 
25693     /* "View.MemoryView":890
25694  *
25695  *     if suboffset_dim[0] < 0:
25696  *         dst.data += start * stride             # <<<<<<<<<<<<<<
25697  *     else:
25698  *         dst.suboffsets[suboffset_dim[0]] += start * stride
25699  */
25700     __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
25701 
25702     /* "View.MemoryView":889
25703  *
25704  *
25705  *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
25706  *         dst.data += start * stride
25707  *     else:
25708  */
25709     goto __pyx_L23;
25710   }
25711 
25712   /* "View.MemoryView":892
25713  *         dst.data += start * stride
25714  *     else:
25715  *         dst.suboffsets[suboffset_dim[0]] += start * stride             # <<<<<<<<<<<<<<
25716  *
25717  *     if suboffset >= 0:
25718  */
25719   /*else*/ {
25720     __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
25721     (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
25722   }
25723   __pyx_L23:;
25724 
25725   /* "View.MemoryView":894
25726  *         dst.suboffsets[suboffset_dim[0]] += start * stride
25727  *
25728  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
25729  *         if not is_slice:
25730  *             if new_ndim == 0:
25731  */
25732   __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
25733   if (__pyx_t_2) {
25734 
25735     /* "View.MemoryView":895
25736  *
25737  *     if suboffset >= 0:
25738  *         if not is_slice:             # <<<<<<<<<<<<<<
25739  *             if new_ndim == 0:
25740  *                 dst.data = (<char **> dst.data)[0] + suboffset
25741  */
25742     __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
25743     if (__pyx_t_2) {
25744 
25745       /* "View.MemoryView":896
25746  *     if suboffset >= 0:
25747  *         if not is_slice:
25748  *             if new_ndim == 0:             # <<<<<<<<<<<<<<
25749  *                 dst.data = (<char **> dst.data)[0] + suboffset
25750  *             else:
25751  */
25752       __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
25753       if (__pyx_t_2) {
25754 
25755         /* "View.MemoryView":897
25756  *         if not is_slice:
25757  *             if new_ndim == 0:
25758  *                 dst.data = (<char **> dst.data)[0] + suboffset             # <<<<<<<<<<<<<<
25759  *             else:
25760  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
25761  */
25762         __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
25763 
25764         /* "View.MemoryView":896
25765  *     if suboffset >= 0:
25766  *         if not is_slice:
25767  *             if new_ndim == 0:             # <<<<<<<<<<<<<<
25768  *                 dst.data = (<char **> dst.data)[0] + suboffset
25769  *             else:
25770  */
25771         goto __pyx_L26;
25772       }
25773 
25774       /* "View.MemoryView":899
25775  *                 dst.data = (<char **> dst.data)[0] + suboffset
25776  *             else:
25777  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "             # <<<<<<<<<<<<<<
25778  *                                      "must be indexed and not sliced", dim)
25779  *         else:
25780  */
25781       /*else*/ {
25782 
25783         /* "View.MemoryView":900
25784  *             else:
25785  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
25786  *                                      "must be indexed and not sliced", dim)             # <<<<<<<<<<<<<<
25787  *         else:
25788  *             suboffset_dim[0] = new_ndim
25789  */
25790         __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 899, __pyx_L1_error)
25791       }
25792       __pyx_L26:;
25793 
25794       /* "View.MemoryView":895
25795  *
25796  *     if suboffset >= 0:
25797  *         if not is_slice:             # <<<<<<<<<<<<<<
25798  *             if new_ndim == 0:
25799  *                 dst.data = (<char **> dst.data)[0] + suboffset
25800  */
25801       goto __pyx_L25;
25802     }
25803 
25804     /* "View.MemoryView":902
25805  *                                      "must be indexed and not sliced", dim)
25806  *         else:
25807  *             suboffset_dim[0] = new_ndim             # <<<<<<<<<<<<<<
25808  *
25809  *     return 0
25810  */
25811     /*else*/ {
25812       (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
25813     }
25814     __pyx_L25:;
25815 
25816     /* "View.MemoryView":894
25817  *         dst.suboffsets[suboffset_dim[0]] += start * stride
25818  *
25819  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
25820  *         if not is_slice:
25821  *             if new_ndim == 0:
25822  */
25823   }
25824 
25825   /* "View.MemoryView":904
25826  *             suboffset_dim[0] = new_ndim
25827  *
25828  *     return 0             # <<<<<<<<<<<<<<
25829  *
25830  *
25831  */
25832   __pyx_r = 0;
25833   goto __pyx_L0;
25834 
25835   /* "View.MemoryView":807
25836  *
25837  * @cname('__pyx_memoryview_slice_memviewslice')
25838  * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
25839  *         __Pyx_memviewslice *dst,
25840  *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
25841  */
25842 
25843   /* function exit code */
25844   __pyx_L1_error:;
25845   {
25846     #ifdef WITH_THREAD
25847     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
25848     #endif
25849     __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
25850     #ifdef WITH_THREAD
25851     __Pyx_PyGILState_Release(__pyx_gilstate_save);
25852     #endif
25853   }
25854   __pyx_r = -1;
25855   __pyx_L0:;
25856   return __pyx_r;
25857 }
25858 
25859 /* "View.MemoryView":910
25860  *
25861  * @cname('__pyx_pybuffer_index')
25862  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
25863  *                           Py_ssize_t dim) except NULL:
25864  *     cdef Py_ssize_t shape, stride, suboffset = -1
25865  */
25866 
__pyx_pybuffer_index(Py_buffer * __pyx_v_view,char * __pyx_v_bufp,Py_ssize_t __pyx_v_index,Py_ssize_t __pyx_v_dim)25867 static 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) {
25868   Py_ssize_t __pyx_v_shape;
25869   Py_ssize_t __pyx_v_stride;
25870   Py_ssize_t __pyx_v_suboffset;
25871   Py_ssize_t __pyx_v_itemsize;
25872   char *__pyx_v_resultp;
25873   char *__pyx_r;
25874   __Pyx_RefNannyDeclarations
25875   Py_ssize_t __pyx_t_1;
25876   int __pyx_t_2;
25877   PyObject *__pyx_t_3 = NULL;
25878   PyObject *__pyx_t_4 = NULL;
25879   int __pyx_lineno = 0;
25880   const char *__pyx_filename = NULL;
25881   int __pyx_clineno = 0;
25882   __Pyx_RefNannySetupContext("pybuffer_index", 0);
25883 
25884   /* "View.MemoryView":912
25885  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
25886  *                           Py_ssize_t dim) except NULL:
25887  *     cdef Py_ssize_t shape, stride, suboffset = -1             # <<<<<<<<<<<<<<
25888  *     cdef Py_ssize_t itemsize = view.itemsize
25889  *     cdef char *resultp
25890  */
25891   __pyx_v_suboffset = -1L;
25892 
25893   /* "View.MemoryView":913
25894  *                           Py_ssize_t dim) except NULL:
25895  *     cdef Py_ssize_t shape, stride, suboffset = -1
25896  *     cdef Py_ssize_t itemsize = view.itemsize             # <<<<<<<<<<<<<<
25897  *     cdef char *resultp
25898  *
25899  */
25900   __pyx_t_1 = __pyx_v_view->itemsize;
25901   __pyx_v_itemsize = __pyx_t_1;
25902 
25903   /* "View.MemoryView":916
25904  *     cdef char *resultp
25905  *
25906  *     if view.ndim == 0:             # <<<<<<<<<<<<<<
25907  *         shape = view.len / itemsize
25908  *         stride = itemsize
25909  */
25910   __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
25911   if (__pyx_t_2) {
25912 
25913     /* "View.MemoryView":917
25914  *
25915  *     if view.ndim == 0:
25916  *         shape = view.len / itemsize             # <<<<<<<<<<<<<<
25917  *         stride = itemsize
25918  *     else:
25919  */
25920     if (unlikely(__pyx_v_itemsize == 0)) {
25921       PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
25922       __PYX_ERR(1, 917, __pyx_L1_error)
25923     }
25924     else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
25925       PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
25926       __PYX_ERR(1, 917, __pyx_L1_error)
25927     }
25928     __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
25929 
25930     /* "View.MemoryView":918
25931  *     if view.ndim == 0:
25932  *         shape = view.len / itemsize
25933  *         stride = itemsize             # <<<<<<<<<<<<<<
25934  *     else:
25935  *         shape = view.shape[dim]
25936  */
25937     __pyx_v_stride = __pyx_v_itemsize;
25938 
25939     /* "View.MemoryView":916
25940  *     cdef char *resultp
25941  *
25942  *     if view.ndim == 0:             # <<<<<<<<<<<<<<
25943  *         shape = view.len / itemsize
25944  *         stride = itemsize
25945  */
25946     goto __pyx_L3;
25947   }
25948 
25949   /* "View.MemoryView":920
25950  *         stride = itemsize
25951  *     else:
25952  *         shape = view.shape[dim]             # <<<<<<<<<<<<<<
25953  *         stride = view.strides[dim]
25954  *         if view.suboffsets != NULL:
25955  */
25956   /*else*/ {
25957     __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
25958 
25959     /* "View.MemoryView":921
25960  *     else:
25961  *         shape = view.shape[dim]
25962  *         stride = view.strides[dim]             # <<<<<<<<<<<<<<
25963  *         if view.suboffsets != NULL:
25964  *             suboffset = view.suboffsets[dim]
25965  */
25966     __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
25967 
25968     /* "View.MemoryView":922
25969  *         shape = view.shape[dim]
25970  *         stride = view.strides[dim]
25971  *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
25972  *             suboffset = view.suboffsets[dim]
25973  *
25974  */
25975     __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
25976     if (__pyx_t_2) {
25977 
25978       /* "View.MemoryView":923
25979  *         stride = view.strides[dim]
25980  *         if view.suboffsets != NULL:
25981  *             suboffset = view.suboffsets[dim]             # <<<<<<<<<<<<<<
25982  *
25983  *     if index < 0:
25984  */
25985       __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
25986 
25987       /* "View.MemoryView":922
25988  *         shape = view.shape[dim]
25989  *         stride = view.strides[dim]
25990  *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
25991  *             suboffset = view.suboffsets[dim]
25992  *
25993  */
25994     }
25995   }
25996   __pyx_L3:;
25997 
25998   /* "View.MemoryView":925
25999  *             suboffset = view.suboffsets[dim]
26000  *
26001  *     if index < 0:             # <<<<<<<<<<<<<<
26002  *         index += view.shape[dim]
26003  *         if index < 0:
26004  */
26005   __pyx_t_2 = ((__pyx_v_index < 0) != 0);
26006   if (__pyx_t_2) {
26007 
26008     /* "View.MemoryView":926
26009  *
26010  *     if index < 0:
26011  *         index += view.shape[dim]             # <<<<<<<<<<<<<<
26012  *         if index < 0:
26013  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
26014  */
26015     __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
26016 
26017     /* "View.MemoryView":927
26018  *     if index < 0:
26019  *         index += view.shape[dim]
26020  *         if index < 0:             # <<<<<<<<<<<<<<
26021  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
26022  *
26023  */
26024     __pyx_t_2 = ((__pyx_v_index < 0) != 0);
26025     if (unlikely(__pyx_t_2)) {
26026 
26027       /* "View.MemoryView":928
26028  *         index += view.shape[dim]
26029  *         if index < 0:
26030  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
26031  *
26032  *     if index >= shape:
26033  */
26034       __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
26035       __Pyx_GOTREF(__pyx_t_3);
26036       __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error)
26037       __Pyx_GOTREF(__pyx_t_4);
26038       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26039       __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
26040       __Pyx_GOTREF(__pyx_t_3);
26041       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26042       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
26043       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26044       __PYX_ERR(1, 928, __pyx_L1_error)
26045 
26046       /* "View.MemoryView":927
26047  *     if index < 0:
26048  *         index += view.shape[dim]
26049  *         if index < 0:             # <<<<<<<<<<<<<<
26050  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
26051  *
26052  */
26053     }
26054 
26055     /* "View.MemoryView":925
26056  *             suboffset = view.suboffsets[dim]
26057  *
26058  *     if index < 0:             # <<<<<<<<<<<<<<
26059  *         index += view.shape[dim]
26060  *         if index < 0:
26061  */
26062   }
26063 
26064   /* "View.MemoryView":930
26065  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
26066  *
26067  *     if index >= shape:             # <<<<<<<<<<<<<<
26068  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
26069  *
26070  */
26071   __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
26072   if (unlikely(__pyx_t_2)) {
26073 
26074     /* "View.MemoryView":931
26075  *
26076  *     if index >= shape:
26077  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
26078  *
26079  *     resultp = bufp + index * stride
26080  */
26081     __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
26082     __Pyx_GOTREF(__pyx_t_3);
26083     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error)
26084     __Pyx_GOTREF(__pyx_t_4);
26085     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26086     __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
26087     __Pyx_GOTREF(__pyx_t_3);
26088     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26089     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
26090     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26091     __PYX_ERR(1, 931, __pyx_L1_error)
26092 
26093     /* "View.MemoryView":930
26094  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
26095  *
26096  *     if index >= shape:             # <<<<<<<<<<<<<<
26097  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
26098  *
26099  */
26100   }
26101 
26102   /* "View.MemoryView":933
26103  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
26104  *
26105  *     resultp = bufp + index * stride             # <<<<<<<<<<<<<<
26106  *     if suboffset >= 0:
26107  *         resultp = (<char **> resultp)[0] + suboffset
26108  */
26109   __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
26110 
26111   /* "View.MemoryView":934
26112  *
26113  *     resultp = bufp + index * stride
26114  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
26115  *         resultp = (<char **> resultp)[0] + suboffset
26116  *
26117  */
26118   __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
26119   if (__pyx_t_2) {
26120 
26121     /* "View.MemoryView":935
26122  *     resultp = bufp + index * stride
26123  *     if suboffset >= 0:
26124  *         resultp = (<char **> resultp)[0] + suboffset             # <<<<<<<<<<<<<<
26125  *
26126  *     return resultp
26127  */
26128     __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
26129 
26130     /* "View.MemoryView":934
26131  *
26132  *     resultp = bufp + index * stride
26133  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
26134  *         resultp = (<char **> resultp)[0] + suboffset
26135  *
26136  */
26137   }
26138 
26139   /* "View.MemoryView":937
26140  *         resultp = (<char **> resultp)[0] + suboffset
26141  *
26142  *     return resultp             # <<<<<<<<<<<<<<
26143  *
26144  *
26145  */
26146   __pyx_r = __pyx_v_resultp;
26147   goto __pyx_L0;
26148 
26149   /* "View.MemoryView":910
26150  *
26151  * @cname('__pyx_pybuffer_index')
26152  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
26153  *                           Py_ssize_t dim) except NULL:
26154  *     cdef Py_ssize_t shape, stride, suboffset = -1
26155  */
26156 
26157   /* function exit code */
26158   __pyx_L1_error:;
26159   __Pyx_XDECREF(__pyx_t_3);
26160   __Pyx_XDECREF(__pyx_t_4);
26161   __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
26162   __pyx_r = NULL;
26163   __pyx_L0:;
26164   __Pyx_RefNannyFinishContext();
26165   return __pyx_r;
26166 }
26167 
26168 /* "View.MemoryView":943
26169  *
26170  * @cname('__pyx_memslice_transpose')
26171  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
26172  *     cdef int ndim = memslice.memview.view.ndim
26173  *
26174  */
26175 
__pyx_memslice_transpose(__Pyx_memviewslice * __pyx_v_memslice)26176 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
26177   int __pyx_v_ndim;
26178   Py_ssize_t *__pyx_v_shape;
26179   Py_ssize_t *__pyx_v_strides;
26180   int __pyx_v_i;
26181   int __pyx_v_j;
26182   int __pyx_r;
26183   int __pyx_t_1;
26184   Py_ssize_t *__pyx_t_2;
26185   long __pyx_t_3;
26186   long __pyx_t_4;
26187   Py_ssize_t __pyx_t_5;
26188   Py_ssize_t __pyx_t_6;
26189   int __pyx_t_7;
26190   int __pyx_t_8;
26191   int __pyx_t_9;
26192   int __pyx_lineno = 0;
26193   const char *__pyx_filename = NULL;
26194   int __pyx_clineno = 0;
26195 
26196   /* "View.MemoryView":944
26197  * @cname('__pyx_memslice_transpose')
26198  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
26199  *     cdef int ndim = memslice.memview.view.ndim             # <<<<<<<<<<<<<<
26200  *
26201  *     cdef Py_ssize_t *shape = memslice.shape
26202  */
26203   __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
26204   __pyx_v_ndim = __pyx_t_1;
26205 
26206   /* "View.MemoryView":946
26207  *     cdef int ndim = memslice.memview.view.ndim
26208  *
26209  *     cdef Py_ssize_t *shape = memslice.shape             # <<<<<<<<<<<<<<
26210  *     cdef Py_ssize_t *strides = memslice.strides
26211  *
26212  */
26213   __pyx_t_2 = __pyx_v_memslice->shape;
26214   __pyx_v_shape = __pyx_t_2;
26215 
26216   /* "View.MemoryView":947
26217  *
26218  *     cdef Py_ssize_t *shape = memslice.shape
26219  *     cdef Py_ssize_t *strides = memslice.strides             # <<<<<<<<<<<<<<
26220  *
26221  *
26222  */
26223   __pyx_t_2 = __pyx_v_memslice->strides;
26224   __pyx_v_strides = __pyx_t_2;
26225 
26226   /* "View.MemoryView":951
26227  *
26228  *     cdef int i, j
26229  *     for i in range(ndim / 2):             # <<<<<<<<<<<<<<
26230  *         j = ndim - 1 - i
26231  *         strides[i], strides[j] = strides[j], strides[i]
26232  */
26233   __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
26234   __pyx_t_4 = __pyx_t_3;
26235   for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
26236     __pyx_v_i = __pyx_t_1;
26237 
26238     /* "View.MemoryView":952
26239  *     cdef int i, j
26240  *     for i in range(ndim / 2):
26241  *         j = ndim - 1 - i             # <<<<<<<<<<<<<<
26242  *         strides[i], strides[j] = strides[j], strides[i]
26243  *         shape[i], shape[j] = shape[j], shape[i]
26244  */
26245     __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
26246 
26247     /* "View.MemoryView":953
26248  *     for i in range(ndim / 2):
26249  *         j = ndim - 1 - i
26250  *         strides[i], strides[j] = strides[j], strides[i]             # <<<<<<<<<<<<<<
26251  *         shape[i], shape[j] = shape[j], shape[i]
26252  *
26253  */
26254     __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
26255     __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
26256     (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
26257     (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
26258 
26259     /* "View.MemoryView":954
26260  *         j = ndim - 1 - i
26261  *         strides[i], strides[j] = strides[j], strides[i]
26262  *         shape[i], shape[j] = shape[j], shape[i]             # <<<<<<<<<<<<<<
26263  *
26264  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
26265  */
26266     __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
26267     __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
26268     (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
26269     (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
26270 
26271     /* "View.MemoryView":956
26272  *         shape[i], shape[j] = shape[j], shape[i]
26273  *
26274  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
26275  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
26276  *
26277  */
26278     __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
26279     if (!__pyx_t_8) {
26280     } else {
26281       __pyx_t_7 = __pyx_t_8;
26282       goto __pyx_L6_bool_binop_done;
26283     }
26284     __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
26285     __pyx_t_7 = __pyx_t_8;
26286     __pyx_L6_bool_binop_done:;
26287     if (__pyx_t_7) {
26288 
26289       /* "View.MemoryView":957
26290  *
26291  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
26292  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")             # <<<<<<<<<<<<<<
26293  *
26294  *     return 1
26295  */
26296       __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 957, __pyx_L1_error)
26297 
26298       /* "View.MemoryView":956
26299  *         shape[i], shape[j] = shape[j], shape[i]
26300  *
26301  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
26302  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
26303  *
26304  */
26305     }
26306   }
26307 
26308   /* "View.MemoryView":959
26309  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
26310  *
26311  *     return 1             # <<<<<<<<<<<<<<
26312  *
26313  *
26314  */
26315   __pyx_r = 1;
26316   goto __pyx_L0;
26317 
26318   /* "View.MemoryView":943
26319  *
26320  * @cname('__pyx_memslice_transpose')
26321  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
26322  *     cdef int ndim = memslice.memview.view.ndim
26323  *
26324  */
26325 
26326   /* function exit code */
26327   __pyx_L1_error:;
26328   {
26329     #ifdef WITH_THREAD
26330     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
26331     #endif
26332     __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
26333     #ifdef WITH_THREAD
26334     __Pyx_PyGILState_Release(__pyx_gilstate_save);
26335     #endif
26336   }
26337   __pyx_r = 0;
26338   __pyx_L0:;
26339   return __pyx_r;
26340 }
26341 
26342 /* "View.MemoryView":976
26343  *     cdef int (*to_dtype_func)(char *, object) except 0
26344  *
26345  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
26346  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
26347  *
26348  */
26349 
26350 /* Python wrapper */
26351 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryviewslice___dealloc__(PyObject * __pyx_v_self)26352 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
26353   __Pyx_RefNannyDeclarations
26354   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
26355   __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
26356 
26357   /* function exit code */
26358   __Pyx_RefNannyFinishContext();
26359 }
26360 
__pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj * __pyx_v_self)26361 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
26362   __Pyx_RefNannyDeclarations
26363   __Pyx_RefNannySetupContext("__dealloc__", 0);
26364 
26365   /* "View.MemoryView":977
26366  *
26367  *     def __dealloc__(self):
26368  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)             # <<<<<<<<<<<<<<
26369  *
26370  *     cdef convert_item_to_object(self, char *itemp):
26371  */
26372   __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
26373 
26374   /* "View.MemoryView":976
26375  *     cdef int (*to_dtype_func)(char *, object) except 0
26376  *
26377  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
26378  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
26379  *
26380  */
26381 
26382   /* function exit code */
26383   __Pyx_RefNannyFinishContext();
26384 }
26385 
26386 /* "View.MemoryView":979
26387  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
26388  *
26389  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
26390  *         if self.to_object_func != NULL:
26391  *             return self.to_object_func(itemp)
26392  */
26393 
__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj * __pyx_v_self,char * __pyx_v_itemp)26394 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
26395   PyObject *__pyx_r = NULL;
26396   __Pyx_RefNannyDeclarations
26397   int __pyx_t_1;
26398   PyObject *__pyx_t_2 = NULL;
26399   int __pyx_lineno = 0;
26400   const char *__pyx_filename = NULL;
26401   int __pyx_clineno = 0;
26402   __Pyx_RefNannySetupContext("convert_item_to_object", 0);
26403 
26404   /* "View.MemoryView":980
26405  *
26406  *     cdef convert_item_to_object(self, char *itemp):
26407  *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
26408  *             return self.to_object_func(itemp)
26409  *         else:
26410  */
26411   __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
26412   if (__pyx_t_1) {
26413 
26414     /* "View.MemoryView":981
26415  *     cdef convert_item_to_object(self, char *itemp):
26416  *         if self.to_object_func != NULL:
26417  *             return self.to_object_func(itemp)             # <<<<<<<<<<<<<<
26418  *         else:
26419  *             return memoryview.convert_item_to_object(self, itemp)
26420  */
26421     __Pyx_XDECREF(__pyx_r);
26422     __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
26423     __Pyx_GOTREF(__pyx_t_2);
26424     __pyx_r = __pyx_t_2;
26425     __pyx_t_2 = 0;
26426     goto __pyx_L0;
26427 
26428     /* "View.MemoryView":980
26429  *
26430  *     cdef convert_item_to_object(self, char *itemp):
26431  *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
26432  *             return self.to_object_func(itemp)
26433  *         else:
26434  */
26435   }
26436 
26437   /* "View.MemoryView":983
26438  *             return self.to_object_func(itemp)
26439  *         else:
26440  *             return memoryview.convert_item_to_object(self, itemp)             # <<<<<<<<<<<<<<
26441  *
26442  *     cdef assign_item_from_object(self, char *itemp, object value):
26443  */
26444   /*else*/ {
26445     __Pyx_XDECREF(__pyx_r);
26446     __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, 983, __pyx_L1_error)
26447     __Pyx_GOTREF(__pyx_t_2);
26448     __pyx_r = __pyx_t_2;
26449     __pyx_t_2 = 0;
26450     goto __pyx_L0;
26451   }
26452 
26453   /* "View.MemoryView":979
26454  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
26455  *
26456  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
26457  *         if self.to_object_func != NULL:
26458  *             return self.to_object_func(itemp)
26459  */
26460 
26461   /* function exit code */
26462   __pyx_L1_error:;
26463   __Pyx_XDECREF(__pyx_t_2);
26464   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
26465   __pyx_r = 0;
26466   __pyx_L0:;
26467   __Pyx_XGIVEREF(__pyx_r);
26468   __Pyx_RefNannyFinishContext();
26469   return __pyx_r;
26470 }
26471 
26472 /* "View.MemoryView":985
26473  *             return memoryview.convert_item_to_object(self, itemp)
26474  *
26475  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
26476  *         if self.to_dtype_func != NULL:
26477  *             self.to_dtype_func(itemp, value)
26478  */
26479 
__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj * __pyx_v_self,char * __pyx_v_itemp,PyObject * __pyx_v_value)26480 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
26481   PyObject *__pyx_r = NULL;
26482   __Pyx_RefNannyDeclarations
26483   int __pyx_t_1;
26484   int __pyx_t_2;
26485   PyObject *__pyx_t_3 = NULL;
26486   int __pyx_lineno = 0;
26487   const char *__pyx_filename = NULL;
26488   int __pyx_clineno = 0;
26489   __Pyx_RefNannySetupContext("assign_item_from_object", 0);
26490 
26491   /* "View.MemoryView":986
26492  *
26493  *     cdef assign_item_from_object(self, char *itemp, object value):
26494  *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
26495  *             self.to_dtype_func(itemp, value)
26496  *         else:
26497  */
26498   __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
26499   if (__pyx_t_1) {
26500 
26501     /* "View.MemoryView":987
26502  *     cdef assign_item_from_object(self, char *itemp, object value):
26503  *         if self.to_dtype_func != NULL:
26504  *             self.to_dtype_func(itemp, value)             # <<<<<<<<<<<<<<
26505  *         else:
26506  *             memoryview.assign_item_from_object(self, itemp, value)
26507  */
26508     __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, 987, __pyx_L1_error)
26509 
26510     /* "View.MemoryView":986
26511  *
26512  *     cdef assign_item_from_object(self, char *itemp, object value):
26513  *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
26514  *             self.to_dtype_func(itemp, value)
26515  *         else:
26516  */
26517     goto __pyx_L3;
26518   }
26519 
26520   /* "View.MemoryView":989
26521  *             self.to_dtype_func(itemp, value)
26522  *         else:
26523  *             memoryview.assign_item_from_object(self, itemp, value)             # <<<<<<<<<<<<<<
26524  *
26525  *     @property
26526  */
26527   /*else*/ {
26528     __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, 989, __pyx_L1_error)
26529     __Pyx_GOTREF(__pyx_t_3);
26530     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26531   }
26532   __pyx_L3:;
26533 
26534   /* "View.MemoryView":985
26535  *             return memoryview.convert_item_to_object(self, itemp)
26536  *
26537  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
26538  *         if self.to_dtype_func != NULL:
26539  *             self.to_dtype_func(itemp, value)
26540  */
26541 
26542   /* function exit code */
26543   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
26544   goto __pyx_L0;
26545   __pyx_L1_error:;
26546   __Pyx_XDECREF(__pyx_t_3);
26547   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
26548   __pyx_r = 0;
26549   __pyx_L0:;
26550   __Pyx_XGIVEREF(__pyx_r);
26551   __Pyx_RefNannyFinishContext();
26552   return __pyx_r;
26553 }
26554 
26555 /* "View.MemoryView":992
26556  *
26557  *     @property
26558  *     def base(self):             # <<<<<<<<<<<<<<
26559  *         return self.from_object
26560  *
26561  */
26562 
26563 /* Python wrapper */
26564 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject * __pyx_v_self)26565 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
26566   PyObject *__pyx_r = 0;
26567   __Pyx_RefNannyDeclarations
26568   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
26569   __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
26570 
26571   /* function exit code */
26572   __Pyx_RefNannyFinishContext();
26573   return __pyx_r;
26574 }
26575 
__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj * __pyx_v_self)26576 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
26577   PyObject *__pyx_r = NULL;
26578   __Pyx_RefNannyDeclarations
26579   __Pyx_RefNannySetupContext("__get__", 0);
26580 
26581   /* "View.MemoryView":993
26582  *     @property
26583  *     def base(self):
26584  *         return self.from_object             # <<<<<<<<<<<<<<
26585  *
26586  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
26587  */
26588   __Pyx_XDECREF(__pyx_r);
26589   __Pyx_INCREF(__pyx_v_self->from_object);
26590   __pyx_r = __pyx_v_self->from_object;
26591   goto __pyx_L0;
26592 
26593   /* "View.MemoryView":992
26594  *
26595  *     @property
26596  *     def base(self):             # <<<<<<<<<<<<<<
26597  *         return self.from_object
26598  *
26599  */
26600 
26601   /* function exit code */
26602   __pyx_L0:;
26603   __Pyx_XGIVEREF(__pyx_r);
26604   __Pyx_RefNannyFinishContext();
26605   return __pyx_r;
26606 }
26607 
26608 /* "(tree fragment)":1
26609  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
26610  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26611  * def __setstate_cython__(self, __pyx_state):
26612  */
26613 
26614 /* Python wrapper */
26615 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)26616 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
26617   PyObject *__pyx_r = 0;
26618   __Pyx_RefNannyDeclarations
26619   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
26620   __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
26621 
26622   /* function exit code */
26623   __Pyx_RefNannyFinishContext();
26624   return __pyx_r;
26625 }
26626 
__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj * __pyx_v_self)26627 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
26628   PyObject *__pyx_r = NULL;
26629   __Pyx_RefNannyDeclarations
26630   PyObject *__pyx_t_1 = NULL;
26631   int __pyx_lineno = 0;
26632   const char *__pyx_filename = NULL;
26633   int __pyx_clineno = 0;
26634   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
26635 
26636   /* "(tree fragment)":2
26637  * def __reduce_cython__(self):
26638  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
26639  * def __setstate_cython__(self, __pyx_state):
26640  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26641  */
26642   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
26643   __Pyx_GOTREF(__pyx_t_1);
26644   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
26645   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26646   __PYX_ERR(1, 2, __pyx_L1_error)
26647 
26648   /* "(tree fragment)":1
26649  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
26650  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26651  * def __setstate_cython__(self, __pyx_state):
26652  */
26653 
26654   /* function exit code */
26655   __pyx_L1_error:;
26656   __Pyx_XDECREF(__pyx_t_1);
26657   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
26658   __pyx_r = NULL;
26659   __Pyx_XGIVEREF(__pyx_r);
26660   __Pyx_RefNannyFinishContext();
26661   return __pyx_r;
26662 }
26663 
26664 /* "(tree fragment)":3
26665  * def __reduce_cython__(self):
26666  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26667  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
26668  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26669  */
26670 
26671 /* Python wrapper */
26672 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)26673 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
26674   PyObject *__pyx_r = 0;
26675   __Pyx_RefNannyDeclarations
26676   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
26677   __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
26678 
26679   /* function exit code */
26680   __Pyx_RefNannyFinishContext();
26681   return __pyx_r;
26682 }
26683 
__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)26684 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
26685   PyObject *__pyx_r = NULL;
26686   __Pyx_RefNannyDeclarations
26687   PyObject *__pyx_t_1 = NULL;
26688   int __pyx_lineno = 0;
26689   const char *__pyx_filename = NULL;
26690   int __pyx_clineno = 0;
26691   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
26692 
26693   /* "(tree fragment)":4
26694  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26695  * def __setstate_cython__(self, __pyx_state):
26696  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
26697  */
26698   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
26699   __Pyx_GOTREF(__pyx_t_1);
26700   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
26701   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26702   __PYX_ERR(1, 4, __pyx_L1_error)
26703 
26704   /* "(tree fragment)":3
26705  * def __reduce_cython__(self):
26706  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26707  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
26708  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26709  */
26710 
26711   /* function exit code */
26712   __pyx_L1_error:;
26713   __Pyx_XDECREF(__pyx_t_1);
26714   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
26715   __pyx_r = NULL;
26716   __Pyx_XGIVEREF(__pyx_r);
26717   __Pyx_RefNannyFinishContext();
26718   return __pyx_r;
26719 }
26720 
26721 /* "View.MemoryView":999
26722  *
26723  * @cname('__pyx_memoryview_fromslice')
26724  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
26725  *                           int ndim,
26726  *                           object (*to_object_func)(char *),
26727  */
26728 
__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice,int __pyx_v_ndim,PyObject * (* __pyx_v_to_object_func)(char *),int (* __pyx_v_to_dtype_func)(char *,PyObject *),int __pyx_v_dtype_is_object)26729 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
26730   struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
26731   Py_ssize_t __pyx_v_suboffset;
26732   PyObject *__pyx_v_length = NULL;
26733   PyObject *__pyx_r = NULL;
26734   __Pyx_RefNannyDeclarations
26735   int __pyx_t_1;
26736   PyObject *__pyx_t_2 = NULL;
26737   PyObject *__pyx_t_3 = NULL;
26738   __Pyx_TypeInfo *__pyx_t_4;
26739   Py_buffer __pyx_t_5;
26740   Py_ssize_t *__pyx_t_6;
26741   Py_ssize_t *__pyx_t_7;
26742   Py_ssize_t *__pyx_t_8;
26743   Py_ssize_t __pyx_t_9;
26744   int __pyx_lineno = 0;
26745   const char *__pyx_filename = NULL;
26746   int __pyx_clineno = 0;
26747   __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
26748 
26749   /* "View.MemoryView":1007
26750  *     cdef _memoryviewslice result
26751  *
26752  *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
26753  *         return None
26754  *
26755  */
26756   __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
26757   if (__pyx_t_1) {
26758 
26759     /* "View.MemoryView":1008
26760  *
26761  *     if <PyObject *> memviewslice.memview == Py_None:
26762  *         return None             # <<<<<<<<<<<<<<
26763  *
26764  *
26765  */
26766     __Pyx_XDECREF(__pyx_r);
26767     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
26768     goto __pyx_L0;
26769 
26770     /* "View.MemoryView":1007
26771  *     cdef _memoryviewslice result
26772  *
26773  *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
26774  *         return None
26775  *
26776  */
26777   }
26778 
26779   /* "View.MemoryView":1013
26780  *
26781  *
26782  *     result = _memoryviewslice(None, 0, dtype_is_object)             # <<<<<<<<<<<<<<
26783  *
26784  *     result.from_slice = memviewslice
26785  */
26786   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
26787   __Pyx_GOTREF(__pyx_t_2);
26788   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
26789   __Pyx_GOTREF(__pyx_t_3);
26790   __Pyx_INCREF(Py_None);
26791   __Pyx_GIVEREF(Py_None);
26792   PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
26793   __Pyx_INCREF(__pyx_int_0);
26794   __Pyx_GIVEREF(__pyx_int_0);
26795   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
26796   __Pyx_GIVEREF(__pyx_t_2);
26797   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
26798   __pyx_t_2 = 0;
26799   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
26800   __Pyx_GOTREF(__pyx_t_2);
26801   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26802   __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
26803   __pyx_t_2 = 0;
26804 
26805   /* "View.MemoryView":1015
26806  *     result = _memoryviewslice(None, 0, dtype_is_object)
26807  *
26808  *     result.from_slice = memviewslice             # <<<<<<<<<<<<<<
26809  *     __PYX_INC_MEMVIEW(&memviewslice, 1)
26810  *
26811  */
26812   __pyx_v_result->from_slice = __pyx_v_memviewslice;
26813 
26814   /* "View.MemoryView":1016
26815  *
26816  *     result.from_slice = memviewslice
26817  *     __PYX_INC_MEMVIEW(&memviewslice, 1)             # <<<<<<<<<<<<<<
26818  *
26819  *     result.from_object = (<memoryview> memviewslice.memview).base
26820  */
26821   __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
26822 
26823   /* "View.MemoryView":1018
26824  *     __PYX_INC_MEMVIEW(&memviewslice, 1)
26825  *
26826  *     result.from_object = (<memoryview> memviewslice.memview).base             # <<<<<<<<<<<<<<
26827  *     result.typeinfo = memviewslice.memview.typeinfo
26828  *
26829  */
26830   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
26831   __Pyx_GOTREF(__pyx_t_2);
26832   __Pyx_GIVEREF(__pyx_t_2);
26833   __Pyx_GOTREF(__pyx_v_result->from_object);
26834   __Pyx_DECREF(__pyx_v_result->from_object);
26835   __pyx_v_result->from_object = __pyx_t_2;
26836   __pyx_t_2 = 0;
26837 
26838   /* "View.MemoryView":1019
26839  *
26840  *     result.from_object = (<memoryview> memviewslice.memview).base
26841  *     result.typeinfo = memviewslice.memview.typeinfo             # <<<<<<<<<<<<<<
26842  *
26843  *     result.view = memviewslice.memview.view
26844  */
26845   __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
26846   __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
26847 
26848   /* "View.MemoryView":1021
26849  *     result.typeinfo = memviewslice.memview.typeinfo
26850  *
26851  *     result.view = memviewslice.memview.view             # <<<<<<<<<<<<<<
26852  *     result.view.buf = <void *> memviewslice.data
26853  *     result.view.ndim = ndim
26854  */
26855   __pyx_t_5 = __pyx_v_memviewslice.memview->view;
26856   __pyx_v_result->__pyx_base.view = __pyx_t_5;
26857 
26858   /* "View.MemoryView":1022
26859  *
26860  *     result.view = memviewslice.memview.view
26861  *     result.view.buf = <void *> memviewslice.data             # <<<<<<<<<<<<<<
26862  *     result.view.ndim = ndim
26863  *     (<__pyx_buffer *> &result.view).obj = Py_None
26864  */
26865   __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
26866 
26867   /* "View.MemoryView":1023
26868  *     result.view = memviewslice.memview.view
26869  *     result.view.buf = <void *> memviewslice.data
26870  *     result.view.ndim = ndim             # <<<<<<<<<<<<<<
26871  *     (<__pyx_buffer *> &result.view).obj = Py_None
26872  *     Py_INCREF(Py_None)
26873  */
26874   __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
26875 
26876   /* "View.MemoryView":1024
26877  *     result.view.buf = <void *> memviewslice.data
26878  *     result.view.ndim = ndim
26879  *     (<__pyx_buffer *> &result.view).obj = Py_None             # <<<<<<<<<<<<<<
26880  *     Py_INCREF(Py_None)
26881  *
26882  */
26883   ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
26884 
26885   /* "View.MemoryView":1025
26886  *     result.view.ndim = ndim
26887  *     (<__pyx_buffer *> &result.view).obj = Py_None
26888  *     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
26889  *
26890  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
26891  */
26892   Py_INCREF(Py_None);
26893 
26894   /* "View.MemoryView":1027
26895  *     Py_INCREF(Py_None)
26896  *
26897  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
26898  *         result.flags = PyBUF_RECORDS
26899  *     else:
26900  */
26901   __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
26902   if (__pyx_t_1) {
26903 
26904     /* "View.MemoryView":1028
26905  *
26906  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
26907  *         result.flags = PyBUF_RECORDS             # <<<<<<<<<<<<<<
26908  *     else:
26909  *         result.flags = PyBUF_RECORDS_RO
26910  */
26911     __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
26912 
26913     /* "View.MemoryView":1027
26914  *     Py_INCREF(Py_None)
26915  *
26916  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
26917  *         result.flags = PyBUF_RECORDS
26918  *     else:
26919  */
26920     goto __pyx_L4;
26921   }
26922 
26923   /* "View.MemoryView":1030
26924  *         result.flags = PyBUF_RECORDS
26925  *     else:
26926  *         result.flags = PyBUF_RECORDS_RO             # <<<<<<<<<<<<<<
26927  *
26928  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
26929  */
26930   /*else*/ {
26931     __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
26932   }
26933   __pyx_L4:;
26934 
26935   /* "View.MemoryView":1032
26936  *         result.flags = PyBUF_RECORDS_RO
26937  *
26938  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape             # <<<<<<<<<<<<<<
26939  *     result.view.strides = <Py_ssize_t *> result.from_slice.strides
26940  *
26941  */
26942   __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
26943 
26944   /* "View.MemoryView":1033
26945  *
26946  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
26947  *     result.view.strides = <Py_ssize_t *> result.from_slice.strides             # <<<<<<<<<<<<<<
26948  *
26949  *
26950  */
26951   __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
26952 
26953   /* "View.MemoryView":1036
26954  *
26955  *
26956  *     result.view.suboffsets = NULL             # <<<<<<<<<<<<<<
26957  *     for suboffset in result.from_slice.suboffsets[:ndim]:
26958  *         if suboffset >= 0:
26959  */
26960   __pyx_v_result->__pyx_base.view.suboffsets = NULL;
26961 
26962   /* "View.MemoryView":1037
26963  *
26964  *     result.view.suboffsets = NULL
26965  *     for suboffset in result.from_slice.suboffsets[:ndim]:             # <<<<<<<<<<<<<<
26966  *         if suboffset >= 0:
26967  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
26968  */
26969   __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
26970   for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
26971     __pyx_t_6 = __pyx_t_8;
26972     __pyx_v_suboffset = (__pyx_t_6[0]);
26973 
26974     /* "View.MemoryView":1038
26975  *     result.view.suboffsets = NULL
26976  *     for suboffset in result.from_slice.suboffsets[:ndim]:
26977  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
26978  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
26979  *             break
26980  */
26981     __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
26982     if (__pyx_t_1) {
26983 
26984       /* "View.MemoryView":1039
26985  *     for suboffset in result.from_slice.suboffsets[:ndim]:
26986  *         if suboffset >= 0:
26987  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets             # <<<<<<<<<<<<<<
26988  *             break
26989  *
26990  */
26991       __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
26992 
26993       /* "View.MemoryView":1040
26994  *         if suboffset >= 0:
26995  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
26996  *             break             # <<<<<<<<<<<<<<
26997  *
26998  *     result.view.len = result.view.itemsize
26999  */
27000       goto __pyx_L6_break;
27001 
27002       /* "View.MemoryView":1038
27003  *     result.view.suboffsets = NULL
27004  *     for suboffset in result.from_slice.suboffsets[:ndim]:
27005  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
27006  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
27007  *             break
27008  */
27009     }
27010   }
27011   __pyx_L6_break:;
27012 
27013   /* "View.MemoryView":1042
27014  *             break
27015  *
27016  *     result.view.len = result.view.itemsize             # <<<<<<<<<<<<<<
27017  *     for length in result.view.shape[:ndim]:
27018  *         result.view.len *= length
27019  */
27020   __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
27021   __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
27022 
27023   /* "View.MemoryView":1043
27024  *
27025  *     result.view.len = result.view.itemsize
27026  *     for length in result.view.shape[:ndim]:             # <<<<<<<<<<<<<<
27027  *         result.view.len *= length
27028  *
27029  */
27030   __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
27031   for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
27032     __pyx_t_6 = __pyx_t_8;
27033     __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
27034     __Pyx_GOTREF(__pyx_t_2);
27035     __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
27036     __pyx_t_2 = 0;
27037 
27038     /* "View.MemoryView":1044
27039  *     result.view.len = result.view.itemsize
27040  *     for length in result.view.shape[:ndim]:
27041  *         result.view.len *= length             # <<<<<<<<<<<<<<
27042  *
27043  *     result.to_object_func = to_object_func
27044  */
27045     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
27046     __Pyx_GOTREF(__pyx_t_2);
27047     __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
27048     __Pyx_GOTREF(__pyx_t_3);
27049     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27050     __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
27051     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27052     __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
27053   }
27054 
27055   /* "View.MemoryView":1046
27056  *         result.view.len *= length
27057  *
27058  *     result.to_object_func = to_object_func             # <<<<<<<<<<<<<<
27059  *     result.to_dtype_func = to_dtype_func
27060  *
27061  */
27062   __pyx_v_result->to_object_func = __pyx_v_to_object_func;
27063 
27064   /* "View.MemoryView":1047
27065  *
27066  *     result.to_object_func = to_object_func
27067  *     result.to_dtype_func = to_dtype_func             # <<<<<<<<<<<<<<
27068  *
27069  *     return result
27070  */
27071   __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
27072 
27073   /* "View.MemoryView":1049
27074  *     result.to_dtype_func = to_dtype_func
27075  *
27076  *     return result             # <<<<<<<<<<<<<<
27077  *
27078  * @cname('__pyx_memoryview_get_slice_from_memoryview')
27079  */
27080   __Pyx_XDECREF(__pyx_r);
27081   __Pyx_INCREF(((PyObject *)__pyx_v_result));
27082   __pyx_r = ((PyObject *)__pyx_v_result);
27083   goto __pyx_L0;
27084 
27085   /* "View.MemoryView":999
27086  *
27087  * @cname('__pyx_memoryview_fromslice')
27088  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
27089  *                           int ndim,
27090  *                           object (*to_object_func)(char *),
27091  */
27092 
27093   /* function exit code */
27094   __pyx_L1_error:;
27095   __Pyx_XDECREF(__pyx_t_2);
27096   __Pyx_XDECREF(__pyx_t_3);
27097   __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
27098   __pyx_r = 0;
27099   __pyx_L0:;
27100   __Pyx_XDECREF((PyObject *)__pyx_v_result);
27101   __Pyx_XDECREF(__pyx_v_length);
27102   __Pyx_XGIVEREF(__pyx_r);
27103   __Pyx_RefNannyFinishContext();
27104   return __pyx_r;
27105 }
27106 
27107 /* "View.MemoryView":1052
27108  *
27109  * @cname('__pyx_memoryview_get_slice_from_memoryview')
27110  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
27111  *                                                    __Pyx_memviewslice *mslice) except NULL:
27112  *     cdef _memoryviewslice obj
27113  */
27114 
__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_mslice)27115 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
27116   struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
27117   __Pyx_memviewslice *__pyx_r;
27118   __Pyx_RefNannyDeclarations
27119   int __pyx_t_1;
27120   int __pyx_t_2;
27121   PyObject *__pyx_t_3 = NULL;
27122   int __pyx_lineno = 0;
27123   const char *__pyx_filename = NULL;
27124   int __pyx_clineno = 0;
27125   __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
27126 
27127   /* "View.MemoryView":1055
27128  *                                                    __Pyx_memviewslice *mslice) except NULL:
27129  *     cdef _memoryviewslice obj
27130  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
27131  *         obj = memview
27132  *         return &obj.from_slice
27133  */
27134   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
27135   __pyx_t_2 = (__pyx_t_1 != 0);
27136   if (__pyx_t_2) {
27137 
27138     /* "View.MemoryView":1056
27139  *     cdef _memoryviewslice obj
27140  *     if isinstance(memview, _memoryviewslice):
27141  *         obj = memview             # <<<<<<<<<<<<<<
27142  *         return &obj.from_slice
27143  *     else:
27144  */
27145     if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
27146     __pyx_t_3 = ((PyObject *)__pyx_v_memview);
27147     __Pyx_INCREF(__pyx_t_3);
27148     __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
27149     __pyx_t_3 = 0;
27150 
27151     /* "View.MemoryView":1057
27152  *     if isinstance(memview, _memoryviewslice):
27153  *         obj = memview
27154  *         return &obj.from_slice             # <<<<<<<<<<<<<<
27155  *     else:
27156  *         slice_copy(memview, mslice)
27157  */
27158     __pyx_r = (&__pyx_v_obj->from_slice);
27159     goto __pyx_L0;
27160 
27161     /* "View.MemoryView":1055
27162  *                                                    __Pyx_memviewslice *mslice) except NULL:
27163  *     cdef _memoryviewslice obj
27164  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
27165  *         obj = memview
27166  *         return &obj.from_slice
27167  */
27168   }
27169 
27170   /* "View.MemoryView":1059
27171  *         return &obj.from_slice
27172  *     else:
27173  *         slice_copy(memview, mslice)             # <<<<<<<<<<<<<<
27174  *         return mslice
27175  *
27176  */
27177   /*else*/ {
27178     __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
27179 
27180     /* "View.MemoryView":1060
27181  *     else:
27182  *         slice_copy(memview, mslice)
27183  *         return mslice             # <<<<<<<<<<<<<<
27184  *
27185  * @cname('__pyx_memoryview_slice_copy')
27186  */
27187     __pyx_r = __pyx_v_mslice;
27188     goto __pyx_L0;
27189   }
27190 
27191   /* "View.MemoryView":1052
27192  *
27193  * @cname('__pyx_memoryview_get_slice_from_memoryview')
27194  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
27195  *                                                    __Pyx_memviewslice *mslice) except NULL:
27196  *     cdef _memoryviewslice obj
27197  */
27198 
27199   /* function exit code */
27200   __pyx_L1_error:;
27201   __Pyx_XDECREF(__pyx_t_3);
27202   __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
27203   __pyx_r = NULL;
27204   __pyx_L0:;
27205   __Pyx_XDECREF((PyObject *)__pyx_v_obj);
27206   __Pyx_RefNannyFinishContext();
27207   return __pyx_r;
27208 }
27209 
27210 /* "View.MemoryView":1063
27211  *
27212  * @cname('__pyx_memoryview_slice_copy')
27213  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
27214  *     cdef int dim
27215  *     cdef (Py_ssize_t*) shape, strides, suboffsets
27216  */
27217 
__pyx_memoryview_slice_copy(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_dst)27218 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
27219   int __pyx_v_dim;
27220   Py_ssize_t *__pyx_v_shape;
27221   Py_ssize_t *__pyx_v_strides;
27222   Py_ssize_t *__pyx_v_suboffsets;
27223   __Pyx_RefNannyDeclarations
27224   Py_ssize_t *__pyx_t_1;
27225   int __pyx_t_2;
27226   int __pyx_t_3;
27227   int __pyx_t_4;
27228   Py_ssize_t __pyx_t_5;
27229   __Pyx_RefNannySetupContext("slice_copy", 0);
27230 
27231   /* "View.MemoryView":1067
27232  *     cdef (Py_ssize_t*) shape, strides, suboffsets
27233  *
27234  *     shape = memview.view.shape             # <<<<<<<<<<<<<<
27235  *     strides = memview.view.strides
27236  *     suboffsets = memview.view.suboffsets
27237  */
27238   __pyx_t_1 = __pyx_v_memview->view.shape;
27239   __pyx_v_shape = __pyx_t_1;
27240 
27241   /* "View.MemoryView":1068
27242  *
27243  *     shape = memview.view.shape
27244  *     strides = memview.view.strides             # <<<<<<<<<<<<<<
27245  *     suboffsets = memview.view.suboffsets
27246  *
27247  */
27248   __pyx_t_1 = __pyx_v_memview->view.strides;
27249   __pyx_v_strides = __pyx_t_1;
27250 
27251   /* "View.MemoryView":1069
27252  *     shape = memview.view.shape
27253  *     strides = memview.view.strides
27254  *     suboffsets = memview.view.suboffsets             # <<<<<<<<<<<<<<
27255  *
27256  *     dst.memview = <__pyx_memoryview *> memview
27257  */
27258   __pyx_t_1 = __pyx_v_memview->view.suboffsets;
27259   __pyx_v_suboffsets = __pyx_t_1;
27260 
27261   /* "View.MemoryView":1071
27262  *     suboffsets = memview.view.suboffsets
27263  *
27264  *     dst.memview = <__pyx_memoryview *> memview             # <<<<<<<<<<<<<<
27265  *     dst.data = <char *> memview.view.buf
27266  *
27267  */
27268   __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
27269 
27270   /* "View.MemoryView":1072
27271  *
27272  *     dst.memview = <__pyx_memoryview *> memview
27273  *     dst.data = <char *> memview.view.buf             # <<<<<<<<<<<<<<
27274  *
27275  *     for dim in range(memview.view.ndim):
27276  */
27277   __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
27278 
27279   /* "View.MemoryView":1074
27280  *     dst.data = <char *> memview.view.buf
27281  *
27282  *     for dim in range(memview.view.ndim):             # <<<<<<<<<<<<<<
27283  *         dst.shape[dim] = shape[dim]
27284  *         dst.strides[dim] = strides[dim]
27285  */
27286   __pyx_t_2 = __pyx_v_memview->view.ndim;
27287   __pyx_t_3 = __pyx_t_2;
27288   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
27289     __pyx_v_dim = __pyx_t_4;
27290 
27291     /* "View.MemoryView":1075
27292  *
27293  *     for dim in range(memview.view.ndim):
27294  *         dst.shape[dim] = shape[dim]             # <<<<<<<<<<<<<<
27295  *         dst.strides[dim] = strides[dim]
27296  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
27297  */
27298     (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
27299 
27300     /* "View.MemoryView":1076
27301  *     for dim in range(memview.view.ndim):
27302  *         dst.shape[dim] = shape[dim]
27303  *         dst.strides[dim] = strides[dim]             # <<<<<<<<<<<<<<
27304  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
27305  *
27306  */
27307     (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
27308 
27309     /* "View.MemoryView":1077
27310  *         dst.shape[dim] = shape[dim]
27311  *         dst.strides[dim] = strides[dim]
27312  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1             # <<<<<<<<<<<<<<
27313  *
27314  * @cname('__pyx_memoryview_copy_object')
27315  */
27316     if ((__pyx_v_suboffsets != 0)) {
27317       __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
27318     } else {
27319       __pyx_t_5 = -1L;
27320     }
27321     (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
27322   }
27323 
27324   /* "View.MemoryView":1063
27325  *
27326  * @cname('__pyx_memoryview_slice_copy')
27327  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
27328  *     cdef int dim
27329  *     cdef (Py_ssize_t*) shape, strides, suboffsets
27330  */
27331 
27332   /* function exit code */
27333   __Pyx_RefNannyFinishContext();
27334 }
27335 
27336 /* "View.MemoryView":1080
27337  *
27338  * @cname('__pyx_memoryview_copy_object')
27339  * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
27340  *     "Create a new memoryview object"
27341  *     cdef __Pyx_memviewslice memviewslice
27342  */
27343 
__pyx_memoryview_copy_object(struct __pyx_memoryview_obj * __pyx_v_memview)27344 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
27345   __Pyx_memviewslice __pyx_v_memviewslice;
27346   PyObject *__pyx_r = NULL;
27347   __Pyx_RefNannyDeclarations
27348   PyObject *__pyx_t_1 = NULL;
27349   int __pyx_lineno = 0;
27350   const char *__pyx_filename = NULL;
27351   int __pyx_clineno = 0;
27352   __Pyx_RefNannySetupContext("memoryview_copy", 0);
27353 
27354   /* "View.MemoryView":1083
27355  *     "Create a new memoryview object"
27356  *     cdef __Pyx_memviewslice memviewslice
27357  *     slice_copy(memview, &memviewslice)             # <<<<<<<<<<<<<<
27358  *     return memoryview_copy_from_slice(memview, &memviewslice)
27359  *
27360  */
27361   __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
27362 
27363   /* "View.MemoryView":1084
27364  *     cdef __Pyx_memviewslice memviewslice
27365  *     slice_copy(memview, &memviewslice)
27366  *     return memoryview_copy_from_slice(memview, &memviewslice)             # <<<<<<<<<<<<<<
27367  *
27368  * @cname('__pyx_memoryview_copy_object_from_slice')
27369  */
27370   __Pyx_XDECREF(__pyx_r);
27371   __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
27372   __Pyx_GOTREF(__pyx_t_1);
27373   __pyx_r = __pyx_t_1;
27374   __pyx_t_1 = 0;
27375   goto __pyx_L0;
27376 
27377   /* "View.MemoryView":1080
27378  *
27379  * @cname('__pyx_memoryview_copy_object')
27380  * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
27381  *     "Create a new memoryview object"
27382  *     cdef __Pyx_memviewslice memviewslice
27383  */
27384 
27385   /* function exit code */
27386   __pyx_L1_error:;
27387   __Pyx_XDECREF(__pyx_t_1);
27388   __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
27389   __pyx_r = 0;
27390   __pyx_L0:;
27391   __Pyx_XGIVEREF(__pyx_r);
27392   __Pyx_RefNannyFinishContext();
27393   return __pyx_r;
27394 }
27395 
27396 /* "View.MemoryView":1087
27397  *
27398  * @cname('__pyx_memoryview_copy_object_from_slice')
27399  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
27400  *     """
27401  *     Create a new memoryview object from a given memoryview object and slice.
27402  */
27403 
__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_memviewslice)27404 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
27405   PyObject *(*__pyx_v_to_object_func)(char *);
27406   int (*__pyx_v_to_dtype_func)(char *, PyObject *);
27407   PyObject *__pyx_r = NULL;
27408   __Pyx_RefNannyDeclarations
27409   int __pyx_t_1;
27410   int __pyx_t_2;
27411   PyObject *(*__pyx_t_3)(char *);
27412   int (*__pyx_t_4)(char *, PyObject *);
27413   PyObject *__pyx_t_5 = NULL;
27414   int __pyx_lineno = 0;
27415   const char *__pyx_filename = NULL;
27416   int __pyx_clineno = 0;
27417   __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
27418 
27419   /* "View.MemoryView":1094
27420  *     cdef int (*to_dtype_func)(char *, object) except 0
27421  *
27422  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
27423  *         to_object_func = (<_memoryviewslice> memview).to_object_func
27424  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
27425  */
27426   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
27427   __pyx_t_2 = (__pyx_t_1 != 0);
27428   if (__pyx_t_2) {
27429 
27430     /* "View.MemoryView":1095
27431  *
27432  *     if isinstance(memview, _memoryviewslice):
27433  *         to_object_func = (<_memoryviewslice> memview).to_object_func             # <<<<<<<<<<<<<<
27434  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
27435  *     else:
27436  */
27437     __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
27438     __pyx_v_to_object_func = __pyx_t_3;
27439 
27440     /* "View.MemoryView":1096
27441  *     if isinstance(memview, _memoryviewslice):
27442  *         to_object_func = (<_memoryviewslice> memview).to_object_func
27443  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func             # <<<<<<<<<<<<<<
27444  *     else:
27445  *         to_object_func = NULL
27446  */
27447     __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
27448     __pyx_v_to_dtype_func = __pyx_t_4;
27449 
27450     /* "View.MemoryView":1094
27451  *     cdef int (*to_dtype_func)(char *, object) except 0
27452  *
27453  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
27454  *         to_object_func = (<_memoryviewslice> memview).to_object_func
27455  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
27456  */
27457     goto __pyx_L3;
27458   }
27459 
27460   /* "View.MemoryView":1098
27461  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
27462  *     else:
27463  *         to_object_func = NULL             # <<<<<<<<<<<<<<
27464  *         to_dtype_func = NULL
27465  *
27466  */
27467   /*else*/ {
27468     __pyx_v_to_object_func = NULL;
27469 
27470     /* "View.MemoryView":1099
27471  *     else:
27472  *         to_object_func = NULL
27473  *         to_dtype_func = NULL             # <<<<<<<<<<<<<<
27474  *
27475  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
27476  */
27477     __pyx_v_to_dtype_func = NULL;
27478   }
27479   __pyx_L3:;
27480 
27481   /* "View.MemoryView":1101
27482  *         to_dtype_func = NULL
27483  *
27484  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,             # <<<<<<<<<<<<<<
27485  *                                 to_object_func, to_dtype_func,
27486  *                                 memview.dtype_is_object)
27487  */
27488   __Pyx_XDECREF(__pyx_r);
27489 
27490   /* "View.MemoryView":1103
27491  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
27492  *                                 to_object_func, to_dtype_func,
27493  *                                 memview.dtype_is_object)             # <<<<<<<<<<<<<<
27494  *
27495  *
27496  */
27497   __pyx_t_5 = __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_5)) __PYX_ERR(1, 1101, __pyx_L1_error)
27498   __Pyx_GOTREF(__pyx_t_5);
27499   __pyx_r = __pyx_t_5;
27500   __pyx_t_5 = 0;
27501   goto __pyx_L0;
27502 
27503   /* "View.MemoryView":1087
27504  *
27505  * @cname('__pyx_memoryview_copy_object_from_slice')
27506  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
27507  *     """
27508  *     Create a new memoryview object from a given memoryview object and slice.
27509  */
27510 
27511   /* function exit code */
27512   __pyx_L1_error:;
27513   __Pyx_XDECREF(__pyx_t_5);
27514   __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
27515   __pyx_r = 0;
27516   __pyx_L0:;
27517   __Pyx_XGIVEREF(__pyx_r);
27518   __Pyx_RefNannyFinishContext();
27519   return __pyx_r;
27520 }
27521 
27522 /* "View.MemoryView":1109
27523  *
27524  *
27525  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
27526  *     if arg < 0:
27527  *         return -arg
27528  */
27529 
abs_py_ssize_t(Py_ssize_t __pyx_v_arg)27530 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
27531   Py_ssize_t __pyx_r;
27532   int __pyx_t_1;
27533 
27534   /* "View.MemoryView":1110
27535  *
27536  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
27537  *     if arg < 0:             # <<<<<<<<<<<<<<
27538  *         return -arg
27539  *     else:
27540  */
27541   __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
27542   if (__pyx_t_1) {
27543 
27544     /* "View.MemoryView":1111
27545  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
27546  *     if arg < 0:
27547  *         return -arg             # <<<<<<<<<<<<<<
27548  *     else:
27549  *         return arg
27550  */
27551     __pyx_r = (-__pyx_v_arg);
27552     goto __pyx_L0;
27553 
27554     /* "View.MemoryView":1110
27555  *
27556  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
27557  *     if arg < 0:             # <<<<<<<<<<<<<<
27558  *         return -arg
27559  *     else:
27560  */
27561   }
27562 
27563   /* "View.MemoryView":1113
27564  *         return -arg
27565  *     else:
27566  *         return arg             # <<<<<<<<<<<<<<
27567  *
27568  * @cname('__pyx_get_best_slice_order')
27569  */
27570   /*else*/ {
27571     __pyx_r = __pyx_v_arg;
27572     goto __pyx_L0;
27573   }
27574 
27575   /* "View.MemoryView":1109
27576  *
27577  *
27578  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
27579  *     if arg < 0:
27580  *         return -arg
27581  */
27582 
27583   /* function exit code */
27584   __pyx_L0:;
27585   return __pyx_r;
27586 }
27587 
27588 /* "View.MemoryView":1116
27589  *
27590  * @cname('__pyx_get_best_slice_order')
27591  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
27592  *     """
27593  *     Figure out the best memory access order for a given slice.
27594  */
27595 
__pyx_get_best_slice_order(__Pyx_memviewslice * __pyx_v_mslice,int __pyx_v_ndim)27596 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
27597   int __pyx_v_i;
27598   Py_ssize_t __pyx_v_c_stride;
27599   Py_ssize_t __pyx_v_f_stride;
27600   char __pyx_r;
27601   int __pyx_t_1;
27602   int __pyx_t_2;
27603   int __pyx_t_3;
27604   int __pyx_t_4;
27605 
27606   /* "View.MemoryView":1121
27607  *     """
27608  *     cdef int i
27609  *     cdef Py_ssize_t c_stride = 0             # <<<<<<<<<<<<<<
27610  *     cdef Py_ssize_t f_stride = 0
27611  *
27612  */
27613   __pyx_v_c_stride = 0;
27614 
27615   /* "View.MemoryView":1122
27616  *     cdef int i
27617  *     cdef Py_ssize_t c_stride = 0
27618  *     cdef Py_ssize_t f_stride = 0             # <<<<<<<<<<<<<<
27619  *
27620  *     for i in range(ndim - 1, -1, -1):
27621  */
27622   __pyx_v_f_stride = 0;
27623 
27624   /* "View.MemoryView":1124
27625  *     cdef Py_ssize_t f_stride = 0
27626  *
27627  *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
27628  *         if mslice.shape[i] > 1:
27629  *             c_stride = mslice.strides[i]
27630  */
27631   for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
27632     __pyx_v_i = __pyx_t_1;
27633 
27634     /* "View.MemoryView":1125
27635  *
27636  *     for i in range(ndim - 1, -1, -1):
27637  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
27638  *             c_stride = mslice.strides[i]
27639  *             break
27640  */
27641     __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
27642     if (__pyx_t_2) {
27643 
27644       /* "View.MemoryView":1126
27645  *     for i in range(ndim - 1, -1, -1):
27646  *         if mslice.shape[i] > 1:
27647  *             c_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
27648  *             break
27649  *
27650  */
27651       __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
27652 
27653       /* "View.MemoryView":1127
27654  *         if mslice.shape[i] > 1:
27655  *             c_stride = mslice.strides[i]
27656  *             break             # <<<<<<<<<<<<<<
27657  *
27658  *     for i in range(ndim):
27659  */
27660       goto __pyx_L4_break;
27661 
27662       /* "View.MemoryView":1125
27663  *
27664  *     for i in range(ndim - 1, -1, -1):
27665  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
27666  *             c_stride = mslice.strides[i]
27667  *             break
27668  */
27669     }
27670   }
27671   __pyx_L4_break:;
27672 
27673   /* "View.MemoryView":1129
27674  *             break
27675  *
27676  *     for i in range(ndim):             # <<<<<<<<<<<<<<
27677  *         if mslice.shape[i] > 1:
27678  *             f_stride = mslice.strides[i]
27679  */
27680   __pyx_t_1 = __pyx_v_ndim;
27681   __pyx_t_3 = __pyx_t_1;
27682   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
27683     __pyx_v_i = __pyx_t_4;
27684 
27685     /* "View.MemoryView":1130
27686  *
27687  *     for i in range(ndim):
27688  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
27689  *             f_stride = mslice.strides[i]
27690  *             break
27691  */
27692     __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
27693     if (__pyx_t_2) {
27694 
27695       /* "View.MemoryView":1131
27696  *     for i in range(ndim):
27697  *         if mslice.shape[i] > 1:
27698  *             f_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
27699  *             break
27700  *
27701  */
27702       __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
27703 
27704       /* "View.MemoryView":1132
27705  *         if mslice.shape[i] > 1:
27706  *             f_stride = mslice.strides[i]
27707  *             break             # <<<<<<<<<<<<<<
27708  *
27709  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
27710  */
27711       goto __pyx_L7_break;
27712 
27713       /* "View.MemoryView":1130
27714  *
27715  *     for i in range(ndim):
27716  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
27717  *             f_stride = mslice.strides[i]
27718  *             break
27719  */
27720     }
27721   }
27722   __pyx_L7_break:;
27723 
27724   /* "View.MemoryView":1134
27725  *             break
27726  *
27727  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
27728  *         return 'C'
27729  *     else:
27730  */
27731   __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
27732   if (__pyx_t_2) {
27733 
27734     /* "View.MemoryView":1135
27735  *
27736  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
27737  *         return 'C'             # <<<<<<<<<<<<<<
27738  *     else:
27739  *         return 'F'
27740  */
27741     __pyx_r = 'C';
27742     goto __pyx_L0;
27743 
27744     /* "View.MemoryView":1134
27745  *             break
27746  *
27747  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
27748  *         return 'C'
27749  *     else:
27750  */
27751   }
27752 
27753   /* "View.MemoryView":1137
27754  *         return 'C'
27755  *     else:
27756  *         return 'F'             # <<<<<<<<<<<<<<
27757  *
27758  * @cython.cdivision(True)
27759  */
27760   /*else*/ {
27761     __pyx_r = 'F';
27762     goto __pyx_L0;
27763   }
27764 
27765   /* "View.MemoryView":1116
27766  *
27767  * @cname('__pyx_get_best_slice_order')
27768  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
27769  *     """
27770  *     Figure out the best memory access order for a given slice.
27771  */
27772 
27773   /* function exit code */
27774   __pyx_L0:;
27775   return __pyx_r;
27776 }
27777 
27778 /* "View.MemoryView":1140
27779  *
27780  * @cython.cdivision(True)
27781  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
27782  *                                    char *dst_data, Py_ssize_t *dst_strides,
27783  *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
27784  */
27785 
_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)27786 static 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) {
27787   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
27788   CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
27789   Py_ssize_t __pyx_v_dst_extent;
27790   Py_ssize_t __pyx_v_src_stride;
27791   Py_ssize_t __pyx_v_dst_stride;
27792   int __pyx_t_1;
27793   int __pyx_t_2;
27794   int __pyx_t_3;
27795   Py_ssize_t __pyx_t_4;
27796   Py_ssize_t __pyx_t_5;
27797   Py_ssize_t __pyx_t_6;
27798 
27799   /* "View.MemoryView":1147
27800  *
27801  *     cdef Py_ssize_t i
27802  *     cdef Py_ssize_t src_extent = src_shape[0]             # <<<<<<<<<<<<<<
27803  *     cdef Py_ssize_t dst_extent = dst_shape[0]
27804  *     cdef Py_ssize_t src_stride = src_strides[0]
27805  */
27806   __pyx_v_src_extent = (__pyx_v_src_shape[0]);
27807 
27808   /* "View.MemoryView":1148
27809  *     cdef Py_ssize_t i
27810  *     cdef Py_ssize_t src_extent = src_shape[0]
27811  *     cdef Py_ssize_t dst_extent = dst_shape[0]             # <<<<<<<<<<<<<<
27812  *     cdef Py_ssize_t src_stride = src_strides[0]
27813  *     cdef Py_ssize_t dst_stride = dst_strides[0]
27814  */
27815   __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
27816 
27817   /* "View.MemoryView":1149
27818  *     cdef Py_ssize_t src_extent = src_shape[0]
27819  *     cdef Py_ssize_t dst_extent = dst_shape[0]
27820  *     cdef Py_ssize_t src_stride = src_strides[0]             # <<<<<<<<<<<<<<
27821  *     cdef Py_ssize_t dst_stride = dst_strides[0]
27822  *
27823  */
27824   __pyx_v_src_stride = (__pyx_v_src_strides[0]);
27825 
27826   /* "View.MemoryView":1150
27827  *     cdef Py_ssize_t dst_extent = dst_shape[0]
27828  *     cdef Py_ssize_t src_stride = src_strides[0]
27829  *     cdef Py_ssize_t dst_stride = dst_strides[0]             # <<<<<<<<<<<<<<
27830  *
27831  *     if ndim == 1:
27832  */
27833   __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
27834 
27835   /* "View.MemoryView":1152
27836  *     cdef Py_ssize_t dst_stride = dst_strides[0]
27837  *
27838  *     if ndim == 1:             # <<<<<<<<<<<<<<
27839  *        if (src_stride > 0 and dst_stride > 0 and
27840  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
27841  */
27842   __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
27843   if (__pyx_t_1) {
27844 
27845     /* "View.MemoryView":1153
27846  *
27847  *     if ndim == 1:
27848  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
27849  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
27850  *            memcpy(dst_data, src_data, itemsize * dst_extent)
27851  */
27852     __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
27853     if (__pyx_t_2) {
27854     } else {
27855       __pyx_t_1 = __pyx_t_2;
27856       goto __pyx_L5_bool_binop_done;
27857     }
27858     __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
27859     if (__pyx_t_2) {
27860     } else {
27861       __pyx_t_1 = __pyx_t_2;
27862       goto __pyx_L5_bool_binop_done;
27863     }
27864 
27865     /* "View.MemoryView":1154
27866  *     if ndim == 1:
27867  *        if (src_stride > 0 and dst_stride > 0 and
27868  *            <size_t> src_stride == itemsize == <size_t> dst_stride):             # <<<<<<<<<<<<<<
27869  *            memcpy(dst_data, src_data, itemsize * dst_extent)
27870  *        else:
27871  */
27872     __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
27873     if (__pyx_t_2) {
27874       __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
27875     }
27876     __pyx_t_3 = (__pyx_t_2 != 0);
27877     __pyx_t_1 = __pyx_t_3;
27878     __pyx_L5_bool_binop_done:;
27879 
27880     /* "View.MemoryView":1153
27881  *
27882  *     if ndim == 1:
27883  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
27884  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
27885  *            memcpy(dst_data, src_data, itemsize * dst_extent)
27886  */
27887     if (__pyx_t_1) {
27888 
27889       /* "View.MemoryView":1155
27890  *        if (src_stride > 0 and dst_stride > 0 and
27891  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
27892  *            memcpy(dst_data, src_data, itemsize * dst_extent)             # <<<<<<<<<<<<<<
27893  *        else:
27894  *            for i in range(dst_extent):
27895  */
27896       (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
27897 
27898       /* "View.MemoryView":1153
27899  *
27900  *     if ndim == 1:
27901  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
27902  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
27903  *            memcpy(dst_data, src_data, itemsize * dst_extent)
27904  */
27905       goto __pyx_L4;
27906     }
27907 
27908     /* "View.MemoryView":1157
27909  *            memcpy(dst_data, src_data, itemsize * dst_extent)
27910  *        else:
27911  *            for i in range(dst_extent):             # <<<<<<<<<<<<<<
27912  *                memcpy(dst_data, src_data, itemsize)
27913  *                src_data += src_stride
27914  */
27915     /*else*/ {
27916       __pyx_t_4 = __pyx_v_dst_extent;
27917       __pyx_t_5 = __pyx_t_4;
27918       for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
27919         __pyx_v_i = __pyx_t_6;
27920 
27921         /* "View.MemoryView":1158
27922  *        else:
27923  *            for i in range(dst_extent):
27924  *                memcpy(dst_data, src_data, itemsize)             # <<<<<<<<<<<<<<
27925  *                src_data += src_stride
27926  *                dst_data += dst_stride
27927  */
27928         (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
27929 
27930         /* "View.MemoryView":1159
27931  *            for i in range(dst_extent):
27932  *                memcpy(dst_data, src_data, itemsize)
27933  *                src_data += src_stride             # <<<<<<<<<<<<<<
27934  *                dst_data += dst_stride
27935  *     else:
27936  */
27937         __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
27938 
27939         /* "View.MemoryView":1160
27940  *                memcpy(dst_data, src_data, itemsize)
27941  *                src_data += src_stride
27942  *                dst_data += dst_stride             # <<<<<<<<<<<<<<
27943  *     else:
27944  *         for i in range(dst_extent):
27945  */
27946         __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
27947       }
27948     }
27949     __pyx_L4:;
27950 
27951     /* "View.MemoryView":1152
27952  *     cdef Py_ssize_t dst_stride = dst_strides[0]
27953  *
27954  *     if ndim == 1:             # <<<<<<<<<<<<<<
27955  *        if (src_stride > 0 and dst_stride > 0 and
27956  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
27957  */
27958     goto __pyx_L3;
27959   }
27960 
27961   /* "View.MemoryView":1162
27962  *                dst_data += dst_stride
27963  *     else:
27964  *         for i in range(dst_extent):             # <<<<<<<<<<<<<<
27965  *             _copy_strided_to_strided(src_data, src_strides + 1,
27966  *                                      dst_data, dst_strides + 1,
27967  */
27968   /*else*/ {
27969     __pyx_t_4 = __pyx_v_dst_extent;
27970     __pyx_t_5 = __pyx_t_4;
27971     for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
27972       __pyx_v_i = __pyx_t_6;
27973 
27974       /* "View.MemoryView":1163
27975  *     else:
27976  *         for i in range(dst_extent):
27977  *             _copy_strided_to_strided(src_data, src_strides + 1,             # <<<<<<<<<<<<<<
27978  *                                      dst_data, dst_strides + 1,
27979  *                                      src_shape + 1, dst_shape + 1,
27980  */
27981       _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);
27982 
27983       /* "View.MemoryView":1167
27984  *                                      src_shape + 1, dst_shape + 1,
27985  *                                      ndim - 1, itemsize)
27986  *             src_data += src_stride             # <<<<<<<<<<<<<<
27987  *             dst_data += dst_stride
27988  *
27989  */
27990       __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
27991 
27992       /* "View.MemoryView":1168
27993  *                                      ndim - 1, itemsize)
27994  *             src_data += src_stride
27995  *             dst_data += dst_stride             # <<<<<<<<<<<<<<
27996  *
27997  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
27998  */
27999       __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
28000     }
28001   }
28002   __pyx_L3:;
28003 
28004   /* "View.MemoryView":1140
28005  *
28006  * @cython.cdivision(True)
28007  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
28008  *                                    char *dst_data, Py_ssize_t *dst_strides,
28009  *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
28010  */
28011 
28012   /* function exit code */
28013 }
28014 
28015 /* "View.MemoryView":1170
28016  *             dst_data += dst_stride
28017  *
28018  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
28019  *                                   __Pyx_memviewslice *dst,
28020  *                                   int ndim, size_t itemsize) nogil:
28021  */
28022 
copy_strided_to_strided(__Pyx_memviewslice * __pyx_v_src,__Pyx_memviewslice * __pyx_v_dst,int __pyx_v_ndim,size_t __pyx_v_itemsize)28023 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
28024 
28025   /* "View.MemoryView":1173
28026  *                                   __Pyx_memviewslice *dst,
28027  *                                   int ndim, size_t itemsize) nogil:
28028  *     _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides,             # <<<<<<<<<<<<<<
28029  *                              src.shape, dst.shape, ndim, itemsize)
28030  *
28031  */
28032   _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);
28033 
28034   /* "View.MemoryView":1170
28035  *             dst_data += dst_stride
28036  *
28037  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
28038  *                                   __Pyx_memviewslice *dst,
28039  *                                   int ndim, size_t itemsize) nogil:
28040  */
28041 
28042   /* function exit code */
28043 }
28044 
28045 /* "View.MemoryView":1177
28046  *
28047  * @cname('__pyx_memoryview_slice_get_size')
28048  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
28049  *     "Return the size of the memory occupied by the slice in number of bytes"
28050  *     cdef Py_ssize_t shape, size = src.memview.view.itemsize
28051  */
28052 
__pyx_memoryview_slice_get_size(__Pyx_memviewslice * __pyx_v_src,int __pyx_v_ndim)28053 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
28054   Py_ssize_t __pyx_v_shape;
28055   Py_ssize_t __pyx_v_size;
28056   Py_ssize_t __pyx_r;
28057   Py_ssize_t __pyx_t_1;
28058   Py_ssize_t *__pyx_t_2;
28059   Py_ssize_t *__pyx_t_3;
28060   Py_ssize_t *__pyx_t_4;
28061 
28062   /* "View.MemoryView":1179
28063  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
28064  *     "Return the size of the memory occupied by the slice in number of bytes"
28065  *     cdef Py_ssize_t shape, size = src.memview.view.itemsize             # <<<<<<<<<<<<<<
28066  *
28067  *     for shape in src.shape[:ndim]:
28068  */
28069   __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
28070   __pyx_v_size = __pyx_t_1;
28071 
28072   /* "View.MemoryView":1181
28073  *     cdef Py_ssize_t shape, size = src.memview.view.itemsize
28074  *
28075  *     for shape in src.shape[:ndim]:             # <<<<<<<<<<<<<<
28076  *         size *= shape
28077  *
28078  */
28079   __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
28080   for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
28081     __pyx_t_2 = __pyx_t_4;
28082     __pyx_v_shape = (__pyx_t_2[0]);
28083 
28084     /* "View.MemoryView":1182
28085  *
28086  *     for shape in src.shape[:ndim]:
28087  *         size *= shape             # <<<<<<<<<<<<<<
28088  *
28089  *     return size
28090  */
28091     __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
28092   }
28093 
28094   /* "View.MemoryView":1184
28095  *         size *= shape
28096  *
28097  *     return size             # <<<<<<<<<<<<<<
28098  *
28099  * @cname('__pyx_fill_contig_strides_array')
28100  */
28101   __pyx_r = __pyx_v_size;
28102   goto __pyx_L0;
28103 
28104   /* "View.MemoryView":1177
28105  *
28106  * @cname('__pyx_memoryview_slice_get_size')
28107  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
28108  *     "Return the size of the memory occupied by the slice in number of bytes"
28109  *     cdef Py_ssize_t shape, size = src.memview.view.itemsize
28110  */
28111 
28112   /* function exit code */
28113   __pyx_L0:;
28114   return __pyx_r;
28115 }
28116 
28117 /* "View.MemoryView":1187
28118  *
28119  * @cname('__pyx_fill_contig_strides_array')
28120  * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
28121  *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
28122  *                 int ndim, char order) nogil:
28123  */
28124 
__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)28125 static 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) {
28126   int __pyx_v_idx;
28127   Py_ssize_t __pyx_r;
28128   int __pyx_t_1;
28129   int __pyx_t_2;
28130   int __pyx_t_3;
28131   int __pyx_t_4;
28132 
28133   /* "View.MemoryView":1196
28134  *     cdef int idx
28135  *
28136  *     if order == 'F':             # <<<<<<<<<<<<<<
28137  *         for idx in range(ndim):
28138  *             strides[idx] = stride
28139  */
28140   __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
28141   if (__pyx_t_1) {
28142 
28143     /* "View.MemoryView":1197
28144  *
28145  *     if order == 'F':
28146  *         for idx in range(ndim):             # <<<<<<<<<<<<<<
28147  *             strides[idx] = stride
28148  *             stride *= shape[idx]
28149  */
28150     __pyx_t_2 = __pyx_v_ndim;
28151     __pyx_t_3 = __pyx_t_2;
28152     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
28153       __pyx_v_idx = __pyx_t_4;
28154 
28155       /* "View.MemoryView":1198
28156  *     if order == 'F':
28157  *         for idx in range(ndim):
28158  *             strides[idx] = stride             # <<<<<<<<<<<<<<
28159  *             stride *= shape[idx]
28160  *     else:
28161  */
28162       (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
28163 
28164       /* "View.MemoryView":1199
28165  *         for idx in range(ndim):
28166  *             strides[idx] = stride
28167  *             stride *= shape[idx]             # <<<<<<<<<<<<<<
28168  *     else:
28169  *         for idx in range(ndim - 1, -1, -1):
28170  */
28171       __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
28172     }
28173 
28174     /* "View.MemoryView":1196
28175  *     cdef int idx
28176  *
28177  *     if order == 'F':             # <<<<<<<<<<<<<<
28178  *         for idx in range(ndim):
28179  *             strides[idx] = stride
28180  */
28181     goto __pyx_L3;
28182   }
28183 
28184   /* "View.MemoryView":1201
28185  *             stride *= shape[idx]
28186  *     else:
28187  *         for idx in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
28188  *             strides[idx] = stride
28189  *             stride *= shape[idx]
28190  */
28191   /*else*/ {
28192     for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
28193       __pyx_v_idx = __pyx_t_2;
28194 
28195       /* "View.MemoryView":1202
28196  *     else:
28197  *         for idx in range(ndim - 1, -1, -1):
28198  *             strides[idx] = stride             # <<<<<<<<<<<<<<
28199  *             stride *= shape[idx]
28200  *
28201  */
28202       (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
28203 
28204       /* "View.MemoryView":1203
28205  *         for idx in range(ndim - 1, -1, -1):
28206  *             strides[idx] = stride
28207  *             stride *= shape[idx]             # <<<<<<<<<<<<<<
28208  *
28209  *     return stride
28210  */
28211       __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
28212     }
28213   }
28214   __pyx_L3:;
28215 
28216   /* "View.MemoryView":1205
28217  *             stride *= shape[idx]
28218  *
28219  *     return stride             # <<<<<<<<<<<<<<
28220  *
28221  * @cname('__pyx_memoryview_copy_data_to_temp')
28222  */
28223   __pyx_r = __pyx_v_stride;
28224   goto __pyx_L0;
28225 
28226   /* "View.MemoryView":1187
28227  *
28228  * @cname('__pyx_fill_contig_strides_array')
28229  * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
28230  *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
28231  *                 int ndim, char order) nogil:
28232  */
28233 
28234   /* function exit code */
28235   __pyx_L0:;
28236   return __pyx_r;
28237 }
28238 
28239 /* "View.MemoryView":1208
28240  *
28241  * @cname('__pyx_memoryview_copy_data_to_temp')
28242  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
28243  *                              __Pyx_memviewslice *tmpslice,
28244  *                              char order,
28245  */
28246 
__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice * __pyx_v_src,__Pyx_memviewslice * __pyx_v_tmpslice,char __pyx_v_order,int __pyx_v_ndim)28247 static 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) {
28248   int __pyx_v_i;
28249   void *__pyx_v_result;
28250   size_t __pyx_v_itemsize;
28251   size_t __pyx_v_size;
28252   void *__pyx_r;
28253   Py_ssize_t __pyx_t_1;
28254   int __pyx_t_2;
28255   int __pyx_t_3;
28256   struct __pyx_memoryview_obj *__pyx_t_4;
28257   int __pyx_t_5;
28258   int __pyx_t_6;
28259   int __pyx_lineno = 0;
28260   const char *__pyx_filename = NULL;
28261   int __pyx_clineno = 0;
28262 
28263   /* "View.MemoryView":1219
28264  *     cdef void *result
28265  *
28266  *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
28267  *     cdef size_t size = slice_get_size(src, ndim)
28268  *
28269  */
28270   __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
28271   __pyx_v_itemsize = __pyx_t_1;
28272 
28273   /* "View.MemoryView":1220
28274  *
28275  *     cdef size_t itemsize = src.memview.view.itemsize
28276  *     cdef size_t size = slice_get_size(src, ndim)             # <<<<<<<<<<<<<<
28277  *
28278  *     result = malloc(size)
28279  */
28280   __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
28281 
28282   /* "View.MemoryView":1222
28283  *     cdef size_t size = slice_get_size(src, ndim)
28284  *
28285  *     result = malloc(size)             # <<<<<<<<<<<<<<
28286  *     if not result:
28287  *         _err(MemoryError, NULL)
28288  */
28289   __pyx_v_result = malloc(__pyx_v_size);
28290 
28291   /* "View.MemoryView":1223
28292  *
28293  *     result = malloc(size)
28294  *     if not result:             # <<<<<<<<<<<<<<
28295  *         _err(MemoryError, NULL)
28296  *
28297  */
28298   __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
28299   if (__pyx_t_2) {
28300 
28301     /* "View.MemoryView":1224
28302  *     result = malloc(size)
28303  *     if not result:
28304  *         _err(MemoryError, NULL)             # <<<<<<<<<<<<<<
28305  *
28306  *
28307  */
28308     __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error)
28309 
28310     /* "View.MemoryView":1223
28311  *
28312  *     result = malloc(size)
28313  *     if not result:             # <<<<<<<<<<<<<<
28314  *         _err(MemoryError, NULL)
28315  *
28316  */
28317   }
28318 
28319   /* "View.MemoryView":1227
28320  *
28321  *
28322  *     tmpslice.data = <char *> result             # <<<<<<<<<<<<<<
28323  *     tmpslice.memview = src.memview
28324  *     for i in range(ndim):
28325  */
28326   __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
28327 
28328   /* "View.MemoryView":1228
28329  *
28330  *     tmpslice.data = <char *> result
28331  *     tmpslice.memview = src.memview             # <<<<<<<<<<<<<<
28332  *     for i in range(ndim):
28333  *         tmpslice.shape[i] = src.shape[i]
28334  */
28335   __pyx_t_4 = __pyx_v_src->memview;
28336   __pyx_v_tmpslice->memview = __pyx_t_4;
28337 
28338   /* "View.MemoryView":1229
28339  *     tmpslice.data = <char *> result
28340  *     tmpslice.memview = src.memview
28341  *     for i in range(ndim):             # <<<<<<<<<<<<<<
28342  *         tmpslice.shape[i] = src.shape[i]
28343  *         tmpslice.suboffsets[i] = -1
28344  */
28345   __pyx_t_3 = __pyx_v_ndim;
28346   __pyx_t_5 = __pyx_t_3;
28347   for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
28348     __pyx_v_i = __pyx_t_6;
28349 
28350     /* "View.MemoryView":1230
28351  *     tmpslice.memview = src.memview
28352  *     for i in range(ndim):
28353  *         tmpslice.shape[i] = src.shape[i]             # <<<<<<<<<<<<<<
28354  *         tmpslice.suboffsets[i] = -1
28355  *
28356  */
28357     (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
28358 
28359     /* "View.MemoryView":1231
28360  *     for i in range(ndim):
28361  *         tmpslice.shape[i] = src.shape[i]
28362  *         tmpslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
28363  *
28364  *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
28365  */
28366     (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
28367   }
28368 
28369   /* "View.MemoryView":1233
28370  *         tmpslice.suboffsets[i] = -1
28371  *
28372  *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,             # <<<<<<<<<<<<<<
28373  *                               ndim, order)
28374  *
28375  */
28376   (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
28377 
28378   /* "View.MemoryView":1237
28379  *
28380  *
28381  *     for i in range(ndim):             # <<<<<<<<<<<<<<
28382  *         if tmpslice.shape[i] == 1:
28383  *             tmpslice.strides[i] = 0
28384  */
28385   __pyx_t_3 = __pyx_v_ndim;
28386   __pyx_t_5 = __pyx_t_3;
28387   for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
28388     __pyx_v_i = __pyx_t_6;
28389 
28390     /* "View.MemoryView":1238
28391  *
28392  *     for i in range(ndim):
28393  *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
28394  *             tmpslice.strides[i] = 0
28395  *
28396  */
28397     __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
28398     if (__pyx_t_2) {
28399 
28400       /* "View.MemoryView":1239
28401  *     for i in range(ndim):
28402  *         if tmpslice.shape[i] == 1:
28403  *             tmpslice.strides[i] = 0             # <<<<<<<<<<<<<<
28404  *
28405  *     if slice_is_contig(src[0], order, ndim):
28406  */
28407       (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
28408 
28409       /* "View.MemoryView":1238
28410  *
28411  *     for i in range(ndim):
28412  *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
28413  *             tmpslice.strides[i] = 0
28414  *
28415  */
28416     }
28417   }
28418 
28419   /* "View.MemoryView":1241
28420  *             tmpslice.strides[i] = 0
28421  *
28422  *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
28423  *         memcpy(result, src.data, size)
28424  *     else:
28425  */
28426   __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
28427   if (__pyx_t_2) {
28428 
28429     /* "View.MemoryView":1242
28430  *
28431  *     if slice_is_contig(src[0], order, ndim):
28432  *         memcpy(result, src.data, size)             # <<<<<<<<<<<<<<
28433  *     else:
28434  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
28435  */
28436     (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
28437 
28438     /* "View.MemoryView":1241
28439  *             tmpslice.strides[i] = 0
28440  *
28441  *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
28442  *         memcpy(result, src.data, size)
28443  *     else:
28444  */
28445     goto __pyx_L9;
28446   }
28447 
28448   /* "View.MemoryView":1244
28449  *         memcpy(result, src.data, size)
28450  *     else:
28451  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)             # <<<<<<<<<<<<<<
28452  *
28453  *     return result
28454  */
28455   /*else*/ {
28456     copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
28457   }
28458   __pyx_L9:;
28459 
28460   /* "View.MemoryView":1246
28461  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
28462  *
28463  *     return result             # <<<<<<<<<<<<<<
28464  *
28465  *
28466  */
28467   __pyx_r = __pyx_v_result;
28468   goto __pyx_L0;
28469 
28470   /* "View.MemoryView":1208
28471  *
28472  * @cname('__pyx_memoryview_copy_data_to_temp')
28473  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
28474  *                              __Pyx_memviewslice *tmpslice,
28475  *                              char order,
28476  */
28477 
28478   /* function exit code */
28479   __pyx_L1_error:;
28480   {
28481     #ifdef WITH_THREAD
28482     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
28483     #endif
28484     __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
28485     #ifdef WITH_THREAD
28486     __Pyx_PyGILState_Release(__pyx_gilstate_save);
28487     #endif
28488   }
28489   __pyx_r = NULL;
28490   __pyx_L0:;
28491   return __pyx_r;
28492 }
28493 
28494 /* "View.MemoryView":1251
28495  *
28496  * @cname('__pyx_memoryview_err_extents')
28497  * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
28498  *                              Py_ssize_t extent2) except -1 with gil:
28499  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
28500  */
28501 
__pyx_memoryview_err_extents(int __pyx_v_i,Py_ssize_t __pyx_v_extent1,Py_ssize_t __pyx_v_extent2)28502 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
28503   int __pyx_r;
28504   __Pyx_RefNannyDeclarations
28505   PyObject *__pyx_t_1 = NULL;
28506   PyObject *__pyx_t_2 = NULL;
28507   PyObject *__pyx_t_3 = NULL;
28508   PyObject *__pyx_t_4 = NULL;
28509   int __pyx_lineno = 0;
28510   const char *__pyx_filename = NULL;
28511   int __pyx_clineno = 0;
28512   #ifdef WITH_THREAD
28513   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
28514   #endif
28515   __Pyx_RefNannySetupContext("_err_extents", 0);
28516 
28517   /* "View.MemoryView":1254
28518  *                              Py_ssize_t extent2) except -1 with gil:
28519  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
28520  *                                                         (i, extent1, extent2))             # <<<<<<<<<<<<<<
28521  *
28522  * @cname('__pyx_memoryview_err_dim')
28523  */
28524   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
28525   __Pyx_GOTREF(__pyx_t_1);
28526   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
28527   __Pyx_GOTREF(__pyx_t_2);
28528   __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
28529   __Pyx_GOTREF(__pyx_t_3);
28530   __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
28531   __Pyx_GOTREF(__pyx_t_4);
28532   __Pyx_GIVEREF(__pyx_t_1);
28533   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
28534   __Pyx_GIVEREF(__pyx_t_2);
28535   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
28536   __Pyx_GIVEREF(__pyx_t_3);
28537   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
28538   __pyx_t_1 = 0;
28539   __pyx_t_2 = 0;
28540   __pyx_t_3 = 0;
28541 
28542   /* "View.MemoryView":1253
28543  * cdef int _err_extents(int i, Py_ssize_t extent1,
28544  *                              Py_ssize_t extent2) except -1 with gil:
28545  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %             # <<<<<<<<<<<<<<
28546  *                                                         (i, extent1, extent2))
28547  *
28548  */
28549   __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error)
28550   __Pyx_GOTREF(__pyx_t_3);
28551   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28552   __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error)
28553   __Pyx_GOTREF(__pyx_t_4);
28554   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28555   __Pyx_Raise(__pyx_t_4, 0, 0, 0);
28556   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28557   __PYX_ERR(1, 1253, __pyx_L1_error)
28558 
28559   /* "View.MemoryView":1251
28560  *
28561  * @cname('__pyx_memoryview_err_extents')
28562  * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
28563  *                              Py_ssize_t extent2) except -1 with gil:
28564  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
28565  */
28566 
28567   /* function exit code */
28568   __pyx_L1_error:;
28569   __Pyx_XDECREF(__pyx_t_1);
28570   __Pyx_XDECREF(__pyx_t_2);
28571   __Pyx_XDECREF(__pyx_t_3);
28572   __Pyx_XDECREF(__pyx_t_4);
28573   __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
28574   __pyx_r = -1;
28575   __Pyx_RefNannyFinishContext();
28576   #ifdef WITH_THREAD
28577   __Pyx_PyGILState_Release(__pyx_gilstate_save);
28578   #endif
28579   return __pyx_r;
28580 }
28581 
28582 /* "View.MemoryView":1257
28583  *
28584  * @cname('__pyx_memoryview_err_dim')
28585  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
28586  *     raise error(msg.decode('ascii') % dim)
28587  *
28588  */
28589 
__pyx_memoryview_err_dim(PyObject * __pyx_v_error,char * __pyx_v_msg,int __pyx_v_dim)28590 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
28591   int __pyx_r;
28592   __Pyx_RefNannyDeclarations
28593   PyObject *__pyx_t_1 = NULL;
28594   PyObject *__pyx_t_2 = NULL;
28595   PyObject *__pyx_t_3 = NULL;
28596   PyObject *__pyx_t_4 = NULL;
28597   int __pyx_lineno = 0;
28598   const char *__pyx_filename = NULL;
28599   int __pyx_clineno = 0;
28600   #ifdef WITH_THREAD
28601   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
28602   #endif
28603   __Pyx_RefNannySetupContext("_err_dim", 0);
28604   __Pyx_INCREF(__pyx_v_error);
28605 
28606   /* "View.MemoryView":1258
28607  * @cname('__pyx_memoryview_err_dim')
28608  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
28609  *     raise error(msg.decode('ascii') % dim)             # <<<<<<<<<<<<<<
28610  *
28611  * @cname('__pyx_memoryview_err')
28612  */
28613   __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error)
28614   __Pyx_GOTREF(__pyx_t_2);
28615   __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error)
28616   __Pyx_GOTREF(__pyx_t_3);
28617   __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error)
28618   __Pyx_GOTREF(__pyx_t_4);
28619   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28620   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28621   __Pyx_INCREF(__pyx_v_error);
28622   __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
28623   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
28624     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
28625     if (likely(__pyx_t_2)) {
28626       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
28627       __Pyx_INCREF(__pyx_t_2);
28628       __Pyx_INCREF(function);
28629       __Pyx_DECREF_SET(__pyx_t_3, function);
28630     }
28631   }
28632   __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
28633   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
28634   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28635   if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error)
28636   __Pyx_GOTREF(__pyx_t_1);
28637   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28638   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
28639   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28640   __PYX_ERR(1, 1258, __pyx_L1_error)
28641 
28642   /* "View.MemoryView":1257
28643  *
28644  * @cname('__pyx_memoryview_err_dim')
28645  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
28646  *     raise error(msg.decode('ascii') % dim)
28647  *
28648  */
28649 
28650   /* function exit code */
28651   __pyx_L1_error:;
28652   __Pyx_XDECREF(__pyx_t_1);
28653   __Pyx_XDECREF(__pyx_t_2);
28654   __Pyx_XDECREF(__pyx_t_3);
28655   __Pyx_XDECREF(__pyx_t_4);
28656   __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
28657   __pyx_r = -1;
28658   __Pyx_XDECREF(__pyx_v_error);
28659   __Pyx_RefNannyFinishContext();
28660   #ifdef WITH_THREAD
28661   __Pyx_PyGILState_Release(__pyx_gilstate_save);
28662   #endif
28663   return __pyx_r;
28664 }
28665 
28666 /* "View.MemoryView":1261
28667  *
28668  * @cname('__pyx_memoryview_err')
28669  * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
28670  *     if msg != NULL:
28671  *         raise error(msg.decode('ascii'))
28672  */
28673 
__pyx_memoryview_err(PyObject * __pyx_v_error,char * __pyx_v_msg)28674 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
28675   int __pyx_r;
28676   __Pyx_RefNannyDeclarations
28677   int __pyx_t_1;
28678   PyObject *__pyx_t_2 = NULL;
28679   PyObject *__pyx_t_3 = NULL;
28680   PyObject *__pyx_t_4 = NULL;
28681   PyObject *__pyx_t_5 = NULL;
28682   int __pyx_lineno = 0;
28683   const char *__pyx_filename = NULL;
28684   int __pyx_clineno = 0;
28685   #ifdef WITH_THREAD
28686   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
28687   #endif
28688   __Pyx_RefNannySetupContext("_err", 0);
28689   __Pyx_INCREF(__pyx_v_error);
28690 
28691   /* "View.MemoryView":1262
28692  * @cname('__pyx_memoryview_err')
28693  * cdef int _err(object error, char *msg) except -1 with gil:
28694  *     if msg != NULL:             # <<<<<<<<<<<<<<
28695  *         raise error(msg.decode('ascii'))
28696  *     else:
28697  */
28698   __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
28699   if (unlikely(__pyx_t_1)) {
28700 
28701     /* "View.MemoryView":1263
28702  * cdef int _err(object error, char *msg) except -1 with gil:
28703  *     if msg != NULL:
28704  *         raise error(msg.decode('ascii'))             # <<<<<<<<<<<<<<
28705  *     else:
28706  *         raise error
28707  */
28708     __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error)
28709     __Pyx_GOTREF(__pyx_t_3);
28710     __Pyx_INCREF(__pyx_v_error);
28711     __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
28712     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
28713       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
28714       if (likely(__pyx_t_5)) {
28715         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
28716         __Pyx_INCREF(__pyx_t_5);
28717         __Pyx_INCREF(function);
28718         __Pyx_DECREF_SET(__pyx_t_4, function);
28719       }
28720     }
28721     __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
28722     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28723     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28724     if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error)
28725     __Pyx_GOTREF(__pyx_t_2);
28726     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28727     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
28728     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28729     __PYX_ERR(1, 1263, __pyx_L1_error)
28730 
28731     /* "View.MemoryView":1262
28732  * @cname('__pyx_memoryview_err')
28733  * cdef int _err(object error, char *msg) except -1 with gil:
28734  *     if msg != NULL:             # <<<<<<<<<<<<<<
28735  *         raise error(msg.decode('ascii'))
28736  *     else:
28737  */
28738   }
28739 
28740   /* "View.MemoryView":1265
28741  *         raise error(msg.decode('ascii'))
28742  *     else:
28743  *         raise error             # <<<<<<<<<<<<<<
28744  *
28745  * @cname('__pyx_memoryview_copy_contents')
28746  */
28747   /*else*/ {
28748     __Pyx_Raise(__pyx_v_error, 0, 0, 0);
28749     __PYX_ERR(1, 1265, __pyx_L1_error)
28750   }
28751 
28752   /* "View.MemoryView":1261
28753  *
28754  * @cname('__pyx_memoryview_err')
28755  * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
28756  *     if msg != NULL:
28757  *         raise error(msg.decode('ascii'))
28758  */
28759 
28760   /* function exit code */
28761   __pyx_L1_error:;
28762   __Pyx_XDECREF(__pyx_t_2);
28763   __Pyx_XDECREF(__pyx_t_3);
28764   __Pyx_XDECREF(__pyx_t_4);
28765   __Pyx_XDECREF(__pyx_t_5);
28766   __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
28767   __pyx_r = -1;
28768   __Pyx_XDECREF(__pyx_v_error);
28769   __Pyx_RefNannyFinishContext();
28770   #ifdef WITH_THREAD
28771   __Pyx_PyGILState_Release(__pyx_gilstate_save);
28772   #endif
28773   return __pyx_r;
28774 }
28775 
28776 /* "View.MemoryView":1268
28777  *
28778  * @cname('__pyx_memoryview_copy_contents')
28779  * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
28780  *                                   __Pyx_memviewslice dst,
28781  *                                   int src_ndim, int dst_ndim,
28782  */
28783 
__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)28784 static 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) {
28785   void *__pyx_v_tmpdata;
28786   size_t __pyx_v_itemsize;
28787   int __pyx_v_i;
28788   char __pyx_v_order;
28789   int __pyx_v_broadcasting;
28790   int __pyx_v_direct_copy;
28791   __Pyx_memviewslice __pyx_v_tmp;
28792   int __pyx_v_ndim;
28793   int __pyx_r;
28794   Py_ssize_t __pyx_t_1;
28795   int __pyx_t_2;
28796   int __pyx_t_3;
28797   int __pyx_t_4;
28798   int __pyx_t_5;
28799   int __pyx_t_6;
28800   void *__pyx_t_7;
28801   int __pyx_t_8;
28802   int __pyx_lineno = 0;
28803   const char *__pyx_filename = NULL;
28804   int __pyx_clineno = 0;
28805 
28806   /* "View.MemoryView":1276
28807  *     Check for overlapping memory and verify the shapes.
28808  *     """
28809  *     cdef void *tmpdata = NULL             # <<<<<<<<<<<<<<
28810  *     cdef size_t itemsize = src.memview.view.itemsize
28811  *     cdef int i
28812  */
28813   __pyx_v_tmpdata = NULL;
28814 
28815   /* "View.MemoryView":1277
28816  *     """
28817  *     cdef void *tmpdata = NULL
28818  *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
28819  *     cdef int i
28820  *     cdef char order = get_best_order(&src, src_ndim)
28821  */
28822   __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
28823   __pyx_v_itemsize = __pyx_t_1;
28824 
28825   /* "View.MemoryView":1279
28826  *     cdef size_t itemsize = src.memview.view.itemsize
28827  *     cdef int i
28828  *     cdef char order = get_best_order(&src, src_ndim)             # <<<<<<<<<<<<<<
28829  *     cdef bint broadcasting = False
28830  *     cdef bint direct_copy = False
28831  */
28832   __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
28833 
28834   /* "View.MemoryView":1280
28835  *     cdef int i
28836  *     cdef char order = get_best_order(&src, src_ndim)
28837  *     cdef bint broadcasting = False             # <<<<<<<<<<<<<<
28838  *     cdef bint direct_copy = False
28839  *     cdef __Pyx_memviewslice tmp
28840  */
28841   __pyx_v_broadcasting = 0;
28842 
28843   /* "View.MemoryView":1281
28844  *     cdef char order = get_best_order(&src, src_ndim)
28845  *     cdef bint broadcasting = False
28846  *     cdef bint direct_copy = False             # <<<<<<<<<<<<<<
28847  *     cdef __Pyx_memviewslice tmp
28848  *
28849  */
28850   __pyx_v_direct_copy = 0;
28851 
28852   /* "View.MemoryView":1284
28853  *     cdef __Pyx_memviewslice tmp
28854  *
28855  *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
28856  *         broadcast_leading(&src, src_ndim, dst_ndim)
28857  *     elif dst_ndim < src_ndim:
28858  */
28859   __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
28860   if (__pyx_t_2) {
28861 
28862     /* "View.MemoryView":1285
28863  *
28864  *     if src_ndim < dst_ndim:
28865  *         broadcast_leading(&src, src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
28866  *     elif dst_ndim < src_ndim:
28867  *         broadcast_leading(&dst, dst_ndim, src_ndim)
28868  */
28869     __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
28870 
28871     /* "View.MemoryView":1284
28872  *     cdef __Pyx_memviewslice tmp
28873  *
28874  *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
28875  *         broadcast_leading(&src, src_ndim, dst_ndim)
28876  *     elif dst_ndim < src_ndim:
28877  */
28878     goto __pyx_L3;
28879   }
28880 
28881   /* "View.MemoryView":1286
28882  *     if src_ndim < dst_ndim:
28883  *         broadcast_leading(&src, src_ndim, dst_ndim)
28884  *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
28885  *         broadcast_leading(&dst, dst_ndim, src_ndim)
28886  *
28887  */
28888   __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
28889   if (__pyx_t_2) {
28890 
28891     /* "View.MemoryView":1287
28892  *         broadcast_leading(&src, src_ndim, dst_ndim)
28893  *     elif dst_ndim < src_ndim:
28894  *         broadcast_leading(&dst, dst_ndim, src_ndim)             # <<<<<<<<<<<<<<
28895  *
28896  *     cdef int ndim = max(src_ndim, dst_ndim)
28897  */
28898     __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
28899 
28900     /* "View.MemoryView":1286
28901  *     if src_ndim < dst_ndim:
28902  *         broadcast_leading(&src, src_ndim, dst_ndim)
28903  *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
28904  *         broadcast_leading(&dst, dst_ndim, src_ndim)
28905  *
28906  */
28907   }
28908   __pyx_L3:;
28909 
28910   /* "View.MemoryView":1289
28911  *         broadcast_leading(&dst, dst_ndim, src_ndim)
28912  *
28913  *     cdef int ndim = max(src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
28914  *
28915  *     for i in range(ndim):
28916  */
28917   __pyx_t_3 = __pyx_v_dst_ndim;
28918   __pyx_t_4 = __pyx_v_src_ndim;
28919   if (((__pyx_t_3 > __pyx_t_4) != 0)) {
28920     __pyx_t_5 = __pyx_t_3;
28921   } else {
28922     __pyx_t_5 = __pyx_t_4;
28923   }
28924   __pyx_v_ndim = __pyx_t_5;
28925 
28926   /* "View.MemoryView":1291
28927  *     cdef int ndim = max(src_ndim, dst_ndim)
28928  *
28929  *     for i in range(ndim):             # <<<<<<<<<<<<<<
28930  *         if src.shape[i] != dst.shape[i]:
28931  *             if src.shape[i] == 1:
28932  */
28933   __pyx_t_5 = __pyx_v_ndim;
28934   __pyx_t_3 = __pyx_t_5;
28935   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
28936     __pyx_v_i = __pyx_t_4;
28937 
28938     /* "View.MemoryView":1292
28939  *
28940  *     for i in range(ndim):
28941  *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
28942  *             if src.shape[i] == 1:
28943  *                 broadcasting = True
28944  */
28945     __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
28946     if (__pyx_t_2) {
28947 
28948       /* "View.MemoryView":1293
28949  *     for i in range(ndim):
28950  *         if src.shape[i] != dst.shape[i]:
28951  *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
28952  *                 broadcasting = True
28953  *                 src.strides[i] = 0
28954  */
28955       __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
28956       if (__pyx_t_2) {
28957 
28958         /* "View.MemoryView":1294
28959  *         if src.shape[i] != dst.shape[i]:
28960  *             if src.shape[i] == 1:
28961  *                 broadcasting = True             # <<<<<<<<<<<<<<
28962  *                 src.strides[i] = 0
28963  *             else:
28964  */
28965         __pyx_v_broadcasting = 1;
28966 
28967         /* "View.MemoryView":1295
28968  *             if src.shape[i] == 1:
28969  *                 broadcasting = True
28970  *                 src.strides[i] = 0             # <<<<<<<<<<<<<<
28971  *             else:
28972  *                 _err_extents(i, dst.shape[i], src.shape[i])
28973  */
28974         (__pyx_v_src.strides[__pyx_v_i]) = 0;
28975 
28976         /* "View.MemoryView":1293
28977  *     for i in range(ndim):
28978  *         if src.shape[i] != dst.shape[i]:
28979  *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
28980  *                 broadcasting = True
28981  *                 src.strides[i] = 0
28982  */
28983         goto __pyx_L7;
28984       }
28985 
28986       /* "View.MemoryView":1297
28987  *                 src.strides[i] = 0
28988  *             else:
28989  *                 _err_extents(i, dst.shape[i], src.shape[i])             # <<<<<<<<<<<<<<
28990  *
28991  *         if src.suboffsets[i] >= 0:
28992  */
28993       /*else*/ {
28994         __pyx_t_6 = __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_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
28995       }
28996       __pyx_L7:;
28997 
28998       /* "View.MemoryView":1292
28999  *
29000  *     for i in range(ndim):
29001  *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
29002  *             if src.shape[i] == 1:
29003  *                 broadcasting = True
29004  */
29005     }
29006 
29007     /* "View.MemoryView":1299
29008  *                 _err_extents(i, dst.shape[i], src.shape[i])
29009  *
29010  *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
29011  *             _err_dim(ValueError, "Dimension %d is not direct", i)
29012  *
29013  */
29014     __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
29015     if (__pyx_t_2) {
29016 
29017       /* "View.MemoryView":1300
29018  *
29019  *         if src.suboffsets[i] >= 0:
29020  *             _err_dim(ValueError, "Dimension %d is not direct", i)             # <<<<<<<<<<<<<<
29021  *
29022  *     if slices_overlap(&src, &dst, ndim, itemsize):
29023  */
29024       __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error)
29025 
29026       /* "View.MemoryView":1299
29027  *                 _err_extents(i, dst.shape[i], src.shape[i])
29028  *
29029  *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
29030  *             _err_dim(ValueError, "Dimension %d is not direct", i)
29031  *
29032  */
29033     }
29034   }
29035 
29036   /* "View.MemoryView":1302
29037  *             _err_dim(ValueError, "Dimension %d is not direct", i)
29038  *
29039  *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
29040  *
29041  *         if not slice_is_contig(src, order, ndim):
29042  */
29043   __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
29044   if (__pyx_t_2) {
29045 
29046     /* "View.MemoryView":1304
29047  *     if slices_overlap(&src, &dst, ndim, itemsize):
29048  *
29049  *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
29050  *             order = get_best_order(&dst, ndim)
29051  *
29052  */
29053     __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
29054     if (__pyx_t_2) {
29055 
29056       /* "View.MemoryView":1305
29057  *
29058  *         if not slice_is_contig(src, order, ndim):
29059  *             order = get_best_order(&dst, ndim)             # <<<<<<<<<<<<<<
29060  *
29061  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
29062  */
29063       __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
29064 
29065       /* "View.MemoryView":1304
29066  *     if slices_overlap(&src, &dst, ndim, itemsize):
29067  *
29068  *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
29069  *             order = get_best_order(&dst, ndim)
29070  *
29071  */
29072     }
29073 
29074     /* "View.MemoryView":1307
29075  *             order = get_best_order(&dst, ndim)
29076  *
29077  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)             # <<<<<<<<<<<<<<
29078  *         src = tmp
29079  *
29080  */
29081     __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error)
29082     __pyx_v_tmpdata = __pyx_t_7;
29083 
29084     /* "View.MemoryView":1308
29085  *
29086  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
29087  *         src = tmp             # <<<<<<<<<<<<<<
29088  *
29089  *     if not broadcasting:
29090  */
29091     __pyx_v_src = __pyx_v_tmp;
29092 
29093     /* "View.MemoryView":1302
29094  *             _err_dim(ValueError, "Dimension %d is not direct", i)
29095  *
29096  *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
29097  *
29098  *         if not slice_is_contig(src, order, ndim):
29099  */
29100   }
29101 
29102   /* "View.MemoryView":1310
29103  *         src = tmp
29104  *
29105  *     if not broadcasting:             # <<<<<<<<<<<<<<
29106  *
29107  *
29108  */
29109   __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
29110   if (__pyx_t_2) {
29111 
29112     /* "View.MemoryView":1313
29113  *
29114  *
29115  *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
29116  *             direct_copy = slice_is_contig(dst, 'C', ndim)
29117  *         elif slice_is_contig(src, 'F', ndim):
29118  */
29119     __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
29120     if (__pyx_t_2) {
29121 
29122       /* "View.MemoryView":1314
29123  *
29124  *         if slice_is_contig(src, 'C', ndim):
29125  *             direct_copy = slice_is_contig(dst, 'C', ndim)             # <<<<<<<<<<<<<<
29126  *         elif slice_is_contig(src, 'F', ndim):
29127  *             direct_copy = slice_is_contig(dst, 'F', ndim)
29128  */
29129       __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
29130 
29131       /* "View.MemoryView":1313
29132  *
29133  *
29134  *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
29135  *             direct_copy = slice_is_contig(dst, 'C', ndim)
29136  *         elif slice_is_contig(src, 'F', ndim):
29137  */
29138       goto __pyx_L12;
29139     }
29140 
29141     /* "View.MemoryView":1315
29142  *         if slice_is_contig(src, 'C', ndim):
29143  *             direct_copy = slice_is_contig(dst, 'C', ndim)
29144  *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
29145  *             direct_copy = slice_is_contig(dst, 'F', ndim)
29146  *
29147  */
29148     __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
29149     if (__pyx_t_2) {
29150 
29151       /* "View.MemoryView":1316
29152  *             direct_copy = slice_is_contig(dst, 'C', ndim)
29153  *         elif slice_is_contig(src, 'F', ndim):
29154  *             direct_copy = slice_is_contig(dst, 'F', ndim)             # <<<<<<<<<<<<<<
29155  *
29156  *         if direct_copy:
29157  */
29158       __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
29159 
29160       /* "View.MemoryView":1315
29161  *         if slice_is_contig(src, 'C', ndim):
29162  *             direct_copy = slice_is_contig(dst, 'C', ndim)
29163  *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
29164  *             direct_copy = slice_is_contig(dst, 'F', ndim)
29165  *
29166  */
29167     }
29168     __pyx_L12:;
29169 
29170     /* "View.MemoryView":1318
29171  *             direct_copy = slice_is_contig(dst, 'F', ndim)
29172  *
29173  *         if direct_copy:             # <<<<<<<<<<<<<<
29174  *
29175  *             refcount_copying(&dst, dtype_is_object, ndim, False)
29176  */
29177     __pyx_t_2 = (__pyx_v_direct_copy != 0);
29178     if (__pyx_t_2) {
29179 
29180       /* "View.MemoryView":1320
29181  *         if direct_copy:
29182  *
29183  *             refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
29184  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
29185  *             refcount_copying(&dst, dtype_is_object, ndim, True)
29186  */
29187       __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
29188 
29189       /* "View.MemoryView":1321
29190  *
29191  *             refcount_copying(&dst, dtype_is_object, ndim, False)
29192  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))             # <<<<<<<<<<<<<<
29193  *             refcount_copying(&dst, dtype_is_object, ndim, True)
29194  *             free(tmpdata)
29195  */
29196       (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
29197 
29198       /* "View.MemoryView":1322
29199  *             refcount_copying(&dst, dtype_is_object, ndim, False)
29200  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
29201  *             refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
29202  *             free(tmpdata)
29203  *             return 0
29204  */
29205       __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
29206 
29207       /* "View.MemoryView":1323
29208  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
29209  *             refcount_copying(&dst, dtype_is_object, ndim, True)
29210  *             free(tmpdata)             # <<<<<<<<<<<<<<
29211  *             return 0
29212  *
29213  */
29214       free(__pyx_v_tmpdata);
29215 
29216       /* "View.MemoryView":1324
29217  *             refcount_copying(&dst, dtype_is_object, ndim, True)
29218  *             free(tmpdata)
29219  *             return 0             # <<<<<<<<<<<<<<
29220  *
29221  *     if order == 'F' == get_best_order(&dst, ndim):
29222  */
29223       __pyx_r = 0;
29224       goto __pyx_L0;
29225 
29226       /* "View.MemoryView":1318
29227  *             direct_copy = slice_is_contig(dst, 'F', ndim)
29228  *
29229  *         if direct_copy:             # <<<<<<<<<<<<<<
29230  *
29231  *             refcount_copying(&dst, dtype_is_object, ndim, False)
29232  */
29233     }
29234 
29235     /* "View.MemoryView":1310
29236  *         src = tmp
29237  *
29238  *     if not broadcasting:             # <<<<<<<<<<<<<<
29239  *
29240  *
29241  */
29242   }
29243 
29244   /* "View.MemoryView":1326
29245  *             return 0
29246  *
29247  *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
29248  *
29249  *
29250  */
29251   __pyx_t_2 = (__pyx_v_order == 'F');
29252   if (__pyx_t_2) {
29253     __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
29254   }
29255   __pyx_t_8 = (__pyx_t_2 != 0);
29256   if (__pyx_t_8) {
29257 
29258     /* "View.MemoryView":1329
29259  *
29260  *
29261  *         transpose_memslice(&src)             # <<<<<<<<<<<<<<
29262  *         transpose_memslice(&dst)
29263  *
29264  */
29265     __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
29266 
29267     /* "View.MemoryView":1330
29268  *
29269  *         transpose_memslice(&src)
29270  *         transpose_memslice(&dst)             # <<<<<<<<<<<<<<
29271  *
29272  *     refcount_copying(&dst, dtype_is_object, ndim, False)
29273  */
29274     __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
29275 
29276     /* "View.MemoryView":1326
29277  *             return 0
29278  *
29279  *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
29280  *
29281  *
29282  */
29283   }
29284 
29285   /* "View.MemoryView":1332
29286  *         transpose_memslice(&dst)
29287  *
29288  *     refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
29289  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
29290  *     refcount_copying(&dst, dtype_is_object, ndim, True)
29291  */
29292   __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
29293 
29294   /* "View.MemoryView":1333
29295  *
29296  *     refcount_copying(&dst, dtype_is_object, ndim, False)
29297  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)             # <<<<<<<<<<<<<<
29298  *     refcount_copying(&dst, dtype_is_object, ndim, True)
29299  *
29300  */
29301   copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
29302 
29303   /* "View.MemoryView":1334
29304  *     refcount_copying(&dst, dtype_is_object, ndim, False)
29305  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
29306  *     refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
29307  *
29308  *     free(tmpdata)
29309  */
29310   __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
29311 
29312   /* "View.MemoryView":1336
29313  *     refcount_copying(&dst, dtype_is_object, ndim, True)
29314  *
29315  *     free(tmpdata)             # <<<<<<<<<<<<<<
29316  *     return 0
29317  *
29318  */
29319   free(__pyx_v_tmpdata);
29320 
29321   /* "View.MemoryView":1337
29322  *
29323  *     free(tmpdata)
29324  *     return 0             # <<<<<<<<<<<<<<
29325  *
29326  * @cname('__pyx_memoryview_broadcast_leading')
29327  */
29328   __pyx_r = 0;
29329   goto __pyx_L0;
29330 
29331   /* "View.MemoryView":1268
29332  *
29333  * @cname('__pyx_memoryview_copy_contents')
29334  * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
29335  *                                   __Pyx_memviewslice dst,
29336  *                                   int src_ndim, int dst_ndim,
29337  */
29338 
29339   /* function exit code */
29340   __pyx_L1_error:;
29341   {
29342     #ifdef WITH_THREAD
29343     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
29344     #endif
29345     __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
29346     #ifdef WITH_THREAD
29347     __Pyx_PyGILState_Release(__pyx_gilstate_save);
29348     #endif
29349   }
29350   __pyx_r = -1;
29351   __pyx_L0:;
29352   return __pyx_r;
29353 }
29354 
29355 /* "View.MemoryView":1340
29356  *
29357  * @cname('__pyx_memoryview_broadcast_leading')
29358  * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
29359  *                             int ndim,
29360  *                             int ndim_other) nogil:
29361  */
29362 
__pyx_memoryview_broadcast_leading(__Pyx_memviewslice * __pyx_v_mslice,int __pyx_v_ndim,int __pyx_v_ndim_other)29363 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
29364   int __pyx_v_i;
29365   int __pyx_v_offset;
29366   int __pyx_t_1;
29367   int __pyx_t_2;
29368   int __pyx_t_3;
29369 
29370   /* "View.MemoryView":1344
29371  *                             int ndim_other) nogil:
29372  *     cdef int i
29373  *     cdef int offset = ndim_other - ndim             # <<<<<<<<<<<<<<
29374  *
29375  *     for i in range(ndim - 1, -1, -1):
29376  */
29377   __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
29378 
29379   /* "View.MemoryView":1346
29380  *     cdef int offset = ndim_other - ndim
29381  *
29382  *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
29383  *         mslice.shape[i + offset] = mslice.shape[i]
29384  *         mslice.strides[i + offset] = mslice.strides[i]
29385  */
29386   for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
29387     __pyx_v_i = __pyx_t_1;
29388 
29389     /* "View.MemoryView":1347
29390  *
29391  *     for i in range(ndim - 1, -1, -1):
29392  *         mslice.shape[i + offset] = mslice.shape[i]             # <<<<<<<<<<<<<<
29393  *         mslice.strides[i + offset] = mslice.strides[i]
29394  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
29395  */
29396     (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
29397 
29398     /* "View.MemoryView":1348
29399  *     for i in range(ndim - 1, -1, -1):
29400  *         mslice.shape[i + offset] = mslice.shape[i]
29401  *         mslice.strides[i + offset] = mslice.strides[i]             # <<<<<<<<<<<<<<
29402  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
29403  *
29404  */
29405     (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
29406 
29407     /* "View.MemoryView":1349
29408  *         mslice.shape[i + offset] = mslice.shape[i]
29409  *         mslice.strides[i + offset] = mslice.strides[i]
29410  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]             # <<<<<<<<<<<<<<
29411  *
29412  *     for i in range(offset):
29413  */
29414     (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
29415   }
29416 
29417   /* "View.MemoryView":1351
29418  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
29419  *
29420  *     for i in range(offset):             # <<<<<<<<<<<<<<
29421  *         mslice.shape[i] = 1
29422  *         mslice.strides[i] = mslice.strides[0]
29423  */
29424   __pyx_t_1 = __pyx_v_offset;
29425   __pyx_t_2 = __pyx_t_1;
29426   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
29427     __pyx_v_i = __pyx_t_3;
29428 
29429     /* "View.MemoryView":1352
29430  *
29431  *     for i in range(offset):
29432  *         mslice.shape[i] = 1             # <<<<<<<<<<<<<<
29433  *         mslice.strides[i] = mslice.strides[0]
29434  *         mslice.suboffsets[i] = -1
29435  */
29436     (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
29437 
29438     /* "View.MemoryView":1353
29439  *     for i in range(offset):
29440  *         mslice.shape[i] = 1
29441  *         mslice.strides[i] = mslice.strides[0]             # <<<<<<<<<<<<<<
29442  *         mslice.suboffsets[i] = -1
29443  *
29444  */
29445     (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
29446 
29447     /* "View.MemoryView":1354
29448  *         mslice.shape[i] = 1
29449  *         mslice.strides[i] = mslice.strides[0]
29450  *         mslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
29451  *
29452  *
29453  */
29454     (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
29455   }
29456 
29457   /* "View.MemoryView":1340
29458  *
29459  * @cname('__pyx_memoryview_broadcast_leading')
29460  * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
29461  *                             int ndim,
29462  *                             int ndim_other) nogil:
29463  */
29464 
29465   /* function exit code */
29466 }
29467 
29468 /* "View.MemoryView":1362
29469  *
29470  * @cname('__pyx_memoryview_refcount_copying')
29471  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
29472  *                            int ndim, bint inc) nogil:
29473  *
29474  */
29475 
__pyx_memoryview_refcount_copying(__Pyx_memviewslice * __pyx_v_dst,int __pyx_v_dtype_is_object,int __pyx_v_ndim,int __pyx_v_inc)29476 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
29477   int __pyx_t_1;
29478 
29479   /* "View.MemoryView":1366
29480  *
29481  *
29482  *     if dtype_is_object:             # <<<<<<<<<<<<<<
29483  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
29484  *                                            dst.strides, ndim, inc)
29485  */
29486   __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
29487   if (__pyx_t_1) {
29488 
29489     /* "View.MemoryView":1367
29490  *
29491  *     if dtype_is_object:
29492  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,             # <<<<<<<<<<<<<<
29493  *                                            dst.strides, ndim, inc)
29494  *
29495  */
29496     __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);
29497 
29498     /* "View.MemoryView":1366
29499  *
29500  *
29501  *     if dtype_is_object:             # <<<<<<<<<<<<<<
29502  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
29503  *                                            dst.strides, ndim, inc)
29504  */
29505   }
29506 
29507   /* "View.MemoryView":1362
29508  *
29509  * @cname('__pyx_memoryview_refcount_copying')
29510  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
29511  *                            int ndim, bint inc) nogil:
29512  *
29513  */
29514 
29515   /* function exit code */
29516 }
29517 
29518 /* "View.MemoryView":1371
29519  *
29520  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
29521  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
29522  *                                              Py_ssize_t *strides, int ndim,
29523  *                                              bint inc) with gil:
29524  */
29525 
__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)29526 static 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) {
29527   __Pyx_RefNannyDeclarations
29528   #ifdef WITH_THREAD
29529   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
29530   #endif
29531   __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
29532 
29533   /* "View.MemoryView":1374
29534  *                                              Py_ssize_t *strides, int ndim,
29535  *                                              bint inc) with gil:
29536  *     refcount_objects_in_slice(data, shape, strides, ndim, inc)             # <<<<<<<<<<<<<<
29537  *
29538  * @cname('__pyx_memoryview_refcount_objects_in_slice')
29539  */
29540   __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
29541 
29542   /* "View.MemoryView":1371
29543  *
29544  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
29545  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
29546  *                                              Py_ssize_t *strides, int ndim,
29547  *                                              bint inc) with gil:
29548  */
29549 
29550   /* function exit code */
29551   __Pyx_RefNannyFinishContext();
29552   #ifdef WITH_THREAD
29553   __Pyx_PyGILState_Release(__pyx_gilstate_save);
29554   #endif
29555 }
29556 
29557 /* "View.MemoryView":1377
29558  *
29559  * @cname('__pyx_memoryview_refcount_objects_in_slice')
29560  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
29561  *                                     Py_ssize_t *strides, int ndim, bint inc):
29562  *     cdef Py_ssize_t i
29563  */
29564 
__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)29565 static 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) {
29566   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
29567   __Pyx_RefNannyDeclarations
29568   Py_ssize_t __pyx_t_1;
29569   Py_ssize_t __pyx_t_2;
29570   Py_ssize_t __pyx_t_3;
29571   int __pyx_t_4;
29572   __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
29573 
29574   /* "View.MemoryView":1381
29575  *     cdef Py_ssize_t i
29576  *
29577  *     for i in range(shape[0]):             # <<<<<<<<<<<<<<
29578  *         if ndim == 1:
29579  *             if inc:
29580  */
29581   __pyx_t_1 = (__pyx_v_shape[0]);
29582   __pyx_t_2 = __pyx_t_1;
29583   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
29584     __pyx_v_i = __pyx_t_3;
29585 
29586     /* "View.MemoryView":1382
29587  *
29588  *     for i in range(shape[0]):
29589  *         if ndim == 1:             # <<<<<<<<<<<<<<
29590  *             if inc:
29591  *                 Py_INCREF((<PyObject **> data)[0])
29592  */
29593     __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
29594     if (__pyx_t_4) {
29595 
29596       /* "View.MemoryView":1383
29597  *     for i in range(shape[0]):
29598  *         if ndim == 1:
29599  *             if inc:             # <<<<<<<<<<<<<<
29600  *                 Py_INCREF((<PyObject **> data)[0])
29601  *             else:
29602  */
29603       __pyx_t_4 = (__pyx_v_inc != 0);
29604       if (__pyx_t_4) {
29605 
29606         /* "View.MemoryView":1384
29607  *         if ndim == 1:
29608  *             if inc:
29609  *                 Py_INCREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
29610  *             else:
29611  *                 Py_DECREF((<PyObject **> data)[0])
29612  */
29613         Py_INCREF((((PyObject **)__pyx_v_data)[0]));
29614 
29615         /* "View.MemoryView":1383
29616  *     for i in range(shape[0]):
29617  *         if ndim == 1:
29618  *             if inc:             # <<<<<<<<<<<<<<
29619  *                 Py_INCREF((<PyObject **> data)[0])
29620  *             else:
29621  */
29622         goto __pyx_L6;
29623       }
29624 
29625       /* "View.MemoryView":1386
29626  *                 Py_INCREF((<PyObject **> data)[0])
29627  *             else:
29628  *                 Py_DECREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
29629  *         else:
29630  *             refcount_objects_in_slice(data, shape + 1, strides + 1,
29631  */
29632       /*else*/ {
29633         Py_DECREF((((PyObject **)__pyx_v_data)[0]));
29634       }
29635       __pyx_L6:;
29636 
29637       /* "View.MemoryView":1382
29638  *
29639  *     for i in range(shape[0]):
29640  *         if ndim == 1:             # <<<<<<<<<<<<<<
29641  *             if inc:
29642  *                 Py_INCREF((<PyObject **> data)[0])
29643  */
29644       goto __pyx_L5;
29645     }
29646 
29647     /* "View.MemoryView":1388
29648  *                 Py_DECREF((<PyObject **> data)[0])
29649  *         else:
29650  *             refcount_objects_in_slice(data, shape + 1, strides + 1,             # <<<<<<<<<<<<<<
29651  *                                       ndim - 1, inc)
29652  *
29653  */
29654     /*else*/ {
29655 
29656       /* "View.MemoryView":1389
29657  *         else:
29658  *             refcount_objects_in_slice(data, shape + 1, strides + 1,
29659  *                                       ndim - 1, inc)             # <<<<<<<<<<<<<<
29660  *
29661  *         data += strides[0]
29662  */
29663       __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
29664     }
29665     __pyx_L5:;
29666 
29667     /* "View.MemoryView":1391
29668  *                                       ndim - 1, inc)
29669  *
29670  *         data += strides[0]             # <<<<<<<<<<<<<<
29671  *
29672  *
29673  */
29674     __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
29675   }
29676 
29677   /* "View.MemoryView":1377
29678  *
29679  * @cname('__pyx_memoryview_refcount_objects_in_slice')
29680  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
29681  *                                     Py_ssize_t *strides, int ndim, bint inc):
29682  *     cdef Py_ssize_t i
29683  */
29684 
29685   /* function exit code */
29686   __Pyx_RefNannyFinishContext();
29687 }
29688 
29689 /* "View.MemoryView":1397
29690  *
29691  * @cname('__pyx_memoryview_slice_assign_scalar')
29692  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
29693  *                               size_t itemsize, void *item,
29694  *                               bint dtype_is_object) nogil:
29695  */
29696 
__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)29697 static 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) {
29698 
29699   /* "View.MemoryView":1400
29700  *                               size_t itemsize, void *item,
29701  *                               bint dtype_is_object) nogil:
29702  *     refcount_copying(dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
29703  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
29704  *                          itemsize, item)
29705  */
29706   __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
29707 
29708   /* "View.MemoryView":1401
29709  *                               bint dtype_is_object) nogil:
29710  *     refcount_copying(dst, dtype_is_object, ndim, False)
29711  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,             # <<<<<<<<<<<<<<
29712  *                          itemsize, item)
29713  *     refcount_copying(dst, dtype_is_object, ndim, True)
29714  */
29715   __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);
29716 
29717   /* "View.MemoryView":1403
29718  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
29719  *                          itemsize, item)
29720  *     refcount_copying(dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
29721  *
29722  *
29723  */
29724   __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
29725 
29726   /* "View.MemoryView":1397
29727  *
29728  * @cname('__pyx_memoryview_slice_assign_scalar')
29729  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
29730  *                               size_t itemsize, void *item,
29731  *                               bint dtype_is_object) nogil:
29732  */
29733 
29734   /* function exit code */
29735 }
29736 
29737 /* "View.MemoryView":1407
29738  *
29739  * @cname('__pyx_memoryview__slice_assign_scalar')
29740  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
29741  *                               Py_ssize_t *strides, int ndim,
29742  *                               size_t itemsize, void *item) nogil:
29743  */
29744 
__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)29745 static 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) {
29746   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
29747   Py_ssize_t __pyx_v_stride;
29748   Py_ssize_t __pyx_v_extent;
29749   int __pyx_t_1;
29750   Py_ssize_t __pyx_t_2;
29751   Py_ssize_t __pyx_t_3;
29752   Py_ssize_t __pyx_t_4;
29753 
29754   /* "View.MemoryView":1411
29755  *                               size_t itemsize, void *item) nogil:
29756  *     cdef Py_ssize_t i
29757  *     cdef Py_ssize_t stride = strides[0]             # <<<<<<<<<<<<<<
29758  *     cdef Py_ssize_t extent = shape[0]
29759  *
29760  */
29761   __pyx_v_stride = (__pyx_v_strides[0]);
29762 
29763   /* "View.MemoryView":1412
29764  *     cdef Py_ssize_t i
29765  *     cdef Py_ssize_t stride = strides[0]
29766  *     cdef Py_ssize_t extent = shape[0]             # <<<<<<<<<<<<<<
29767  *
29768  *     if ndim == 1:
29769  */
29770   __pyx_v_extent = (__pyx_v_shape[0]);
29771 
29772   /* "View.MemoryView":1414
29773  *     cdef Py_ssize_t extent = shape[0]
29774  *
29775  *     if ndim == 1:             # <<<<<<<<<<<<<<
29776  *         for i in range(extent):
29777  *             memcpy(data, item, itemsize)
29778  */
29779   __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
29780   if (__pyx_t_1) {
29781 
29782     /* "View.MemoryView":1415
29783  *
29784  *     if ndim == 1:
29785  *         for i in range(extent):             # <<<<<<<<<<<<<<
29786  *             memcpy(data, item, itemsize)
29787  *             data += stride
29788  */
29789     __pyx_t_2 = __pyx_v_extent;
29790     __pyx_t_3 = __pyx_t_2;
29791     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
29792       __pyx_v_i = __pyx_t_4;
29793 
29794       /* "View.MemoryView":1416
29795  *     if ndim == 1:
29796  *         for i in range(extent):
29797  *             memcpy(data, item, itemsize)             # <<<<<<<<<<<<<<
29798  *             data += stride
29799  *     else:
29800  */
29801       (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
29802 
29803       /* "View.MemoryView":1417
29804  *         for i in range(extent):
29805  *             memcpy(data, item, itemsize)
29806  *             data += stride             # <<<<<<<<<<<<<<
29807  *     else:
29808  *         for i in range(extent):
29809  */
29810       __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
29811     }
29812 
29813     /* "View.MemoryView":1414
29814  *     cdef Py_ssize_t extent = shape[0]
29815  *
29816  *     if ndim == 1:             # <<<<<<<<<<<<<<
29817  *         for i in range(extent):
29818  *             memcpy(data, item, itemsize)
29819  */
29820     goto __pyx_L3;
29821   }
29822 
29823   /* "View.MemoryView":1419
29824  *             data += stride
29825  *     else:
29826  *         for i in range(extent):             # <<<<<<<<<<<<<<
29827  *             _slice_assign_scalar(data, shape + 1, strides + 1,
29828  *                                 ndim - 1, itemsize, item)
29829  */
29830   /*else*/ {
29831     __pyx_t_2 = __pyx_v_extent;
29832     __pyx_t_3 = __pyx_t_2;
29833     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
29834       __pyx_v_i = __pyx_t_4;
29835 
29836       /* "View.MemoryView":1420
29837  *     else:
29838  *         for i in range(extent):
29839  *             _slice_assign_scalar(data, shape + 1, strides + 1,             # <<<<<<<<<<<<<<
29840  *                                 ndim - 1, itemsize, item)
29841  *             data += stride
29842  */
29843       __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);
29844 
29845       /* "View.MemoryView":1422
29846  *             _slice_assign_scalar(data, shape + 1, strides + 1,
29847  *                                 ndim - 1, itemsize, item)
29848  *             data += stride             # <<<<<<<<<<<<<<
29849  *
29850  *
29851  */
29852       __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
29853     }
29854   }
29855   __pyx_L3:;
29856 
29857   /* "View.MemoryView":1407
29858  *
29859  * @cname('__pyx_memoryview__slice_assign_scalar')
29860  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
29861  *                               Py_ssize_t *strides, int ndim,
29862  *                               size_t itemsize, void *item) nogil:
29863  */
29864 
29865   /* function exit code */
29866 }
29867 
29868 /* "(tree fragment)":1
29869  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
29870  *     cdef object __pyx_PickleError
29871  *     cdef object __pyx_result
29872  */
29873 
29874 /* Python wrapper */
29875 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
29876 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)29877 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
29878   PyObject *__pyx_v___pyx_type = 0;
29879   long __pyx_v___pyx_checksum;
29880   PyObject *__pyx_v___pyx_state = 0;
29881   int __pyx_lineno = 0;
29882   const char *__pyx_filename = NULL;
29883   int __pyx_clineno = 0;
29884   PyObject *__pyx_r = 0;
29885   __Pyx_RefNannyDeclarations
29886   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
29887   {
29888     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
29889     PyObject* values[3] = {0,0,0};
29890     if (unlikely(__pyx_kwds)) {
29891       Py_ssize_t kw_args;
29892       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
29893       switch (pos_args) {
29894         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
29895         CYTHON_FALLTHROUGH;
29896         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
29897         CYTHON_FALLTHROUGH;
29898         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
29899         CYTHON_FALLTHROUGH;
29900         case  0: break;
29901         default: goto __pyx_L5_argtuple_error;
29902       }
29903       kw_args = PyDict_Size(__pyx_kwds);
29904       switch (pos_args) {
29905         case  0:
29906         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
29907         else goto __pyx_L5_argtuple_error;
29908         CYTHON_FALLTHROUGH;
29909         case  1:
29910         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
29911         else {
29912           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
29913         }
29914         CYTHON_FALLTHROUGH;
29915         case  2:
29916         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
29917         else {
29918           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
29919         }
29920       }
29921       if (unlikely(kw_args > 0)) {
29922         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
29923       }
29924     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
29925       goto __pyx_L5_argtuple_error;
29926     } else {
29927       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
29928       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
29929       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
29930     }
29931     __pyx_v___pyx_type = values[0];
29932     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
29933     __pyx_v___pyx_state = values[2];
29934   }
29935   goto __pyx_L4_argument_unpacking_done;
29936   __pyx_L5_argtuple_error:;
29937   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
29938   __pyx_L3_error:;
29939   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
29940   __Pyx_RefNannyFinishContext();
29941   return NULL;
29942   __pyx_L4_argument_unpacking_done:;
29943   __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
29944 
29945   /* function exit code */
29946   __Pyx_RefNannyFinishContext();
29947   return __pyx_r;
29948 }
29949 
__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)29950 static 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) {
29951   PyObject *__pyx_v___pyx_PickleError = 0;
29952   PyObject *__pyx_v___pyx_result = 0;
29953   PyObject *__pyx_r = NULL;
29954   __Pyx_RefNannyDeclarations
29955   int __pyx_t_1;
29956   PyObject *__pyx_t_2 = NULL;
29957   PyObject *__pyx_t_3 = NULL;
29958   PyObject *__pyx_t_4 = NULL;
29959   PyObject *__pyx_t_5 = NULL;
29960   int __pyx_t_6;
29961   int __pyx_lineno = 0;
29962   const char *__pyx_filename = NULL;
29963   int __pyx_clineno = 0;
29964   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
29965 
29966   /* "(tree fragment)":4
29967  *     cdef object __pyx_PickleError
29968  *     cdef object __pyx_result
29969  *     if __pyx_checksum != 0xb068931:             # <<<<<<<<<<<<<<
29970  *         from pickle import PickleError as __pyx_PickleError
29971  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
29972  */
29973   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
29974   if (__pyx_t_1) {
29975 
29976     /* "(tree fragment)":5
29977  *     cdef object __pyx_result
29978  *     if __pyx_checksum != 0xb068931:
29979  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
29980  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
29981  *     __pyx_result = Enum.__new__(__pyx_type)
29982  */
29983     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
29984     __Pyx_GOTREF(__pyx_t_2);
29985     __Pyx_INCREF(__pyx_n_s_PickleError);
29986     __Pyx_GIVEREF(__pyx_n_s_PickleError);
29987     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
29988     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
29989     __Pyx_GOTREF(__pyx_t_3);
29990     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29991     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
29992     __Pyx_GOTREF(__pyx_t_2);
29993     __Pyx_INCREF(__pyx_t_2);
29994     __pyx_v___pyx_PickleError = __pyx_t_2;
29995     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29996     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29997 
29998     /* "(tree fragment)":6
29999  *     if __pyx_checksum != 0xb068931:
30000  *         from pickle import PickleError as __pyx_PickleError
30001  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)             # <<<<<<<<<<<<<<
30002  *     __pyx_result = Enum.__new__(__pyx_type)
30003  *     if __pyx_state is not None:
30004  */
30005     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
30006     __Pyx_GOTREF(__pyx_t_2);
30007     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
30008     __Pyx_GOTREF(__pyx_t_4);
30009     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30010     __Pyx_INCREF(__pyx_v___pyx_PickleError);
30011     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
30012     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
30013       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
30014       if (likely(__pyx_t_5)) {
30015         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
30016         __Pyx_INCREF(__pyx_t_5);
30017         __Pyx_INCREF(function);
30018         __Pyx_DECREF_SET(__pyx_t_2, function);
30019       }
30020     }
30021     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
30022     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
30023     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
30024     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
30025     __Pyx_GOTREF(__pyx_t_3);
30026     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30027     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
30028     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
30029     __PYX_ERR(1, 6, __pyx_L1_error)
30030 
30031     /* "(tree fragment)":4
30032  *     cdef object __pyx_PickleError
30033  *     cdef object __pyx_result
30034  *     if __pyx_checksum != 0xb068931:             # <<<<<<<<<<<<<<
30035  *         from pickle import PickleError as __pyx_PickleError
30036  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
30037  */
30038   }
30039 
30040   /* "(tree fragment)":7
30041  *         from pickle import PickleError as __pyx_PickleError
30042  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
30043  *     __pyx_result = Enum.__new__(__pyx_type)             # <<<<<<<<<<<<<<
30044  *     if __pyx_state is not None:
30045  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
30046  */
30047   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
30048   __Pyx_GOTREF(__pyx_t_2);
30049   __pyx_t_4 = NULL;
30050   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
30051     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
30052     if (likely(__pyx_t_4)) {
30053       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
30054       __Pyx_INCREF(__pyx_t_4);
30055       __Pyx_INCREF(function);
30056       __Pyx_DECREF_SET(__pyx_t_2, function);
30057     }
30058   }
30059   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
30060   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
30061   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
30062   __Pyx_GOTREF(__pyx_t_3);
30063   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30064   __pyx_v___pyx_result = __pyx_t_3;
30065   __pyx_t_3 = 0;
30066 
30067   /* "(tree fragment)":8
30068  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
30069  *     __pyx_result = Enum.__new__(__pyx_type)
30070  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
30071  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
30072  *     return __pyx_result
30073  */
30074   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
30075   __pyx_t_6 = (__pyx_t_1 != 0);
30076   if (__pyx_t_6) {
30077 
30078     /* "(tree fragment)":9
30079  *     __pyx_result = Enum.__new__(__pyx_type)
30080  *     if __pyx_state is not None:
30081  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
30082  *     return __pyx_result
30083  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
30084  */
30085     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
30086     __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
30087     __Pyx_GOTREF(__pyx_t_3);
30088     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
30089 
30090     /* "(tree fragment)":8
30091  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
30092  *     __pyx_result = Enum.__new__(__pyx_type)
30093  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
30094  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
30095  *     return __pyx_result
30096  */
30097   }
30098 
30099   /* "(tree fragment)":10
30100  *     if __pyx_state is not None:
30101  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
30102  *     return __pyx_result             # <<<<<<<<<<<<<<
30103  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
30104  *     __pyx_result.name = __pyx_state[0]
30105  */
30106   __Pyx_XDECREF(__pyx_r);
30107   __Pyx_INCREF(__pyx_v___pyx_result);
30108   __pyx_r = __pyx_v___pyx_result;
30109   goto __pyx_L0;
30110 
30111   /* "(tree fragment)":1
30112  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
30113  *     cdef object __pyx_PickleError
30114  *     cdef object __pyx_result
30115  */
30116 
30117   /* function exit code */
30118   __pyx_L1_error:;
30119   __Pyx_XDECREF(__pyx_t_2);
30120   __Pyx_XDECREF(__pyx_t_3);
30121   __Pyx_XDECREF(__pyx_t_4);
30122   __Pyx_XDECREF(__pyx_t_5);
30123   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
30124   __pyx_r = NULL;
30125   __pyx_L0:;
30126   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
30127   __Pyx_XDECREF(__pyx_v___pyx_result);
30128   __Pyx_XGIVEREF(__pyx_r);
30129   __Pyx_RefNannyFinishContext();
30130   return __pyx_r;
30131 }
30132 
30133 /* "(tree fragment)":11
30134  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
30135  *     return __pyx_result
30136  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
30137  *     __pyx_result.name = __pyx_state[0]
30138  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
30139  */
30140 
__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)30141 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
30142   PyObject *__pyx_r = NULL;
30143   __Pyx_RefNannyDeclarations
30144   PyObject *__pyx_t_1 = NULL;
30145   int __pyx_t_2;
30146   Py_ssize_t __pyx_t_3;
30147   int __pyx_t_4;
30148   int __pyx_t_5;
30149   PyObject *__pyx_t_6 = NULL;
30150   PyObject *__pyx_t_7 = NULL;
30151   PyObject *__pyx_t_8 = NULL;
30152   int __pyx_lineno = 0;
30153   const char *__pyx_filename = NULL;
30154   int __pyx_clineno = 0;
30155   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
30156 
30157   /* "(tree fragment)":12
30158  *     return __pyx_result
30159  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
30160  *     __pyx_result.name = __pyx_state[0]             # <<<<<<<<<<<<<<
30161  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
30162  *         __pyx_result.__dict__.update(__pyx_state[1])
30163  */
30164   if (unlikely(__pyx_v___pyx_state == Py_None)) {
30165     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
30166     __PYX_ERR(1, 12, __pyx_L1_error)
30167   }
30168   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
30169   __Pyx_GOTREF(__pyx_t_1);
30170   __Pyx_GIVEREF(__pyx_t_1);
30171   __Pyx_GOTREF(__pyx_v___pyx_result->name);
30172   __Pyx_DECREF(__pyx_v___pyx_result->name);
30173   __pyx_v___pyx_result->name = __pyx_t_1;
30174   __pyx_t_1 = 0;
30175 
30176   /* "(tree fragment)":13
30177  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
30178  *     __pyx_result.name = __pyx_state[0]
30179  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
30180  *         __pyx_result.__dict__.update(__pyx_state[1])
30181  */
30182   if (unlikely(__pyx_v___pyx_state == Py_None)) {
30183     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
30184     __PYX_ERR(1, 13, __pyx_L1_error)
30185   }
30186   __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
30187   __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
30188   if (__pyx_t_4) {
30189   } else {
30190     __pyx_t_2 = __pyx_t_4;
30191     goto __pyx_L4_bool_binop_done;
30192   }
30193   __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
30194   __pyx_t_5 = (__pyx_t_4 != 0);
30195   __pyx_t_2 = __pyx_t_5;
30196   __pyx_L4_bool_binop_done:;
30197   if (__pyx_t_2) {
30198 
30199     /* "(tree fragment)":14
30200  *     __pyx_result.name = __pyx_state[0]
30201  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
30202  *         __pyx_result.__dict__.update(__pyx_state[1])             # <<<<<<<<<<<<<<
30203  */
30204     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
30205     __Pyx_GOTREF(__pyx_t_6);
30206     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
30207     __Pyx_GOTREF(__pyx_t_7);
30208     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
30209     if (unlikely(__pyx_v___pyx_state == Py_None)) {
30210       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
30211       __PYX_ERR(1, 14, __pyx_L1_error)
30212     }
30213     __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
30214     __Pyx_GOTREF(__pyx_t_6);
30215     __pyx_t_8 = NULL;
30216     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
30217       __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
30218       if (likely(__pyx_t_8)) {
30219         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
30220         __Pyx_INCREF(__pyx_t_8);
30221         __Pyx_INCREF(function);
30222         __Pyx_DECREF_SET(__pyx_t_7, function);
30223       }
30224     }
30225     __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
30226     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
30227     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
30228     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
30229     __Pyx_GOTREF(__pyx_t_1);
30230     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
30231     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30232 
30233     /* "(tree fragment)":13
30234  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
30235  *     __pyx_result.name = __pyx_state[0]
30236  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
30237  *         __pyx_result.__dict__.update(__pyx_state[1])
30238  */
30239   }
30240 
30241   /* "(tree fragment)":11
30242  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
30243  *     return __pyx_result
30244  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
30245  *     __pyx_result.name = __pyx_state[0]
30246  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
30247  */
30248 
30249   /* function exit code */
30250   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
30251   goto __pyx_L0;
30252   __pyx_L1_error:;
30253   __Pyx_XDECREF(__pyx_t_1);
30254   __Pyx_XDECREF(__pyx_t_6);
30255   __Pyx_XDECREF(__pyx_t_7);
30256   __Pyx_XDECREF(__pyx_t_8);
30257   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
30258   __pyx_r = 0;
30259   __pyx_L0:;
30260   __Pyx_XGIVEREF(__pyx_r);
30261   __Pyx_RefNannyFinishContext();
30262   return __pyx_r;
30263 }
30264 
30265 /* "BufferFormatFromTypeInfo":1463
30266  *
30267  * @cname('__pyx_format_from_typeinfo')
30268  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type):             # <<<<<<<<<<<<<<
30269  *     cdef __Pyx_StructField *field
30270  *     cdef __pyx_typeinfo_string fmt
30271  */
30272 
__pyx_format_from_typeinfo(__Pyx_TypeInfo * __pyx_v_type)30273 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) {
30274   __Pyx_StructField *__pyx_v_field;
30275   struct __pyx_typeinfo_string __pyx_v_fmt;
30276   PyObject *__pyx_v_part = 0;
30277   PyObject *__pyx_v_result = 0;
30278   PyObject *__pyx_v_alignment = NULL;
30279   PyObject *__pyx_v_parts = NULL;
30280   PyObject *__pyx_v_extents = NULL;
30281   int __pyx_v_i;
30282   PyObject *__pyx_r = NULL;
30283   __Pyx_RefNannyDeclarations
30284   int __pyx_t_1;
30285   PyObject *__pyx_t_2 = NULL;
30286   __Pyx_StructField *__pyx_t_3;
30287   PyObject *__pyx_t_4 = NULL;
30288   PyObject *__pyx_t_5 = NULL;
30289   int __pyx_t_6;
30290   int __pyx_t_7;
30291   int __pyx_t_8;
30292   int __pyx_t_9;
30293   int __pyx_lineno = 0;
30294   const char *__pyx_filename = NULL;
30295   int __pyx_clineno = 0;
30296   __Pyx_RefNannySetupContext("format_from_typeinfo", 0);
30297 
30298   /* "BufferFormatFromTypeInfo":1468
30299  *     cdef bytes part, result
30300  *
30301  *     if type.typegroup == 'S':             # <<<<<<<<<<<<<<
30302  *         assert type.fields != NULL
30303  *         assert type.fields.type != NULL
30304  */
30305   __pyx_t_1 = ((__pyx_v_type->typegroup == 'S') != 0);
30306   if (__pyx_t_1) {
30307 
30308     /* "BufferFormatFromTypeInfo":1469
30309  *
30310  *     if type.typegroup == 'S':
30311  *         assert type.fields != NULL             # <<<<<<<<<<<<<<
30312  *         assert type.fields.type != NULL
30313  *
30314  */
30315     #ifndef CYTHON_WITHOUT_ASSERTIONS
30316     if (unlikely(!Py_OptimizeFlag)) {
30317       if (unlikely(!((__pyx_v_type->fields != NULL) != 0))) {
30318         PyErr_SetNone(PyExc_AssertionError);
30319         __PYX_ERR(1, 1469, __pyx_L1_error)
30320       }
30321     }
30322     #endif
30323 
30324     /* "BufferFormatFromTypeInfo":1470
30325  *     if type.typegroup == 'S':
30326  *         assert type.fields != NULL
30327  *         assert type.fields.type != NULL             # <<<<<<<<<<<<<<
30328  *
30329  *         if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
30330  */
30331     #ifndef CYTHON_WITHOUT_ASSERTIONS
30332     if (unlikely(!Py_OptimizeFlag)) {
30333       if (unlikely(!((__pyx_v_type->fields->type != NULL) != 0))) {
30334         PyErr_SetNone(PyExc_AssertionError);
30335         __PYX_ERR(1, 1470, __pyx_L1_error)
30336       }
30337     }
30338     #endif
30339 
30340     /* "BufferFormatFromTypeInfo":1472
30341  *         assert type.fields.type != NULL
30342  *
30343  *         if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:             # <<<<<<<<<<<<<<
30344  *             alignment = b'^'
30345  *         else:
30346  */
30347     __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0);
30348     if (__pyx_t_1) {
30349 
30350       /* "BufferFormatFromTypeInfo":1473
30351  *
30352  *         if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
30353  *             alignment = b'^'             # <<<<<<<<<<<<<<
30354  *         else:
30355  *             alignment = b''
30356  */
30357       __Pyx_INCREF(__pyx_kp_b__27);
30358       __pyx_v_alignment = __pyx_kp_b__27;
30359 
30360       /* "BufferFormatFromTypeInfo":1472
30361  *         assert type.fields.type != NULL
30362  *
30363  *         if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:             # <<<<<<<<<<<<<<
30364  *             alignment = b'^'
30365  *         else:
30366  */
30367       goto __pyx_L4;
30368     }
30369 
30370     /* "BufferFormatFromTypeInfo":1475
30371  *             alignment = b'^'
30372  *         else:
30373  *             alignment = b''             # <<<<<<<<<<<<<<
30374  *
30375  *         parts = [b"T{"]
30376  */
30377     /*else*/ {
30378       __Pyx_INCREF(__pyx_kp_b__28);
30379       __pyx_v_alignment = __pyx_kp_b__28;
30380     }
30381     __pyx_L4:;
30382 
30383     /* "BufferFormatFromTypeInfo":1477
30384  *             alignment = b''
30385  *
30386  *         parts = [b"T{"]             # <<<<<<<<<<<<<<
30387  *         field = type.fields
30388  *
30389  */
30390     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1477, __pyx_L1_error)
30391     __Pyx_GOTREF(__pyx_t_2);
30392     __Pyx_INCREF(__pyx_kp_b_T);
30393     __Pyx_GIVEREF(__pyx_kp_b_T);
30394     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_b_T);
30395     __pyx_v_parts = ((PyObject*)__pyx_t_2);
30396     __pyx_t_2 = 0;
30397 
30398     /* "BufferFormatFromTypeInfo":1478
30399  *
30400  *         parts = [b"T{"]
30401  *         field = type.fields             # <<<<<<<<<<<<<<
30402  *
30403  *         while field.type:
30404  */
30405     __pyx_t_3 = __pyx_v_type->fields;
30406     __pyx_v_field = __pyx_t_3;
30407 
30408     /* "BufferFormatFromTypeInfo":1480
30409  *         field = type.fields
30410  *
30411  *         while field.type:             # <<<<<<<<<<<<<<
30412  *             part = format_from_typeinfo(field.type)
30413  *             parts.append(part + b':' + field.name + b':')
30414  */
30415     while (1) {
30416       __pyx_t_1 = (__pyx_v_field->type != 0);
30417       if (!__pyx_t_1) break;
30418 
30419       /* "BufferFormatFromTypeInfo":1481
30420  *
30421  *         while field.type:
30422  *             part = format_from_typeinfo(field.type)             # <<<<<<<<<<<<<<
30423  *             parts.append(part + b':' + field.name + b':')
30424  *             field += 1
30425  */
30426       __pyx_t_2 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1481, __pyx_L1_error)
30427       __Pyx_GOTREF(__pyx_t_2);
30428       __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_2));
30429       __pyx_t_2 = 0;
30430 
30431       /* "BufferFormatFromTypeInfo":1482
30432  *         while field.type:
30433  *             part = format_from_typeinfo(field.type)
30434  *             parts.append(part + b':' + field.name + b':')             # <<<<<<<<<<<<<<
30435  *             field += 1
30436  *
30437  */
30438       __pyx_t_2 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__29); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1482, __pyx_L1_error)
30439       __Pyx_GOTREF(__pyx_t_2);
30440       __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1482, __pyx_L1_error)
30441       __Pyx_GOTREF(__pyx_t_4);
30442       __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1482, __pyx_L1_error)
30443       __Pyx_GOTREF(__pyx_t_5);
30444       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30445       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
30446       __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__29); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1482, __pyx_L1_error)
30447       __Pyx_GOTREF(__pyx_t_4);
30448       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
30449       __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_4); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1482, __pyx_L1_error)
30450       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
30451 
30452       /* "BufferFormatFromTypeInfo":1483
30453  *             part = format_from_typeinfo(field.type)
30454  *             parts.append(part + b':' + field.name + b':')
30455  *             field += 1             # <<<<<<<<<<<<<<
30456  *
30457  *         result = alignment.join(parts) + b'}'
30458  */
30459       __pyx_v_field = (__pyx_v_field + 1);
30460     }
30461 
30462     /* "BufferFormatFromTypeInfo":1485
30463  *             field += 1
30464  *
30465  *         result = alignment.join(parts) + b'}'             # <<<<<<<<<<<<<<
30466  *     else:
30467  *         fmt = __Pyx_TypeInfoToFormat(type)
30468  */
30469     __pyx_t_4 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1485, __pyx_L1_error)
30470     __Pyx_GOTREF(__pyx_t_4);
30471     __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_b__30); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1485, __pyx_L1_error)
30472     __Pyx_GOTREF(__pyx_t_5);
30473     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
30474     if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(1, 1485, __pyx_L1_error)
30475     __pyx_v_result = ((PyObject*)__pyx_t_5);
30476     __pyx_t_5 = 0;
30477 
30478     /* "BufferFormatFromTypeInfo":1468
30479  *     cdef bytes part, result
30480  *
30481  *     if type.typegroup == 'S':             # <<<<<<<<<<<<<<
30482  *         assert type.fields != NULL
30483  *         assert type.fields.type != NULL
30484  */
30485     goto __pyx_L3;
30486   }
30487 
30488   /* "BufferFormatFromTypeInfo":1487
30489  *         result = alignment.join(parts) + b'}'
30490  *     else:
30491  *         fmt = __Pyx_TypeInfoToFormat(type)             # <<<<<<<<<<<<<<
30492  *         if type.arraysize[0]:
30493  *             extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
30494  */
30495   /*else*/ {
30496     __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type);
30497 
30498     /* "BufferFormatFromTypeInfo":1488
30499  *     else:
30500  *         fmt = __Pyx_TypeInfoToFormat(type)
30501  *         if type.arraysize[0]:             # <<<<<<<<<<<<<<
30502  *             extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
30503  *             result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
30504  */
30505     __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0);
30506     if (__pyx_t_1) {
30507 
30508       /* "BufferFormatFromTypeInfo":1489
30509  *         fmt = __Pyx_TypeInfoToFormat(type)
30510  *         if type.arraysize[0]:
30511  *             extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]             # <<<<<<<<<<<<<<
30512  *             result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
30513  *         else:
30514  */
30515       __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1489, __pyx_L1_error)
30516       __Pyx_GOTREF(__pyx_t_5);
30517       __pyx_t_7 = __pyx_v_type->ndim;
30518       __pyx_t_8 = __pyx_t_7;
30519       for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
30520         __pyx_v_i = __pyx_t_9;
30521         __pyx_t_4 = __Pyx_PyInt_FromSize_t((__pyx_v_type->arraysize[__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1489, __pyx_L1_error)
30522         __Pyx_GOTREF(__pyx_t_4);
30523         __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1489, __pyx_L1_error)
30524         __Pyx_GOTREF(__pyx_t_2);
30525         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
30526         if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 1489, __pyx_L1_error)
30527         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30528       }
30529       __pyx_v_extents = ((PyObject*)__pyx_t_5);
30530       __pyx_t_5 = 0;
30531 
30532       /* "BufferFormatFromTypeInfo":1490
30533  *         if type.arraysize[0]:
30534  *             extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
30535  *             result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string             # <<<<<<<<<<<<<<
30536  *         else:
30537  *             result = fmt.string
30538  */
30539       __pyx_t_5 = PyUnicode_Join(__pyx_kp_u__31, __pyx_v_extents); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1490, __pyx_L1_error)
30540       __Pyx_GOTREF(__pyx_t_5);
30541       __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1490, __pyx_L1_error)
30542       __Pyx_GOTREF(__pyx_t_2);
30543       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
30544       __pyx_t_5 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1490, __pyx_L1_error)
30545       __Pyx_GOTREF(__pyx_t_5);
30546       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30547       __pyx_t_2 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1490, __pyx_L1_error)
30548       __Pyx_GOTREF(__pyx_t_2);
30549       __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1490, __pyx_L1_error)
30550       __Pyx_GOTREF(__pyx_t_4);
30551       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
30552       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30553       if (!(likely(PyBytes_CheckExact(__pyx_t_4))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 1490, __pyx_L1_error)
30554       __pyx_v_result = ((PyObject*)__pyx_t_4);
30555       __pyx_t_4 = 0;
30556 
30557       /* "BufferFormatFromTypeInfo":1488
30558  *     else:
30559  *         fmt = __Pyx_TypeInfoToFormat(type)
30560  *         if type.arraysize[0]:             # <<<<<<<<<<<<<<
30561  *             extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
30562  *             result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
30563  */
30564       goto __pyx_L7;
30565     }
30566 
30567     /* "BufferFormatFromTypeInfo":1492
30568  *             result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
30569  *         else:
30570  *             result = fmt.string             # <<<<<<<<<<<<<<
30571  *
30572  *     return result
30573  */
30574     /*else*/ {
30575       __pyx_t_4 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1492, __pyx_L1_error)
30576       __Pyx_GOTREF(__pyx_t_4);
30577       __pyx_v_result = ((PyObject*)__pyx_t_4);
30578       __pyx_t_4 = 0;
30579     }
30580     __pyx_L7:;
30581   }
30582   __pyx_L3:;
30583 
30584   /* "BufferFormatFromTypeInfo":1494
30585  *             result = fmt.string
30586  *
30587  *     return result             # <<<<<<<<<<<<<<
30588  */
30589   __Pyx_XDECREF(__pyx_r);
30590   __Pyx_INCREF(__pyx_v_result);
30591   __pyx_r = __pyx_v_result;
30592   goto __pyx_L0;
30593 
30594   /* "BufferFormatFromTypeInfo":1463
30595  *
30596  * @cname('__pyx_format_from_typeinfo')
30597  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type):             # <<<<<<<<<<<<<<
30598  *     cdef __Pyx_StructField *field
30599  *     cdef __pyx_typeinfo_string fmt
30600  */
30601 
30602   /* function exit code */
30603   __pyx_L1_error:;
30604   __Pyx_XDECREF(__pyx_t_2);
30605   __Pyx_XDECREF(__pyx_t_4);
30606   __Pyx_XDECREF(__pyx_t_5);
30607   __Pyx_AddTraceback("BufferFormatFromTypeInfo.format_from_typeinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
30608   __pyx_r = 0;
30609   __pyx_L0:;
30610   __Pyx_XDECREF(__pyx_v_part);
30611   __Pyx_XDECREF(__pyx_v_result);
30612   __Pyx_XDECREF(__pyx_v_alignment);
30613   __Pyx_XDECREF(__pyx_v_parts);
30614   __Pyx_XDECREF(__pyx_v_extents);
30615   __Pyx_XGIVEREF(__pyx_r);
30616   __Pyx_RefNannyFinishContext();
30617   return __pyx_r;
30618 }
30619 static struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_CoeffFunc __pyx_vtable_5qutip_2cy_15cqobjevo_factor_CoeffFunc;
30620 
__pyx_tp_new_5qutip_2cy_15cqobjevo_factor_CoeffFunc(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)30621 static PyObject *__pyx_tp_new_5qutip_2cy_15cqobjevo_factor_CoeffFunc(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
30622   struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *p;
30623   PyObject *o;
30624   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
30625     o = (*t->tp_alloc)(t, 0);
30626   } else {
30627     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
30628   }
30629   if (unlikely(!o)) return 0;
30630   p = ((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *)o);
30631   p->__pyx_vtab = __pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_CoeffFunc;
30632   p->_args = ((PyObject*)Py_None); Py_INCREF(Py_None);
30633   return o;
30634 }
30635 
__pyx_tp_dealloc_5qutip_2cy_15cqobjevo_factor_CoeffFunc(PyObject * o)30636 static void __pyx_tp_dealloc_5qutip_2cy_15cqobjevo_factor_CoeffFunc(PyObject *o) {
30637   struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *p = (struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *)o;
30638   #if CYTHON_USE_TP_FINALIZE
30639   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
30640     if (PyObject_CallFinalizerFromDealloc(o)) return;
30641   }
30642   #endif
30643   PyObject_GC_UnTrack(o);
30644   Py_CLEAR(p->_args);
30645   (*Py_TYPE(o)->tp_free)(o);
30646 }
30647 
__pyx_tp_traverse_5qutip_2cy_15cqobjevo_factor_CoeffFunc(PyObject * o,visitproc v,void * a)30648 static int __pyx_tp_traverse_5qutip_2cy_15cqobjevo_factor_CoeffFunc(PyObject *o, visitproc v, void *a) {
30649   int e;
30650   struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *p = (struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *)o;
30651   if (p->_args) {
30652     e = (*v)(p->_args, a); if (e) return e;
30653   }
30654   return 0;
30655 }
30656 
__pyx_tp_clear_5qutip_2cy_15cqobjevo_factor_CoeffFunc(PyObject * o)30657 static int __pyx_tp_clear_5qutip_2cy_15cqobjevo_factor_CoeffFunc(PyObject *o) {
30658   PyObject* tmp;
30659   struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *p = (struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *)o;
30660   tmp = ((PyObject*)p->_args);
30661   p->_args = ((PyObject*)Py_None); Py_INCREF(Py_None);
30662   Py_XDECREF(tmp);
30663   return 0;
30664 }
30665 
30666 static PyMethodDef __pyx_methods_5qutip_2cy_15cqobjevo_factor_CoeffFunc[] = {
30667   {"set_args", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_5set_args, METH_O, 0},
30668   {"__getstate__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_7__getstate__, METH_NOARGS, 0},
30669   {"__setstate__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_9__setstate__, METH_O, 0},
30670   {"get_args", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_11get_args, METH_NOARGS, 0},
30671   {"__reduce_cython__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_13__reduce_cython__, METH_NOARGS, 0},
30672   {"__setstate_cython__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_15__setstate_cython__, METH_O, 0},
30673   {0, 0, 0, 0}
30674 };
30675 
30676 static PyTypeObject __pyx_type_5qutip_2cy_15cqobjevo_factor_CoeffFunc = {
30677   PyVarObject_HEAD_INIT(0, 0)
30678   "qutip.cy.cqobjevo_factor.CoeffFunc", /*tp_name*/
30679   sizeof(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc), /*tp_basicsize*/
30680   0, /*tp_itemsize*/
30681   __pyx_tp_dealloc_5qutip_2cy_15cqobjevo_factor_CoeffFunc, /*tp_dealloc*/
30682   #if PY_VERSION_HEX < 0x030800b4
30683   0, /*tp_print*/
30684   #endif
30685   #if PY_VERSION_HEX >= 0x030800b4
30686   0, /*tp_vectorcall_offset*/
30687   #endif
30688   0, /*tp_getattr*/
30689   0, /*tp_setattr*/
30690   #if PY_MAJOR_VERSION < 3
30691   0, /*tp_compare*/
30692   #endif
30693   #if PY_MAJOR_VERSION >= 3
30694   0, /*tp_as_async*/
30695   #endif
30696   0, /*tp_repr*/
30697   0, /*tp_as_number*/
30698   0, /*tp_as_sequence*/
30699   0, /*tp_as_mapping*/
30700   0, /*tp_hash*/
30701   __pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_3__call__, /*tp_call*/
30702   0, /*tp_str*/
30703   0, /*tp_getattro*/
30704   0, /*tp_setattro*/
30705   0, /*tp_as_buffer*/
30706   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
30707   0, /*tp_doc*/
30708   __pyx_tp_traverse_5qutip_2cy_15cqobjevo_factor_CoeffFunc, /*tp_traverse*/
30709   __pyx_tp_clear_5qutip_2cy_15cqobjevo_factor_CoeffFunc, /*tp_clear*/
30710   0, /*tp_richcompare*/
30711   0, /*tp_weaklistoffset*/
30712   0, /*tp_iter*/
30713   0, /*tp_iternext*/
30714   __pyx_methods_5qutip_2cy_15cqobjevo_factor_CoeffFunc, /*tp_methods*/
30715   0, /*tp_members*/
30716   0, /*tp_getset*/
30717   0, /*tp_base*/
30718   0, /*tp_dict*/
30719   0, /*tp_descr_get*/
30720   0, /*tp_descr_set*/
30721   0, /*tp_dictoffset*/
30722   __pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_1__init__, /*tp_init*/
30723   0, /*tp_alloc*/
30724   __pyx_tp_new_5qutip_2cy_15cqobjevo_factor_CoeffFunc, /*tp_new*/
30725   0, /*tp_free*/
30726   0, /*tp_is_gc*/
30727   0, /*tp_bases*/
30728   0, /*tp_mro*/
30729   0, /*tp_cache*/
30730   0, /*tp_subclasses*/
30731   0, /*tp_weaklist*/
30732   0, /*tp_del*/
30733   0, /*tp_version_tag*/
30734   #if PY_VERSION_HEX >= 0x030400a1
30735   0, /*tp_finalize*/
30736   #endif
30737   #if PY_VERSION_HEX >= 0x030800b1
30738   0, /*tp_vectorcall*/
30739   #endif
30740   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
30741   0, /*tp_print*/
30742   #endif
30743 };
30744 static struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_StrCoeff __pyx_vtable_5qutip_2cy_15cqobjevo_factor_StrCoeff;
30745 
__pyx_tp_new_5qutip_2cy_15cqobjevo_factor_StrCoeff(PyTypeObject * t,PyObject * a,PyObject * k)30746 static PyObject *__pyx_tp_new_5qutip_2cy_15cqobjevo_factor_StrCoeff(PyTypeObject *t, PyObject *a, PyObject *k) {
30747   struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *p;
30748   PyObject *o = __pyx_tp_new_5qutip_2cy_15cqobjevo_factor_CoeffFunc(t, a, k);
30749   if (unlikely(!o)) return 0;
30750   p = ((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *)o);
30751   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_CoeffFunc*)__pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_StrCoeff;
30752   p->_dyn_args_list = ((PyObject*)Py_None); Py_INCREF(Py_None);
30753   p->_expect_op = ((PyObject*)Py_None); Py_INCREF(Py_None);
30754   p->_expect_vec.data = NULL;
30755   p->_expect_vec.memview = NULL;
30756   p->_vec.data = NULL;
30757   p->_vec.memview = NULL;
30758   return o;
30759 }
30760 
__pyx_tp_dealloc_5qutip_2cy_15cqobjevo_factor_StrCoeff(PyObject * o)30761 static void __pyx_tp_dealloc_5qutip_2cy_15cqobjevo_factor_StrCoeff(PyObject *o) {
30762   struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *p = (struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *)o;
30763   #if CYTHON_USE_TP_FINALIZE
30764   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
30765     if (PyObject_CallFinalizerFromDealloc(o)) return;
30766   }
30767   #endif
30768   PyObject_GC_UnTrack(o);
30769   Py_CLEAR(p->_dyn_args_list);
30770   Py_CLEAR(p->_expect_op);
30771   __PYX_XDEC_MEMVIEW(&p->_expect_vec, 1);
30772   __PYX_XDEC_MEMVIEW(&p->_vec, 1);
30773   PyObject_GC_Track(o);
30774   __pyx_tp_dealloc_5qutip_2cy_15cqobjevo_factor_CoeffFunc(o);
30775 }
30776 
__pyx_tp_traverse_5qutip_2cy_15cqobjevo_factor_StrCoeff(PyObject * o,visitproc v,void * a)30777 static int __pyx_tp_traverse_5qutip_2cy_15cqobjevo_factor_StrCoeff(PyObject *o, visitproc v, void *a) {
30778   int e;
30779   struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *p = (struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *)o;
30780   e = __pyx_tp_traverse_5qutip_2cy_15cqobjevo_factor_CoeffFunc(o, v, a); if (e) return e;
30781   if (p->_dyn_args_list) {
30782     e = (*v)(p->_dyn_args_list, a); if (e) return e;
30783   }
30784   if (p->_expect_op) {
30785     e = (*v)(p->_expect_op, a); if (e) return e;
30786   }
30787   return 0;
30788 }
30789 
__pyx_tp_clear_5qutip_2cy_15cqobjevo_factor_StrCoeff(PyObject * o)30790 static int __pyx_tp_clear_5qutip_2cy_15cqobjevo_factor_StrCoeff(PyObject *o) {
30791   PyObject* tmp;
30792   struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *p = (struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff *)o;
30793   __pyx_tp_clear_5qutip_2cy_15cqobjevo_factor_CoeffFunc(o);
30794   tmp = ((PyObject*)p->_dyn_args_list);
30795   p->_dyn_args_list = ((PyObject*)Py_None); Py_INCREF(Py_None);
30796   Py_XDECREF(tmp);
30797   tmp = ((PyObject*)p->_expect_op);
30798   p->_expect_op = ((PyObject*)Py_None); Py_INCREF(Py_None);
30799   Py_XDECREF(tmp);
30800   return 0;
30801 }
30802 
30803 static PyMethodDef __pyx_methods_5qutip_2cy_15cqobjevo_factor_StrCoeff[] = {
30804   {"_set_dyn_args", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_3_set_dyn_args, METH_O, 0},
30805   {"__getstate__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_7__getstate__, METH_NOARGS, 0},
30806   {"__setstate__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_9__setstate__, METH_O, 0},
30807   {"__reduce_cython__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_11__reduce_cython__, METH_NOARGS, 0},
30808   {"__setstate_cython__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_13__setstate_cython__, METH_O, 0},
30809   {0, 0, 0, 0}
30810 };
30811 
30812 static PyTypeObject __pyx_type_5qutip_2cy_15cqobjevo_factor_StrCoeff = {
30813   PyVarObject_HEAD_INIT(0, 0)
30814   "qutip.cy.cqobjevo_factor.StrCoeff", /*tp_name*/
30815   sizeof(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StrCoeff), /*tp_basicsize*/
30816   0, /*tp_itemsize*/
30817   __pyx_tp_dealloc_5qutip_2cy_15cqobjevo_factor_StrCoeff, /*tp_dealloc*/
30818   #if PY_VERSION_HEX < 0x030800b4
30819   0, /*tp_print*/
30820   #endif
30821   #if PY_VERSION_HEX >= 0x030800b4
30822   0, /*tp_vectorcall_offset*/
30823   #endif
30824   0, /*tp_getattr*/
30825   0, /*tp_setattr*/
30826   #if PY_MAJOR_VERSION < 3
30827   0, /*tp_compare*/
30828   #endif
30829   #if PY_MAJOR_VERSION >= 3
30830   0, /*tp_as_async*/
30831   #endif
30832   0, /*tp_repr*/
30833   0, /*tp_as_number*/
30834   0, /*tp_as_sequence*/
30835   0, /*tp_as_mapping*/
30836   0, /*tp_hash*/
30837   __pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_5__call__, /*tp_call*/
30838   0, /*tp_str*/
30839   0, /*tp_getattro*/
30840   0, /*tp_setattro*/
30841   0, /*tp_as_buffer*/
30842   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
30843   0, /*tp_doc*/
30844   __pyx_tp_traverse_5qutip_2cy_15cqobjevo_factor_StrCoeff, /*tp_traverse*/
30845   __pyx_tp_clear_5qutip_2cy_15cqobjevo_factor_StrCoeff, /*tp_clear*/
30846   0, /*tp_richcompare*/
30847   0, /*tp_weaklistoffset*/
30848   0, /*tp_iter*/
30849   0, /*tp_iternext*/
30850   __pyx_methods_5qutip_2cy_15cqobjevo_factor_StrCoeff, /*tp_methods*/
30851   0, /*tp_members*/
30852   0, /*tp_getset*/
30853   0, /*tp_base*/
30854   0, /*tp_dict*/
30855   0, /*tp_descr_get*/
30856   0, /*tp_descr_set*/
30857   0, /*tp_dictoffset*/
30858   __pyx_pw_5qutip_2cy_15cqobjevo_factor_8StrCoeff_1__init__, /*tp_init*/
30859   0, /*tp_alloc*/
30860   __pyx_tp_new_5qutip_2cy_15cqobjevo_factor_StrCoeff, /*tp_new*/
30861   0, /*tp_free*/
30862   0, /*tp_is_gc*/
30863   0, /*tp_bases*/
30864   0, /*tp_mro*/
30865   0, /*tp_cache*/
30866   0, /*tp_subclasses*/
30867   0, /*tp_weaklist*/
30868   0, /*tp_del*/
30869   0, /*tp_version_tag*/
30870   #if PY_VERSION_HEX >= 0x030400a1
30871   0, /*tp_finalize*/
30872   #endif
30873   #if PY_VERSION_HEX >= 0x030800b1
30874   0, /*tp_vectorcall*/
30875   #endif
30876   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
30877   0, /*tp_print*/
30878   #endif
30879 };
30880 static struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff __pyx_vtable_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff;
30881 
__pyx_tp_new_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff(PyTypeObject * t,PyObject * a,PyObject * k)30882 static PyObject *__pyx_tp_new_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff(PyTypeObject *t, PyObject *a, PyObject *k) {
30883   struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *p;
30884   PyObject *o = __pyx_tp_new_5qutip_2cy_15cqobjevo_factor_CoeffFunc(t, a, k);
30885   if (unlikely(!o)) return 0;
30886   p = ((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *)o);
30887   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_CoeffFunc*)__pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff;
30888   p->c.data = NULL;
30889   p->c.memview = NULL;
30890   return o;
30891 }
30892 
__pyx_tp_dealloc_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff(PyObject * o)30893 static void __pyx_tp_dealloc_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff(PyObject *o) {
30894   struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *p = (struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff *)o;
30895   #if CYTHON_USE_TP_FINALIZE
30896   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
30897     if (PyObject_CallFinalizerFromDealloc(o)) return;
30898   }
30899   #endif
30900   PyObject_GC_UnTrack(o);
30901   __PYX_XDEC_MEMVIEW(&p->c, 1);
30902   PyObject_GC_Track(o);
30903   __pyx_tp_dealloc_5qutip_2cy_15cqobjevo_factor_CoeffFunc(o);
30904 }
30905 
30906 static PyMethodDef __pyx_methods_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff[] = {
30907   {"set_args", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_5set_args, METH_O, 0},
30908   {"__getstate__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_7__getstate__, METH_NOARGS, 0},
30909   {"__setstate__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_9__setstate__, METH_O, 0},
30910   {"__reduce_cython__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_11__reduce_cython__, METH_NOARGS, 0},
30911   {"__setstate_cython__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_13__setstate_cython__, METH_O, 0},
30912   {0, 0, 0, 0}
30913 };
30914 
30915 static PyTypeObject __pyx_type_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff = {
30916   PyVarObject_HEAD_INIT(0, 0)
30917   "qutip.cy.cqobjevo_factor.InterpolateCoeff", /*tp_name*/
30918   sizeof(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff), /*tp_basicsize*/
30919   0, /*tp_itemsize*/
30920   __pyx_tp_dealloc_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff, /*tp_dealloc*/
30921   #if PY_VERSION_HEX < 0x030800b4
30922   0, /*tp_print*/
30923   #endif
30924   #if PY_VERSION_HEX >= 0x030800b4
30925   0, /*tp_vectorcall_offset*/
30926   #endif
30927   0, /*tp_getattr*/
30928   0, /*tp_setattr*/
30929   #if PY_MAJOR_VERSION < 3
30930   0, /*tp_compare*/
30931   #endif
30932   #if PY_MAJOR_VERSION >= 3
30933   0, /*tp_as_async*/
30934   #endif
30935   0, /*tp_repr*/
30936   0, /*tp_as_number*/
30937   0, /*tp_as_sequence*/
30938   0, /*tp_as_mapping*/
30939   0, /*tp_hash*/
30940   __pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_3__call__, /*tp_call*/
30941   0, /*tp_str*/
30942   0, /*tp_getattro*/
30943   0, /*tp_setattro*/
30944   0, /*tp_as_buffer*/
30945   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
30946   0, /*tp_doc*/
30947   __pyx_tp_traverse_5qutip_2cy_15cqobjevo_factor_CoeffFunc, /*tp_traverse*/
30948   __pyx_tp_clear_5qutip_2cy_15cqobjevo_factor_CoeffFunc, /*tp_clear*/
30949   0, /*tp_richcompare*/
30950   0, /*tp_weaklistoffset*/
30951   0, /*tp_iter*/
30952   0, /*tp_iternext*/
30953   __pyx_methods_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff, /*tp_methods*/
30954   0, /*tp_members*/
30955   0, /*tp_getset*/
30956   0, /*tp_base*/
30957   0, /*tp_dict*/
30958   0, /*tp_descr_get*/
30959   0, /*tp_descr_set*/
30960   0, /*tp_dictoffset*/
30961   __pyx_pw_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff_1__init__, /*tp_init*/
30962   0, /*tp_alloc*/
30963   __pyx_tp_new_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff, /*tp_new*/
30964   0, /*tp_free*/
30965   0, /*tp_is_gc*/
30966   0, /*tp_bases*/
30967   0, /*tp_mro*/
30968   0, /*tp_cache*/
30969   0, /*tp_subclasses*/
30970   0, /*tp_weaklist*/
30971   0, /*tp_del*/
30972   0, /*tp_version_tag*/
30973   #if PY_VERSION_HEX >= 0x030400a1
30974   0, /*tp_finalize*/
30975   #endif
30976   #if PY_VERSION_HEX >= 0x030800b1
30977   0, /*tp_vectorcall*/
30978   #endif
30979   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
30980   0, /*tp_print*/
30981   #endif
30982 };
30983 static struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_InterCoeffCte __pyx_vtable_5qutip_2cy_15cqobjevo_factor_InterCoeffCte;
30984 
__pyx_tp_new_5qutip_2cy_15cqobjevo_factor_InterCoeffCte(PyTypeObject * t,PyObject * a,PyObject * k)30985 static PyObject *__pyx_tp_new_5qutip_2cy_15cqobjevo_factor_InterCoeffCte(PyTypeObject *t, PyObject *a, PyObject *k) {
30986   struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *p;
30987   PyObject *o = __pyx_tp_new_5qutip_2cy_15cqobjevo_factor_CoeffFunc(t, a, k);
30988   if (unlikely(!o)) return 0;
30989   p = ((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *)o);
30990   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_CoeffFunc*)__pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_InterCoeffCte;
30991   p->tlist.data = NULL;
30992   p->tlist.memview = NULL;
30993   p->y.data = NULL;
30994   p->y.memview = NULL;
30995   p->M.data = NULL;
30996   p->M.memview = NULL;
30997   return o;
30998 }
30999 
__pyx_tp_dealloc_5qutip_2cy_15cqobjevo_factor_InterCoeffCte(PyObject * o)31000 static void __pyx_tp_dealloc_5qutip_2cy_15cqobjevo_factor_InterCoeffCte(PyObject *o) {
31001   struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *p = (struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte *)o;
31002   #if CYTHON_USE_TP_FINALIZE
31003   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
31004     if (PyObject_CallFinalizerFromDealloc(o)) return;
31005   }
31006   #endif
31007   PyObject_GC_UnTrack(o);
31008   __PYX_XDEC_MEMVIEW(&p->tlist, 1);
31009   __PYX_XDEC_MEMVIEW(&p->y, 1);
31010   __PYX_XDEC_MEMVIEW(&p->M, 1);
31011   PyObject_GC_Track(o);
31012   __pyx_tp_dealloc_5qutip_2cy_15cqobjevo_factor_CoeffFunc(o);
31013 }
31014 
31015 static PyMethodDef __pyx_methods_5qutip_2cy_15cqobjevo_factor_InterCoeffCte[] = {
31016   {"set_args", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_3set_args, METH_O, 0},
31017   {"__getstate__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_5__getstate__, METH_NOARGS, 0},
31018   {"__setstate__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_7__setstate__, METH_O, 0},
31019   {"__reduce_cython__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_9__reduce_cython__, METH_NOARGS, 0},
31020   {"__setstate_cython__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_11__setstate_cython__, METH_O, 0},
31021   {0, 0, 0, 0}
31022 };
31023 
31024 static PyTypeObject __pyx_type_5qutip_2cy_15cqobjevo_factor_InterCoeffCte = {
31025   PyVarObject_HEAD_INIT(0, 0)
31026   "qutip.cy.cqobjevo_factor.InterCoeffCte", /*tp_name*/
31027   sizeof(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffCte), /*tp_basicsize*/
31028   0, /*tp_itemsize*/
31029   __pyx_tp_dealloc_5qutip_2cy_15cqobjevo_factor_InterCoeffCte, /*tp_dealloc*/
31030   #if PY_VERSION_HEX < 0x030800b4
31031   0, /*tp_print*/
31032   #endif
31033   #if PY_VERSION_HEX >= 0x030800b4
31034   0, /*tp_vectorcall_offset*/
31035   #endif
31036   0, /*tp_getattr*/
31037   0, /*tp_setattr*/
31038   #if PY_MAJOR_VERSION < 3
31039   0, /*tp_compare*/
31040   #endif
31041   #if PY_MAJOR_VERSION >= 3
31042   0, /*tp_as_async*/
31043   #endif
31044   0, /*tp_repr*/
31045   0, /*tp_as_number*/
31046   0, /*tp_as_sequence*/
31047   0, /*tp_as_mapping*/
31048   0, /*tp_hash*/
31049   #if CYTHON_COMPILING_IN_PYPY
31050   __pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_3__call__, /*tp_call*/
31051   #else
31052   0, /*tp_call*/
31053   #endif
31054   0, /*tp_str*/
31055   0, /*tp_getattro*/
31056   0, /*tp_setattro*/
31057   0, /*tp_as_buffer*/
31058   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
31059   0, /*tp_doc*/
31060   __pyx_tp_traverse_5qutip_2cy_15cqobjevo_factor_CoeffFunc, /*tp_traverse*/
31061   __pyx_tp_clear_5qutip_2cy_15cqobjevo_factor_CoeffFunc, /*tp_clear*/
31062   0, /*tp_richcompare*/
31063   0, /*tp_weaklistoffset*/
31064   0, /*tp_iter*/
31065   0, /*tp_iternext*/
31066   __pyx_methods_5qutip_2cy_15cqobjevo_factor_InterCoeffCte, /*tp_methods*/
31067   0, /*tp_members*/
31068   0, /*tp_getset*/
31069   0, /*tp_base*/
31070   0, /*tp_dict*/
31071   0, /*tp_descr_get*/
31072   0, /*tp_descr_set*/
31073   0, /*tp_dictoffset*/
31074   __pyx_pw_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte_1__init__, /*tp_init*/
31075   0, /*tp_alloc*/
31076   __pyx_tp_new_5qutip_2cy_15cqobjevo_factor_InterCoeffCte, /*tp_new*/
31077   0, /*tp_free*/
31078   0, /*tp_is_gc*/
31079   0, /*tp_bases*/
31080   0, /*tp_mro*/
31081   0, /*tp_cache*/
31082   0, /*tp_subclasses*/
31083   0, /*tp_weaklist*/
31084   0, /*tp_del*/
31085   0, /*tp_version_tag*/
31086   #if PY_VERSION_HEX >= 0x030400a1
31087   0, /*tp_finalize*/
31088   #endif
31089   #if PY_VERSION_HEX >= 0x030800b1
31090   0, /*tp_vectorcall*/
31091   #endif
31092   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
31093   0, /*tp_print*/
31094   #endif
31095 };
31096 static struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_InterCoeffT __pyx_vtable_5qutip_2cy_15cqobjevo_factor_InterCoeffT;
31097 
__pyx_tp_new_5qutip_2cy_15cqobjevo_factor_InterCoeffT(PyTypeObject * t,PyObject * a,PyObject * k)31098 static PyObject *__pyx_tp_new_5qutip_2cy_15cqobjevo_factor_InterCoeffT(PyTypeObject *t, PyObject *a, PyObject *k) {
31099   struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *p;
31100   PyObject *o = __pyx_tp_new_5qutip_2cy_15cqobjevo_factor_CoeffFunc(t, a, k);
31101   if (unlikely(!o)) return 0;
31102   p = ((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *)o);
31103   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_CoeffFunc*)__pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_InterCoeffT;
31104   p->tlist.data = NULL;
31105   p->tlist.memview = NULL;
31106   p->y.data = NULL;
31107   p->y.memview = NULL;
31108   p->M.data = NULL;
31109   p->M.memview = NULL;
31110   return o;
31111 }
31112 
__pyx_tp_dealloc_5qutip_2cy_15cqobjevo_factor_InterCoeffT(PyObject * o)31113 static void __pyx_tp_dealloc_5qutip_2cy_15cqobjevo_factor_InterCoeffT(PyObject *o) {
31114   struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *p = (struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT *)o;
31115   #if CYTHON_USE_TP_FINALIZE
31116   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
31117     if (PyObject_CallFinalizerFromDealloc(o)) return;
31118   }
31119   #endif
31120   PyObject_GC_UnTrack(o);
31121   __PYX_XDEC_MEMVIEW(&p->tlist, 1);
31122   __PYX_XDEC_MEMVIEW(&p->y, 1);
31123   __PYX_XDEC_MEMVIEW(&p->M, 1);
31124   PyObject_GC_Track(o);
31125   __pyx_tp_dealloc_5qutip_2cy_15cqobjevo_factor_CoeffFunc(o);
31126 }
31127 
31128 static PyMethodDef __pyx_methods_5qutip_2cy_15cqobjevo_factor_InterCoeffT[] = {
31129   {"set_args", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_3set_args, METH_O, 0},
31130   {"__getstate__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_5__getstate__, METH_NOARGS, 0},
31131   {"__setstate__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_7__setstate__, METH_O, 0},
31132   {"__reduce_cython__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_9__reduce_cython__, METH_NOARGS, 0},
31133   {"__setstate_cython__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_11__setstate_cython__, METH_O, 0},
31134   {0, 0, 0, 0}
31135 };
31136 
31137 static PyTypeObject __pyx_type_5qutip_2cy_15cqobjevo_factor_InterCoeffT = {
31138   PyVarObject_HEAD_INIT(0, 0)
31139   "qutip.cy.cqobjevo_factor.InterCoeffT", /*tp_name*/
31140   sizeof(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_InterCoeffT), /*tp_basicsize*/
31141   0, /*tp_itemsize*/
31142   __pyx_tp_dealloc_5qutip_2cy_15cqobjevo_factor_InterCoeffT, /*tp_dealloc*/
31143   #if PY_VERSION_HEX < 0x030800b4
31144   0, /*tp_print*/
31145   #endif
31146   #if PY_VERSION_HEX >= 0x030800b4
31147   0, /*tp_vectorcall_offset*/
31148   #endif
31149   0, /*tp_getattr*/
31150   0, /*tp_setattr*/
31151   #if PY_MAJOR_VERSION < 3
31152   0, /*tp_compare*/
31153   #endif
31154   #if PY_MAJOR_VERSION >= 3
31155   0, /*tp_as_async*/
31156   #endif
31157   0, /*tp_repr*/
31158   0, /*tp_as_number*/
31159   0, /*tp_as_sequence*/
31160   0, /*tp_as_mapping*/
31161   0, /*tp_hash*/
31162   #if CYTHON_COMPILING_IN_PYPY
31163   __pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_3__call__, /*tp_call*/
31164   #else
31165   0, /*tp_call*/
31166   #endif
31167   0, /*tp_str*/
31168   0, /*tp_getattro*/
31169   0, /*tp_setattro*/
31170   0, /*tp_as_buffer*/
31171   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
31172   0, /*tp_doc*/
31173   __pyx_tp_traverse_5qutip_2cy_15cqobjevo_factor_CoeffFunc, /*tp_traverse*/
31174   __pyx_tp_clear_5qutip_2cy_15cqobjevo_factor_CoeffFunc, /*tp_clear*/
31175   0, /*tp_richcompare*/
31176   0, /*tp_weaklistoffset*/
31177   0, /*tp_iter*/
31178   0, /*tp_iternext*/
31179   __pyx_methods_5qutip_2cy_15cqobjevo_factor_InterCoeffT, /*tp_methods*/
31180   0, /*tp_members*/
31181   0, /*tp_getset*/
31182   0, /*tp_base*/
31183   0, /*tp_dict*/
31184   0, /*tp_descr_get*/
31185   0, /*tp_descr_set*/
31186   0, /*tp_dictoffset*/
31187   __pyx_pw_5qutip_2cy_15cqobjevo_factor_11InterCoeffT_1__init__, /*tp_init*/
31188   0, /*tp_alloc*/
31189   __pyx_tp_new_5qutip_2cy_15cqobjevo_factor_InterCoeffT, /*tp_new*/
31190   0, /*tp_free*/
31191   0, /*tp_is_gc*/
31192   0, /*tp_bases*/
31193   0, /*tp_mro*/
31194   0, /*tp_cache*/
31195   0, /*tp_subclasses*/
31196   0, /*tp_weaklist*/
31197   0, /*tp_del*/
31198   0, /*tp_version_tag*/
31199   #if PY_VERSION_HEX >= 0x030400a1
31200   0, /*tp_finalize*/
31201   #endif
31202   #if PY_VERSION_HEX >= 0x030800b1
31203   0, /*tp_vectorcall*/
31204   #endif
31205   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
31206   0, /*tp_print*/
31207   #endif
31208 };
31209 static struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_StepCoeff __pyx_vtable_5qutip_2cy_15cqobjevo_factor_StepCoeff;
31210 
__pyx_tp_new_5qutip_2cy_15cqobjevo_factor_StepCoeff(PyTypeObject * t,PyObject * a,PyObject * k)31211 static PyObject *__pyx_tp_new_5qutip_2cy_15cqobjevo_factor_StepCoeff(PyTypeObject *t, PyObject *a, PyObject *k) {
31212   struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff *p;
31213   PyObject *o = __pyx_tp_new_5qutip_2cy_15cqobjevo_factor_CoeffFunc(t, a, k);
31214   if (unlikely(!o)) return 0;
31215   p = ((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff *)o);
31216   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_CoeffFunc*)__pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_StepCoeff;
31217   p->tlist.data = NULL;
31218   p->tlist.memview = NULL;
31219   p->y.data = NULL;
31220   p->y.memview = NULL;
31221   return o;
31222 }
31223 
__pyx_tp_dealloc_5qutip_2cy_15cqobjevo_factor_StepCoeff(PyObject * o)31224 static void __pyx_tp_dealloc_5qutip_2cy_15cqobjevo_factor_StepCoeff(PyObject *o) {
31225   struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff *p = (struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff *)o;
31226   #if CYTHON_USE_TP_FINALIZE
31227   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
31228     if (PyObject_CallFinalizerFromDealloc(o)) return;
31229   }
31230   #endif
31231   PyObject_GC_UnTrack(o);
31232   __PYX_XDEC_MEMVIEW(&p->tlist, 1);
31233   __PYX_XDEC_MEMVIEW(&p->y, 1);
31234   PyObject_GC_Track(o);
31235   __pyx_tp_dealloc_5qutip_2cy_15cqobjevo_factor_CoeffFunc(o);
31236 }
31237 
31238 static PyMethodDef __pyx_methods_5qutip_2cy_15cqobjevo_factor_StepCoeff[] = {
31239   {"set_arg", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_9StepCoeff_3set_arg, METH_O, 0},
31240   {"__getstate__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_9StepCoeff_5__getstate__, METH_NOARGS, 0},
31241   {"__setstate__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_9StepCoeff_7__setstate__, METH_O, 0},
31242   {"__reduce_cython__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_9StepCoeff_9__reduce_cython__, METH_NOARGS, 0},
31243   {"__setstate_cython__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_9StepCoeff_11__setstate_cython__, METH_O, 0},
31244   {0, 0, 0, 0}
31245 };
31246 
31247 static PyTypeObject __pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeff = {
31248   PyVarObject_HEAD_INIT(0, 0)
31249   "qutip.cy.cqobjevo_factor.StepCoeff", /*tp_name*/
31250   sizeof(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeff), /*tp_basicsize*/
31251   0, /*tp_itemsize*/
31252   __pyx_tp_dealloc_5qutip_2cy_15cqobjevo_factor_StepCoeff, /*tp_dealloc*/
31253   #if PY_VERSION_HEX < 0x030800b4
31254   0, /*tp_print*/
31255   #endif
31256   #if PY_VERSION_HEX >= 0x030800b4
31257   0, /*tp_vectorcall_offset*/
31258   #endif
31259   0, /*tp_getattr*/
31260   0, /*tp_setattr*/
31261   #if PY_MAJOR_VERSION < 3
31262   0, /*tp_compare*/
31263   #endif
31264   #if PY_MAJOR_VERSION >= 3
31265   0, /*tp_as_async*/
31266   #endif
31267   0, /*tp_repr*/
31268   0, /*tp_as_number*/
31269   0, /*tp_as_sequence*/
31270   0, /*tp_as_mapping*/
31271   0, /*tp_hash*/
31272   #if CYTHON_COMPILING_IN_PYPY
31273   __pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_3__call__, /*tp_call*/
31274   #else
31275   0, /*tp_call*/
31276   #endif
31277   0, /*tp_str*/
31278   0, /*tp_getattro*/
31279   0, /*tp_setattro*/
31280   0, /*tp_as_buffer*/
31281   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
31282   0, /*tp_doc*/
31283   __pyx_tp_traverse_5qutip_2cy_15cqobjevo_factor_CoeffFunc, /*tp_traverse*/
31284   __pyx_tp_clear_5qutip_2cy_15cqobjevo_factor_CoeffFunc, /*tp_clear*/
31285   0, /*tp_richcompare*/
31286   0, /*tp_weaklistoffset*/
31287   0, /*tp_iter*/
31288   0, /*tp_iternext*/
31289   __pyx_methods_5qutip_2cy_15cqobjevo_factor_StepCoeff, /*tp_methods*/
31290   0, /*tp_members*/
31291   0, /*tp_getset*/
31292   0, /*tp_base*/
31293   0, /*tp_dict*/
31294   0, /*tp_descr_get*/
31295   0, /*tp_descr_set*/
31296   0, /*tp_dictoffset*/
31297   __pyx_pw_5qutip_2cy_15cqobjevo_factor_9StepCoeff_1__init__, /*tp_init*/
31298   0, /*tp_alloc*/
31299   __pyx_tp_new_5qutip_2cy_15cqobjevo_factor_StepCoeff, /*tp_new*/
31300   0, /*tp_free*/
31301   0, /*tp_is_gc*/
31302   0, /*tp_bases*/
31303   0, /*tp_mro*/
31304   0, /*tp_cache*/
31305   0, /*tp_subclasses*/
31306   0, /*tp_weaklist*/
31307   0, /*tp_del*/
31308   0, /*tp_version_tag*/
31309   #if PY_VERSION_HEX >= 0x030400a1
31310   0, /*tp_finalize*/
31311   #endif
31312   #if PY_VERSION_HEX >= 0x030800b1
31313   0, /*tp_vectorcall*/
31314   #endif
31315   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
31316   0, /*tp_print*/
31317   #endif
31318 };
31319 static struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_StepCoeffT __pyx_vtable_5qutip_2cy_15cqobjevo_factor_StepCoeffT;
31320 
__pyx_tp_new_5qutip_2cy_15cqobjevo_factor_StepCoeffT(PyTypeObject * t,PyObject * a,PyObject * k)31321 static PyObject *__pyx_tp_new_5qutip_2cy_15cqobjevo_factor_StepCoeffT(PyTypeObject *t, PyObject *a, PyObject *k) {
31322   struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffT *p;
31323   PyObject *o = __pyx_tp_new_5qutip_2cy_15cqobjevo_factor_StepCoeff(t, a, k);
31324   if (unlikely(!o)) return 0;
31325   p = ((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffT *)o);
31326   p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_CoeffFunc*)__pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_StepCoeffT;
31327   return o;
31328 }
31329 
31330 static PyMethodDef __pyx_methods_5qutip_2cy_15cqobjevo_factor_StepCoeffT[] = {
31331   {"__reduce_cython__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_10StepCoeffT_1__reduce_cython__, METH_NOARGS, 0},
31332   {"__setstate_cython__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_10StepCoeffT_3__setstate_cython__, METH_O, 0},
31333   {0, 0, 0, 0}
31334 };
31335 
31336 static PyTypeObject __pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeffT = {
31337   PyVarObject_HEAD_INIT(0, 0)
31338   "qutip.cy.cqobjevo_factor.StepCoeffT", /*tp_name*/
31339   sizeof(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffT), /*tp_basicsize*/
31340   0, /*tp_itemsize*/
31341   __pyx_tp_dealloc_5qutip_2cy_15cqobjevo_factor_StepCoeff, /*tp_dealloc*/
31342   #if PY_VERSION_HEX < 0x030800b4
31343   0, /*tp_print*/
31344   #endif
31345   #if PY_VERSION_HEX >= 0x030800b4
31346   0, /*tp_vectorcall_offset*/
31347   #endif
31348   0, /*tp_getattr*/
31349   0, /*tp_setattr*/
31350   #if PY_MAJOR_VERSION < 3
31351   0, /*tp_compare*/
31352   #endif
31353   #if PY_MAJOR_VERSION >= 3
31354   0, /*tp_as_async*/
31355   #endif
31356   0, /*tp_repr*/
31357   0, /*tp_as_number*/
31358   0, /*tp_as_sequence*/
31359   0, /*tp_as_mapping*/
31360   0, /*tp_hash*/
31361   #if CYTHON_COMPILING_IN_PYPY
31362   __pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_3__call__, /*tp_call*/
31363   #else
31364   0, /*tp_call*/
31365   #endif
31366   0, /*tp_str*/
31367   0, /*tp_getattro*/
31368   0, /*tp_setattro*/
31369   0, /*tp_as_buffer*/
31370   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
31371   0, /*tp_doc*/
31372   __pyx_tp_traverse_5qutip_2cy_15cqobjevo_factor_CoeffFunc, /*tp_traverse*/
31373   __pyx_tp_clear_5qutip_2cy_15cqobjevo_factor_CoeffFunc, /*tp_clear*/
31374   0, /*tp_richcompare*/
31375   0, /*tp_weaklistoffset*/
31376   0, /*tp_iter*/
31377   0, /*tp_iternext*/
31378   __pyx_methods_5qutip_2cy_15cqobjevo_factor_StepCoeffT, /*tp_methods*/
31379   0, /*tp_members*/
31380   0, /*tp_getset*/
31381   0, /*tp_base*/
31382   0, /*tp_dict*/
31383   0, /*tp_descr_get*/
31384   0, /*tp_descr_set*/
31385   0, /*tp_dictoffset*/
31386   #if CYTHON_COMPILING_IN_PYPY
31387   __pyx_pw_5qutip_2cy_15cqobjevo_factor_9StepCoeff_1__init__, /*tp_init*/
31388   #else
31389   0, /*tp_init*/
31390   #endif
31391   0, /*tp_alloc*/
31392   __pyx_tp_new_5qutip_2cy_15cqobjevo_factor_StepCoeffT, /*tp_new*/
31393   0, /*tp_free*/
31394   0, /*tp_is_gc*/
31395   0, /*tp_bases*/
31396   0, /*tp_mro*/
31397   0, /*tp_cache*/
31398   0, /*tp_subclasses*/
31399   0, /*tp_weaklist*/
31400   0, /*tp_del*/
31401   0, /*tp_version_tag*/
31402   #if PY_VERSION_HEX >= 0x030400a1
31403   0, /*tp_finalize*/
31404   #endif
31405   #if PY_VERSION_HEX >= 0x030800b1
31406   0, /*tp_vectorcall*/
31407   #endif
31408   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
31409   0, /*tp_print*/
31410   #endif
31411 };
31412 static struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_StepCoeffCte __pyx_vtable_5qutip_2cy_15cqobjevo_factor_StepCoeffCte;
31413 
__pyx_tp_new_5qutip_2cy_15cqobjevo_factor_StepCoeffCte(PyTypeObject * t,PyObject * a,PyObject * k)31414 static PyObject *__pyx_tp_new_5qutip_2cy_15cqobjevo_factor_StepCoeffCte(PyTypeObject *t, PyObject *a, PyObject *k) {
31415   struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffCte *p;
31416   PyObject *o = __pyx_tp_new_5qutip_2cy_15cqobjevo_factor_StepCoeff(t, a, k);
31417   if (unlikely(!o)) return 0;
31418   p = ((struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffCte *)o);
31419   p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5qutip_2cy_15cqobjevo_factor_CoeffFunc*)__pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_StepCoeffCte;
31420   return o;
31421 }
31422 
31423 static PyMethodDef __pyx_methods_5qutip_2cy_15cqobjevo_factor_StepCoeffCte[] = {
31424   {"__reduce_cython__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_12StepCoeffCte_1__reduce_cython__, METH_NOARGS, 0},
31425   {"__setstate_cython__", (PyCFunction)__pyx_pw_5qutip_2cy_15cqobjevo_factor_12StepCoeffCte_3__setstate_cython__, METH_O, 0},
31426   {0, 0, 0, 0}
31427 };
31428 
31429 static PyTypeObject __pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeffCte = {
31430   PyVarObject_HEAD_INIT(0, 0)
31431   "qutip.cy.cqobjevo_factor.StepCoeffCte", /*tp_name*/
31432   sizeof(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_StepCoeffCte), /*tp_basicsize*/
31433   0, /*tp_itemsize*/
31434   __pyx_tp_dealloc_5qutip_2cy_15cqobjevo_factor_StepCoeff, /*tp_dealloc*/
31435   #if PY_VERSION_HEX < 0x030800b4
31436   0, /*tp_print*/
31437   #endif
31438   #if PY_VERSION_HEX >= 0x030800b4
31439   0, /*tp_vectorcall_offset*/
31440   #endif
31441   0, /*tp_getattr*/
31442   0, /*tp_setattr*/
31443   #if PY_MAJOR_VERSION < 3
31444   0, /*tp_compare*/
31445   #endif
31446   #if PY_MAJOR_VERSION >= 3
31447   0, /*tp_as_async*/
31448   #endif
31449   0, /*tp_repr*/
31450   0, /*tp_as_number*/
31451   0, /*tp_as_sequence*/
31452   0, /*tp_as_mapping*/
31453   0, /*tp_hash*/
31454   #if CYTHON_COMPILING_IN_PYPY
31455   __pyx_pw_5qutip_2cy_15cqobjevo_factor_9CoeffFunc_3__call__, /*tp_call*/
31456   #else
31457   0, /*tp_call*/
31458   #endif
31459   0, /*tp_str*/
31460   0, /*tp_getattro*/
31461   0, /*tp_setattro*/
31462   0, /*tp_as_buffer*/
31463   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
31464   0, /*tp_doc*/
31465   __pyx_tp_traverse_5qutip_2cy_15cqobjevo_factor_CoeffFunc, /*tp_traverse*/
31466   __pyx_tp_clear_5qutip_2cy_15cqobjevo_factor_CoeffFunc, /*tp_clear*/
31467   0, /*tp_richcompare*/
31468   0, /*tp_weaklistoffset*/
31469   0, /*tp_iter*/
31470   0, /*tp_iternext*/
31471   __pyx_methods_5qutip_2cy_15cqobjevo_factor_StepCoeffCte, /*tp_methods*/
31472   0, /*tp_members*/
31473   0, /*tp_getset*/
31474   0, /*tp_base*/
31475   0, /*tp_dict*/
31476   0, /*tp_descr_get*/
31477   0, /*tp_descr_set*/
31478   0, /*tp_dictoffset*/
31479   #if CYTHON_COMPILING_IN_PYPY
31480   __pyx_pw_5qutip_2cy_15cqobjevo_factor_9StepCoeff_1__init__, /*tp_init*/
31481   #else
31482   0, /*tp_init*/
31483   #endif
31484   0, /*tp_alloc*/
31485   __pyx_tp_new_5qutip_2cy_15cqobjevo_factor_StepCoeffCte, /*tp_new*/
31486   0, /*tp_free*/
31487   0, /*tp_is_gc*/
31488   0, /*tp_bases*/
31489   0, /*tp_mro*/
31490   0, /*tp_cache*/
31491   0, /*tp_subclasses*/
31492   0, /*tp_weaklist*/
31493   0, /*tp_del*/
31494   0, /*tp_version_tag*/
31495   #if PY_VERSION_HEX >= 0x030400a1
31496   0, /*tp_finalize*/
31497   #endif
31498   #if PY_VERSION_HEX >= 0x030800b1
31499   0, /*tp_vectorcall*/
31500   #endif
31501   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
31502   0, /*tp_print*/
31503   #endif
31504 };
31505 static struct __pyx_vtabstruct_array __pyx_vtable_array;
31506 
__pyx_tp_new_array(PyTypeObject * t,PyObject * a,PyObject * k)31507 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
31508   struct __pyx_array_obj *p;
31509   PyObject *o;
31510   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
31511     o = (*t->tp_alloc)(t, 0);
31512   } else {
31513     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
31514   }
31515   if (unlikely(!o)) return 0;
31516   p = ((struct __pyx_array_obj *)o);
31517   p->__pyx_vtab = __pyx_vtabptr_array;
31518   p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
31519   p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
31520   if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
31521   return o;
31522   bad:
31523   Py_DECREF(o); o = 0;
31524   return NULL;
31525 }
31526 
__pyx_tp_dealloc_array(PyObject * o)31527 static void __pyx_tp_dealloc_array(PyObject *o) {
31528   struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
31529   #if CYTHON_USE_TP_FINALIZE
31530   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
31531     if (PyObject_CallFinalizerFromDealloc(o)) return;
31532   }
31533   #endif
31534   {
31535     PyObject *etype, *eval, *etb;
31536     PyErr_Fetch(&etype, &eval, &etb);
31537     __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
31538     __pyx_array___dealloc__(o);
31539     __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
31540     PyErr_Restore(etype, eval, etb);
31541   }
31542   Py_CLEAR(p->mode);
31543   Py_CLEAR(p->_format);
31544   (*Py_TYPE(o)->tp_free)(o);
31545 }
__pyx_sq_item_array(PyObject * o,Py_ssize_t i)31546 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
31547   PyObject *r;
31548   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
31549   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
31550   Py_DECREF(x);
31551   return r;
31552 }
31553 
__pyx_mp_ass_subscript_array(PyObject * o,PyObject * i,PyObject * v)31554 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
31555   if (v) {
31556     return __pyx_array___setitem__(o, i, v);
31557   }
31558   else {
31559     PyErr_Format(PyExc_NotImplementedError,
31560       "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
31561     return -1;
31562   }
31563 }
31564 
__pyx_tp_getattro_array(PyObject * o,PyObject * n)31565 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
31566   PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
31567   if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
31568     PyErr_Clear();
31569     v = __pyx_array___getattr__(o, n);
31570   }
31571   return v;
31572 }
31573 
__pyx_getprop___pyx_array_memview(PyObject * o,CYTHON_UNUSED void * x)31574 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
31575   return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
31576 }
31577 
31578 static PyMethodDef __pyx_methods_array[] = {
31579   {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
31580   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
31581   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
31582   {0, 0, 0, 0}
31583 };
31584 
31585 static struct PyGetSetDef __pyx_getsets_array[] = {
31586   {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
31587   {0, 0, 0, 0, 0}
31588 };
31589 
31590 static PySequenceMethods __pyx_tp_as_sequence_array = {
31591   __pyx_array___len__, /*sq_length*/
31592   0, /*sq_concat*/
31593   0, /*sq_repeat*/
31594   __pyx_sq_item_array, /*sq_item*/
31595   0, /*sq_slice*/
31596   0, /*sq_ass_item*/
31597   0, /*sq_ass_slice*/
31598   0, /*sq_contains*/
31599   0, /*sq_inplace_concat*/
31600   0, /*sq_inplace_repeat*/
31601 };
31602 
31603 static PyMappingMethods __pyx_tp_as_mapping_array = {
31604   __pyx_array___len__, /*mp_length*/
31605   __pyx_array___getitem__, /*mp_subscript*/
31606   __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
31607 };
31608 
31609 static PyBufferProcs __pyx_tp_as_buffer_array = {
31610   #if PY_MAJOR_VERSION < 3
31611   0, /*bf_getreadbuffer*/
31612   #endif
31613   #if PY_MAJOR_VERSION < 3
31614   0, /*bf_getwritebuffer*/
31615   #endif
31616   #if PY_MAJOR_VERSION < 3
31617   0, /*bf_getsegcount*/
31618   #endif
31619   #if PY_MAJOR_VERSION < 3
31620   0, /*bf_getcharbuffer*/
31621   #endif
31622   __pyx_array_getbuffer, /*bf_getbuffer*/
31623   0, /*bf_releasebuffer*/
31624 };
31625 
31626 static PyTypeObject __pyx_type___pyx_array = {
31627   PyVarObject_HEAD_INIT(0, 0)
31628   "qutip.cy.cqobjevo_factor.array", /*tp_name*/
31629   sizeof(struct __pyx_array_obj), /*tp_basicsize*/
31630   0, /*tp_itemsize*/
31631   __pyx_tp_dealloc_array, /*tp_dealloc*/
31632   #if PY_VERSION_HEX < 0x030800b4
31633   0, /*tp_print*/
31634   #endif
31635   #if PY_VERSION_HEX >= 0x030800b4
31636   0, /*tp_vectorcall_offset*/
31637   #endif
31638   0, /*tp_getattr*/
31639   0, /*tp_setattr*/
31640   #if PY_MAJOR_VERSION < 3
31641   0, /*tp_compare*/
31642   #endif
31643   #if PY_MAJOR_VERSION >= 3
31644   0, /*tp_as_async*/
31645   #endif
31646   0, /*tp_repr*/
31647   0, /*tp_as_number*/
31648   &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
31649   &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
31650   0, /*tp_hash*/
31651   0, /*tp_call*/
31652   0, /*tp_str*/
31653   __pyx_tp_getattro_array, /*tp_getattro*/
31654   0, /*tp_setattro*/
31655   &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
31656   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
31657   0, /*tp_doc*/
31658   0, /*tp_traverse*/
31659   0, /*tp_clear*/
31660   0, /*tp_richcompare*/
31661   0, /*tp_weaklistoffset*/
31662   0, /*tp_iter*/
31663   0, /*tp_iternext*/
31664   __pyx_methods_array, /*tp_methods*/
31665   0, /*tp_members*/
31666   __pyx_getsets_array, /*tp_getset*/
31667   0, /*tp_base*/
31668   0, /*tp_dict*/
31669   0, /*tp_descr_get*/
31670   0, /*tp_descr_set*/
31671   0, /*tp_dictoffset*/
31672   0, /*tp_init*/
31673   0, /*tp_alloc*/
31674   __pyx_tp_new_array, /*tp_new*/
31675   0, /*tp_free*/
31676   0, /*tp_is_gc*/
31677   0, /*tp_bases*/
31678   0, /*tp_mro*/
31679   0, /*tp_cache*/
31680   0, /*tp_subclasses*/
31681   0, /*tp_weaklist*/
31682   0, /*tp_del*/
31683   0, /*tp_version_tag*/
31684   #if PY_VERSION_HEX >= 0x030400a1
31685   0, /*tp_finalize*/
31686   #endif
31687   #if PY_VERSION_HEX >= 0x030800b1
31688   0, /*tp_vectorcall*/
31689   #endif
31690   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
31691   0, /*tp_print*/
31692   #endif
31693 };
31694 
__pyx_tp_new_Enum(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)31695 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
31696   struct __pyx_MemviewEnum_obj *p;
31697   PyObject *o;
31698   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
31699     o = (*t->tp_alloc)(t, 0);
31700   } else {
31701     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
31702   }
31703   if (unlikely(!o)) return 0;
31704   p = ((struct __pyx_MemviewEnum_obj *)o);
31705   p->name = Py_None; Py_INCREF(Py_None);
31706   return o;
31707 }
31708 
__pyx_tp_dealloc_Enum(PyObject * o)31709 static void __pyx_tp_dealloc_Enum(PyObject *o) {
31710   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
31711   #if CYTHON_USE_TP_FINALIZE
31712   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
31713     if (PyObject_CallFinalizerFromDealloc(o)) return;
31714   }
31715   #endif
31716   PyObject_GC_UnTrack(o);
31717   Py_CLEAR(p->name);
31718   (*Py_TYPE(o)->tp_free)(o);
31719 }
31720 
__pyx_tp_traverse_Enum(PyObject * o,visitproc v,void * a)31721 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
31722   int e;
31723   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
31724   if (p->name) {
31725     e = (*v)(p->name, a); if (e) return e;
31726   }
31727   return 0;
31728 }
31729 
__pyx_tp_clear_Enum(PyObject * o)31730 static int __pyx_tp_clear_Enum(PyObject *o) {
31731   PyObject* tmp;
31732   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
31733   tmp = ((PyObject*)p->name);
31734   p->name = Py_None; Py_INCREF(Py_None);
31735   Py_XDECREF(tmp);
31736   return 0;
31737 }
31738 
31739 static PyMethodDef __pyx_methods_Enum[] = {
31740   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
31741   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
31742   {0, 0, 0, 0}
31743 };
31744 
31745 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
31746   PyVarObject_HEAD_INIT(0, 0)
31747   "qutip.cy.cqobjevo_factor.Enum", /*tp_name*/
31748   sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
31749   0, /*tp_itemsize*/
31750   __pyx_tp_dealloc_Enum, /*tp_dealloc*/
31751   #if PY_VERSION_HEX < 0x030800b4
31752   0, /*tp_print*/
31753   #endif
31754   #if PY_VERSION_HEX >= 0x030800b4
31755   0, /*tp_vectorcall_offset*/
31756   #endif
31757   0, /*tp_getattr*/
31758   0, /*tp_setattr*/
31759   #if PY_MAJOR_VERSION < 3
31760   0, /*tp_compare*/
31761   #endif
31762   #if PY_MAJOR_VERSION >= 3
31763   0, /*tp_as_async*/
31764   #endif
31765   __pyx_MemviewEnum___repr__, /*tp_repr*/
31766   0, /*tp_as_number*/
31767   0, /*tp_as_sequence*/
31768   0, /*tp_as_mapping*/
31769   0, /*tp_hash*/
31770   0, /*tp_call*/
31771   0, /*tp_str*/
31772   0, /*tp_getattro*/
31773   0, /*tp_setattro*/
31774   0, /*tp_as_buffer*/
31775   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
31776   0, /*tp_doc*/
31777   __pyx_tp_traverse_Enum, /*tp_traverse*/
31778   __pyx_tp_clear_Enum, /*tp_clear*/
31779   0, /*tp_richcompare*/
31780   0, /*tp_weaklistoffset*/
31781   0, /*tp_iter*/
31782   0, /*tp_iternext*/
31783   __pyx_methods_Enum, /*tp_methods*/
31784   0, /*tp_members*/
31785   0, /*tp_getset*/
31786   0, /*tp_base*/
31787   0, /*tp_dict*/
31788   0, /*tp_descr_get*/
31789   0, /*tp_descr_set*/
31790   0, /*tp_dictoffset*/
31791   __pyx_MemviewEnum___init__, /*tp_init*/
31792   0, /*tp_alloc*/
31793   __pyx_tp_new_Enum, /*tp_new*/
31794   0, /*tp_free*/
31795   0, /*tp_is_gc*/
31796   0, /*tp_bases*/
31797   0, /*tp_mro*/
31798   0, /*tp_cache*/
31799   0, /*tp_subclasses*/
31800   0, /*tp_weaklist*/
31801   0, /*tp_del*/
31802   0, /*tp_version_tag*/
31803   #if PY_VERSION_HEX >= 0x030400a1
31804   0, /*tp_finalize*/
31805   #endif
31806   #if PY_VERSION_HEX >= 0x030800b1
31807   0, /*tp_vectorcall*/
31808   #endif
31809   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
31810   0, /*tp_print*/
31811   #endif
31812 };
31813 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
31814 
__pyx_tp_new_memoryview(PyTypeObject * t,PyObject * a,PyObject * k)31815 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
31816   struct __pyx_memoryview_obj *p;
31817   PyObject *o;
31818   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
31819     o = (*t->tp_alloc)(t, 0);
31820   } else {
31821     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
31822   }
31823   if (unlikely(!o)) return 0;
31824   p = ((struct __pyx_memoryview_obj *)o);
31825   p->__pyx_vtab = __pyx_vtabptr_memoryview;
31826   p->obj = Py_None; Py_INCREF(Py_None);
31827   p->_size = Py_None; Py_INCREF(Py_None);
31828   p->_array_interface = Py_None; Py_INCREF(Py_None);
31829   p->view.obj = NULL;
31830   if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
31831   return o;
31832   bad:
31833   Py_DECREF(o); o = 0;
31834   return NULL;
31835 }
31836 
__pyx_tp_dealloc_memoryview(PyObject * o)31837 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
31838   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
31839   #if CYTHON_USE_TP_FINALIZE
31840   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
31841     if (PyObject_CallFinalizerFromDealloc(o)) return;
31842   }
31843   #endif
31844   PyObject_GC_UnTrack(o);
31845   {
31846     PyObject *etype, *eval, *etb;
31847     PyErr_Fetch(&etype, &eval, &etb);
31848     __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
31849     __pyx_memoryview___dealloc__(o);
31850     __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
31851     PyErr_Restore(etype, eval, etb);
31852   }
31853   Py_CLEAR(p->obj);
31854   Py_CLEAR(p->_size);
31855   Py_CLEAR(p->_array_interface);
31856   (*Py_TYPE(o)->tp_free)(o);
31857 }
31858 
__pyx_tp_traverse_memoryview(PyObject * o,visitproc v,void * a)31859 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
31860   int e;
31861   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
31862   if (p->obj) {
31863     e = (*v)(p->obj, a); if (e) return e;
31864   }
31865   if (p->_size) {
31866     e = (*v)(p->_size, a); if (e) return e;
31867   }
31868   if (p->_array_interface) {
31869     e = (*v)(p->_array_interface, a); if (e) return e;
31870   }
31871   if (p->view.obj) {
31872     e = (*v)(p->view.obj, a); if (e) return e;
31873   }
31874   return 0;
31875 }
31876 
__pyx_tp_clear_memoryview(PyObject * o)31877 static int __pyx_tp_clear_memoryview(PyObject *o) {
31878   PyObject* tmp;
31879   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
31880   tmp = ((PyObject*)p->obj);
31881   p->obj = Py_None; Py_INCREF(Py_None);
31882   Py_XDECREF(tmp);
31883   tmp = ((PyObject*)p->_size);
31884   p->_size = Py_None; Py_INCREF(Py_None);
31885   Py_XDECREF(tmp);
31886   tmp = ((PyObject*)p->_array_interface);
31887   p->_array_interface = Py_None; Py_INCREF(Py_None);
31888   Py_XDECREF(tmp);
31889   Py_CLEAR(p->view.obj);
31890   return 0;
31891 }
__pyx_sq_item_memoryview(PyObject * o,Py_ssize_t i)31892 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
31893   PyObject *r;
31894   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
31895   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
31896   Py_DECREF(x);
31897   return r;
31898 }
31899 
__pyx_mp_ass_subscript_memoryview(PyObject * o,PyObject * i,PyObject * v)31900 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
31901   if (v) {
31902     return __pyx_memoryview___setitem__(o, i, v);
31903   }
31904   else {
31905     PyErr_Format(PyExc_NotImplementedError,
31906       "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
31907     return -1;
31908   }
31909 }
31910 
__pyx_getprop___pyx_memoryview_T(PyObject * o,CYTHON_UNUSED void * x)31911 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
31912   return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
31913 }
31914 
__pyx_getprop___pyx_memoryview_base(PyObject * o,CYTHON_UNUSED void * x)31915 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
31916   return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
31917 }
31918 
__pyx_getprop___pyx_memoryview_shape(PyObject * o,CYTHON_UNUSED void * x)31919 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
31920   return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
31921 }
31922 
__pyx_getprop___pyx_memoryview_strides(PyObject * o,CYTHON_UNUSED void * x)31923 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
31924   return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
31925 }
31926 
__pyx_getprop___pyx_memoryview_suboffsets(PyObject * o,CYTHON_UNUSED void * x)31927 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
31928   return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
31929 }
31930 
__pyx_getprop___pyx_memoryview_ndim(PyObject * o,CYTHON_UNUSED void * x)31931 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
31932   return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
31933 }
31934 
__pyx_getprop___pyx_memoryview_itemsize(PyObject * o,CYTHON_UNUSED void * x)31935 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
31936   return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
31937 }
31938 
__pyx_getprop___pyx_memoryview_nbytes(PyObject * o,CYTHON_UNUSED void * x)31939 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
31940   return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
31941 }
31942 
__pyx_getprop___pyx_memoryview_size(PyObject * o,CYTHON_UNUSED void * x)31943 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
31944   return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
31945 }
31946 
31947 static PyMethodDef __pyx_methods_memoryview[] = {
31948   {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
31949   {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
31950   {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
31951   {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
31952   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
31953   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
31954   {0, 0, 0, 0}
31955 };
31956 
31957 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
31958   {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
31959   {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
31960   {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
31961   {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
31962   {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
31963   {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
31964   {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
31965   {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
31966   {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
31967   {0, 0, 0, 0, 0}
31968 };
31969 
31970 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
31971   __pyx_memoryview___len__, /*sq_length*/
31972   0, /*sq_concat*/
31973   0, /*sq_repeat*/
31974   __pyx_sq_item_memoryview, /*sq_item*/
31975   0, /*sq_slice*/
31976   0, /*sq_ass_item*/
31977   0, /*sq_ass_slice*/
31978   0, /*sq_contains*/
31979   0, /*sq_inplace_concat*/
31980   0, /*sq_inplace_repeat*/
31981 };
31982 
31983 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
31984   __pyx_memoryview___len__, /*mp_length*/
31985   __pyx_memoryview___getitem__, /*mp_subscript*/
31986   __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
31987 };
31988 
31989 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
31990   #if PY_MAJOR_VERSION < 3
31991   0, /*bf_getreadbuffer*/
31992   #endif
31993   #if PY_MAJOR_VERSION < 3
31994   0, /*bf_getwritebuffer*/
31995   #endif
31996   #if PY_MAJOR_VERSION < 3
31997   0, /*bf_getsegcount*/
31998   #endif
31999   #if PY_MAJOR_VERSION < 3
32000   0, /*bf_getcharbuffer*/
32001   #endif
32002   __pyx_memoryview_getbuffer, /*bf_getbuffer*/
32003   0, /*bf_releasebuffer*/
32004 };
32005 
32006 static PyTypeObject __pyx_type___pyx_memoryview = {
32007   PyVarObject_HEAD_INIT(0, 0)
32008   "qutip.cy.cqobjevo_factor.memoryview", /*tp_name*/
32009   sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
32010   0, /*tp_itemsize*/
32011   __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
32012   #if PY_VERSION_HEX < 0x030800b4
32013   0, /*tp_print*/
32014   #endif
32015   #if PY_VERSION_HEX >= 0x030800b4
32016   0, /*tp_vectorcall_offset*/
32017   #endif
32018   0, /*tp_getattr*/
32019   0, /*tp_setattr*/
32020   #if PY_MAJOR_VERSION < 3
32021   0, /*tp_compare*/
32022   #endif
32023   #if PY_MAJOR_VERSION >= 3
32024   0, /*tp_as_async*/
32025   #endif
32026   __pyx_memoryview___repr__, /*tp_repr*/
32027   0, /*tp_as_number*/
32028   &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
32029   &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
32030   0, /*tp_hash*/
32031   0, /*tp_call*/
32032   __pyx_memoryview___str__, /*tp_str*/
32033   0, /*tp_getattro*/
32034   0, /*tp_setattro*/
32035   &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
32036   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
32037   0, /*tp_doc*/
32038   __pyx_tp_traverse_memoryview, /*tp_traverse*/
32039   __pyx_tp_clear_memoryview, /*tp_clear*/
32040   0, /*tp_richcompare*/
32041   0, /*tp_weaklistoffset*/
32042   0, /*tp_iter*/
32043   0, /*tp_iternext*/
32044   __pyx_methods_memoryview, /*tp_methods*/
32045   0, /*tp_members*/
32046   __pyx_getsets_memoryview, /*tp_getset*/
32047   0, /*tp_base*/
32048   0, /*tp_dict*/
32049   0, /*tp_descr_get*/
32050   0, /*tp_descr_set*/
32051   0, /*tp_dictoffset*/
32052   0, /*tp_init*/
32053   0, /*tp_alloc*/
32054   __pyx_tp_new_memoryview, /*tp_new*/
32055   0, /*tp_free*/
32056   0, /*tp_is_gc*/
32057   0, /*tp_bases*/
32058   0, /*tp_mro*/
32059   0, /*tp_cache*/
32060   0, /*tp_subclasses*/
32061   0, /*tp_weaklist*/
32062   0, /*tp_del*/
32063   0, /*tp_version_tag*/
32064   #if PY_VERSION_HEX >= 0x030400a1
32065   0, /*tp_finalize*/
32066   #endif
32067   #if PY_VERSION_HEX >= 0x030800b1
32068   0, /*tp_vectorcall*/
32069   #endif
32070   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
32071   0, /*tp_print*/
32072   #endif
32073 };
32074 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
32075 
__pyx_tp_new__memoryviewslice(PyTypeObject * t,PyObject * a,PyObject * k)32076 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
32077   struct __pyx_memoryviewslice_obj *p;
32078   PyObject *o = __pyx_tp_new_memoryview(t, a, k);
32079   if (unlikely(!o)) return 0;
32080   p = ((struct __pyx_memoryviewslice_obj *)o);
32081   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
32082   p->from_object = Py_None; Py_INCREF(Py_None);
32083   p->from_slice.memview = NULL;
32084   return o;
32085 }
32086 
__pyx_tp_dealloc__memoryviewslice(PyObject * o)32087 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
32088   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
32089   #if CYTHON_USE_TP_FINALIZE
32090   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
32091     if (PyObject_CallFinalizerFromDealloc(o)) return;
32092   }
32093   #endif
32094   PyObject_GC_UnTrack(o);
32095   {
32096     PyObject *etype, *eval, *etb;
32097     PyErr_Fetch(&etype, &eval, &etb);
32098     __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
32099     __pyx_memoryviewslice___dealloc__(o);
32100     __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
32101     PyErr_Restore(etype, eval, etb);
32102   }
32103   Py_CLEAR(p->from_object);
32104   PyObject_GC_Track(o);
32105   __pyx_tp_dealloc_memoryview(o);
32106 }
32107 
__pyx_tp_traverse__memoryviewslice(PyObject * o,visitproc v,void * a)32108 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
32109   int e;
32110   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
32111   e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
32112   if (p->from_object) {
32113     e = (*v)(p->from_object, a); if (e) return e;
32114   }
32115   return 0;
32116 }
32117 
__pyx_tp_clear__memoryviewslice(PyObject * o)32118 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
32119   PyObject* tmp;
32120   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
32121   __pyx_tp_clear_memoryview(o);
32122   tmp = ((PyObject*)p->from_object);
32123   p->from_object = Py_None; Py_INCREF(Py_None);
32124   Py_XDECREF(tmp);
32125   __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
32126   return 0;
32127 }
32128 
__pyx_getprop___pyx_memoryviewslice_base(PyObject * o,CYTHON_UNUSED void * x)32129 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
32130   return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
32131 }
32132 
32133 static PyMethodDef __pyx_methods__memoryviewslice[] = {
32134   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
32135   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
32136   {0, 0, 0, 0}
32137 };
32138 
32139 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
32140   {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
32141   {0, 0, 0, 0, 0}
32142 };
32143 
32144 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
32145   PyVarObject_HEAD_INIT(0, 0)
32146   "qutip.cy.cqobjevo_factor._memoryviewslice", /*tp_name*/
32147   sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
32148   0, /*tp_itemsize*/
32149   __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
32150   #if PY_VERSION_HEX < 0x030800b4
32151   0, /*tp_print*/
32152   #endif
32153   #if PY_VERSION_HEX >= 0x030800b4
32154   0, /*tp_vectorcall_offset*/
32155   #endif
32156   0, /*tp_getattr*/
32157   0, /*tp_setattr*/
32158   #if PY_MAJOR_VERSION < 3
32159   0, /*tp_compare*/
32160   #endif
32161   #if PY_MAJOR_VERSION >= 3
32162   0, /*tp_as_async*/
32163   #endif
32164   #if CYTHON_COMPILING_IN_PYPY
32165   __pyx_memoryview___repr__, /*tp_repr*/
32166   #else
32167   0, /*tp_repr*/
32168   #endif
32169   0, /*tp_as_number*/
32170   0, /*tp_as_sequence*/
32171   0, /*tp_as_mapping*/
32172   0, /*tp_hash*/
32173   0, /*tp_call*/
32174   #if CYTHON_COMPILING_IN_PYPY
32175   __pyx_memoryview___str__, /*tp_str*/
32176   #else
32177   0, /*tp_str*/
32178   #endif
32179   0, /*tp_getattro*/
32180   0, /*tp_setattro*/
32181   0, /*tp_as_buffer*/
32182   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
32183   "Internal class for passing memoryview slices to Python", /*tp_doc*/
32184   __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
32185   __pyx_tp_clear__memoryviewslice, /*tp_clear*/
32186   0, /*tp_richcompare*/
32187   0, /*tp_weaklistoffset*/
32188   0, /*tp_iter*/
32189   0, /*tp_iternext*/
32190   __pyx_methods__memoryviewslice, /*tp_methods*/
32191   0, /*tp_members*/
32192   __pyx_getsets__memoryviewslice, /*tp_getset*/
32193   0, /*tp_base*/
32194   0, /*tp_dict*/
32195   0, /*tp_descr_get*/
32196   0, /*tp_descr_set*/
32197   0, /*tp_dictoffset*/
32198   0, /*tp_init*/
32199   0, /*tp_alloc*/
32200   __pyx_tp_new__memoryviewslice, /*tp_new*/
32201   0, /*tp_free*/
32202   0, /*tp_is_gc*/
32203   0, /*tp_bases*/
32204   0, /*tp_mro*/
32205   0, /*tp_cache*/
32206   0, /*tp_subclasses*/
32207   0, /*tp_weaklist*/
32208   0, /*tp_del*/
32209   0, /*tp_version_tag*/
32210   #if PY_VERSION_HEX >= 0x030400a1
32211   0, /*tp_finalize*/
32212   #endif
32213   #if PY_VERSION_HEX >= 0x030800b1
32214   0, /*tp_vectorcall*/
32215   #endif
32216   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
32217   0, /*tp_print*/
32218   #endif
32219 };
32220 
32221 static PyMethodDef __pyx_methods[] = {
32222   {0, 0, 0, 0}
32223 };
32224 
32225 #if PY_MAJOR_VERSION >= 3
32226 #if CYTHON_PEP489_MULTI_PHASE_INIT
32227 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
32228 static int __pyx_pymod_exec_cqobjevo_factor(PyObject* module); /*proto*/
32229 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
32230   {Py_mod_create, (void*)__pyx_pymod_create},
32231   {Py_mod_exec, (void*)__pyx_pymod_exec_cqobjevo_factor},
32232   {0, NULL}
32233 };
32234 #endif
32235 
32236 static struct PyModuleDef __pyx_moduledef = {
32237     PyModuleDef_HEAD_INIT,
32238     "cqobjevo_factor",
32239     0, /* m_doc */
32240   #if CYTHON_PEP489_MULTI_PHASE_INIT
32241     0, /* m_size */
32242   #else
32243     -1, /* m_size */
32244   #endif
32245     __pyx_methods /* m_methods */,
32246   #if CYTHON_PEP489_MULTI_PHASE_INIT
32247     __pyx_moduledef_slots, /* m_slots */
32248   #else
32249     NULL, /* m_reload */
32250   #endif
32251     NULL, /* m_traverse */
32252     NULL, /* m_clear */
32253     NULL /* m_free */
32254 };
32255 #endif
32256 #ifndef CYTHON_SMALL_CODE
32257 #if defined(__clang__)
32258     #define CYTHON_SMALL_CODE
32259 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
32260     #define CYTHON_SMALL_CODE __attribute__((cold))
32261 #else
32262     #define CYTHON_SMALL_CODE
32263 #endif
32264 #endif
32265 
32266 static __Pyx_StringTabEntry __pyx_string_tab[] = {
32267   {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
32268   {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
32269   {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
32270   {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
32271   {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
32272   {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
32273   {&__pyx_n_s_CoeffFunc, __pyx_k_CoeffFunc, sizeof(__pyx_k_CoeffFunc), 0, 0, 1, 1},
32274   {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
32275   {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
32276   {&__pyx_n_u_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 1, 0, 1},
32277   {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
32278   {&__pyx_kp_s_Incompatible_checksums_s_vs_0x77, __pyx_k_Incompatible_checksums_s_vs_0x77, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x77), 0, 0, 1, 0},
32279   {&__pyx_kp_s_Incompatible_checksums_s_vs_0x94, __pyx_k_Incompatible_checksums_s_vs_0x94, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x94), 0, 0, 1, 0},
32280   {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
32281   {&__pyx_kp_s_Incompatible_checksums_s_vs_0xc4, __pyx_k_Incompatible_checksums_s_vs_0xc4, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xc4), 0, 0, 1, 0},
32282   {&__pyx_kp_s_Incompatible_checksums_s_vs_0xc6, __pyx_k_Incompatible_checksums_s_vs_0xc6, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xc6), 0, 0, 1, 0},
32283   {&__pyx_kp_s_Incompatible_checksums_s_vs_0xea, __pyx_k_Incompatible_checksums_s_vs_0xea, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xea), 0, 0, 1, 0},
32284   {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
32285   {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
32286   {&__pyx_n_s_InterCoeffCte, __pyx_k_InterCoeffCte, sizeof(__pyx_k_InterCoeffCte), 0, 0, 1, 1},
32287   {&__pyx_n_s_InterCoeffT, __pyx_k_InterCoeffT, sizeof(__pyx_k_InterCoeffT), 0, 0, 1, 1},
32288   {&__pyx_n_s_InterpolateCoeff, __pyx_k_InterpolateCoeff, sizeof(__pyx_k_InterpolateCoeff), 0, 0, 1, 1},
32289   {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
32290   {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
32291   {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
32292   {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
32293   {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
32294   {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
32295   {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
32296   {&__pyx_n_s_OverflowError, __pyx_k_OverflowError, sizeof(__pyx_k_OverflowError), 0, 0, 1, 1},
32297   {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
32298   {&__pyx_n_u_Qobj, __pyx_k_Qobj, sizeof(__pyx_k_Qobj), 0, 1, 0, 1},
32299   {&__pyx_n_s_StepCoeff, __pyx_k_StepCoeff, sizeof(__pyx_k_StepCoeff), 0, 0, 1, 1},
32300   {&__pyx_n_s_StepCoeffCte, __pyx_k_StepCoeffCte, sizeof(__pyx_k_StepCoeffCte), 0, 0, 1, 1},
32301   {&__pyx_n_s_StepCoeffT, __pyx_k_StepCoeffT, sizeof(__pyx_k_StepCoeffT), 0, 0, 1, 1},
32302   {&__pyx_n_s_StrCoeff, __pyx_k_StrCoeff, sizeof(__pyx_k_StrCoeff), 0, 0, 1, 1},
32303   {&__pyx_kp_b_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 0, 0},
32304   {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
32305   {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
32306   {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
32307   {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
32308   {&__pyx_kp_b__27, __pyx_k__27, sizeof(__pyx_k__27), 0, 0, 0, 0},
32309   {&__pyx_kp_b__28, __pyx_k__28, sizeof(__pyx_k__28), 0, 0, 0, 0},
32310   {&__pyx_kp_b__29, __pyx_k__29, sizeof(__pyx_k__29), 0, 0, 0, 0},
32311   {&__pyx_kp_b__30, __pyx_k__30, sizeof(__pyx_k__30), 0, 0, 0, 0},
32312   {&__pyx_kp_u__31, __pyx_k__31, sizeof(__pyx_k__31), 0, 1, 0, 0},
32313   {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
32314   {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
32315   {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
32316   {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
32317   {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
32318   {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
32319   {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
32320   {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
32321   {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
32322   {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
32323   {&__pyx_n_s_coeffs, __pyx_k_coeffs, sizeof(__pyx_k_coeffs), 0, 0, 1, 1},
32324   {&__pyx_n_s_compiled_qobjevo, __pyx_k_compiled_qobjevo, sizeof(__pyx_k_compiled_qobjevo), 0, 0, 1, 1},
32325   {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
32326   {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
32327   {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
32328   {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
32329   {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
32330   {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
32331   {&__pyx_n_s_dyn_args, __pyx_k_dyn_args, sizeof(__pyx_k_dyn_args), 0, 0, 1, 1},
32332   {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
32333   {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
32334   {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
32335   {&__pyx_n_u_expect, __pyx_k_expect, sizeof(__pyx_k_expect), 0, 1, 0, 1},
32336   {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
32337   {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
32338   {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
32339   {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
32340   {&__pyx_n_s_full, __pyx_k_full, sizeof(__pyx_k_full), 0, 0, 1, 1},
32341   {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
32342   {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
32343   {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
32344   {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
32345   {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
32346   {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
32347   {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
32348   {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
32349   {&__pyx_n_u_mat, __pyx_k_mat, sizeof(__pyx_k_mat), 0, 1, 0, 1},
32350   {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
32351   {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
32352   {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
32353   {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
32354   {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
32355   {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
32356   {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
32357   {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
32358   {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
32359   {&__pyx_kp_u_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0, 0},
32360   {&__pyx_kp_u_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0},
32361   {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
32362   {&__pyx_n_s_ops, __pyx_k_ops, sizeof(__pyx_k_ops), 0, 0, 1, 1},
32363   {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
32364   {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
32365   {&__pyx_n_s_prep_cubic_spline, __pyx_k_prep_cubic_spline, sizeof(__pyx_k_prep_cubic_spline), 0, 0, 1, 1},
32366   {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
32367   {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
32368   {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
32369   {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
32370   {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
32371   {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
32372   {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
32373   {&__pyx_n_s_pyx_unpickle_CoeffFunc, __pyx_k_pyx_unpickle_CoeffFunc, sizeof(__pyx_k_pyx_unpickle_CoeffFunc), 0, 0, 1, 1},
32374   {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
32375   {&__pyx_n_s_pyx_unpickle_InterCoeffCte, __pyx_k_pyx_unpickle_InterCoeffCte, sizeof(__pyx_k_pyx_unpickle_InterCoeffCte), 0, 0, 1, 1},
32376   {&__pyx_n_s_pyx_unpickle_InterCoeffT, __pyx_k_pyx_unpickle_InterCoeffT, sizeof(__pyx_k_pyx_unpickle_InterCoeffT), 0, 0, 1, 1},
32377   {&__pyx_n_s_pyx_unpickle_InterpolateCoeff, __pyx_k_pyx_unpickle_InterpolateCoeff, sizeof(__pyx_k_pyx_unpickle_InterpolateCoeff), 0, 0, 1, 1},
32378   {&__pyx_n_s_pyx_unpickle_StepCoeff, __pyx_k_pyx_unpickle_StepCoeff, sizeof(__pyx_k_pyx_unpickle_StepCoeff), 0, 0, 1, 1},
32379   {&__pyx_n_s_pyx_unpickle_StepCoeffCte, __pyx_k_pyx_unpickle_StepCoeffCte, sizeof(__pyx_k_pyx_unpickle_StepCoeffCte), 0, 0, 1, 1},
32380   {&__pyx_n_s_pyx_unpickle_StepCoeffT, __pyx_k_pyx_unpickle_StepCoeffT, sizeof(__pyx_k_pyx_unpickle_StepCoeffT), 0, 0, 1, 1},
32381   {&__pyx_n_s_pyx_unpickle_StrCoeff, __pyx_k_pyx_unpickle_StrCoeff, sizeof(__pyx_k_pyx_unpickle_StrCoeff), 0, 0, 1, 1},
32382   {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
32383   {&__pyx_n_s_qutip_cy_cqobjevo_factor, __pyx_k_qutip_cy_cqobjevo_factor, sizeof(__pyx_k_qutip_cy_cqobjevo_factor), 0, 0, 1, 1},
32384   {&__pyx_n_s_qutip_cy_inter, __pyx_k_qutip_cy_inter, sizeof(__pyx_k_qutip_cy_inter), 0, 0, 1, 1},
32385   {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
32386   {&__pyx_n_s_ravel, __pyx_k_ravel, sizeof(__pyx_k_ravel), 0, 0, 1, 1},
32387   {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
32388   {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
32389   {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
32390   {&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0},
32391   {&__pyx_n_s_set_args, __pyx_k_set_args, sizeof(__pyx_k_set_args), 0, 0, 1, 1},
32392   {&__pyx_n_s_set_dyn_args, __pyx_k_set_dyn_args, sizeof(__pyx_k_set_dyn_args), 0, 0, 1, 1},
32393   {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
32394   {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
32395   {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
32396   {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
32397   {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
32398   {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
32399   {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
32400   {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
32401   {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
32402   {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
32403   {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
32404   {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
32405   {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
32406   {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
32407   {&__pyx_n_s_tlist, __pyx_k_tlist, sizeof(__pyx_k_tlist), 0, 0, 1, 1},
32408   {&__pyx_kp_u_tlist_not_sampled_uniformly, __pyx_k_tlist_not_sampled_uniformly, sizeof(__pyx_k_tlist_not_sampled_uniformly), 0, 1, 0, 0},
32409   {&__pyx_kp_u_tlist_not_uniform, __pyx_k_tlist_not_uniform, sizeof(__pyx_k_tlist_not_uniform), 0, 1, 0, 0},
32410   {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
32411   {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
32412   {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
32413   {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
32414   {&__pyx_n_s_vec, __pyx_k_vec, sizeof(__pyx_k_vec), 0, 0, 1, 1},
32415   {&__pyx_n_u_vec, __pyx_k_vec, sizeof(__pyx_k_vec), 0, 1, 0, 1},
32416   {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
32417   {0, 0, 0, 0, 0, 0, 0}
32418 };
__Pyx_InitCachedBuiltins(void)32419 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
32420   __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 112, __pyx_L1_error)
32421   __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 203, __pyx_L1_error)
32422   __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 884, __pyx_L1_error)
32423   __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 81, __pyx_L1_error)
32424   __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) __PYX_ERR(1, 81, __pyx_L1_error)
32425   __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 84, __pyx_L1_error)
32426   __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 94, __pyx_L1_error)
32427   __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 133, __pyx_L1_error)
32428   __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
32429   __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error)
32430   __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error)
32431   return 0;
32432   __pyx_L1_error:;
32433   return -1;
32434 }
32435 
__Pyx_InitCachedConstants(void)32436 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
32437   __Pyx_RefNannyDeclarations
32438   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
32439 
32440   /* "qutip/cy/cqobjevo_factor.pyx":159
32441  *             m, cte = _prep_cubic_spline(ops[i][2], tlist)
32442  *             if not cte:
32443  *                 raise Exception("tlist not sampled uniformly")             # <<<<<<<<<<<<<<
32444  *             for j in range(self.n_t):
32445  *                 self.y[i,j] = ops[i][2][j]
32446  */
32447   __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_tlist_not_sampled_uniformly); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 159, __pyx_L1_error)
32448   __Pyx_GOTREF(__pyx_tuple__3);
32449   __Pyx_GIVEREF(__pyx_tuple__3);
32450 
32451   /* "qutip/cy/cqobjevo_factor.pyx":203
32452  *             m, cte = _prep_cubic_spline(ops[i][2], tlist)
32453  *             if cte:
32454  *                 print("tlist not uniform?")             # <<<<<<<<<<<<<<
32455  *             for j in range(self.n_t):
32456  *                 self.y[i,j] = ops[i][2][j]
32457  */
32458   __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_tlist_not_uniform); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 203, __pyx_L1_error)
32459   __Pyx_GOTREF(__pyx_tuple__4);
32460   __Pyx_GIVEREF(__pyx_tuple__4);
32461 
32462   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":884
32463  *         __pyx_import_array()
32464  *     except Exception:
32465  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
32466  *
32467  * cdef inline int import_umath() except -1:
32468  */
32469   __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 884, __pyx_L1_error)
32470   __Pyx_GOTREF(__pyx_tuple__7);
32471   __Pyx_GIVEREF(__pyx_tuple__7);
32472 
32473   /* "../../../../../tmp/build-env-hoit1hud/lib/python3.6/site-packages/numpy/__init__.pxd":890
32474  *         _import_umath()
32475  *     except Exception:
32476  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
32477  *
32478  * cdef inline int import_ufunc() except -1:
32479  */
32480   __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 890, __pyx_L1_error)
32481   __Pyx_GOTREF(__pyx_tuple__8);
32482   __Pyx_GIVEREF(__pyx_tuple__8);
32483 
32484   /* "View.MemoryView":133
32485  *
32486  *         if not self.ndim:
32487  *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
32488  *
32489  *         if itemsize <= 0:
32490  */
32491   __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 133, __pyx_L1_error)
32492   __Pyx_GOTREF(__pyx_tuple__9);
32493   __Pyx_GIVEREF(__pyx_tuple__9);
32494 
32495   /* "View.MemoryView":136
32496  *
32497  *         if itemsize <= 0:
32498  *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
32499  *
32500  *         if not isinstance(format, bytes):
32501  */
32502   __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 136, __pyx_L1_error)
32503   __Pyx_GOTREF(__pyx_tuple__10);
32504   __Pyx_GIVEREF(__pyx_tuple__10);
32505 
32506   /* "View.MemoryView":148
32507  *
32508  *         if not self._shape:
32509  *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
32510  *
32511  *
32512  */
32513   __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 148, __pyx_L1_error)
32514   __Pyx_GOTREF(__pyx_tuple__11);
32515   __Pyx_GIVEREF(__pyx_tuple__11);
32516 
32517   /* "View.MemoryView":176
32518  *             self.data = <char *>malloc(self.len)
32519  *             if not self.data:
32520  *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
32521  *
32522  *             if self.dtype_is_object:
32523  */
32524   __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 176, __pyx_L1_error)
32525   __Pyx_GOTREF(__pyx_tuple__12);
32526   __Pyx_GIVEREF(__pyx_tuple__12);
32527 
32528   /* "View.MemoryView":192
32529  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
32530  *         if not (flags & bufmode):
32531  *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
32532  *         info.buf = self.data
32533  *         info.len = self.len
32534  */
32535   __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 192, __pyx_L1_error)
32536   __Pyx_GOTREF(__pyx_tuple__13);
32537   __Pyx_GIVEREF(__pyx_tuple__13);
32538 
32539   /* "(tree fragment)":2
32540  * def __reduce_cython__(self):
32541  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
32542  * def __setstate_cython__(self, __pyx_state):
32543  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
32544  */
32545   __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 2, __pyx_L1_error)
32546   __Pyx_GOTREF(__pyx_tuple__14);
32547   __Pyx_GIVEREF(__pyx_tuple__14);
32548 
32549   /* "(tree fragment)":4
32550  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
32551  * def __setstate_cython__(self, __pyx_state):
32552  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
32553  */
32554   __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 4, __pyx_L1_error)
32555   __Pyx_GOTREF(__pyx_tuple__15);
32556   __Pyx_GIVEREF(__pyx_tuple__15);
32557 
32558   /* "View.MemoryView":418
32559  *     def __setitem__(memoryview self, object index, object value):
32560  *         if self.view.readonly:
32561  *             raise TypeError("Cannot assign to read-only memoryview")             # <<<<<<<<<<<<<<
32562  *
32563  *         have_slices, index = _unellipsify(index, self.view.ndim)
32564  */
32565   __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 418, __pyx_L1_error)
32566   __Pyx_GOTREF(__pyx_tuple__16);
32567   __Pyx_GIVEREF(__pyx_tuple__16);
32568 
32569   /* "View.MemoryView":495
32570  *             result = struct.unpack(self.view.format, bytesitem)
32571  *         except struct.error:
32572  *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
32573  *         else:
32574  *             if len(self.view.format) == 1:
32575  */
32576   __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 495, __pyx_L1_error)
32577   __Pyx_GOTREF(__pyx_tuple__17);
32578   __Pyx_GIVEREF(__pyx_tuple__17);
32579 
32580   /* "View.MemoryView":520
32581  *     def __getbuffer__(self, Py_buffer *info, int flags):
32582  *         if flags & PyBUF_WRITABLE and self.view.readonly:
32583  *             raise ValueError("Cannot create writable memory view from read-only memoryview")             # <<<<<<<<<<<<<<
32584  *
32585  *         if flags & PyBUF_ND:
32586  */
32587   __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 520, __pyx_L1_error)
32588   __Pyx_GOTREF(__pyx_tuple__18);
32589   __Pyx_GIVEREF(__pyx_tuple__18);
32590 
32591   /* "View.MemoryView":570
32592  *         if self.view.strides == NULL:
32593  *
32594  *             raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
32595  *
32596  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
32597  */
32598   __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 570, __pyx_L1_error)
32599   __Pyx_GOTREF(__pyx_tuple__19);
32600   __Pyx_GIVEREF(__pyx_tuple__19);
32601 
32602   /* "View.MemoryView":577
32603  *     def suboffsets(self):
32604  *         if self.view.suboffsets == NULL:
32605  *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
32606  *
32607  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
32608  */
32609   __pyx_tuple__20 = PyTuple_New(1); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 577, __pyx_L1_error)
32610   __Pyx_GOTREF(__pyx_tuple__20);
32611   __Pyx_INCREF(__pyx_int_neg_1);
32612   __Pyx_GIVEREF(__pyx_int_neg_1);
32613   PyTuple_SET_ITEM(__pyx_tuple__20, 0, __pyx_int_neg_1);
32614   __Pyx_GIVEREF(__pyx_tuple__20);
32615 
32616   /* "(tree fragment)":2
32617  * def __reduce_cython__(self):
32618  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
32619  * def __setstate_cython__(self, __pyx_state):
32620  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
32621  */
32622   __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 2, __pyx_L1_error)
32623   __Pyx_GOTREF(__pyx_tuple__21);
32624   __Pyx_GIVEREF(__pyx_tuple__21);
32625 
32626   /* "(tree fragment)":4
32627  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
32628  * def __setstate_cython__(self, __pyx_state):
32629  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
32630  */
32631   __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 4, __pyx_L1_error)
32632   __Pyx_GOTREF(__pyx_tuple__22);
32633   __Pyx_GIVEREF(__pyx_tuple__22);
32634 
32635   /* "View.MemoryView":682
32636  *         if item is Ellipsis:
32637  *             if not seen_ellipsis:
32638  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))             # <<<<<<<<<<<<<<
32639  *                 seen_ellipsis = True
32640  *             else:
32641  */
32642   __pyx_slice__23 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__23)) __PYX_ERR(1, 682, __pyx_L1_error)
32643   __Pyx_GOTREF(__pyx_slice__23);
32644   __Pyx_GIVEREF(__pyx_slice__23);
32645 
32646   /* "View.MemoryView":703
32647  *     for suboffset in suboffsets[:ndim]:
32648  *         if suboffset >= 0:
32649  *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
32650  *
32651  *
32652  */
32653   __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 703, __pyx_L1_error)
32654   __Pyx_GOTREF(__pyx_tuple__24);
32655   __Pyx_GIVEREF(__pyx_tuple__24);
32656 
32657   /* "(tree fragment)":2
32658  * def __reduce_cython__(self):
32659  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
32660  * def __setstate_cython__(self, __pyx_state):
32661  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
32662  */
32663   __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 2, __pyx_L1_error)
32664   __Pyx_GOTREF(__pyx_tuple__25);
32665   __Pyx_GIVEREF(__pyx_tuple__25);
32666 
32667   /* "(tree fragment)":4
32668  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
32669  * def __setstate_cython__(self, __pyx_state):
32670  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
32671  */
32672   __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 4, __pyx_L1_error)
32673   __Pyx_GOTREF(__pyx_tuple__26);
32674   __Pyx_GIVEREF(__pyx_tuple__26);
32675 
32676   /* "(tree fragment)":1
32677  * def __pyx_unpickle_CoeffFunc(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
32678  *     cdef object __pyx_PickleError
32679  *     cdef object __pyx_result
32680  */
32681   __pyx_tuple__32 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 1, __pyx_L1_error)
32682   __Pyx_GOTREF(__pyx_tuple__32);
32683   __Pyx_GIVEREF(__pyx_tuple__32);
32684   __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_CoeffFunc, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(1, 1, __pyx_L1_error)
32685   __pyx_tuple__34 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 1, __pyx_L1_error)
32686   __Pyx_GOTREF(__pyx_tuple__34);
32687   __Pyx_GIVEREF(__pyx_tuple__34);
32688   __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_InterpolateCoeff, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(1, 1, __pyx_L1_error)
32689   __pyx_tuple__36 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 1, __pyx_L1_error)
32690   __Pyx_GOTREF(__pyx_tuple__36);
32691   __Pyx_GIVEREF(__pyx_tuple__36);
32692   __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_InterCoeffCte, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(1, 1, __pyx_L1_error)
32693   __pyx_tuple__38 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 1, __pyx_L1_error)
32694   __Pyx_GOTREF(__pyx_tuple__38);
32695   __Pyx_GIVEREF(__pyx_tuple__38);
32696   __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_InterCoeffT, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(1, 1, __pyx_L1_error)
32697   __pyx_tuple__40 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(1, 1, __pyx_L1_error)
32698   __Pyx_GOTREF(__pyx_tuple__40);
32699   __Pyx_GIVEREF(__pyx_tuple__40);
32700   __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_StepCoeff, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(1, 1, __pyx_L1_error)
32701   __pyx_tuple__42 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(1, 1, __pyx_L1_error)
32702   __Pyx_GOTREF(__pyx_tuple__42);
32703   __Pyx_GIVEREF(__pyx_tuple__42);
32704   __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_StepCoeffT, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(1, 1, __pyx_L1_error)
32705   __pyx_tuple__44 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(1, 1, __pyx_L1_error)
32706   __Pyx_GOTREF(__pyx_tuple__44);
32707   __Pyx_GIVEREF(__pyx_tuple__44);
32708   __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_StepCoeffCte, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(1, 1, __pyx_L1_error)
32709   __pyx_tuple__46 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 1, __pyx_L1_error)
32710   __Pyx_GOTREF(__pyx_tuple__46);
32711   __Pyx_GIVEREF(__pyx_tuple__46);
32712   __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_StrCoeff, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(1, 1, __pyx_L1_error)
32713 
32714   /* "View.MemoryView":286
32715  *         return self.name
32716  *
32717  * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
32718  * cdef strided = Enum("<strided and direct>") # default
32719  * cdef indirect = Enum("<strided and indirect>")
32720  */
32721   __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 286, __pyx_L1_error)
32722   __Pyx_GOTREF(__pyx_tuple__48);
32723   __Pyx_GIVEREF(__pyx_tuple__48);
32724 
32725   /* "View.MemoryView":287
32726  *
32727  * cdef generic = Enum("<strided and direct or indirect>")
32728  * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
32729  * cdef indirect = Enum("<strided and indirect>")
32730  *
32731  */
32732   __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 287, __pyx_L1_error)
32733   __Pyx_GOTREF(__pyx_tuple__49);
32734   __Pyx_GIVEREF(__pyx_tuple__49);
32735 
32736   /* "View.MemoryView":288
32737  * cdef generic = Enum("<strided and direct or indirect>")
32738  * cdef strided = Enum("<strided and direct>") # default
32739  * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
32740  *
32741  *
32742  */
32743   __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 288, __pyx_L1_error)
32744   __Pyx_GOTREF(__pyx_tuple__50);
32745   __Pyx_GIVEREF(__pyx_tuple__50);
32746 
32747   /* "View.MemoryView":291
32748  *
32749  *
32750  * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
32751  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
32752  *
32753  */
32754   __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 291, __pyx_L1_error)
32755   __Pyx_GOTREF(__pyx_tuple__51);
32756   __Pyx_GIVEREF(__pyx_tuple__51);
32757 
32758   /* "View.MemoryView":292
32759  *
32760  * cdef contiguous = Enum("<contiguous and direct>")
32761  * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
32762  *
32763  *
32764  */
32765   __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 292, __pyx_L1_error)
32766   __Pyx_GOTREF(__pyx_tuple__52);
32767   __Pyx_GIVEREF(__pyx_tuple__52);
32768 
32769   /* "(tree fragment)":1
32770  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
32771  *     cdef object __pyx_PickleError
32772  *     cdef object __pyx_result
32773  */
32774   __pyx_tuple__53 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 1, __pyx_L1_error)
32775   __Pyx_GOTREF(__pyx_tuple__53);
32776   __Pyx_GIVEREF(__pyx_tuple__53);
32777   __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(1, 1, __pyx_L1_error)
32778   __Pyx_RefNannyFinishContext();
32779   return 0;
32780   __pyx_L1_error:;
32781   __Pyx_RefNannyFinishContext();
32782   return -1;
32783 }
32784 
__Pyx_InitGlobals(void)32785 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
32786   if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
32787   __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
32788   __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
32789   __pyx_int_125307164 = PyInt_FromLong(125307164L); if (unlikely(!__pyx_int_125307164)) __PYX_ERR(0, 1, __pyx_L1_error)
32790   __pyx_int_156087469 = PyInt_FromLong(156087469L); if (unlikely(!__pyx_int_156087469)) __PYX_ERR(0, 1, __pyx_L1_error)
32791   __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
32792   __pyx_int_206188833 = PyInt_FromLong(206188833L); if (unlikely(!__pyx_int_206188833)) __PYX_ERR(0, 1, __pyx_L1_error)
32793   __pyx_int_208310989 = PyInt_FromLong(208310989L); if (unlikely(!__pyx_int_208310989)) __PYX_ERR(0, 1, __pyx_L1_error)
32794   __pyx_int_245494154 = PyInt_FromLong(245494154L); if (unlikely(!__pyx_int_245494154)) __PYX_ERR(0, 1, __pyx_L1_error)
32795   __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
32796   return 0;
32797   __pyx_L1_error:;
32798   return -1;
32799 }
32800 
32801 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
32802 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
32803 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
32804 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
32805 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
32806 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
32807 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
32808 
__Pyx_modinit_global_init_code(void)32809 static int __Pyx_modinit_global_init_code(void) {
32810   __Pyx_RefNannyDeclarations
32811   __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
32812   /*--- Global init code ---*/
32813   generic = Py_None; Py_INCREF(Py_None);
32814   strided = Py_None; Py_INCREF(Py_None);
32815   indirect = Py_None; Py_INCREF(Py_None);
32816   contiguous = Py_None; Py_INCREF(Py_None);
32817   indirect_contiguous = Py_None; Py_INCREF(Py_None);
32818   __Pyx_RefNannyFinishContext();
32819   return 0;
32820 }
32821 
__Pyx_modinit_variable_export_code(void)32822 static int __Pyx_modinit_variable_export_code(void) {
32823   __Pyx_RefNannyDeclarations
32824   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
32825   /*--- Variable export code ---*/
32826   __Pyx_RefNannyFinishContext();
32827   return 0;
32828 }
32829 
__Pyx_modinit_function_export_code(void)32830 static int __Pyx_modinit_function_export_code(void) {
32831   __Pyx_RefNannyDeclarations
32832   int __pyx_lineno = 0;
32833   const char *__pyx_filename = NULL;
32834   int __pyx_clineno = 0;
32835   __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
32836   /*--- Function export code ---*/
32837   if (__Pyx_ExportFunction("zptr2array1d", (void (*)(void))__pyx_f_5qutip_2cy_15cqobjevo_factor_zptr2array1d, "PyArrayObject *(__pyx_t_double_complex *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32838   if (__Pyx_ExportFunction("zptr2array2d", (void (*)(void))__pyx_f_5qutip_2cy_15cqobjevo_factor_zptr2array2d, "PyArrayObject *(__pyx_t_double_complex *, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32839   if (__Pyx_ExportFunction("iprt2array", (void (*)(void))__pyx_f_5qutip_2cy_15cqobjevo_factor_iprt2array, "PyArrayObject *(int *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32840   __Pyx_RefNannyFinishContext();
32841   return 0;
32842   __pyx_L1_error:;
32843   __Pyx_RefNannyFinishContext();
32844   return -1;
32845 }
32846 
__Pyx_modinit_type_init_code(void)32847 static int __Pyx_modinit_type_init_code(void) {
32848   __Pyx_RefNannyDeclarations
32849   int __pyx_lineno = 0;
32850   const char *__pyx_filename = NULL;
32851   int __pyx_clineno = 0;
32852   __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
32853   /*--- Type init code ---*/
32854   __pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_CoeffFunc = &__pyx_vtable_5qutip_2cy_15cqobjevo_factor_CoeffFunc;
32855   __pyx_vtable_5qutip_2cy_15cqobjevo_factor_CoeffFunc._call_core = (void (*)(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *, double, __pyx_t_double_complex *))__pyx_f_5qutip_2cy_15cqobjevo_factor_9CoeffFunc__call_core;
32856   __pyx_vtable_5qutip_2cy_15cqobjevo_factor_CoeffFunc._dyn_args = (void (*)(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *, double, __pyx_t_double_complex *, __Pyx_memviewslice))__pyx_f_5qutip_2cy_15cqobjevo_factor_9CoeffFunc__dyn_args;
32857   if (PyType_Ready(&__pyx_type_5qutip_2cy_15cqobjevo_factor_CoeffFunc) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
32858   #if PY_VERSION_HEX < 0x030800B1
32859   __pyx_type_5qutip_2cy_15cqobjevo_factor_CoeffFunc.tp_print = 0;
32860   #endif
32861   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5qutip_2cy_15cqobjevo_factor_CoeffFunc.tp_dictoffset && __pyx_type_5qutip_2cy_15cqobjevo_factor_CoeffFunc.tp_getattro == PyObject_GenericGetAttr)) {
32862     __pyx_type_5qutip_2cy_15cqobjevo_factor_CoeffFunc.tp_getattro = __Pyx_PyObject_GenericGetAttr;
32863   }
32864   if (__Pyx_SetVtable(__pyx_type_5qutip_2cy_15cqobjevo_factor_CoeffFunc.tp_dict, __pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_CoeffFunc) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
32865   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CoeffFunc, (PyObject *)&__pyx_type_5qutip_2cy_15cqobjevo_factor_CoeffFunc) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
32866   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5qutip_2cy_15cqobjevo_factor_CoeffFunc) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
32867   __pyx_ptype_5qutip_2cy_15cqobjevo_factor_CoeffFunc = &__pyx_type_5qutip_2cy_15cqobjevo_factor_CoeffFunc;
32868   __pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_StrCoeff = &__pyx_vtable_5qutip_2cy_15cqobjevo_factor_StrCoeff;
32869   __pyx_vtable_5qutip_2cy_15cqobjevo_factor_StrCoeff.__pyx_base = *__pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_CoeffFunc;
32870   __pyx_vtable_5qutip_2cy_15cqobjevo_factor_StrCoeff.__pyx_base._dyn_args = (void (*)(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *, double, __pyx_t_double_complex *, __Pyx_memviewslice))__pyx_f_5qutip_2cy_15cqobjevo_factor_8StrCoeff__dyn_args;
32871   __pyx_type_5qutip_2cy_15cqobjevo_factor_StrCoeff.tp_base = __pyx_ptype_5qutip_2cy_15cqobjevo_factor_CoeffFunc;
32872   if (PyType_Ready(&__pyx_type_5qutip_2cy_15cqobjevo_factor_StrCoeff) < 0) __PYX_ERR(0, 273, __pyx_L1_error)
32873   #if PY_VERSION_HEX < 0x030800B1
32874   __pyx_type_5qutip_2cy_15cqobjevo_factor_StrCoeff.tp_print = 0;
32875   #endif
32876   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5qutip_2cy_15cqobjevo_factor_StrCoeff.tp_dictoffset && __pyx_type_5qutip_2cy_15cqobjevo_factor_StrCoeff.tp_getattro == PyObject_GenericGetAttr)) {
32877     __pyx_type_5qutip_2cy_15cqobjevo_factor_StrCoeff.tp_getattro = __Pyx_PyObject_GenericGetAttr;
32878   }
32879   if (__Pyx_SetVtable(__pyx_type_5qutip_2cy_15cqobjevo_factor_StrCoeff.tp_dict, __pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_StrCoeff) < 0) __PYX_ERR(0, 273, __pyx_L1_error)
32880   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StrCoeff, (PyObject *)&__pyx_type_5qutip_2cy_15cqobjevo_factor_StrCoeff) < 0) __PYX_ERR(0, 273, __pyx_L1_error)
32881   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5qutip_2cy_15cqobjevo_factor_StrCoeff) < 0) __PYX_ERR(0, 273, __pyx_L1_error)
32882   __pyx_ptype_5qutip_2cy_15cqobjevo_factor_StrCoeff = &__pyx_type_5qutip_2cy_15cqobjevo_factor_StrCoeff;
32883   __pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff = &__pyx_vtable_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff;
32884   __pyx_vtable_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff.__pyx_base = *__pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_CoeffFunc;
32885   __pyx_vtable_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff.__pyx_base._call_core = (void (*)(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *, double, __pyx_t_double_complex *))__pyx_f_5qutip_2cy_15cqobjevo_factor_16InterpolateCoeff__call_core;
32886   __pyx_type_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff.tp_base = __pyx_ptype_5qutip_2cy_15cqobjevo_factor_CoeffFunc;
32887   if (PyType_Ready(&__pyx_type_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
32888   #if PY_VERSION_HEX < 0x030800B1
32889   __pyx_type_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff.tp_print = 0;
32890   #endif
32891   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff.tp_dictoffset && __pyx_type_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff.tp_getattro == PyObject_GenericGetAttr)) {
32892     __pyx_type_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff.tp_getattro = __Pyx_PyObject_GenericGetAttr;
32893   }
32894   if (__Pyx_SetVtable(__pyx_type_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff.tp_dict, __pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
32895   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_InterpolateCoeff, (PyObject *)&__pyx_type_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
32896   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
32897   __pyx_ptype_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff = &__pyx_type_5qutip_2cy_15cqobjevo_factor_InterpolateCoeff;
32898   __pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_InterCoeffCte = &__pyx_vtable_5qutip_2cy_15cqobjevo_factor_InterCoeffCte;
32899   __pyx_vtable_5qutip_2cy_15cqobjevo_factor_InterCoeffCte.__pyx_base = *__pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_CoeffFunc;
32900   __pyx_vtable_5qutip_2cy_15cqobjevo_factor_InterCoeffCte.__pyx_base._call_core = (void (*)(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *, double, __pyx_t_double_complex *))__pyx_f_5qutip_2cy_15cqobjevo_factor_13InterCoeffCte__call_core;
32901   __pyx_type_5qutip_2cy_15cqobjevo_factor_InterCoeffCte.tp_base = __pyx_ptype_5qutip_2cy_15cqobjevo_factor_CoeffFunc;
32902   if (PyType_Ready(&__pyx_type_5qutip_2cy_15cqobjevo_factor_InterCoeffCte) < 0) __PYX_ERR(0, 140, __pyx_L1_error)
32903   #if PY_VERSION_HEX < 0x030800B1
32904   __pyx_type_5qutip_2cy_15cqobjevo_factor_InterCoeffCte.tp_print = 0;
32905   #endif
32906   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5qutip_2cy_15cqobjevo_factor_InterCoeffCte.tp_dictoffset && __pyx_type_5qutip_2cy_15cqobjevo_factor_InterCoeffCte.tp_getattro == PyObject_GenericGetAttr)) {
32907     __pyx_type_5qutip_2cy_15cqobjevo_factor_InterCoeffCte.tp_getattro = __Pyx_PyObject_GenericGetAttr;
32908   }
32909   if (__Pyx_SetVtable(__pyx_type_5qutip_2cy_15cqobjevo_factor_InterCoeffCte.tp_dict, __pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_InterCoeffCte) < 0) __PYX_ERR(0, 140, __pyx_L1_error)
32910   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_InterCoeffCte, (PyObject *)&__pyx_type_5qutip_2cy_15cqobjevo_factor_InterCoeffCte) < 0) __PYX_ERR(0, 140, __pyx_L1_error)
32911   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5qutip_2cy_15cqobjevo_factor_InterCoeffCte) < 0) __PYX_ERR(0, 140, __pyx_L1_error)
32912   __pyx_ptype_5qutip_2cy_15cqobjevo_factor_InterCoeffCte = &__pyx_type_5qutip_2cy_15cqobjevo_factor_InterCoeffCte;
32913   __pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_InterCoeffT = &__pyx_vtable_5qutip_2cy_15cqobjevo_factor_InterCoeffT;
32914   __pyx_vtable_5qutip_2cy_15cqobjevo_factor_InterCoeffT.__pyx_base = *__pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_CoeffFunc;
32915   __pyx_vtable_5qutip_2cy_15cqobjevo_factor_InterCoeffT.__pyx_base._call_core = (void (*)(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *, double, __pyx_t_double_complex *))__pyx_f_5qutip_2cy_15cqobjevo_factor_11InterCoeffT__call_core;
32916   __pyx_type_5qutip_2cy_15cqobjevo_factor_InterCoeffT.tp_base = __pyx_ptype_5qutip_2cy_15cqobjevo_factor_CoeffFunc;
32917   if (PyType_Ready(&__pyx_type_5qutip_2cy_15cqobjevo_factor_InterCoeffT) < 0) __PYX_ERR(0, 186, __pyx_L1_error)
32918   #if PY_VERSION_HEX < 0x030800B1
32919   __pyx_type_5qutip_2cy_15cqobjevo_factor_InterCoeffT.tp_print = 0;
32920   #endif
32921   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5qutip_2cy_15cqobjevo_factor_InterCoeffT.tp_dictoffset && __pyx_type_5qutip_2cy_15cqobjevo_factor_InterCoeffT.tp_getattro == PyObject_GenericGetAttr)) {
32922     __pyx_type_5qutip_2cy_15cqobjevo_factor_InterCoeffT.tp_getattro = __Pyx_PyObject_GenericGetAttr;
32923   }
32924   if (__Pyx_SetVtable(__pyx_type_5qutip_2cy_15cqobjevo_factor_InterCoeffT.tp_dict, __pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_InterCoeffT) < 0) __PYX_ERR(0, 186, __pyx_L1_error)
32925   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_InterCoeffT, (PyObject *)&__pyx_type_5qutip_2cy_15cqobjevo_factor_InterCoeffT) < 0) __PYX_ERR(0, 186, __pyx_L1_error)
32926   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5qutip_2cy_15cqobjevo_factor_InterCoeffT) < 0) __PYX_ERR(0, 186, __pyx_L1_error)
32927   __pyx_ptype_5qutip_2cy_15cqobjevo_factor_InterCoeffT = &__pyx_type_5qutip_2cy_15cqobjevo_factor_InterCoeffT;
32928   __pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_StepCoeff = &__pyx_vtable_5qutip_2cy_15cqobjevo_factor_StepCoeff;
32929   __pyx_vtable_5qutip_2cy_15cqobjevo_factor_StepCoeff.__pyx_base = *__pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_CoeffFunc;
32930   __pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeff.tp_base = __pyx_ptype_5qutip_2cy_15cqobjevo_factor_CoeffFunc;
32931   if (PyType_Ready(&__pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeff) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
32932   #if PY_VERSION_HEX < 0x030800B1
32933   __pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeff.tp_print = 0;
32934   #endif
32935   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeff.tp_dictoffset && __pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeff.tp_getattro == PyObject_GenericGetAttr)) {
32936     __pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeff.tp_getattro = __Pyx_PyObject_GenericGetAttr;
32937   }
32938   if (__Pyx_SetVtable(__pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeff.tp_dict, __pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_StepCoeff) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
32939   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StepCoeff, (PyObject *)&__pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeff) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
32940   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeff) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
32941   __pyx_ptype_5qutip_2cy_15cqobjevo_factor_StepCoeff = &__pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeff;
32942   __pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_StepCoeffT = &__pyx_vtable_5qutip_2cy_15cqobjevo_factor_StepCoeffT;
32943   __pyx_vtable_5qutip_2cy_15cqobjevo_factor_StepCoeffT.__pyx_base = *__pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_StepCoeff;
32944   __pyx_vtable_5qutip_2cy_15cqobjevo_factor_StepCoeffT.__pyx_base.__pyx_base._call_core = (void (*)(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *, double, __pyx_t_double_complex *))__pyx_f_5qutip_2cy_15cqobjevo_factor_10StepCoeffT__call_core;
32945   __pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeffT.tp_base = __pyx_ptype_5qutip_2cy_15cqobjevo_factor_StepCoeff;
32946   if (PyType_Ready(&__pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeffT) < 0) __PYX_ERR(0, 259, __pyx_L1_error)
32947   #if PY_VERSION_HEX < 0x030800B1
32948   __pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeffT.tp_print = 0;
32949   #endif
32950   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeffT.tp_dictoffset && __pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeffT.tp_getattro == PyObject_GenericGetAttr)) {
32951     __pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeffT.tp_getattro = __Pyx_PyObject_GenericGetAttr;
32952   }
32953   if (__Pyx_SetVtable(__pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeffT.tp_dict, __pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_StepCoeffT) < 0) __PYX_ERR(0, 259, __pyx_L1_error)
32954   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StepCoeffT, (PyObject *)&__pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeffT) < 0) __PYX_ERR(0, 259, __pyx_L1_error)
32955   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeffT) < 0) __PYX_ERR(0, 259, __pyx_L1_error)
32956   __pyx_ptype_5qutip_2cy_15cqobjevo_factor_StepCoeffT = &__pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeffT;
32957   __pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_StepCoeffCte = &__pyx_vtable_5qutip_2cy_15cqobjevo_factor_StepCoeffCte;
32958   __pyx_vtable_5qutip_2cy_15cqobjevo_factor_StepCoeffCte.__pyx_base = *__pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_StepCoeff;
32959   __pyx_vtable_5qutip_2cy_15cqobjevo_factor_StepCoeffCte.__pyx_base.__pyx_base._call_core = (void (*)(struct __pyx_obj_5qutip_2cy_15cqobjevo_factor_CoeffFunc *, double, __pyx_t_double_complex *))__pyx_f_5qutip_2cy_15cqobjevo_factor_12StepCoeffCte__call_core;
32960   __pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeffCte.tp_base = __pyx_ptype_5qutip_2cy_15cqobjevo_factor_StepCoeff;
32961   if (PyType_Ready(&__pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeffCte) < 0) __PYX_ERR(0, 266, __pyx_L1_error)
32962   #if PY_VERSION_HEX < 0x030800B1
32963   __pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeffCte.tp_print = 0;
32964   #endif
32965   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeffCte.tp_dictoffset && __pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeffCte.tp_getattro == PyObject_GenericGetAttr)) {
32966     __pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeffCte.tp_getattro = __Pyx_PyObject_GenericGetAttr;
32967   }
32968   if (__Pyx_SetVtable(__pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeffCte.tp_dict, __pyx_vtabptr_5qutip_2cy_15cqobjevo_factor_StepCoeffCte) < 0) __PYX_ERR(0, 266, __pyx_L1_error)
32969   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StepCoeffCte, (PyObject *)&__pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeffCte) < 0) __PYX_ERR(0, 266, __pyx_L1_error)
32970   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeffCte) < 0) __PYX_ERR(0, 266, __pyx_L1_error)
32971   __pyx_ptype_5qutip_2cy_15cqobjevo_factor_StepCoeffCte = &__pyx_type_5qutip_2cy_15cqobjevo_factor_StepCoeffCte;
32972   __pyx_vtabptr_array = &__pyx_vtable_array;
32973   __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
32974   if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
32975   #if PY_VERSION_HEX < 0x030800B1
32976   __pyx_type___pyx_array.tp_print = 0;
32977   #endif
32978   if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
32979   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
32980   __pyx_array_type = &__pyx_type___pyx_array;
32981   if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
32982   #if PY_VERSION_HEX < 0x030800B1
32983   __pyx_type___pyx_MemviewEnum.tp_print = 0;
32984   #endif
32985   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
32986     __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
32987   }
32988   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
32989   __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
32990   __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
32991   __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
32992   __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
32993   __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
32994   __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
32995   __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
32996   __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
32997   __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
32998   if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
32999   #if PY_VERSION_HEX < 0x030800B1
33000   __pyx_type___pyx_memoryview.tp_print = 0;
33001   #endif
33002   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
33003     __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
33004   }
33005   if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
33006   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
33007   __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
33008   __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
33009   __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
33010   __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
33011   __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
33012   __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
33013   if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
33014   #if PY_VERSION_HEX < 0x030800B1
33015   __pyx_type___pyx_memoryviewslice.tp_print = 0;
33016   #endif
33017   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
33018     __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
33019   }
33020   if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
33021   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
33022   __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
33023   __Pyx_RefNannyFinishContext();
33024   return 0;
33025   __pyx_L1_error:;
33026   __Pyx_RefNannyFinishContext();
33027   return -1;
33028 }
33029 
__Pyx_modinit_type_import_code(void)33030 static int __Pyx_modinit_type_import_code(void) {
33031   __Pyx_RefNannyDeclarations
33032   PyObject *__pyx_t_1 = NULL;
33033   int __pyx_lineno = 0;
33034   const char *__pyx_filename = NULL;
33035   int __pyx_clineno = 0;
33036   __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
33037   /*--- Type import code ---*/
33038   __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
33039   __Pyx_GOTREF(__pyx_t_1);
33040   __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
33041   #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
33042   sizeof(PyTypeObject),
33043   #else
33044   sizeof(PyHeapTypeObject),
33045   #endif
33046   __Pyx_ImportType_CheckSize_Warn);
33047    if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
33048   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33049   __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 199, __pyx_L1_error)
33050   __Pyx_GOTREF(__pyx_t_1);
33051   __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
33052    if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 199, __pyx_L1_error)
33053   __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
33054    if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 222, __pyx_L1_error)
33055   __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
33056    if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 226, __pyx_L1_error)
33057   __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
33058    if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 238, __pyx_L1_error)
33059   __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
33060    if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 764, __pyx_L1_error)
33061   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33062   __pyx_t_1 = PyImport_ImportModule("qutip.cy.cqobjevo"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 38, __pyx_L1_error)
33063   __Pyx_GOTREF(__pyx_t_1);
33064   __pyx_ptype_5qutip_2cy_8cqobjevo_CQobjEvo = __Pyx_ImportType(__pyx_t_1, "qutip.cy.cqobjevo", "CQobjEvo", sizeof(struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvo), __Pyx_ImportType_CheckSize_Warn);
33065    if (!__pyx_ptype_5qutip_2cy_8cqobjevo_CQobjEvo) __PYX_ERR(4, 38, __pyx_L1_error)
33066   __pyx_vtabptr_5qutip_2cy_8cqobjevo_CQobjEvo = (struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjEvo*)__Pyx_GetVtable(__pyx_ptype_5qutip_2cy_8cqobjevo_CQobjEvo->tp_dict); if (unlikely(!__pyx_vtabptr_5qutip_2cy_8cqobjevo_CQobjEvo)) __PYX_ERR(4, 38, __pyx_L1_error)
33067   __pyx_ptype_5qutip_2cy_8cqobjevo_CQobjCte = __Pyx_ImportType(__pyx_t_1, "qutip.cy.cqobjevo", "CQobjCte", sizeof(struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjCte), __Pyx_ImportType_CheckSize_Warn);
33068    if (!__pyx_ptype_5qutip_2cy_8cqobjevo_CQobjCte) __PYX_ERR(4, 67, __pyx_L1_error)
33069   __pyx_vtabptr_5qutip_2cy_8cqobjevo_CQobjCte = (struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjCte*)__Pyx_GetVtable(__pyx_ptype_5qutip_2cy_8cqobjevo_CQobjCte->tp_dict); if (unlikely(!__pyx_vtabptr_5qutip_2cy_8cqobjevo_CQobjCte)) __PYX_ERR(4, 67, __pyx_L1_error)
33070   __pyx_ptype_5qutip_2cy_8cqobjevo_CQobjCteDense = __Pyx_ImportType(__pyx_t_1, "qutip.cy.cqobjevo", "CQobjCteDense", sizeof(struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjCteDense), __Pyx_ImportType_CheckSize_Warn);
33071    if (!__pyx_ptype_5qutip_2cy_8cqobjevo_CQobjCteDense) __PYX_ERR(4, 73, __pyx_L1_error)
33072   __pyx_vtabptr_5qutip_2cy_8cqobjevo_CQobjCteDense = (struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjCteDense*)__Pyx_GetVtable(__pyx_ptype_5qutip_2cy_8cqobjevo_CQobjCteDense->tp_dict); if (unlikely(!__pyx_vtabptr_5qutip_2cy_8cqobjevo_CQobjCteDense)) __PYX_ERR(4, 73, __pyx_L1_error)
33073   __pyx_ptype_5qutip_2cy_8cqobjevo_CQobjEvoTd = __Pyx_ImportType(__pyx_t_1, "qutip.cy.cqobjevo", "CQobjEvoTd", sizeof(struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvoTd), __Pyx_ImportType_CheckSize_Warn);
33074    if (!__pyx_ptype_5qutip_2cy_8cqobjevo_CQobjEvoTd) __PYX_ERR(4, 78, __pyx_L1_error)
33075   __pyx_vtabptr_5qutip_2cy_8cqobjevo_CQobjEvoTd = (struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjEvoTd*)__Pyx_GetVtable(__pyx_ptype_5qutip_2cy_8cqobjevo_CQobjEvoTd->tp_dict); if (unlikely(!__pyx_vtabptr_5qutip_2cy_8cqobjevo_CQobjEvoTd)) __PYX_ERR(4, 78, __pyx_L1_error)
33076   __pyx_ptype_5qutip_2cy_8cqobjevo_CQobjEvoTdDense = __Pyx_ImportType(__pyx_t_1, "qutip.cy.cqobjevo", "CQobjEvoTdDense", sizeof(struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvoTdDense), __Pyx_ImportType_CheckSize_Warn);
33077    if (!__pyx_ptype_5qutip_2cy_8cqobjevo_CQobjEvoTdDense) __PYX_ERR(4, 87, __pyx_L1_error)
33078   __pyx_vtabptr_5qutip_2cy_8cqobjevo_CQobjEvoTdDense = (struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjEvoTdDense*)__Pyx_GetVtable(__pyx_ptype_5qutip_2cy_8cqobjevo_CQobjEvoTdDense->tp_dict); if (unlikely(!__pyx_vtabptr_5qutip_2cy_8cqobjevo_CQobjEvoTdDense)) __PYX_ERR(4, 87, __pyx_L1_error)
33079   __pyx_ptype_5qutip_2cy_8cqobjevo_CQobjEvoTdMatched = __Pyx_ImportType(__pyx_t_1, "qutip.cy.cqobjevo", "CQobjEvoTdMatched", sizeof(struct __pyx_obj_5qutip_2cy_8cqobjevo_CQobjEvoTdMatched), __Pyx_ImportType_CheckSize_Warn);
33080    if (!__pyx_ptype_5qutip_2cy_8cqobjevo_CQobjEvoTdMatched) __PYX_ERR(4, 100, __pyx_L1_error)
33081   __pyx_vtabptr_5qutip_2cy_8cqobjevo_CQobjEvoTdMatched = (struct __pyx_vtabstruct_5qutip_2cy_8cqobjevo_CQobjEvoTdMatched*)__Pyx_GetVtable(__pyx_ptype_5qutip_2cy_8cqobjevo_CQobjEvoTdMatched->tp_dict); if (unlikely(!__pyx_vtabptr_5qutip_2cy_8cqobjevo_CQobjEvoTdMatched)) __PYX_ERR(4, 100, __pyx_L1_error)
33082   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33083   __Pyx_RefNannyFinishContext();
33084   return 0;
33085   __pyx_L1_error:;
33086   __Pyx_XDECREF(__pyx_t_1);
33087   __Pyx_RefNannyFinishContext();
33088   return -1;
33089 }
33090 
__Pyx_modinit_variable_import_code(void)33091 static int __Pyx_modinit_variable_import_code(void) {
33092   __Pyx_RefNannyDeclarations
33093   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
33094   /*--- Variable import code ---*/
33095   __Pyx_RefNannyFinishContext();
33096   return 0;
33097 }
33098 
__Pyx_modinit_function_import_code(void)33099 static int __Pyx_modinit_function_import_code(void) {
33100   __Pyx_RefNannyDeclarations
33101   PyObject *__pyx_t_1 = NULL;
33102   int __pyx_lineno = 0;
33103   const char *__pyx_filename = NULL;
33104   int __pyx_clineno = 0;
33105   __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
33106   /*--- Function import code ---*/
33107   __pyx_t_1 = PyImport_ImportModule("qutip.cy.inter"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
33108   __Pyx_GOTREF(__pyx_t_1);
33109   if (__Pyx_ImportFunction(__pyx_t_1, "_spline_complex_t_second", (void (**)(void))&__pyx_f_5qutip_2cy_5inter__spline_complex_t_second, "__pyx_t_double_complex (double, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
33110   if (__Pyx_ImportFunction(__pyx_t_1, "_spline_complex_cte_second", (void (**)(void))&__pyx_f_5qutip_2cy_5inter__spline_complex_cte_second, "__pyx_t_double_complex (double, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, double)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
33111   if (__Pyx_ImportFunction(__pyx_t_1, "_step_complex_cte", (void (**)(void))&__pyx_f_5qutip_2cy_5inter__step_complex_cte, "__pyx_t_double_complex (double, __Pyx_memviewslice, __Pyx_memviewslice, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
33112   if (__Pyx_ImportFunction(__pyx_t_1, "_step_complex_t", (void (**)(void))&__pyx_f_5qutip_2cy_5inter__step_complex_t, "__pyx_t_double_complex (double, __Pyx_memviewslice, __Pyx_memviewslice, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
33113   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33114   __pyx_t_1 = PyImport_ImportModule("qutip.cy.interpolate"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
33115   __Pyx_GOTREF(__pyx_t_1);
33116   if (__Pyx_ImportFunction(__pyx_t_1, "interp", (void (**)(void))&__pyx_f_5qutip_2cy_11interpolate_interp, "double (double, double, double, __Pyx_memviewslice, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
33117   if (__Pyx_ImportFunction(__pyx_t_1, "zinterp", (void (**)(void))&__pyx_f_5qutip_2cy_11interpolate_zinterp, "__pyx_t_double_complex (double, double, double, __Pyx_memviewslice, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
33118   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33119   __Pyx_RefNannyFinishContext();
33120   return 0;
33121   __pyx_L1_error:;
33122   __Pyx_XDECREF(__pyx_t_1);
33123   __Pyx_RefNannyFinishContext();
33124   return -1;
33125 }
33126 
33127 
33128 #ifndef CYTHON_NO_PYINIT_EXPORT
33129 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
33130 #elif PY_MAJOR_VERSION < 3
33131 #ifdef __cplusplus
33132 #define __Pyx_PyMODINIT_FUNC extern "C" void
33133 #else
33134 #define __Pyx_PyMODINIT_FUNC void
33135 #endif
33136 #else
33137 #ifdef __cplusplus
33138 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
33139 #else
33140 #define __Pyx_PyMODINIT_FUNC PyObject *
33141 #endif
33142 #endif
33143 
33144 
33145 #if PY_MAJOR_VERSION < 3
33146 __Pyx_PyMODINIT_FUNC initcqobjevo_factor(void) CYTHON_SMALL_CODE; /*proto*/
initcqobjevo_factor(void)33147 __Pyx_PyMODINIT_FUNC initcqobjevo_factor(void)
33148 #else
33149 __Pyx_PyMODINIT_FUNC PyInit_cqobjevo_factor(void) CYTHON_SMALL_CODE; /*proto*/
33150 __Pyx_PyMODINIT_FUNC PyInit_cqobjevo_factor(void)
33151 #if CYTHON_PEP489_MULTI_PHASE_INIT
33152 {
33153   return PyModuleDef_Init(&__pyx_moduledef);
33154 }
33155 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
33156     #if PY_VERSION_HEX >= 0x030700A1
33157     static PY_INT64_T main_interpreter_id = -1;
33158     PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
33159     if (main_interpreter_id == -1) {
33160         main_interpreter_id = current_id;
33161         return (unlikely(current_id == -1)) ? -1 : 0;
33162     } else if (unlikely(main_interpreter_id != current_id))
33163     #else
33164     static PyInterpreterState *main_interpreter = NULL;
33165     PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
33166     if (!main_interpreter) {
33167         main_interpreter = current_interpreter;
33168     } else if (unlikely(main_interpreter != current_interpreter))
33169     #endif
33170     {
33171         PyErr_SetString(
33172             PyExc_ImportError,
33173             "Interpreter change detected - this module can only be loaded into one interpreter per process.");
33174         return -1;
33175     }
33176     return 0;
33177 }
33178 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
33179     PyObject *value = PyObject_GetAttrString(spec, from_name);
33180     int result = 0;
33181     if (likely(value)) {
33182         if (allow_none || value != Py_None) {
33183             result = PyDict_SetItemString(moddict, to_name, value);
33184         }
33185         Py_DECREF(value);
33186     } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
33187         PyErr_Clear();
33188     } else {
33189         result = -1;
33190     }
33191     return result;
33192 }
33193 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
33194     PyObject *module = NULL, *moddict, *modname;
33195     if (__Pyx_check_single_interpreter())
33196         return NULL;
33197     if (__pyx_m)
33198         return __Pyx_NewRef(__pyx_m);
33199     modname = PyObject_GetAttrString(spec, "name");
33200     if (unlikely(!modname)) goto bad;
33201     module = PyModule_NewObject(modname);
33202     Py_DECREF(modname);
33203     if (unlikely(!module)) goto bad;
33204     moddict = PyModule_GetDict(module);
33205     if (unlikely(!moddict)) goto bad;
33206     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
33207     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
33208     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
33209     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
33210     return module;
33211 bad:
33212     Py_XDECREF(module);
33213     return NULL;
33214 }
33215 
33216 
33217 static CYTHON_SMALL_CODE int __pyx_pymod_exec_cqobjevo_factor(PyObject *__pyx_pyinit_module)
33218 #endif
33219 #endif
33220 {
33221   PyObject *__pyx_t_1 = NULL;
33222   PyObject *__pyx_t_2 = NULL;
33223   static PyThread_type_lock __pyx_t_3[8];
33224   int __pyx_lineno = 0;
33225   const char *__pyx_filename = NULL;
33226   int __pyx_clineno = 0;
33227   __Pyx_RefNannyDeclarations
33228   #if CYTHON_PEP489_MULTI_PHASE_INIT
33229   if (__pyx_m) {
33230     if (__pyx_m == __pyx_pyinit_module) return 0;
33231     PyErr_SetString(PyExc_RuntimeError, "Module 'cqobjevo_factor' has already been imported. Re-initialisation is not supported.");
33232     return -1;
33233   }
33234   #elif PY_MAJOR_VERSION >= 3
33235   if (__pyx_m) return __Pyx_NewRef(__pyx_m);
33236   #endif
33237   #if CYTHON_REFNANNY
33238 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
33239 if (!__Pyx_RefNanny) {
33240   PyErr_Clear();
33241   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
33242   if (!__Pyx_RefNanny)
33243       Py_FatalError("failed to import 'refnanny' module");
33244 }
33245 #endif
33246   __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_cqobjevo_factor(void)", 0);
33247   if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
33248   #ifdef __Pxy_PyFrame_Initialize_Offsets
33249   __Pxy_PyFrame_Initialize_Offsets();
33250   #endif
33251   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
33252   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
33253   __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
33254   #ifdef __Pyx_CyFunction_USED
33255   if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
33256   #endif
33257   #ifdef __Pyx_FusedFunction_USED
33258   if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
33259   #endif
33260   #ifdef __Pyx_Coroutine_USED
33261   if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
33262   #endif
33263   #ifdef __Pyx_Generator_USED
33264   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
33265   #endif
33266   #ifdef __Pyx_AsyncGen_USED
33267   if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
33268   #endif
33269   #ifdef __Pyx_StopAsyncIteration_USED
33270   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
33271   #endif
33272   /*--- Library function declarations ---*/
33273   /*--- Threads initialization code ---*/
33274   #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
33275   #ifdef WITH_THREAD /* Python build with threading support? */
33276   PyEval_InitThreads();
33277   #endif
33278   #endif
33279   /*--- Module creation code ---*/
33280   #if CYTHON_PEP489_MULTI_PHASE_INIT
33281   __pyx_m = __pyx_pyinit_module;
33282   Py_INCREF(__pyx_m);
33283   #else
33284   #if PY_MAJOR_VERSION < 3
33285   __pyx_m = Py_InitModule4("cqobjevo_factor", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
33286   #else
33287   __pyx_m = PyModule_Create(&__pyx_moduledef);
33288   #endif
33289   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
33290   #endif
33291   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
33292   Py_INCREF(__pyx_d);
33293   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
33294   Py_INCREF(__pyx_b);
33295   __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
33296   Py_INCREF(__pyx_cython_runtime);
33297   if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
33298   /*--- Initialize various global constants etc. ---*/
33299   if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
33300   #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
33301   if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
33302   #endif
33303   if (__pyx_module_is_main_qutip__cy__cqobjevo_factor) {
33304     if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
33305   }
33306   #if PY_MAJOR_VERSION >= 3
33307   {
33308     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
33309     if (!PyDict_GetItemString(modules, "qutip.cy.cqobjevo_factor")) {
33310       if (unlikely(PyDict_SetItemString(modules, "qutip.cy.cqobjevo_factor", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
33311     }
33312   }
33313   #endif
33314   /*--- Builtin init code ---*/
33315   if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
33316   /*--- Constants init code ---*/
33317   if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
33318   /*--- Global type/function init code ---*/
33319   (void)__Pyx_modinit_global_init_code();
33320   (void)__Pyx_modinit_variable_export_code();
33321   if (unlikely(__Pyx_modinit_function_export_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
33322   if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
33323   if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
33324   (void)__Pyx_modinit_variable_import_code();
33325   if (unlikely(__Pyx_modinit_function_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
33326   /*--- Execution code ---*/
33327   #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
33328   if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
33329   #endif
33330 
33331   /* "qutip/cy/cqobjevo_factor.pyx":34
33332  * #    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33333  * ###############################################################################
33334  * import numpy as np             # <<<<<<<<<<<<<<
33335  * cimport numpy as np
33336  * import cython
33337  */
33338   __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
33339   __Pyx_GOTREF(__pyx_t_1);
33340   if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
33341   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33342 
33343   /* "qutip/cy/cqobjevo_factor.pyx":39
33344  * cimport cython
33345  * cimport libc.math
33346  * from qutip.cy.inter import _prep_cubic_spline             # <<<<<<<<<<<<<<
33347  * from qutip.cy.inter cimport (_spline_complex_cte_second,
33348  *                              _spline_complex_t_second,
33349  */
33350   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
33351   __Pyx_GOTREF(__pyx_t_1);
33352   __Pyx_INCREF(__pyx_n_s_prep_cubic_spline);
33353   __Pyx_GIVEREF(__pyx_n_s_prep_cubic_spline);
33354   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_prep_cubic_spline);
33355   __pyx_t_2 = __Pyx_Import(__pyx_n_s_qutip_cy_inter, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
33356   __Pyx_GOTREF(__pyx_t_2);
33357   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33358   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_prep_cubic_spline); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
33359   __Pyx_GOTREF(__pyx_t_1);
33360   if (PyDict_SetItem(__pyx_d, __pyx_n_s_prep_cubic_spline, __pyx_t_1) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
33361   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33362   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33363 
33364   /* "qutip/cy/cqobjevo_factor.pyx":75
33365  *         self._args = {}
33366  *
33367  *     def __call__(self, double t, args={}):             # <<<<<<<<<<<<<<
33368  *         cdef np.ndarray[ndim=1, dtype=complex] coeff = \
33369  *                                             np.zeros(self._num_ops, dtype=complex)
33370  */
33371   __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error)
33372   __Pyx_GOTREF(__pyx_t_2);
33373   __pyx_k_ = __pyx_t_2;
33374   __Pyx_GIVEREF(__pyx_t_2);
33375   __pyx_t_2 = 0;
33376 
33377   /* "qutip/cy/cqobjevo_factor.pyx":116
33378  *                 self.c[i,j] = ops[i][2].coeffs[j]
33379  *
33380  *     def __call__(self, t, args={}):             # <<<<<<<<<<<<<<
33381  *         cdef np.ndarray[ndim=1, dtype=complex] coeff = \
33382  *                                             np.zeros(self._num_ops, dtype=complex)
33383  */
33384   __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error)
33385   __Pyx_GOTREF(__pyx_t_2);
33386   __pyx_k__2 = __pyx_t_2;
33387   __Pyx_GIVEREF(__pyx_t_2);
33388   __pyx_t_2 = 0;
33389 
33390   /* "qutip/cy/cqobjevo_factor.pyx":274
33391  *
33392  * cdef class StrCoeff(CoeffFunc):
33393  *     def __init__(self, ops, args, tlist, dyn_args=[]):             # <<<<<<<<<<<<<<
33394  *         self._num_ops = len(ops)
33395  *         self._args = args
33396  */
33397   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error)
33398   __Pyx_GOTREF(__pyx_t_2);
33399   __pyx_k__5 = __pyx_t_2;
33400   __Pyx_GIVEREF(__pyx_t_2);
33401   __pyx_t_2 = 0;
33402 
33403   /* "qutip/cy/cqobjevo_factor.pyx":320
33404  *                 self._expect_vec[ii] = cop._expect(t, state)
33405  *
33406  *     def __call__(self, double t, args={}, vec=None):             # <<<<<<<<<<<<<<
33407  *         cdef np.ndarray[ndim=1, dtype=complex] coeff = \
33408  *                                     np.zeros(self._num_ops, dtype=complex)
33409  */
33410   __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 320, __pyx_L1_error)
33411   __Pyx_GOTREF(__pyx_t_2);
33412   __pyx_k__6 = __pyx_t_2;
33413   __Pyx_GIVEREF(__pyx_t_2);
33414   __pyx_t_2 = 0;
33415 
33416   /* "(tree fragment)":1
33417  * def __pyx_unpickle_CoeffFunc(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
33418  *     cdef object __pyx_PickleError
33419  *     cdef object __pyx_result
33420  */
33421   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5qutip_2cy_15cqobjevo_factor_1__pyx_unpickle_CoeffFunc, NULL, __pyx_n_s_qutip_cy_cqobjevo_factor); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
33422   __Pyx_GOTREF(__pyx_t_2);
33423   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_CoeffFunc, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
33424   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33425 
33426   /* "(tree fragment)":11
33427  *         __pyx_unpickle_CoeffFunc__set_state(<CoeffFunc> __pyx_result, __pyx_state)
33428  *     return __pyx_result
33429  * cdef __pyx_unpickle_CoeffFunc__set_state(CoeffFunc __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
33430  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]
33431  *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
33432  */
33433   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5qutip_2cy_15cqobjevo_factor_3__pyx_unpickle_InterpolateCoeff, NULL, __pyx_n_s_qutip_cy_cqobjevo_factor); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
33434   __Pyx_GOTREF(__pyx_t_2);
33435   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_InterpolateCoeff, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
33436   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33437 
33438   /* "(tree fragment)":1
33439  * def __pyx_unpickle_InterCoeffCte(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
33440  *     cdef object __pyx_PickleError
33441  *     cdef object __pyx_result
33442  */
33443   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5qutip_2cy_15cqobjevo_factor_5__pyx_unpickle_InterCoeffCte, NULL, __pyx_n_s_qutip_cy_cqobjevo_factor); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
33444   __Pyx_GOTREF(__pyx_t_2);
33445   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_InterCoeffCte, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
33446   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33447 
33448   /* "(tree fragment)":11
33449  *         __pyx_unpickle_InterCoeffCte__set_state(<InterCoeffCte> __pyx_result, __pyx_state)
33450  *     return __pyx_result
33451  * cdef __pyx_unpickle_InterCoeffCte__set_state(InterCoeffCte __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
33452  *     __pyx_result.M = __pyx_state[0]; __pyx_result._args = __pyx_state[1]; __pyx_result._num_ops = __pyx_state[2]; __pyx_result.dt = __pyx_state[3]; __pyx_result.n_t = __pyx_state[4]; __pyx_result.tlist = __pyx_state[5]; __pyx_result.y = __pyx_state[6]
33453  *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
33454  */
33455   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5qutip_2cy_15cqobjevo_factor_7__pyx_unpickle_InterCoeffT, NULL, __pyx_n_s_qutip_cy_cqobjevo_factor); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
33456   __Pyx_GOTREF(__pyx_t_2);
33457   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_InterCoeffT, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
33458   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33459 
33460   /* "(tree fragment)":1
33461  * def __pyx_unpickle_StepCoeff(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
33462  *     cdef object __pyx_PickleError
33463  *     cdef object __pyx_result
33464  */
33465   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5qutip_2cy_15cqobjevo_factor_9__pyx_unpickle_StepCoeff, NULL, __pyx_n_s_qutip_cy_cqobjevo_factor); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
33466   __Pyx_GOTREF(__pyx_t_2);
33467   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_StepCoeff, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
33468   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33469 
33470   /* "(tree fragment)":11
33471  *         __pyx_unpickle_StepCoeff__set_state(<StepCoeff> __pyx_result, __pyx_state)
33472  *     return __pyx_result
33473  * cdef __pyx_unpickle_StepCoeff__set_state(StepCoeff __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
33474  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.n_t = __pyx_state[2]; __pyx_result.tlist = __pyx_state[3]; __pyx_result.y = __pyx_state[4]
33475  *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):
33476  */
33477   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5qutip_2cy_15cqobjevo_factor_11__pyx_unpickle_StepCoeffT, NULL, __pyx_n_s_qutip_cy_cqobjevo_factor); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
33478   __Pyx_GOTREF(__pyx_t_2);
33479   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_StepCoeffT, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
33480   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33481 
33482   /* "(tree fragment)":1
33483  * def __pyx_unpickle_StepCoeffCte(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
33484  *     cdef object __pyx_PickleError
33485  *     cdef object __pyx_result
33486  */
33487   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5qutip_2cy_15cqobjevo_factor_13__pyx_unpickle_StepCoeffCte, NULL, __pyx_n_s_qutip_cy_cqobjevo_factor); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
33488   __Pyx_GOTREF(__pyx_t_2);
33489   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_StepCoeffCte, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
33490   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33491 
33492   /* "(tree fragment)":11
33493  *         __pyx_unpickle_StepCoeffCte__set_state(<StepCoeffCte> __pyx_result, __pyx_state)
33494  *     return __pyx_result
33495  * cdef __pyx_unpickle_StepCoeffCte__set_state(StepCoeffCte __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
33496  *     __pyx_result._args = __pyx_state[0]; __pyx_result._num_ops = __pyx_state[1]; __pyx_result.n_t = __pyx_state[2]; __pyx_result.tlist = __pyx_state[3]; __pyx_result.y = __pyx_state[4]
33497  *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):
33498  */
33499   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5qutip_2cy_15cqobjevo_factor_15__pyx_unpickle_StrCoeff, NULL, __pyx_n_s_qutip_cy_cqobjevo_factor); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
33500   __Pyx_GOTREF(__pyx_t_2);
33501   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_StrCoeff, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
33502   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33503 
33504   /* "qutip/cy/cqobjevo_factor.pyx":1
33505  * #cython: language_level=3             # <<<<<<<<<<<<<<
33506  * # This file is part of QuTiP: Quantum Toolbox in Python.
33507  * #
33508  */
33509   __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
33510   __Pyx_GOTREF(__pyx_t_2);
33511   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
33512   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33513 
33514   /* "View.MemoryView":209
33515  *         info.obj = self
33516  *
33517  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
33518  *
33519  *     def __dealloc__(array self):
33520  */
33521   __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 209, __pyx_L1_error)
33522   __Pyx_GOTREF(__pyx_t_2);
33523   if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
33524   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33525   PyType_Modified(__pyx_array_type);
33526 
33527   /* "View.MemoryView":286
33528  *         return self.name
33529  *
33530  * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
33531  * cdef strided = Enum("<strided and direct>") # default
33532  * cdef indirect = Enum("<strided and indirect>")
33533  */
33534   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 286, __pyx_L1_error)
33535   __Pyx_GOTREF(__pyx_t_2);
33536   __Pyx_XGOTREF(generic);
33537   __Pyx_DECREF_SET(generic, __pyx_t_2);
33538   __Pyx_GIVEREF(__pyx_t_2);
33539   __pyx_t_2 = 0;
33540 
33541   /* "View.MemoryView":287
33542  *
33543  * cdef generic = Enum("<strided and direct or indirect>")
33544  * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
33545  * cdef indirect = Enum("<strided and indirect>")
33546  *
33547  */
33548   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 287, __pyx_L1_error)
33549   __Pyx_GOTREF(__pyx_t_2);
33550   __Pyx_XGOTREF(strided);
33551   __Pyx_DECREF_SET(strided, __pyx_t_2);
33552   __Pyx_GIVEREF(__pyx_t_2);
33553   __pyx_t_2 = 0;
33554 
33555   /* "View.MemoryView":288
33556  * cdef generic = Enum("<strided and direct or indirect>")
33557  * cdef strided = Enum("<strided and direct>") # default
33558  * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
33559  *
33560  *
33561  */
33562   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error)
33563   __Pyx_GOTREF(__pyx_t_2);
33564   __Pyx_XGOTREF(indirect);
33565   __Pyx_DECREF_SET(indirect, __pyx_t_2);
33566   __Pyx_GIVEREF(__pyx_t_2);
33567   __pyx_t_2 = 0;
33568 
33569   /* "View.MemoryView":291
33570  *
33571  *
33572  * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
33573  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
33574  *
33575  */
33576   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 291, __pyx_L1_error)
33577   __Pyx_GOTREF(__pyx_t_2);
33578   __Pyx_XGOTREF(contiguous);
33579   __Pyx_DECREF_SET(contiguous, __pyx_t_2);
33580   __Pyx_GIVEREF(__pyx_t_2);
33581   __pyx_t_2 = 0;
33582 
33583   /* "View.MemoryView":292
33584  *
33585  * cdef contiguous = Enum("<contiguous and direct>")
33586  * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
33587  *
33588  *
33589  */
33590   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 292, __pyx_L1_error)
33591   __Pyx_GOTREF(__pyx_t_2);
33592   __Pyx_XGOTREF(indirect_contiguous);
33593   __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2);
33594   __Pyx_GIVEREF(__pyx_t_2);
33595   __pyx_t_2 = 0;
33596 
33597   /* "View.MemoryView":316
33598  *
33599  * DEF THREAD_LOCKS_PREALLOCATED = 8
33600  * cdef int __pyx_memoryview_thread_locks_used = 0             # <<<<<<<<<<<<<<
33601  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
33602  *     PyThread_allocate_lock(),
33603  */
33604   __pyx_memoryview_thread_locks_used = 0;
33605 
33606   /* "View.MemoryView":317
33607  * DEF THREAD_LOCKS_PREALLOCATED = 8
33608  * cdef int __pyx_memoryview_thread_locks_used = 0
33609  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [             # <<<<<<<<<<<<<<
33610  *     PyThread_allocate_lock(),
33611  *     PyThread_allocate_lock(),
33612  */
33613   __pyx_t_3[0] = PyThread_allocate_lock();
33614   __pyx_t_3[1] = PyThread_allocate_lock();
33615   __pyx_t_3[2] = PyThread_allocate_lock();
33616   __pyx_t_3[3] = PyThread_allocate_lock();
33617   __pyx_t_3[4] = PyThread_allocate_lock();
33618   __pyx_t_3[5] = PyThread_allocate_lock();
33619   __pyx_t_3[6] = PyThread_allocate_lock();
33620   __pyx_t_3[7] = PyThread_allocate_lock();
33621   memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
33622 
33623   /* "View.MemoryView":549
33624  *         info.obj = self
33625  *
33626  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
33627  *
33628  *
33629  */
33630   __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 549, __pyx_L1_error)
33631   __Pyx_GOTREF(__pyx_t_2);
33632   if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
33633   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33634   PyType_Modified(__pyx_memoryview_type);
33635 
33636   /* "View.MemoryView":995
33637  *         return self.from_object
33638  *
33639  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
33640  *
33641  *
33642  */
33643   __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 995, __pyx_L1_error)
33644   __Pyx_GOTREF(__pyx_t_2);
33645   if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 995, __pyx_L1_error)
33646   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33647   PyType_Modified(__pyx_memoryviewslice_type);
33648 
33649   /* "(tree fragment)":1
33650  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
33651  *     cdef object __pyx_PickleError
33652  *     cdef object __pyx_result
33653  */
33654   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
33655   __Pyx_GOTREF(__pyx_t_2);
33656   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
33657   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33658 
33659   /* "BufferFormatFromTypeInfo":1463
33660  *
33661  * @cname('__pyx_format_from_typeinfo')
33662  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type):             # <<<<<<<<<<<<<<
33663  *     cdef __Pyx_StructField *field
33664  *     cdef __pyx_typeinfo_string fmt
33665  */
33666 
33667   /*--- Wrapped vars code ---*/
33668 
33669   goto __pyx_L0;
33670   __pyx_L1_error:;
33671   __Pyx_XDECREF(__pyx_t_1);
33672   __Pyx_XDECREF(__pyx_t_2);
33673   if (__pyx_m) {
33674     if (__pyx_d) {
33675       __Pyx_AddTraceback("init qutip.cy.cqobjevo_factor", __pyx_clineno, __pyx_lineno, __pyx_filename);
33676     }
33677     Py_CLEAR(__pyx_m);
33678   } else if (!PyErr_Occurred()) {
33679     PyErr_SetString(PyExc_ImportError, "init qutip.cy.cqobjevo_factor");
33680   }
33681   __pyx_L0:;
33682   __Pyx_RefNannyFinishContext();
33683   #if CYTHON_PEP489_MULTI_PHASE_INIT
33684   return (__pyx_m != NULL) ? 0 : -1;
33685   #elif PY_MAJOR_VERSION >= 3
33686   return __pyx_m;
33687   #else
33688   return;
33689   #endif
33690 }
33691 
33692 /* --- Runtime support code --- */
33693 /* Refnanny */
33694 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)33695 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
33696     PyObject *m = NULL, *p = NULL;
33697     void *r = NULL;
33698     m = PyImport_ImportModule(modname);
33699     if (!m) goto end;
33700     p = PyObject_GetAttrString(m, "RefNannyAPI");
33701     if (!p) goto end;
33702     r = PyLong_AsVoidPtr(p);
33703 end:
33704     Py_XDECREF(p);
33705     Py_XDECREF(m);
33706     return (__Pyx_RefNannyAPIStruct *)r;
33707 }
33708 #endif
33709 
33710 /* PyObjectGetAttrStr */
33711 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)33712 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
33713     PyTypeObject* tp = Py_TYPE(obj);
33714     if (likely(tp->tp_getattro))
33715         return tp->tp_getattro(obj, attr_name);
33716 #if PY_MAJOR_VERSION < 3
33717     if (likely(tp->tp_getattr))
33718         return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
33719 #endif
33720     return PyObject_GetAttr(obj, attr_name);
33721 }
33722 #endif
33723 
33724 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)33725 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
33726     PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
33727     if (unlikely(!result)) {
33728         PyErr_Format(PyExc_NameError,
33729 #if PY_MAJOR_VERSION >= 3
33730             "name '%U' is not defined", name);
33731 #else
33732             "name '%.200s' is not defined", PyString_AS_STRING(name));
33733 #endif
33734     }
33735     return result;
33736 }
33737 
33738 /* ExtTypeTest */
__Pyx_TypeTest(PyObject * obj,PyTypeObject * type)33739 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
33740     if (unlikely(!type)) {
33741         PyErr_SetString(PyExc_SystemError, "Missing type object");
33742         return 0;
33743     }
33744     if (likely(__Pyx_TypeCheck(obj, type)))
33745         return 1;
33746     PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
33747                  Py_TYPE(obj)->tp_name, type->tp_name);
33748     return 0;
33749 }
33750 
33751 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)33752 static void __Pyx_RaiseArgtupleInvalid(
33753     const char* func_name,
33754     int exact,
33755     Py_ssize_t num_min,
33756     Py_ssize_t num_max,
33757     Py_ssize_t num_found)
33758 {
33759     Py_ssize_t num_expected;
33760     const char *more_or_less;
33761     if (num_found < num_min) {
33762         num_expected = num_min;
33763         more_or_less = "at least";
33764     } else {
33765         num_expected = num_max;
33766         more_or_less = "at most";
33767     }
33768     if (exact) {
33769         more_or_less = "exactly";
33770     }
33771     PyErr_Format(PyExc_TypeError,
33772                  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
33773                  func_name, more_or_less, num_expected,
33774                  (num_expected == 1) ? "" : "s", num_found);
33775 }
33776 
33777 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)33778 static void __Pyx_RaiseDoubleKeywordsError(
33779     const char* func_name,
33780     PyObject* kw_name)
33781 {
33782     PyErr_Format(PyExc_TypeError,
33783         #if PY_MAJOR_VERSION >= 3
33784         "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
33785         #else
33786         "%s() got multiple values for keyword argument '%s'", func_name,
33787         PyString_AsString(kw_name));
33788         #endif
33789 }
33790 
33791 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)33792 static int __Pyx_ParseOptionalKeywords(
33793     PyObject *kwds,
33794     PyObject **argnames[],
33795     PyObject *kwds2,
33796     PyObject *values[],
33797     Py_ssize_t num_pos_args,
33798     const char* function_name)
33799 {
33800     PyObject *key = 0, *value = 0;
33801     Py_ssize_t pos = 0;
33802     PyObject*** name;
33803     PyObject*** first_kw_arg = argnames + num_pos_args;
33804     while (PyDict_Next(kwds, &pos, &key, &value)) {
33805         name = first_kw_arg;
33806         while (*name && (**name != key)) name++;
33807         if (*name) {
33808             values[name-argnames] = value;
33809             continue;
33810         }
33811         name = first_kw_arg;
33812         #if PY_MAJOR_VERSION < 3
33813         if (likely(PyString_Check(key))) {
33814             while (*name) {
33815                 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
33816                         && _PyString_Eq(**name, key)) {
33817                     values[name-argnames] = value;
33818                     break;
33819                 }
33820                 name++;
33821             }
33822             if (*name) continue;
33823             else {
33824                 PyObject*** argname = argnames;
33825                 while (argname != first_kw_arg) {
33826                     if ((**argname == key) || (
33827                             (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
33828                              && _PyString_Eq(**argname, key))) {
33829                         goto arg_passed_twice;
33830                     }
33831                     argname++;
33832                 }
33833             }
33834         } else
33835         #endif
33836         if (likely(PyUnicode_Check(key))) {
33837             while (*name) {
33838                 int cmp = (**name == key) ? 0 :
33839                 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
33840                     (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
33841                 #endif
33842                     PyUnicode_Compare(**name, key);
33843                 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
33844                 if (cmp == 0) {
33845                     values[name-argnames] = value;
33846                     break;
33847                 }
33848                 name++;
33849             }
33850             if (*name) continue;
33851             else {
33852                 PyObject*** argname = argnames;
33853                 while (argname != first_kw_arg) {
33854                     int cmp = (**argname == key) ? 0 :
33855                     #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
33856                         (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
33857                     #endif
33858                         PyUnicode_Compare(**argname, key);
33859                     if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
33860                     if (cmp == 0) goto arg_passed_twice;
33861                     argname++;
33862                 }
33863             }
33864         } else
33865             goto invalid_keyword_type;
33866         if (kwds2) {
33867             if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
33868         } else {
33869             goto invalid_keyword;
33870         }
33871     }
33872     return 0;
33873 arg_passed_twice:
33874     __Pyx_RaiseDoubleKeywordsError(function_name, key);
33875     goto bad;
33876 invalid_keyword_type:
33877     PyErr_Format(PyExc_TypeError,
33878         "%.200s() keywords must be strings", function_name);
33879     goto bad;
33880 invalid_keyword:
33881     PyErr_Format(PyExc_TypeError,
33882     #if PY_MAJOR_VERSION < 3
33883         "%.200s() got an unexpected keyword argument '%.200s'",
33884         function_name, PyString_AsString(key));
33885     #else
33886         "%s() got an unexpected keyword argument '%U'",
33887         function_name, key);
33888     #endif
33889 bad:
33890     return -1;
33891 }
33892 
33893 /* PyDictVersioning */
33894 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)33895 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
33896     PyObject *dict = Py_TYPE(obj)->tp_dict;
33897     return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
33898 }
__Pyx_get_object_dict_version(PyObject * obj)33899 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
33900     PyObject **dictptr = NULL;
33901     Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
33902     if (offset) {
33903 #if CYTHON_COMPILING_IN_CPYTHON
33904         dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
33905 #else
33906         dictptr = _PyObject_GetDictPtr(obj);
33907 #endif
33908     }
33909     return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
33910 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)33911 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
33912     PyObject *dict = Py_TYPE(obj)->tp_dict;
33913     if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
33914         return 0;
33915     return obj_dict_version == __Pyx_get_object_dict_version(obj);
33916 }
33917 #endif
33918 
33919 /* GetModuleGlobalName */
33920 #if CYTHON_USE_DICT_VERSIONS
__Pyx__GetModuleGlobalName(PyObject * name,PY_UINT64_T * dict_version,PyObject ** dict_cached_value)33921 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
33922 #else
33923 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
33924 #endif
33925 {
33926     PyObject *result;
33927 #if !CYTHON_AVOID_BORROWED_REFS
33928 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
33929     result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
33930     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
33931     if (likely(result)) {
33932         return __Pyx_NewRef(result);
33933     } else if (unlikely(PyErr_Occurred())) {
33934         return NULL;
33935     }
33936 #else
33937     result = PyDict_GetItem(__pyx_d, name);
33938     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
33939     if (likely(result)) {
33940         return __Pyx_NewRef(result);
33941     }
33942 #endif
33943 #else
33944     result = PyObject_GetItem(__pyx_d, name);
33945     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
33946     if (likely(result)) {
33947         return __Pyx_NewRef(result);
33948     }
33949     PyErr_Clear();
33950 #endif
33951     return __Pyx_GetBuiltinName(name);
33952 }
33953 
33954 /* PyObjectCall */
33955 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)33956 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
33957     PyObject *result;
33958     ternaryfunc call = func->ob_type->tp_call;
33959     if (unlikely(!call))
33960         return PyObject_Call(func, arg, kw);
33961     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
33962         return NULL;
33963     result = (*call)(func, arg, kw);
33964     Py_LeaveRecursiveCall();
33965     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
33966         PyErr_SetString(
33967             PyExc_SystemError,
33968             "NULL result without error in PyObject_Call");
33969     }
33970     return result;
33971 }
33972 #endif
33973 
33974 /* IsLittleEndian */
__Pyx_Is_Little_Endian(void)33975 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
33976 {
33977   union {
33978     uint32_t u32;
33979     uint8_t u8[4];
33980   } S;
33981   S.u32 = 0x01020304;
33982   return S.u8[0] == 4;
33983 }
33984 
33985 /* BufferFormatCheck */
__Pyx_BufFmt_Init(__Pyx_BufFmt_Context * ctx,__Pyx_BufFmt_StackElem * stack,__Pyx_TypeInfo * type)33986 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
33987                               __Pyx_BufFmt_StackElem* stack,
33988                               __Pyx_TypeInfo* type) {
33989   stack[0].field = &ctx->root;
33990   stack[0].parent_offset = 0;
33991   ctx->root.type = type;
33992   ctx->root.name = "buffer dtype";
33993   ctx->root.offset = 0;
33994   ctx->head = stack;
33995   ctx->head->field = &ctx->root;
33996   ctx->fmt_offset = 0;
33997   ctx->head->parent_offset = 0;
33998   ctx->new_packmode = '@';
33999   ctx->enc_packmode = '@';
34000   ctx->new_count = 1;
34001   ctx->enc_count = 0;
34002   ctx->enc_type = 0;
34003   ctx->is_complex = 0;
34004   ctx->is_valid_array = 0;
34005   ctx->struct_alignment = 0;
34006   while (type->typegroup == 'S') {
34007     ++ctx->head;
34008     ctx->head->field = type->fields;
34009     ctx->head->parent_offset = 0;
34010     type = type->fields->type;
34011   }
34012 }
__Pyx_BufFmt_ParseNumber(const char ** ts)34013 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
34014     int count;
34015     const char* t = *ts;
34016     if (*t < '0' || *t > '9') {
34017       return -1;
34018     } else {
34019         count = *t++ - '0';
34020         while (*t >= '0' && *t <= '9') {
34021             count *= 10;
34022             count += *t++ - '0';
34023         }
34024     }
34025     *ts = t;
34026     return count;
34027 }
__Pyx_BufFmt_ExpectNumber(const char ** ts)34028 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
34029     int number = __Pyx_BufFmt_ParseNumber(ts);
34030     if (number == -1)
34031         PyErr_Format(PyExc_ValueError,\
34032                      "Does not understand character buffer dtype format string ('%c')", **ts);
34033     return number;
34034 }
__Pyx_BufFmt_RaiseUnexpectedChar(char ch)34035 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
34036   PyErr_Format(PyExc_ValueError,
34037                "Unexpected format string character: '%c'", ch);
34038 }
__Pyx_BufFmt_DescribeTypeChar(char ch,int is_complex)34039 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
34040   switch (ch) {
34041     case '?': return "'bool'";
34042     case 'c': return "'char'";
34043     case 'b': return "'signed char'";
34044     case 'B': return "'unsigned char'";
34045     case 'h': return "'short'";
34046     case 'H': return "'unsigned short'";
34047     case 'i': return "'int'";
34048     case 'I': return "'unsigned int'";
34049     case 'l': return "'long'";
34050     case 'L': return "'unsigned long'";
34051     case 'q': return "'long long'";
34052     case 'Q': return "'unsigned long long'";
34053     case 'f': return (is_complex ? "'complex float'" : "'float'");
34054     case 'd': return (is_complex ? "'complex double'" : "'double'");
34055     case 'g': return (is_complex ? "'complex long double'" : "'long double'");
34056     case 'T': return "a struct";
34057     case 'O': return "Python object";
34058     case 'P': return "a pointer";
34059     case 's': case 'p': return "a string";
34060     case 0: return "end";
34061     default: return "unparseable format string";
34062   }
34063 }
__Pyx_BufFmt_TypeCharToStandardSize(char ch,int is_complex)34064 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
34065   switch (ch) {
34066     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
34067     case 'h': case 'H': return 2;
34068     case 'i': case 'I': case 'l': case 'L': return 4;
34069     case 'q': case 'Q': return 8;
34070     case 'f': return (is_complex ? 8 : 4);
34071     case 'd': return (is_complex ? 16 : 8);
34072     case 'g': {
34073       PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
34074       return 0;
34075     }
34076     case 'O': case 'P': return sizeof(void*);
34077     default:
34078       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
34079       return 0;
34080     }
34081 }
__Pyx_BufFmt_TypeCharToNativeSize(char ch,int is_complex)34082 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
34083   switch (ch) {
34084     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
34085     case 'h': case 'H': return sizeof(short);
34086     case 'i': case 'I': return sizeof(int);
34087     case 'l': case 'L': return sizeof(long);
34088     #ifdef HAVE_LONG_LONG
34089     case 'q': case 'Q': return sizeof(PY_LONG_LONG);
34090     #endif
34091     case 'f': return sizeof(float) * (is_complex ? 2 : 1);
34092     case 'd': return sizeof(double) * (is_complex ? 2 : 1);
34093     case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
34094     case 'O': case 'P': return sizeof(void*);
34095     default: {
34096       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
34097       return 0;
34098     }
34099   }
34100 }
34101 typedef struct { char c; short x; } __Pyx_st_short;
34102 typedef struct { char c; int x; } __Pyx_st_int;
34103 typedef struct { char c; long x; } __Pyx_st_long;
34104 typedef struct { char c; float x; } __Pyx_st_float;
34105 typedef struct { char c; double x; } __Pyx_st_double;
34106 typedef struct { char c; long double x; } __Pyx_st_longdouble;
34107 typedef struct { char c; void *x; } __Pyx_st_void_p;
34108 #ifdef HAVE_LONG_LONG
34109 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
34110 #endif
__Pyx_BufFmt_TypeCharToAlignment(char ch,CYTHON_UNUSED int is_complex)34111 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
34112   switch (ch) {
34113     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
34114     case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
34115     case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
34116     case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
34117 #ifdef HAVE_LONG_LONG
34118     case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
34119 #endif
34120     case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
34121     case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
34122     case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
34123     case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
34124     default:
34125       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
34126       return 0;
34127     }
34128 }
34129 /* These are for computing the padding at the end of the struct to align
34130    on the first member of the struct. This will probably the same as above,
34131    but we don't have any guarantees.
34132  */
34133 typedef struct { short x; char c; } __Pyx_pad_short;
34134 typedef struct { int x; char c; } __Pyx_pad_int;
34135 typedef struct { long x; char c; } __Pyx_pad_long;
34136 typedef struct { float x; char c; } __Pyx_pad_float;
34137 typedef struct { double x; char c; } __Pyx_pad_double;
34138 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
34139 typedef struct { void *x; char c; } __Pyx_pad_void_p;
34140 #ifdef HAVE_LONG_LONG
34141 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
34142 #endif
__Pyx_BufFmt_TypeCharToPadding(char ch,CYTHON_UNUSED int is_complex)34143 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
34144   switch (ch) {
34145     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
34146     case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
34147     case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
34148     case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
34149 #ifdef HAVE_LONG_LONG
34150     case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
34151 #endif
34152     case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
34153     case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
34154     case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
34155     case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
34156     default:
34157       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
34158       return 0;
34159     }
34160 }
__Pyx_BufFmt_TypeCharToGroup(char ch,int is_complex)34161 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
34162   switch (ch) {
34163     case 'c':
34164         return 'H';
34165     case 'b': case 'h': case 'i':
34166     case 'l': case 'q': case 's': case 'p':
34167         return 'I';
34168     case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
34169         return 'U';
34170     case 'f': case 'd': case 'g':
34171         return (is_complex ? 'C' : 'R');
34172     case 'O':
34173         return 'O';
34174     case 'P':
34175         return 'P';
34176     default: {
34177       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
34178       return 0;
34179     }
34180   }
34181 }
__Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context * ctx)34182 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
34183   if (ctx->head == NULL || ctx->head->field == &ctx->root) {
34184     const char* expected;
34185     const char* quote;
34186     if (ctx->head == NULL) {
34187       expected = "end";
34188       quote = "";
34189     } else {
34190       expected = ctx->head->field->type->name;
34191       quote = "'";
34192     }
34193     PyErr_Format(PyExc_ValueError,
34194                  "Buffer dtype mismatch, expected %s%s%s but got %s",
34195                  quote, expected, quote,
34196                  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
34197   } else {
34198     __Pyx_StructField* field = ctx->head->field;
34199     __Pyx_StructField* parent = (ctx->head - 1)->field;
34200     PyErr_Format(PyExc_ValueError,
34201                  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
34202                  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
34203                  parent->type->name, field->name);
34204   }
34205 }
__Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context * ctx)34206 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
34207   char group;
34208   size_t size, offset, arraysize = 1;
34209   if (ctx->enc_type == 0) return 0;
34210   if (ctx->head->field->type->arraysize[0]) {
34211     int i, ndim = 0;
34212     if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
34213         ctx->is_valid_array = ctx->head->field->type->ndim == 1;
34214         ndim = 1;
34215         if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
34216             PyErr_Format(PyExc_ValueError,
34217                          "Expected a dimension of size %zu, got %zu",
34218                          ctx->head->field->type->arraysize[0], ctx->enc_count);
34219             return -1;
34220         }
34221     }
34222     if (!ctx->is_valid_array) {
34223       PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
34224                    ctx->head->field->type->ndim, ndim);
34225       return -1;
34226     }
34227     for (i = 0; i < ctx->head->field->type->ndim; i++) {
34228       arraysize *= ctx->head->field->type->arraysize[i];
34229     }
34230     ctx->is_valid_array = 0;
34231     ctx->enc_count = 1;
34232   }
34233   group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
34234   do {
34235     __Pyx_StructField* field = ctx->head->field;
34236     __Pyx_TypeInfo* type = field->type;
34237     if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
34238       size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
34239     } else {
34240       size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
34241     }
34242     if (ctx->enc_packmode == '@') {
34243       size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
34244       size_t align_mod_offset;
34245       if (align_at == 0) return -1;
34246       align_mod_offset = ctx->fmt_offset % align_at;
34247       if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
34248       if (ctx->struct_alignment == 0)
34249           ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
34250                                                                  ctx->is_complex);
34251     }
34252     if (type->size != size || type->typegroup != group) {
34253       if (type->typegroup == 'C' && type->fields != NULL) {
34254         size_t parent_offset = ctx->head->parent_offset + field->offset;
34255         ++ctx->head;
34256         ctx->head->field = type->fields;
34257         ctx->head->parent_offset = parent_offset;
34258         continue;
34259       }
34260       if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
34261       } else {
34262           __Pyx_BufFmt_RaiseExpected(ctx);
34263           return -1;
34264       }
34265     }
34266     offset = ctx->head->parent_offset + field->offset;
34267     if (ctx->fmt_offset != offset) {
34268       PyErr_Format(PyExc_ValueError,
34269                    "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
34270                    (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
34271       return -1;
34272     }
34273     ctx->fmt_offset += size;
34274     if (arraysize)
34275       ctx->fmt_offset += (arraysize - 1) * size;
34276     --ctx->enc_count;
34277     while (1) {
34278       if (field == &ctx->root) {
34279         ctx->head = NULL;
34280         if (ctx->enc_count != 0) {
34281           __Pyx_BufFmt_RaiseExpected(ctx);
34282           return -1;
34283         }
34284         break;
34285       }
34286       ctx->head->field = ++field;
34287       if (field->type == NULL) {
34288         --ctx->head;
34289         field = ctx->head->field;
34290         continue;
34291       } else if (field->type->typegroup == 'S') {
34292         size_t parent_offset = ctx->head->parent_offset + field->offset;
34293         if (field->type->fields->type == NULL) continue;
34294         field = field->type->fields;
34295         ++ctx->head;
34296         ctx->head->field = field;
34297         ctx->head->parent_offset = parent_offset;
34298         break;
34299       } else {
34300         break;
34301       }
34302     }
34303   } while (ctx->enc_count);
34304   ctx->enc_type = 0;
34305   ctx->is_complex = 0;
34306   return 0;
34307 }
34308 static PyObject *
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context * ctx,const char ** tsp)34309 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
34310 {
34311     const char *ts = *tsp;
34312     int i = 0, number, ndim;
34313     ++ts;
34314     if (ctx->new_count != 1) {
34315         PyErr_SetString(PyExc_ValueError,
34316                         "Cannot handle repeated arrays in format string");
34317         return NULL;
34318     }
34319     if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
34320     ndim = ctx->head->field->type->ndim;
34321     while (*ts && *ts != ')') {
34322         switch (*ts) {
34323             case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
34324             default:  break;
34325         }
34326         number = __Pyx_BufFmt_ExpectNumber(&ts);
34327         if (number == -1) return NULL;
34328         if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
34329             return PyErr_Format(PyExc_ValueError,
34330                         "Expected a dimension of size %zu, got %d",
34331                         ctx->head->field->type->arraysize[i], number);
34332         if (*ts != ',' && *ts != ')')
34333             return PyErr_Format(PyExc_ValueError,
34334                                 "Expected a comma in format string, got '%c'", *ts);
34335         if (*ts == ',') ts++;
34336         i++;
34337     }
34338     if (i != ndim)
34339         return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
34340                             ctx->head->field->type->ndim, i);
34341     if (!*ts) {
34342         PyErr_SetString(PyExc_ValueError,
34343                         "Unexpected end of format string, expected ')'");
34344         return NULL;
34345     }
34346     ctx->is_valid_array = 1;
34347     ctx->new_count = 1;
34348     *tsp = ++ts;
34349     return Py_None;
34350 }
__Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context * ctx,const char * ts)34351 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
34352   int got_Z = 0;
34353   while (1) {
34354     switch(*ts) {
34355       case 0:
34356         if (ctx->enc_type != 0 && ctx->head == NULL) {
34357           __Pyx_BufFmt_RaiseExpected(ctx);
34358           return NULL;
34359         }
34360         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
34361         if (ctx->head != NULL) {
34362           __Pyx_BufFmt_RaiseExpected(ctx);
34363           return NULL;
34364         }
34365         return ts;
34366       case ' ':
34367       case '\r':
34368       case '\n':
34369         ++ts;
34370         break;
34371       case '<':
34372         if (!__Pyx_Is_Little_Endian()) {
34373           PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
34374           return NULL;
34375         }
34376         ctx->new_packmode = '=';
34377         ++ts;
34378         break;
34379       case '>':
34380       case '!':
34381         if (__Pyx_Is_Little_Endian()) {
34382           PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
34383           return NULL;
34384         }
34385         ctx->new_packmode = '=';
34386         ++ts;
34387         break;
34388       case '=':
34389       case '@':
34390       case '^':
34391         ctx->new_packmode = *ts++;
34392         break;
34393       case 'T':
34394         {
34395           const char* ts_after_sub;
34396           size_t i, struct_count = ctx->new_count;
34397           size_t struct_alignment = ctx->struct_alignment;
34398           ctx->new_count = 1;
34399           ++ts;
34400           if (*ts != '{') {
34401             PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
34402             return NULL;
34403           }
34404           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
34405           ctx->enc_type = 0;
34406           ctx->enc_count = 0;
34407           ctx->struct_alignment = 0;
34408           ++ts;
34409           ts_after_sub = ts;
34410           for (i = 0; i != struct_count; ++i) {
34411             ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
34412             if (!ts_after_sub) return NULL;
34413           }
34414           ts = ts_after_sub;
34415           if (struct_alignment) ctx->struct_alignment = struct_alignment;
34416         }
34417         break;
34418       case '}':
34419         {
34420           size_t alignment = ctx->struct_alignment;
34421           ++ts;
34422           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
34423           ctx->enc_type = 0;
34424           if (alignment && ctx->fmt_offset % alignment) {
34425             ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
34426           }
34427         }
34428         return ts;
34429       case 'x':
34430         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
34431         ctx->fmt_offset += ctx->new_count;
34432         ctx->new_count = 1;
34433         ctx->enc_count = 0;
34434         ctx->enc_type = 0;
34435         ctx->enc_packmode = ctx->new_packmode;
34436         ++ts;
34437         break;
34438       case 'Z':
34439         got_Z = 1;
34440         ++ts;
34441         if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
34442           __Pyx_BufFmt_RaiseUnexpectedChar('Z');
34443           return NULL;
34444         }
34445         CYTHON_FALLTHROUGH;
34446       case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
34447       case 'l': case 'L': case 'q': case 'Q':
34448       case 'f': case 'd': case 'g':
34449       case 'O': case 'p':
34450         if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
34451             (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
34452           ctx->enc_count += ctx->new_count;
34453           ctx->new_count = 1;
34454           got_Z = 0;
34455           ++ts;
34456           break;
34457         }
34458         CYTHON_FALLTHROUGH;
34459       case 's':
34460         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
34461         ctx->enc_count = ctx->new_count;
34462         ctx->enc_packmode = ctx->new_packmode;
34463         ctx->enc_type = *ts;
34464         ctx->is_complex = got_Z;
34465         ++ts;
34466         ctx->new_count = 1;
34467         got_Z = 0;
34468         break;
34469       case ':':
34470         ++ts;
34471         while(*ts != ':') ++ts;
34472         ++ts;
34473         break;
34474       case '(':
34475         if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
34476         break;
34477       default:
34478         {
34479           int number = __Pyx_BufFmt_ExpectNumber(&ts);
34480           if (number == -1) return NULL;
34481           ctx->new_count = (size_t)number;
34482         }
34483     }
34484   }
34485 }
34486 
34487 /* BufferGetAndValidate */
__Pyx_SafeReleaseBuffer(Py_buffer * info)34488   static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
34489   if (unlikely(info->buf == NULL)) return;
34490   if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
34491   __Pyx_ReleaseBuffer(info);
34492 }
__Pyx_ZeroBuffer(Py_buffer * buf)34493 static void __Pyx_ZeroBuffer(Py_buffer* buf) {
34494   buf->buf = NULL;
34495   buf->obj = NULL;
34496   buf->strides = __Pyx_zeros;
34497   buf->shape = __Pyx_zeros;
34498   buf->suboffsets = __Pyx_minusones;
34499 }
__Pyx__GetBufferAndValidate(Py_buffer * buf,PyObject * obj,__Pyx_TypeInfo * dtype,int flags,int nd,int cast,__Pyx_BufFmt_StackElem * stack)34500 static int __Pyx__GetBufferAndValidate(
34501         Py_buffer* buf, PyObject* obj,  __Pyx_TypeInfo* dtype, int flags,
34502         int nd, int cast, __Pyx_BufFmt_StackElem* stack)
34503 {
34504   buf->buf = NULL;
34505   if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
34506     __Pyx_ZeroBuffer(buf);
34507     return -1;
34508   }
34509   if (unlikely(buf->ndim != nd)) {
34510     PyErr_Format(PyExc_ValueError,
34511                  "Buffer has wrong number of dimensions (expected %d, got %d)",
34512                  nd, buf->ndim);
34513     goto fail;
34514   }
34515   if (!cast) {
34516     __Pyx_BufFmt_Context ctx;
34517     __Pyx_BufFmt_Init(&ctx, stack, dtype);
34518     if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
34519   }
34520   if (unlikely((size_t)buf->itemsize != dtype->size)) {
34521     PyErr_Format(PyExc_ValueError,
34522       "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
34523       buf->itemsize, (buf->itemsize > 1) ? "s" : "",
34524       dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
34525     goto fail;
34526   }
34527   if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
34528   return 0;
34529 fail:;
34530   __Pyx_SafeReleaseBuffer(buf);
34531   return -1;
34532 }
34533 
34534 /* BufferIndexError */
__Pyx_RaiseBufferIndexError(int axis)34535   static void __Pyx_RaiseBufferIndexError(int axis) {
34536   PyErr_Format(PyExc_IndexError,
34537      "Out of bounds on buffer access (axis %d)", axis);
34538 }
34539 
34540 /* PyErrFetchRestore */
34541   #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)34542 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
34543     PyObject *tmp_type, *tmp_value, *tmp_tb;
34544     tmp_type = tstate->curexc_type;
34545     tmp_value = tstate->curexc_value;
34546     tmp_tb = tstate->curexc_traceback;
34547     tstate->curexc_type = type;
34548     tstate->curexc_value = value;
34549     tstate->curexc_traceback = tb;
34550     Py_XDECREF(tmp_type);
34551     Py_XDECREF(tmp_value);
34552     Py_XDECREF(tmp_tb);
34553 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)34554 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
34555     *type = tstate->curexc_type;
34556     *value = tstate->curexc_value;
34557     *tb = tstate->curexc_traceback;
34558     tstate->curexc_type = 0;
34559     tstate->curexc_value = 0;
34560     tstate->curexc_traceback = 0;
34561 }
34562 #endif
34563 
34564 /* PyErrExceptionMatches */
34565   #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)34566 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
34567     Py_ssize_t i, n;
34568     n = PyTuple_GET_SIZE(tuple);
34569 #if PY_MAJOR_VERSION >= 3
34570     for (i=0; i<n; i++) {
34571         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
34572     }
34573 #endif
34574     for (i=0; i<n; i++) {
34575         if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
34576     }
34577     return 0;
34578 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)34579 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
34580     PyObject *exc_type = tstate->curexc_type;
34581     if (exc_type == err) return 1;
34582     if (unlikely(!exc_type)) return 0;
34583     if (unlikely(PyTuple_Check(err)))
34584         return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
34585     return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
34586 }
34587 #endif
34588 
34589 /* GetAttr */
__Pyx_GetAttr(PyObject * o,PyObject * n)34590   static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
34591 #if CYTHON_USE_TYPE_SLOTS
34592 #if PY_MAJOR_VERSION >= 3
34593     if (likely(PyUnicode_Check(n)))
34594 #else
34595     if (likely(PyString_Check(n)))
34596 #endif
34597         return __Pyx_PyObject_GetAttrStr(o, n);
34598 #endif
34599     return PyObject_GetAttr(o, n);
34600 }
34601 
34602 /* GetAttr3 */
__Pyx_GetAttr3Default(PyObject * d)34603   static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
34604     __Pyx_PyThreadState_declare
34605     __Pyx_PyThreadState_assign
34606     if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
34607         return NULL;
34608     __Pyx_PyErr_Clear();
34609     Py_INCREF(d);
34610     return d;
34611 }
__Pyx_GetAttr3(PyObject * o,PyObject * n,PyObject * d)34612 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
34613     PyObject *r = __Pyx_GetAttr(o, n);
34614     return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
34615 }
34616 
34617 /* GetItemInt */
__Pyx_GetItemInt_Generic(PyObject * o,PyObject * j)34618   static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
34619     PyObject *r;
34620     if (!j) return NULL;
34621     r = PyObject_GetItem(o, j);
34622     Py_DECREF(j);
34623     return r;
34624 }
__Pyx_GetItemInt_List_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)34625 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
34626                                                               CYTHON_NCP_UNUSED int wraparound,
34627                                                               CYTHON_NCP_UNUSED int boundscheck) {
34628 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
34629     Py_ssize_t wrapped_i = i;
34630     if (wraparound & unlikely(i < 0)) {
34631         wrapped_i += PyList_GET_SIZE(o);
34632     }
34633     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
34634         PyObject *r = PyList_GET_ITEM(o, wrapped_i);
34635         Py_INCREF(r);
34636         return r;
34637     }
34638     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
34639 #else
34640     return PySequence_GetItem(o, i);
34641 #endif
34642 }
__Pyx_GetItemInt_Tuple_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)34643 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
34644                                                               CYTHON_NCP_UNUSED int wraparound,
34645                                                               CYTHON_NCP_UNUSED int boundscheck) {
34646 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
34647     Py_ssize_t wrapped_i = i;
34648     if (wraparound & unlikely(i < 0)) {
34649         wrapped_i += PyTuple_GET_SIZE(o);
34650     }
34651     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
34652         PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
34653         Py_INCREF(r);
34654         return r;
34655     }
34656     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
34657 #else
34658     return PySequence_GetItem(o, i);
34659 #endif
34660 }
__Pyx_GetItemInt_Fast(PyObject * o,Py_ssize_t i,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)34661 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
34662                                                      CYTHON_NCP_UNUSED int wraparound,
34663                                                      CYTHON_NCP_UNUSED int boundscheck) {
34664 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
34665     if (is_list || PyList_CheckExact(o)) {
34666         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
34667         if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
34668             PyObject *r = PyList_GET_ITEM(o, n);
34669             Py_INCREF(r);
34670             return r;
34671         }
34672     }
34673     else if (PyTuple_CheckExact(o)) {
34674         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
34675         if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
34676             PyObject *r = PyTuple_GET_ITEM(o, n);
34677             Py_INCREF(r);
34678             return r;
34679         }
34680     } else {
34681         PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
34682         if (likely(m && m->sq_item)) {
34683             if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
34684                 Py_ssize_t l = m->sq_length(o);
34685                 if (likely(l >= 0)) {
34686                     i += l;
34687                 } else {
34688                     if (!PyErr_ExceptionMatches(PyExc_OverflowError))
34689                         return NULL;
34690                     PyErr_Clear();
34691                 }
34692             }
34693             return m->sq_item(o, i);
34694         }
34695     }
34696 #else
34697     if (is_list || PySequence_Check(o)) {
34698         return PySequence_GetItem(o, i);
34699     }
34700 #endif
34701     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
34702 }
34703 
34704 /* MemviewSliceInit */
34705   static int
__Pyx_init_memviewslice(struct __pyx_memoryview_obj * memview,int ndim,__Pyx_memviewslice * memviewslice,int memview_is_new_reference)34706 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
34707                         int ndim,
34708                         __Pyx_memviewslice *memviewslice,
34709                         int memview_is_new_reference)
34710 {
34711     __Pyx_RefNannyDeclarations
34712     int i, retval=-1;
34713     Py_buffer *buf = &memview->view;
34714     __Pyx_RefNannySetupContext("init_memviewslice", 0);
34715     if (unlikely(memviewslice->memview || memviewslice->data)) {
34716         PyErr_SetString(PyExc_ValueError,
34717             "memviewslice is already initialized!");
34718         goto fail;
34719     }
34720     if (buf->strides) {
34721         for (i = 0; i < ndim; i++) {
34722             memviewslice->strides[i] = buf->strides[i];
34723         }
34724     } else {
34725         Py_ssize_t stride = buf->itemsize;
34726         for (i = ndim - 1; i >= 0; i--) {
34727             memviewslice->strides[i] = stride;
34728             stride *= buf->shape[i];
34729         }
34730     }
34731     for (i = 0; i < ndim; i++) {
34732         memviewslice->shape[i]   = buf->shape[i];
34733         if (buf->suboffsets) {
34734             memviewslice->suboffsets[i] = buf->suboffsets[i];
34735         } else {
34736             memviewslice->suboffsets[i] = -1;
34737         }
34738     }
34739     memviewslice->memview = memview;
34740     memviewslice->data = (char *)buf->buf;
34741     if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
34742         Py_INCREF(memview);
34743     }
34744     retval = 0;
34745     goto no_fail;
34746 fail:
34747     memviewslice->memview = 0;
34748     memviewslice->data = 0;
34749     retval = -1;
34750 no_fail:
34751     __Pyx_RefNannyFinishContext();
34752     return retval;
34753 }
34754 #ifndef Py_NO_RETURN
34755 #define Py_NO_RETURN
34756 #endif
__pyx_fatalerror(const char * fmt,...)34757 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
34758     va_list vargs;
34759     char msg[200];
34760 #ifdef HAVE_STDARG_PROTOTYPES
34761     va_start(vargs, fmt);
34762 #else
34763     va_start(vargs);
34764 #endif
34765     vsnprintf(msg, 200, fmt, vargs);
34766     va_end(vargs);
34767     Py_FatalError(msg);
34768 }
34769 static CYTHON_INLINE int
__pyx_add_acquisition_count_locked(__pyx_atomic_int * acquisition_count,PyThread_type_lock lock)34770 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
34771                                    PyThread_type_lock lock)
34772 {
34773     int result;
34774     PyThread_acquire_lock(lock, 1);
34775     result = (*acquisition_count)++;
34776     PyThread_release_lock(lock);
34777     return result;
34778 }
34779 static CYTHON_INLINE int
__pyx_sub_acquisition_count_locked(__pyx_atomic_int * acquisition_count,PyThread_type_lock lock)34780 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
34781                                    PyThread_type_lock lock)
34782 {
34783     int result;
34784     PyThread_acquire_lock(lock, 1);
34785     result = (*acquisition_count)--;
34786     PyThread_release_lock(lock);
34787     return result;
34788 }
34789 static CYTHON_INLINE void
__Pyx_INC_MEMVIEW(__Pyx_memviewslice * memslice,int have_gil,int lineno)34790 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
34791 {
34792     int first_time;
34793     struct __pyx_memoryview_obj *memview = memslice->memview;
34794     if (unlikely(!memview || (PyObject *) memview == Py_None))
34795         return;
34796     if (unlikely(__pyx_get_slice_count(memview) < 0))
34797         __pyx_fatalerror("Acquisition count is %d (line %d)",
34798                          __pyx_get_slice_count(memview), lineno);
34799     first_time = __pyx_add_acquisition_count(memview) == 0;
34800     if (unlikely(first_time)) {
34801         if (have_gil) {
34802             Py_INCREF((PyObject *) memview);
34803         } else {
34804             PyGILState_STATE _gilstate = PyGILState_Ensure();
34805             Py_INCREF((PyObject *) memview);
34806             PyGILState_Release(_gilstate);
34807         }
34808     }
34809 }
__Pyx_XDEC_MEMVIEW(__Pyx_memviewslice * memslice,int have_gil,int lineno)34810 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
34811                                              int have_gil, int lineno) {
34812     int last_time;
34813     struct __pyx_memoryview_obj *memview = memslice->memview;
34814     if (unlikely(!memview || (PyObject *) memview == Py_None)) {
34815         memslice->memview = NULL;
34816         return;
34817     }
34818     if (unlikely(__pyx_get_slice_count(memview) <= 0))
34819         __pyx_fatalerror("Acquisition count is %d (line %d)",
34820                          __pyx_get_slice_count(memview), lineno);
34821     last_time = __pyx_sub_acquisition_count(memview) == 1;
34822     memslice->data = NULL;
34823     if (unlikely(last_time)) {
34824         if (have_gil) {
34825             Py_CLEAR(memslice->memview);
34826         } else {
34827             PyGILState_STATE _gilstate = PyGILState_Ensure();
34828             Py_CLEAR(memslice->memview);
34829             PyGILState_Release(_gilstate);
34830         }
34831     } else {
34832         memslice->memview = NULL;
34833     }
34834 }
34835 
34836 /* WriteUnraisableException */
__Pyx_WriteUnraisable(const char * name,CYTHON_UNUSED int clineno,CYTHON_UNUSED int lineno,CYTHON_UNUSED const char * filename,int full_traceback,CYTHON_UNUSED int nogil)34837   static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
34838                                   CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
34839                                   int full_traceback, CYTHON_UNUSED int nogil) {
34840     PyObject *old_exc, *old_val, *old_tb;
34841     PyObject *ctx;
34842     __Pyx_PyThreadState_declare
34843 #ifdef WITH_THREAD
34844     PyGILState_STATE state;
34845     if (nogil)
34846         state = PyGILState_Ensure();
34847 #ifdef _MSC_VER
34848     else state = (PyGILState_STATE)-1;
34849 #endif
34850 #endif
34851     __Pyx_PyThreadState_assign
34852     __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
34853     if (full_traceback) {
34854         Py_XINCREF(old_exc);
34855         Py_XINCREF(old_val);
34856         Py_XINCREF(old_tb);
34857         __Pyx_ErrRestore(old_exc, old_val, old_tb);
34858         PyErr_PrintEx(1);
34859     }
34860     #if PY_MAJOR_VERSION < 3
34861     ctx = PyString_FromString(name);
34862     #else
34863     ctx = PyUnicode_FromString(name);
34864     #endif
34865     __Pyx_ErrRestore(old_exc, old_val, old_tb);
34866     if (!ctx) {
34867         PyErr_WriteUnraisable(Py_None);
34868     } else {
34869         PyErr_WriteUnraisable(ctx);
34870         Py_DECREF(ctx);
34871     }
34872 #ifdef WITH_THREAD
34873     if (nogil)
34874         PyGILState_Release(state);
34875 #endif
34876 }
34877 
34878 /* PyCFunctionFastCall */
34879   #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)34880 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
34881     PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
34882     PyCFunction meth = PyCFunction_GET_FUNCTION(func);
34883     PyObject *self = PyCFunction_GET_SELF(func);
34884     int flags = PyCFunction_GET_FLAGS(func);
34885     assert(PyCFunction_Check(func));
34886     assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
34887     assert(nargs >= 0);
34888     assert(nargs == 0 || args != NULL);
34889     /* _PyCFunction_FastCallDict() must not be called with an exception set,
34890        because it may clear it (directly or indirectly) and so the
34891        caller loses its exception */
34892     assert(!PyErr_Occurred());
34893     if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
34894         return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
34895     } else {
34896         return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
34897     }
34898 }
34899 #endif
34900 
34901 /* PyFunctionFastCall */
34902   #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)34903 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
34904                                                PyObject *globals) {
34905     PyFrameObject *f;
34906     PyThreadState *tstate = __Pyx_PyThreadState_Current;
34907     PyObject **fastlocals;
34908     Py_ssize_t i;
34909     PyObject *result;
34910     assert(globals != NULL);
34911     /* XXX Perhaps we should create a specialized
34912        PyFrame_New() that doesn't take locals, but does
34913        take builtins without sanity checking them.
34914        */
34915     assert(tstate != NULL);
34916     f = PyFrame_New(tstate, co, globals, NULL);
34917     if (f == NULL) {
34918         return NULL;
34919     }
34920     fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
34921     for (i = 0; i < na; i++) {
34922         Py_INCREF(*args);
34923         fastlocals[i] = *args++;
34924     }
34925     result = PyEval_EvalFrameEx(f,0);
34926     ++tstate->recursion_depth;
34927     Py_DECREF(f);
34928     --tstate->recursion_depth;
34929     return result;
34930 }
34931 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)34932 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
34933     PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
34934     PyObject *globals = PyFunction_GET_GLOBALS(func);
34935     PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
34936     PyObject *closure;
34937 #if PY_MAJOR_VERSION >= 3
34938     PyObject *kwdefs;
34939 #endif
34940     PyObject *kwtuple, **k;
34941     PyObject **d;
34942     Py_ssize_t nd;
34943     Py_ssize_t nk;
34944     PyObject *result;
34945     assert(kwargs == NULL || PyDict_Check(kwargs));
34946     nk = kwargs ? PyDict_Size(kwargs) : 0;
34947     if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
34948         return NULL;
34949     }
34950     if (
34951 #if PY_MAJOR_VERSION >= 3
34952             co->co_kwonlyargcount == 0 &&
34953 #endif
34954             likely(kwargs == NULL || nk == 0) &&
34955             co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
34956         if (argdefs == NULL && co->co_argcount == nargs) {
34957             result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
34958             goto done;
34959         }
34960         else if (nargs == 0 && argdefs != NULL
34961                  && co->co_argcount == Py_SIZE(argdefs)) {
34962             /* function called with no arguments, but all parameters have
34963                a default value: use default values as arguments .*/
34964             args = &PyTuple_GET_ITEM(argdefs, 0);
34965             result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
34966             goto done;
34967         }
34968     }
34969     if (kwargs != NULL) {
34970         Py_ssize_t pos, i;
34971         kwtuple = PyTuple_New(2 * nk);
34972         if (kwtuple == NULL) {
34973             result = NULL;
34974             goto done;
34975         }
34976         k = &PyTuple_GET_ITEM(kwtuple, 0);
34977         pos = i = 0;
34978         while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
34979             Py_INCREF(k[i]);
34980             Py_INCREF(k[i+1]);
34981             i += 2;
34982         }
34983         nk = i / 2;
34984     }
34985     else {
34986         kwtuple = NULL;
34987         k = NULL;
34988     }
34989     closure = PyFunction_GET_CLOSURE(func);
34990 #if PY_MAJOR_VERSION >= 3
34991     kwdefs = PyFunction_GET_KW_DEFAULTS(func);
34992 #endif
34993     if (argdefs != NULL) {
34994         d = &PyTuple_GET_ITEM(argdefs, 0);
34995         nd = Py_SIZE(argdefs);
34996     }
34997     else {
34998         d = NULL;
34999         nd = 0;
35000     }
35001 #if PY_MAJOR_VERSION >= 3
35002     result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
35003                                args, (int)nargs,
35004                                k, (int)nk,
35005                                d, (int)nd, kwdefs, closure);
35006 #else
35007     result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
35008                                args, (int)nargs,
35009                                k, (int)nk,
35010                                d, (int)nd, closure);
35011 #endif
35012     Py_XDECREF(kwtuple);
35013 done:
35014     Py_LeaveRecursiveCall();
35015     return result;
35016 }
35017 #endif
35018 #endif
35019 
35020 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)35021   static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
35022     PyObject *args, *result = NULL;
35023     #if CYTHON_FAST_PYCALL
35024     if (PyFunction_Check(function)) {
35025         PyObject *args[2] = {arg1, arg2};
35026         return __Pyx_PyFunction_FastCall(function, args, 2);
35027     }
35028     #endif
35029     #if CYTHON_FAST_PYCCALL
35030     if (__Pyx_PyFastCFunction_Check(function)) {
35031         PyObject *args[2] = {arg1, arg2};
35032         return __Pyx_PyCFunction_FastCall(function, args, 2);
35033     }
35034     #endif
35035     args = PyTuple_New(2);
35036     if (unlikely(!args)) goto done;
35037     Py_INCREF(arg1);
35038     PyTuple_SET_ITEM(args, 0, arg1);
35039     Py_INCREF(arg2);
35040     PyTuple_SET_ITEM(args, 1, arg2);
35041     Py_INCREF(function);
35042     result = __Pyx_PyObject_Call(function, args, NULL);
35043     Py_DECREF(args);
35044     Py_DECREF(function);
35045 done:
35046     return result;
35047 }
35048 
35049 /* PyObjectCallMethO */
35050   #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)35051 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
35052     PyObject *self, *result;
35053     PyCFunction cfunc;
35054     cfunc = PyCFunction_GET_FUNCTION(func);
35055     self = PyCFunction_GET_SELF(func);
35056     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
35057         return NULL;
35058     result = cfunc(self, arg);
35059     Py_LeaveRecursiveCall();
35060     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
35061         PyErr_SetString(
35062             PyExc_SystemError,
35063             "NULL result without error in PyObject_Call");
35064     }
35065     return result;
35066 }
35067 #endif
35068 
35069 /* PyObjectCallOneArg */
35070   #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)35071 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
35072     PyObject *result;
35073     PyObject *args = PyTuple_New(1);
35074     if (unlikely(!args)) return NULL;
35075     Py_INCREF(arg);
35076     PyTuple_SET_ITEM(args, 0, arg);
35077     result = __Pyx_PyObject_Call(func, args, NULL);
35078     Py_DECREF(args);
35079     return result;
35080 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)35081 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
35082 #if CYTHON_FAST_PYCALL
35083     if (PyFunction_Check(func)) {
35084         return __Pyx_PyFunction_FastCall(func, &arg, 1);
35085     }
35086 #endif
35087     if (likely(PyCFunction_Check(func))) {
35088         if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
35089             return __Pyx_PyObject_CallMethO(func, arg);
35090 #if CYTHON_FAST_PYCCALL
35091         } else if (__Pyx_PyFastCFunction_Check(func)) {
35092             return __Pyx_PyCFunction_FastCall(func, &arg, 1);
35093 #endif
35094         }
35095     }
35096     return __Pyx__PyObject_CallOneArg(func, arg);
35097 }
35098 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)35099 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
35100     PyObject *result;
35101     PyObject *args = PyTuple_Pack(1, arg);
35102     if (unlikely(!args)) return NULL;
35103     result = __Pyx_PyObject_Call(func, args, NULL);
35104     Py_DECREF(args);
35105     return result;
35106 }
35107 #endif
35108 
35109 /* RaiseTooManyValuesToUnpack */
__Pyx_RaiseTooManyValuesError(Py_ssize_t expected)35110   static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
35111     PyErr_Format(PyExc_ValueError,
35112                  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
35113 }
35114 
35115 /* RaiseNeedMoreValuesToUnpack */
__Pyx_RaiseNeedMoreValuesError(Py_ssize_t index)35116   static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
35117     PyErr_Format(PyExc_ValueError,
35118                  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
35119                  index, (index == 1) ? "" : "s");
35120 }
35121 
35122 /* IterFinish */
__Pyx_IterFinish(void)35123   static CYTHON_INLINE int __Pyx_IterFinish(void) {
35124 #if CYTHON_FAST_THREAD_STATE
35125     PyThreadState *tstate = __Pyx_PyThreadState_Current;
35126     PyObject* exc_type = tstate->curexc_type;
35127     if (unlikely(exc_type)) {
35128         if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
35129             PyObject *exc_value, *exc_tb;
35130             exc_value = tstate->curexc_value;
35131             exc_tb = tstate->curexc_traceback;
35132             tstate->curexc_type = 0;
35133             tstate->curexc_value = 0;
35134             tstate->curexc_traceback = 0;
35135             Py_DECREF(exc_type);
35136             Py_XDECREF(exc_value);
35137             Py_XDECREF(exc_tb);
35138             return 0;
35139         } else {
35140             return -1;
35141         }
35142     }
35143     return 0;
35144 #else
35145     if (unlikely(PyErr_Occurred())) {
35146         if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
35147             PyErr_Clear();
35148             return 0;
35149         } else {
35150             return -1;
35151         }
35152     }
35153     return 0;
35154 #endif
35155 }
35156 
35157 /* UnpackItemEndCheck */
__Pyx_IternextUnpackEndCheck(PyObject * retval,Py_ssize_t expected)35158   static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
35159     if (unlikely(retval)) {
35160         Py_DECREF(retval);
35161         __Pyx_RaiseTooManyValuesError(expected);
35162         return -1;
35163     } else {
35164         return __Pyx_IterFinish();
35165     }
35166     return 0;
35167 }
35168 
35169 /* RaiseException */
35170   #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)35171 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
35172                         CYTHON_UNUSED PyObject *cause) {
35173     __Pyx_PyThreadState_declare
35174     Py_XINCREF(type);
35175     if (!value || value == Py_None)
35176         value = NULL;
35177     else
35178         Py_INCREF(value);
35179     if (!tb || tb == Py_None)
35180         tb = NULL;
35181     else {
35182         Py_INCREF(tb);
35183         if (!PyTraceBack_Check(tb)) {
35184             PyErr_SetString(PyExc_TypeError,
35185                 "raise: arg 3 must be a traceback or None");
35186             goto raise_error;
35187         }
35188     }
35189     if (PyType_Check(type)) {
35190 #if CYTHON_COMPILING_IN_PYPY
35191         if (!value) {
35192             Py_INCREF(Py_None);
35193             value = Py_None;
35194         }
35195 #endif
35196         PyErr_NormalizeException(&type, &value, &tb);
35197     } else {
35198         if (value) {
35199             PyErr_SetString(PyExc_TypeError,
35200                 "instance exception may not have a separate value");
35201             goto raise_error;
35202         }
35203         value = type;
35204         type = (PyObject*) Py_TYPE(type);
35205         Py_INCREF(type);
35206         if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
35207             PyErr_SetString(PyExc_TypeError,
35208                 "raise: exception class must be a subclass of BaseException");
35209             goto raise_error;
35210         }
35211     }
35212     __Pyx_PyThreadState_assign
35213     __Pyx_ErrRestore(type, value, tb);
35214     return;
35215 raise_error:
35216     Py_XDECREF(value);
35217     Py_XDECREF(type);
35218     Py_XDECREF(tb);
35219     return;
35220 }
35221 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)35222 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
35223     PyObject* owned_instance = NULL;
35224     if (tb == Py_None) {
35225         tb = 0;
35226     } else if (tb && !PyTraceBack_Check(tb)) {
35227         PyErr_SetString(PyExc_TypeError,
35228             "raise: arg 3 must be a traceback or None");
35229         goto bad;
35230     }
35231     if (value == Py_None)
35232         value = 0;
35233     if (PyExceptionInstance_Check(type)) {
35234         if (value) {
35235             PyErr_SetString(PyExc_TypeError,
35236                 "instance exception may not have a separate value");
35237             goto bad;
35238         }
35239         value = type;
35240         type = (PyObject*) Py_TYPE(value);
35241     } else if (PyExceptionClass_Check(type)) {
35242         PyObject *instance_class = NULL;
35243         if (value && PyExceptionInstance_Check(value)) {
35244             instance_class = (PyObject*) Py_TYPE(value);
35245             if (instance_class != type) {
35246                 int is_subclass = PyObject_IsSubclass(instance_class, type);
35247                 if (!is_subclass) {
35248                     instance_class = NULL;
35249                 } else if (unlikely(is_subclass == -1)) {
35250                     goto bad;
35251                 } else {
35252                     type = instance_class;
35253                 }
35254             }
35255         }
35256         if (!instance_class) {
35257             PyObject *args;
35258             if (!value)
35259                 args = PyTuple_New(0);
35260             else if (PyTuple_Check(value)) {
35261                 Py_INCREF(value);
35262                 args = value;
35263             } else
35264                 args = PyTuple_Pack(1, value);
35265             if (!args)
35266                 goto bad;
35267             owned_instance = PyObject_Call(type, args, NULL);
35268             Py_DECREF(args);
35269             if (!owned_instance)
35270                 goto bad;
35271             value = owned_instance;
35272             if (!PyExceptionInstance_Check(value)) {
35273                 PyErr_Format(PyExc_TypeError,
35274                              "calling %R should have returned an instance of "
35275                              "BaseException, not %R",
35276                              type, Py_TYPE(value));
35277                 goto bad;
35278             }
35279         }
35280     } else {
35281         PyErr_SetString(PyExc_TypeError,
35282             "raise: exception class must be a subclass of BaseException");
35283         goto bad;
35284     }
35285     if (cause) {
35286         PyObject *fixed_cause;
35287         if (cause == Py_None) {
35288             fixed_cause = NULL;
35289         } else if (PyExceptionClass_Check(cause)) {
35290             fixed_cause = PyObject_CallObject(cause, NULL);
35291             if (fixed_cause == NULL)
35292                 goto bad;
35293         } else if (PyExceptionInstance_Check(cause)) {
35294             fixed_cause = cause;
35295             Py_INCREF(fixed_cause);
35296         } else {
35297             PyErr_SetString(PyExc_TypeError,
35298                             "exception causes must derive from "
35299                             "BaseException");
35300             goto bad;
35301         }
35302         PyException_SetCause(value, fixed_cause);
35303     }
35304     PyErr_SetObject(type, value);
35305     if (tb) {
35306 #if CYTHON_COMPILING_IN_PYPY
35307         PyObject *tmp_type, *tmp_value, *tmp_tb;
35308         PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
35309         Py_INCREF(tb);
35310         PyErr_Restore(tmp_type, tmp_value, tb);
35311         Py_XDECREF(tmp_tb);
35312 #else
35313         PyThreadState *tstate = __Pyx_PyThreadState_Current;
35314         PyObject* tmp_tb = tstate->curexc_traceback;
35315         if (tb != tmp_tb) {
35316             Py_INCREF(tb);
35317             tstate->curexc_traceback = tb;
35318             Py_XDECREF(tmp_tb);
35319         }
35320 #endif
35321     }
35322 bad:
35323     Py_XDECREF(owned_instance);
35324     return;
35325 }
35326 #endif
35327 
35328 /* BytesEquals */
__Pyx_PyBytes_Equals(PyObject * s1,PyObject * s2,int equals)35329   static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
35330 #if CYTHON_COMPILING_IN_PYPY
35331     return PyObject_RichCompareBool(s1, s2, equals);
35332 #else
35333     if (s1 == s2) {
35334         return (equals == Py_EQ);
35335     } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
35336         const char *ps1, *ps2;
35337         Py_ssize_t length = PyBytes_GET_SIZE(s1);
35338         if (length != PyBytes_GET_SIZE(s2))
35339             return (equals == Py_NE);
35340         ps1 = PyBytes_AS_STRING(s1);
35341         ps2 = PyBytes_AS_STRING(s2);
35342         if (ps1[0] != ps2[0]) {
35343             return (equals == Py_NE);
35344         } else if (length == 1) {
35345             return (equals == Py_EQ);
35346         } else {
35347             int result;
35348 #if CYTHON_USE_UNICODE_INTERNALS
35349             Py_hash_t hash1, hash2;
35350             hash1 = ((PyBytesObject*)s1)->ob_shash;
35351             hash2 = ((PyBytesObject*)s2)->ob_shash;
35352             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
35353                 return (equals == Py_NE);
35354             }
35355 #endif
35356             result = memcmp(ps1, ps2, (size_t)length);
35357             return (equals == Py_EQ) ? (result == 0) : (result != 0);
35358         }
35359     } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
35360         return (equals == Py_NE);
35361     } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
35362         return (equals == Py_NE);
35363     } else {
35364         int result;
35365         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
35366         if (!py_result)
35367             return -1;
35368         result = __Pyx_PyObject_IsTrue(py_result);
35369         Py_DECREF(py_result);
35370         return result;
35371     }
35372 #endif
35373 }
35374 
35375 /* UnicodeEquals */
__Pyx_PyUnicode_Equals(PyObject * s1,PyObject * s2,int equals)35376   static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
35377 #if CYTHON_COMPILING_IN_PYPY
35378     return PyObject_RichCompareBool(s1, s2, equals);
35379 #else
35380 #if PY_MAJOR_VERSION < 3
35381     PyObject* owned_ref = NULL;
35382 #endif
35383     int s1_is_unicode, s2_is_unicode;
35384     if (s1 == s2) {
35385         goto return_eq;
35386     }
35387     s1_is_unicode = PyUnicode_CheckExact(s1);
35388     s2_is_unicode = PyUnicode_CheckExact(s2);
35389 #if PY_MAJOR_VERSION < 3
35390     if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
35391         owned_ref = PyUnicode_FromObject(s2);
35392         if (unlikely(!owned_ref))
35393             return -1;
35394         s2 = owned_ref;
35395         s2_is_unicode = 1;
35396     } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
35397         owned_ref = PyUnicode_FromObject(s1);
35398         if (unlikely(!owned_ref))
35399             return -1;
35400         s1 = owned_ref;
35401         s1_is_unicode = 1;
35402     } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
35403         return __Pyx_PyBytes_Equals(s1, s2, equals);
35404     }
35405 #endif
35406     if (s1_is_unicode & s2_is_unicode) {
35407         Py_ssize_t length;
35408         int kind;
35409         void *data1, *data2;
35410         if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
35411             return -1;
35412         length = __Pyx_PyUnicode_GET_LENGTH(s1);
35413         if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
35414             goto return_ne;
35415         }
35416 #if CYTHON_USE_UNICODE_INTERNALS
35417         {
35418             Py_hash_t hash1, hash2;
35419         #if CYTHON_PEP393_ENABLED
35420             hash1 = ((PyASCIIObject*)s1)->hash;
35421             hash2 = ((PyASCIIObject*)s2)->hash;
35422         #else
35423             hash1 = ((PyUnicodeObject*)s1)->hash;
35424             hash2 = ((PyUnicodeObject*)s2)->hash;
35425         #endif
35426             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
35427                 goto return_ne;
35428             }
35429         }
35430 #endif
35431         kind = __Pyx_PyUnicode_KIND(s1);
35432         if (kind != __Pyx_PyUnicode_KIND(s2)) {
35433             goto return_ne;
35434         }
35435         data1 = __Pyx_PyUnicode_DATA(s1);
35436         data2 = __Pyx_PyUnicode_DATA(s2);
35437         if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
35438             goto return_ne;
35439         } else if (length == 1) {
35440             goto return_eq;
35441         } else {
35442             int result = memcmp(data1, data2, (size_t)(length * kind));
35443             #if PY_MAJOR_VERSION < 3
35444             Py_XDECREF(owned_ref);
35445             #endif
35446             return (equals == Py_EQ) ? (result == 0) : (result != 0);
35447         }
35448     } else if ((s1 == Py_None) & s2_is_unicode) {
35449         goto return_ne;
35450     } else if ((s2 == Py_None) & s1_is_unicode) {
35451         goto return_ne;
35452     } else {
35453         int result;
35454         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
35455         #if PY_MAJOR_VERSION < 3
35456         Py_XDECREF(owned_ref);
35457         #endif
35458         if (!py_result)
35459             return -1;
35460         result = __Pyx_PyObject_IsTrue(py_result);
35461         Py_DECREF(py_result);
35462         return result;
35463     }
35464 return_eq:
35465     #if PY_MAJOR_VERSION < 3
35466     Py_XDECREF(owned_ref);
35467     #endif
35468     return (equals == Py_EQ);
35469 return_ne:
35470     #if PY_MAJOR_VERSION < 3
35471     Py_XDECREF(owned_ref);
35472     #endif
35473     return (equals == Py_NE);
35474 #endif
35475 }
35476 
35477 /* DictGetItem */
35478   #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
__Pyx_PyDict_GetItem(PyObject * d,PyObject * key)35479 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
35480     PyObject *value;
35481     value = PyDict_GetItemWithError(d, key);
35482     if (unlikely(!value)) {
35483         if (!PyErr_Occurred()) {
35484             if (unlikely(PyTuple_Check(key))) {
35485                 PyObject* args = PyTuple_Pack(1, key);
35486                 if (likely(args)) {
35487                     PyErr_SetObject(PyExc_KeyError, args);
35488                     Py_DECREF(args);
35489                 }
35490             } else {
35491                 PyErr_SetObject(PyExc_KeyError, key);
35492             }
35493         }
35494         return NULL;
35495     }
35496     Py_INCREF(value);
35497     return value;
35498 }
35499 #endif
35500 
35501 /* PyObjectCallNoArg */
35502   #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallNoArg(PyObject * func)35503 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
35504 #if CYTHON_FAST_PYCALL
35505     if (PyFunction_Check(func)) {
35506         return __Pyx_PyFunction_FastCall(func, NULL, 0);
35507     }
35508 #endif
35509 #ifdef __Pyx_CyFunction_USED
35510     if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
35511 #else
35512     if (likely(PyCFunction_Check(func)))
35513 #endif
35514     {
35515         if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
35516             return __Pyx_PyObject_CallMethO(func, NULL);
35517         }
35518     }
35519     return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
35520 }
35521 #endif
35522 
35523 /* Import */
__Pyx_Import(PyObject * name,PyObject * from_list,int level)35524   static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
35525     PyObject *empty_list = 0;
35526     PyObject *module = 0;
35527     PyObject *global_dict = 0;
35528     PyObject *empty_dict = 0;
35529     PyObject *list;
35530     #if PY_MAJOR_VERSION < 3
35531     PyObject *py_import;
35532     py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
35533     if (!py_import)
35534         goto bad;
35535     #endif
35536     if (from_list)
35537         list = from_list;
35538     else {
35539         empty_list = PyList_New(0);
35540         if (!empty_list)
35541             goto bad;
35542         list = empty_list;
35543     }
35544     global_dict = PyModule_GetDict(__pyx_m);
35545     if (!global_dict)
35546         goto bad;
35547     empty_dict = PyDict_New();
35548     if (!empty_dict)
35549         goto bad;
35550     {
35551         #if PY_MAJOR_VERSION >= 3
35552         if (level == -1) {
35553             if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
35554                 module = PyImport_ImportModuleLevelObject(
35555                     name, global_dict, empty_dict, list, 1);
35556                 if (!module) {
35557                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
35558                         goto bad;
35559                     PyErr_Clear();
35560                 }
35561             }
35562             level = 0;
35563         }
35564         #endif
35565         if (!module) {
35566             #if PY_MAJOR_VERSION < 3
35567             PyObject *py_level = PyInt_FromLong(level);
35568             if (!py_level)
35569                 goto bad;
35570             module = PyObject_CallFunctionObjArgs(py_import,
35571                 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
35572             Py_DECREF(py_level);
35573             #else
35574             module = PyImport_ImportModuleLevelObject(
35575                 name, global_dict, empty_dict, list, level);
35576             #endif
35577         }
35578     }
35579 bad:
35580     #if PY_MAJOR_VERSION < 3
35581     Py_XDECREF(py_import);
35582     #endif
35583     Py_XDECREF(empty_list);
35584     Py_XDECREF(empty_dict);
35585     return module;
35586 }
35587 
35588 /* ImportFrom */
__Pyx_ImportFrom(PyObject * module,PyObject * name)35589   static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
35590     PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
35591     if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
35592         PyErr_Format(PyExc_ImportError,
35593         #if PY_MAJOR_VERSION < 3
35594             "cannot import name %.230s", PyString_AS_STRING(name));
35595         #else
35596             "cannot import name %S", name);
35597         #endif
35598     }
35599     return value;
35600 }
35601 
35602 /* HasAttr */
__Pyx_HasAttr(PyObject * o,PyObject * n)35603   static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
35604     PyObject *r;
35605     if (unlikely(!__Pyx_PyBaseString_Check(n))) {
35606         PyErr_SetString(PyExc_TypeError,
35607                         "hasattr(): attribute name must be string");
35608         return -1;
35609     }
35610     r = __Pyx_GetAttr(o, n);
35611     if (unlikely(!r)) {
35612         PyErr_Clear();
35613         return 0;
35614     } else {
35615         Py_DECREF(r);
35616         return 1;
35617     }
35618 }
35619 
35620 /* GetTopmostException */
35621   #if CYTHON_USE_EXC_INFO_STACK
35622 static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState * tstate)35623 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
35624 {
35625     _PyErr_StackItem *exc_info = tstate->exc_info;
35626     while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
35627            exc_info->previous_item != NULL)
35628     {
35629         exc_info = exc_info->previous_item;
35630     }
35631     return exc_info;
35632 }
35633 #endif
35634 
35635 /* SaveResetException */
35636   #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSave(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)35637 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
35638     #if CYTHON_USE_EXC_INFO_STACK
35639     _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
35640     *type = exc_info->exc_type;
35641     *value = exc_info->exc_value;
35642     *tb = exc_info->exc_traceback;
35643     #else
35644     *type = tstate->exc_type;
35645     *value = tstate->exc_value;
35646     *tb = tstate->exc_traceback;
35647     #endif
35648     Py_XINCREF(*type);
35649     Py_XINCREF(*value);
35650     Py_XINCREF(*tb);
35651 }
__Pyx__ExceptionReset(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)35652 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
35653     PyObject *tmp_type, *tmp_value, *tmp_tb;
35654     #if CYTHON_USE_EXC_INFO_STACK
35655     _PyErr_StackItem *exc_info = tstate->exc_info;
35656     tmp_type = exc_info->exc_type;
35657     tmp_value = exc_info->exc_value;
35658     tmp_tb = exc_info->exc_traceback;
35659     exc_info->exc_type = type;
35660     exc_info->exc_value = value;
35661     exc_info->exc_traceback = tb;
35662     #else
35663     tmp_type = tstate->exc_type;
35664     tmp_value = tstate->exc_value;
35665     tmp_tb = tstate->exc_traceback;
35666     tstate->exc_type = type;
35667     tstate->exc_value = value;
35668     tstate->exc_traceback = tb;
35669     #endif
35670     Py_XDECREF(tmp_type);
35671     Py_XDECREF(tmp_value);
35672     Py_XDECREF(tmp_tb);
35673 }
35674 #endif
35675 
35676 /* GetException */
35677   #if CYTHON_FAST_THREAD_STATE
__Pyx__GetException(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)35678 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
35679 #else
35680 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
35681 #endif
35682 {
35683     PyObject *local_type, *local_value, *local_tb;
35684 #if CYTHON_FAST_THREAD_STATE
35685     PyObject *tmp_type, *tmp_value, *tmp_tb;
35686     local_type = tstate->curexc_type;
35687     local_value = tstate->curexc_value;
35688     local_tb = tstate->curexc_traceback;
35689     tstate->curexc_type = 0;
35690     tstate->curexc_value = 0;
35691     tstate->curexc_traceback = 0;
35692 #else
35693     PyErr_Fetch(&local_type, &local_value, &local_tb);
35694 #endif
35695     PyErr_NormalizeException(&local_type, &local_value, &local_tb);
35696 #if CYTHON_FAST_THREAD_STATE
35697     if (unlikely(tstate->curexc_type))
35698 #else
35699     if (unlikely(PyErr_Occurred()))
35700 #endif
35701         goto bad;
35702     #if PY_MAJOR_VERSION >= 3
35703     if (local_tb) {
35704         if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
35705             goto bad;
35706     }
35707     #endif
35708     Py_XINCREF(local_tb);
35709     Py_XINCREF(local_type);
35710     Py_XINCREF(local_value);
35711     *type = local_type;
35712     *value = local_value;
35713     *tb = local_tb;
35714 #if CYTHON_FAST_THREAD_STATE
35715     #if CYTHON_USE_EXC_INFO_STACK
35716     {
35717         _PyErr_StackItem *exc_info = tstate->exc_info;
35718         tmp_type = exc_info->exc_type;
35719         tmp_value = exc_info->exc_value;
35720         tmp_tb = exc_info->exc_traceback;
35721         exc_info->exc_type = local_type;
35722         exc_info->exc_value = local_value;
35723         exc_info->exc_traceback = local_tb;
35724     }
35725     #else
35726     tmp_type = tstate->exc_type;
35727     tmp_value = tstate->exc_value;
35728     tmp_tb = tstate->exc_traceback;
35729     tstate->exc_type = local_type;
35730     tstate->exc_value = local_value;
35731     tstate->exc_traceback = local_tb;
35732     #endif
35733     Py_XDECREF(tmp_type);
35734     Py_XDECREF(tmp_value);
35735     Py_XDECREF(tmp_tb);
35736 #else
35737     PyErr_SetExcInfo(local_type, local_value, local_tb);
35738 #endif
35739     return 0;
35740 bad:
35741     *type = 0;
35742     *value = 0;
35743     *tb = 0;
35744     Py_XDECREF(local_type);
35745     Py_XDECREF(local_value);
35746     Py_XDECREF(local_tb);
35747     return -1;
35748 }
35749 
35750 /* ArgTypeTest */
__Pyx__ArgTypeTest(PyObject * obj,PyTypeObject * type,const char * name,int exact)35751   static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
35752 {
35753     if (unlikely(!type)) {
35754         PyErr_SetString(PyExc_SystemError, "Missing type object");
35755         return 0;
35756     }
35757     else if (exact) {
35758         #if PY_MAJOR_VERSION == 2
35759         if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
35760         #endif
35761     }
35762     else {
35763         if (likely(__Pyx_TypeCheck(obj, type))) return 1;
35764     }
35765     PyErr_Format(PyExc_TypeError,
35766         "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
35767         name, type->tp_name, Py_TYPE(obj)->tp_name);
35768     return 0;
35769 }
35770 
35771 /* None */
__Pyx_div_Py_ssize_t(Py_ssize_t a,Py_ssize_t b)35772   static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
35773     Py_ssize_t q = a / b;
35774     Py_ssize_t r = a - q*b;
35775     q -= ((r != 0) & ((r ^ b) < 0));
35776     return q;
35777 }
35778 
35779 /* ObjectGetItem */
35780   #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetIndex(PyObject * obj,PyObject * index)35781 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
35782     PyObject *runerr;
35783     Py_ssize_t key_value;
35784     PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
35785     if (unlikely(!(m && m->sq_item))) {
35786         PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
35787         return NULL;
35788     }
35789     key_value = __Pyx_PyIndex_AsSsize_t(index);
35790     if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
35791         return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
35792     }
35793     if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
35794         PyErr_Clear();
35795         PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
35796     }
35797     return NULL;
35798 }
__Pyx_PyObject_GetItem(PyObject * obj,PyObject * key)35799 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
35800     PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
35801     if (likely(m && m->mp_subscript)) {
35802         return m->mp_subscript(obj, key);
35803     }
35804     return __Pyx_PyObject_GetIndex(obj, key);
35805 }
35806 #endif
35807 
35808 /* decode_c_string */
__Pyx_decode_c_string(const char * cstring,Py_ssize_t start,Py_ssize_t stop,const char * encoding,const char * errors,PyObject * (* decode_func)(const char * s,Py_ssize_t size,const char * errors))35809   static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
35810          const char* cstring, Py_ssize_t start, Py_ssize_t stop,
35811          const char* encoding, const char* errors,
35812          PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
35813     Py_ssize_t length;
35814     if (unlikely((start < 0) | (stop < 0))) {
35815         size_t slen = strlen(cstring);
35816         if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
35817             PyErr_SetString(PyExc_OverflowError,
35818                             "c-string too long to convert to Python");
35819             return NULL;
35820         }
35821         length = (Py_ssize_t) slen;
35822         if (start < 0) {
35823             start += length;
35824             if (start < 0)
35825                 start = 0;
35826         }
35827         if (stop < 0)
35828             stop += length;
35829     }
35830     if (unlikely(stop <= start))
35831         return __Pyx_NewRef(__pyx_empty_unicode);
35832     length = stop - start;
35833     cstring += start;
35834     if (decode_func) {
35835         return decode_func(cstring, length, errors);
35836     } else {
35837         return PyUnicode_Decode(cstring, length, encoding, errors);
35838     }
35839 }
35840 
35841 /* RaiseNoneIterError */
__Pyx_RaiseNoneNotIterableError(void)35842   static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
35843     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
35844 }
35845 
35846 /* SwapException */
35847   #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSwap(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)35848 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
35849     PyObject *tmp_type, *tmp_value, *tmp_tb;
35850     #if CYTHON_USE_EXC_INFO_STACK
35851     _PyErr_StackItem *exc_info = tstate->exc_info;
35852     tmp_type = exc_info->exc_type;
35853     tmp_value = exc_info->exc_value;
35854     tmp_tb = exc_info->exc_traceback;
35855     exc_info->exc_type = *type;
35856     exc_info->exc_value = *value;
35857     exc_info->exc_traceback = *tb;
35858     #else
35859     tmp_type = tstate->exc_type;
35860     tmp_value = tstate->exc_value;
35861     tmp_tb = tstate->exc_traceback;
35862     tstate->exc_type = *type;
35863     tstate->exc_value = *value;
35864     tstate->exc_traceback = *tb;
35865     #endif
35866     *type = tmp_type;
35867     *value = tmp_value;
35868     *tb = tmp_tb;
35869 }
35870 #else
__Pyx_ExceptionSwap(PyObject ** type,PyObject ** value,PyObject ** tb)35871 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
35872     PyObject *tmp_type, *tmp_value, *tmp_tb;
35873     PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
35874     PyErr_SetExcInfo(*type, *value, *tb);
35875     *type = tmp_type;
35876     *value = tmp_value;
35877     *tb = tmp_tb;
35878 }
35879 #endif
35880 
35881 /* FastTypeChecks */
35882   #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)35883 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
35884     while (a) {
35885         a = a->tp_base;
35886         if (a == b)
35887             return 1;
35888     }
35889     return b == &PyBaseObject_Type;
35890 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)35891 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
35892     PyObject *mro;
35893     if (a == b) return 1;
35894     mro = a->tp_mro;
35895     if (likely(mro)) {
35896         Py_ssize_t i, n;
35897         n = PyTuple_GET_SIZE(mro);
35898         for (i = 0; i < n; i++) {
35899             if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
35900                 return 1;
35901         }
35902         return 0;
35903     }
35904     return __Pyx_InBases(a, b);
35905 }
35906 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)35907 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
35908     PyObject *exception, *value, *tb;
35909     int res;
35910     __Pyx_PyThreadState_declare
35911     __Pyx_PyThreadState_assign
35912     __Pyx_ErrFetch(&exception, &value, &tb);
35913     res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
35914     if (unlikely(res == -1)) {
35915         PyErr_WriteUnraisable(err);
35916         res = 0;
35917     }
35918     if (!res) {
35919         res = PyObject_IsSubclass(err, exc_type2);
35920         if (unlikely(res == -1)) {
35921             PyErr_WriteUnraisable(err);
35922             res = 0;
35923         }
35924     }
35925     __Pyx_ErrRestore(exception, value, tb);
35926     return res;
35927 }
35928 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)35929 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
35930     int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
35931     if (!res) {
35932         res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
35933     }
35934     return res;
35935 }
35936 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)35937 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
35938     Py_ssize_t i, n;
35939     assert(PyExceptionClass_Check(exc_type));
35940     n = PyTuple_GET_SIZE(tuple);
35941 #if PY_MAJOR_VERSION >= 3
35942     for (i=0; i<n; i++) {
35943         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
35944     }
35945 #endif
35946     for (i=0; i<n; i++) {
35947         PyObject *t = PyTuple_GET_ITEM(tuple, i);
35948         #if PY_MAJOR_VERSION < 3
35949         if (likely(exc_type == t)) return 1;
35950         #endif
35951         if (likely(PyExceptionClass_Check(t))) {
35952             if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
35953         } else {
35954         }
35955     }
35956     return 0;
35957 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)35958 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
35959     if (likely(err == exc_type)) return 1;
35960     if (likely(PyExceptionClass_Check(err))) {
35961         if (likely(PyExceptionClass_Check(exc_type))) {
35962             return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
35963         } else if (likely(PyTuple_Check(exc_type))) {
35964             return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
35965         } else {
35966         }
35967     }
35968     return PyErr_GivenExceptionMatches(err, exc_type);
35969 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)35970 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
35971     assert(PyExceptionClass_Check(exc_type1));
35972     assert(PyExceptionClass_Check(exc_type2));
35973     if (likely(err == exc_type1 || err == exc_type2)) return 1;
35974     if (likely(PyExceptionClass_Check(err))) {
35975         return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
35976     }
35977     return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
35978 }
35979 #endif
35980 
35981 /* PyIntBinop */
35982   #if !CYTHON_COMPILING_IN_PYPY
__Pyx_PyInt_AddObjC(PyObject * op1,PyObject * op2,CYTHON_UNUSED long intval,int inplace,int zerodivision_check)35983 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
35984     (void)inplace;
35985     (void)zerodivision_check;
35986     #if PY_MAJOR_VERSION < 3
35987     if (likely(PyInt_CheckExact(op1))) {
35988         const long b = intval;
35989         long x;
35990         long a = PyInt_AS_LONG(op1);
35991             x = (long)((unsigned long)a + b);
35992             if (likely((x^a) >= 0 || (x^b) >= 0))
35993                 return PyInt_FromLong(x);
35994             return PyLong_Type.tp_as_number->nb_add(op1, op2);
35995     }
35996     #endif
35997     #if CYTHON_USE_PYLONG_INTERNALS
35998     if (likely(PyLong_CheckExact(op1))) {
35999         const long b = intval;
36000         long a, x;
36001 #ifdef HAVE_LONG_LONG
36002         const PY_LONG_LONG llb = intval;
36003         PY_LONG_LONG lla, llx;
36004 #endif
36005         const digit* digits = ((PyLongObject*)op1)->ob_digit;
36006         const Py_ssize_t size = Py_SIZE(op1);
36007         if (likely(__Pyx_sst_abs(size) <= 1)) {
36008             a = likely(size) ? digits[0] : 0;
36009             if (size == -1) a = -a;
36010         } else {
36011             switch (size) {
36012                 case -2:
36013                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
36014                         a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
36015                         break;
36016 #ifdef HAVE_LONG_LONG
36017                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
36018                         lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
36019                         goto long_long;
36020 #endif
36021                     }
36022                     CYTHON_FALLTHROUGH;
36023                 case 2:
36024                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
36025                         a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
36026                         break;
36027 #ifdef HAVE_LONG_LONG
36028                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
36029                         lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
36030                         goto long_long;
36031 #endif
36032                     }
36033                     CYTHON_FALLTHROUGH;
36034                 case -3:
36035                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
36036                         a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
36037                         break;
36038 #ifdef HAVE_LONG_LONG
36039                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
36040                         lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
36041                         goto long_long;
36042 #endif
36043                     }
36044                     CYTHON_FALLTHROUGH;
36045                 case 3:
36046                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
36047                         a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
36048                         break;
36049 #ifdef HAVE_LONG_LONG
36050                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
36051                         lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
36052                         goto long_long;
36053 #endif
36054                     }
36055                     CYTHON_FALLTHROUGH;
36056                 case -4:
36057                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
36058                         a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
36059                         break;
36060 #ifdef HAVE_LONG_LONG
36061                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
36062                         lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
36063                         goto long_long;
36064 #endif
36065                     }
36066                     CYTHON_FALLTHROUGH;
36067                 case 4:
36068                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
36069                         a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
36070                         break;
36071 #ifdef HAVE_LONG_LONG
36072                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
36073                         lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
36074                         goto long_long;
36075 #endif
36076                     }
36077                     CYTHON_FALLTHROUGH;
36078                 default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
36079             }
36080         }
36081                 x = a + b;
36082             return PyLong_FromLong(x);
36083 #ifdef HAVE_LONG_LONG
36084         long_long:
36085                 llx = lla + llb;
36086             return PyLong_FromLongLong(llx);
36087 #endif
36088 
36089 
36090     }
36091     #endif
36092     if (PyFloat_CheckExact(op1)) {
36093         const long b = intval;
36094         double a = PyFloat_AS_DOUBLE(op1);
36095             double result;
36096             PyFPE_START_PROTECT("add", return NULL)
36097             result = ((double)a) + (double)b;
36098             PyFPE_END_PROTECT(result)
36099             return PyFloat_FromDouble(result);
36100     }
36101     return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
36102 }
36103 #endif
36104 
36105 /* None */
__Pyx_RaiseUnboundLocalError(const char * varname)36106   static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
36107     PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
36108 }
36109 
36110 /* None */
__Pyx_div_long(long a,long b)36111   static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
36112     long q = a / b;
36113     long r = a - q*b;
36114     q -= ((r != 0) & ((r ^ b) < 0));
36115     return q;
36116 }
36117 
36118 /* StringJoin */
36119   #if !CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyBytes_Join(PyObject * sep,PyObject * values)36120 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
36121     return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
36122 }
36123 #endif
36124 
36125 /* PyObject_GenericGetAttrNoDict */
36126   #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_RaiseGenericGetAttributeError(PyTypeObject * tp,PyObject * attr_name)36127 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
36128     PyErr_Format(PyExc_AttributeError,
36129 #if PY_MAJOR_VERSION >= 3
36130                  "'%.50s' object has no attribute '%U'",
36131                  tp->tp_name, attr_name);
36132 #else
36133                  "'%.50s' object has no attribute '%.400s'",
36134                  tp->tp_name, PyString_AS_STRING(attr_name));
36135 #endif
36136     return NULL;
36137 }
__Pyx_PyObject_GenericGetAttrNoDict(PyObject * obj,PyObject * attr_name)36138 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
36139     PyObject *descr;
36140     PyTypeObject *tp = Py_TYPE(obj);
36141     if (unlikely(!PyString_Check(attr_name))) {
36142         return PyObject_GenericGetAttr(obj, attr_name);
36143     }
36144     assert(!tp->tp_dictoffset);
36145     descr = _PyType_Lookup(tp, attr_name);
36146     if (unlikely(!descr)) {
36147         return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
36148     }
36149     Py_INCREF(descr);
36150     #if PY_MAJOR_VERSION < 3
36151     if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
36152     #endif
36153     {
36154         descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
36155         if (unlikely(f)) {
36156             PyObject *res = f(descr, obj, (PyObject *)tp);
36157             Py_DECREF(descr);
36158             return res;
36159         }
36160     }
36161     return descr;
36162 }
36163 #endif
36164 
36165 /* PyObject_GenericGetAttr */
36166   #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_PyObject_GenericGetAttr(PyObject * obj,PyObject * attr_name)36167 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
36168     if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
36169         return PyObject_GenericGetAttr(obj, attr_name);
36170     }
36171     return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
36172 }
36173 #endif
36174 
36175 /* SetVTable */
__Pyx_SetVtable(PyObject * dict,void * vtable)36176   static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
36177 #if PY_VERSION_HEX >= 0x02070000
36178     PyObject *ob = PyCapsule_New(vtable, 0, 0);
36179 #else
36180     PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
36181 #endif
36182     if (!ob)
36183         goto bad;
36184     if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
36185         goto bad;
36186     Py_DECREF(ob);
36187     return 0;
36188 bad:
36189     Py_XDECREF(ob);
36190     return -1;
36191 }
36192 
36193 /* PyObjectGetAttrStrNoError */
__Pyx_PyObject_GetAttrStr_ClearAttributeError(void)36194   static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
36195     __Pyx_PyThreadState_declare
36196     __Pyx_PyThreadState_assign
36197     if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
36198         __Pyx_PyErr_Clear();
36199 }
__Pyx_PyObject_GetAttrStrNoError(PyObject * obj,PyObject * attr_name)36200 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
36201     PyObject *result;
36202 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
36203     PyTypeObject* tp = Py_TYPE(obj);
36204     if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
36205         return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
36206     }
36207 #endif
36208     result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
36209     if (unlikely(!result)) {
36210         __Pyx_PyObject_GetAttrStr_ClearAttributeError();
36211     }
36212     return result;
36213 }
36214 
36215 /* SetupReduce */
__Pyx_setup_reduce_is_named(PyObject * meth,PyObject * name)36216   static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
36217   int ret;
36218   PyObject *name_attr;
36219   name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
36220   if (likely(name_attr)) {
36221       ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
36222   } else {
36223       ret = -1;
36224   }
36225   if (unlikely(ret < 0)) {
36226       PyErr_Clear();
36227       ret = 0;
36228   }
36229   Py_XDECREF(name_attr);
36230   return ret;
36231 }
__Pyx_setup_reduce(PyObject * type_obj)36232 static int __Pyx_setup_reduce(PyObject* type_obj) {
36233     int ret = 0;
36234     PyObject *object_reduce = NULL;
36235     PyObject *object_reduce_ex = NULL;
36236     PyObject *reduce = NULL;
36237     PyObject *reduce_ex = NULL;
36238     PyObject *reduce_cython = NULL;
36239     PyObject *setstate = NULL;
36240     PyObject *setstate_cython = NULL;
36241 #if CYTHON_USE_PYTYPE_LOOKUP
36242     if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
36243 #else
36244     if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
36245 #endif
36246 #if CYTHON_USE_PYTYPE_LOOKUP
36247     object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
36248 #else
36249     object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
36250 #endif
36251     reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
36252     if (reduce_ex == object_reduce_ex) {
36253 #if CYTHON_USE_PYTYPE_LOOKUP
36254         object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
36255 #else
36256         object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
36257 #endif
36258         reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
36259         if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
36260             reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
36261             if (likely(reduce_cython)) {
36262                 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
36263                 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
36264             } else if (reduce == object_reduce || PyErr_Occurred()) {
36265                 goto __PYX_BAD;
36266             }
36267             setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
36268             if (!setstate) PyErr_Clear();
36269             if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
36270                 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
36271                 if (likely(setstate_cython)) {
36272                     ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
36273                     ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
36274                 } else if (!setstate || PyErr_Occurred()) {
36275                     goto __PYX_BAD;
36276                 }
36277             }
36278             PyType_Modified((PyTypeObject*)type_obj);
36279         }
36280     }
36281     goto __PYX_GOOD;
36282 __PYX_BAD:
36283     if (!PyErr_Occurred())
36284         PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
36285     ret = -1;
36286 __PYX_GOOD:
36287 #if !CYTHON_USE_PYTYPE_LOOKUP
36288     Py_XDECREF(object_reduce);
36289     Py_XDECREF(object_reduce_ex);
36290 #endif
36291     Py_XDECREF(reduce);
36292     Py_XDECREF(reduce_ex);
36293     Py_XDECREF(reduce_cython);
36294     Py_XDECREF(setstate);
36295     Py_XDECREF(setstate_cython);
36296     return ret;
36297 }
36298 
36299 /* TypeImport */
36300   #ifndef __PYX_HAVE_RT_ImportType
36301 #define __PYX_HAVE_RT_ImportType
__Pyx_ImportType(PyObject * module,const char * module_name,const char * class_name,size_t size,enum __Pyx_ImportType_CheckSize check_size)36302 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
36303     size_t size, enum __Pyx_ImportType_CheckSize check_size)
36304 {
36305     PyObject *result = 0;
36306     char warning[200];
36307     Py_ssize_t basicsize;
36308 #ifdef Py_LIMITED_API
36309     PyObject *py_basicsize;
36310 #endif
36311     result = PyObject_GetAttrString(module, class_name);
36312     if (!result)
36313         goto bad;
36314     if (!PyType_Check(result)) {
36315         PyErr_Format(PyExc_TypeError,
36316             "%.200s.%.200s is not a type object",
36317             module_name, class_name);
36318         goto bad;
36319     }
36320 #ifndef Py_LIMITED_API
36321     basicsize = ((PyTypeObject *)result)->tp_basicsize;
36322 #else
36323     py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
36324     if (!py_basicsize)
36325         goto bad;
36326     basicsize = PyLong_AsSsize_t(py_basicsize);
36327     Py_DECREF(py_basicsize);
36328     py_basicsize = 0;
36329     if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
36330         goto bad;
36331 #endif
36332     if ((size_t)basicsize < size) {
36333         PyErr_Format(PyExc_ValueError,
36334             "%.200s.%.200s size changed, may indicate binary incompatibility. "
36335             "Expected %zd from C header, got %zd from PyObject",
36336             module_name, class_name, size, basicsize);
36337         goto bad;
36338     }
36339     if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
36340         PyErr_Format(PyExc_ValueError,
36341             "%.200s.%.200s size changed, may indicate binary incompatibility. "
36342             "Expected %zd from C header, got %zd from PyObject",
36343             module_name, class_name, size, basicsize);
36344         goto bad;
36345     }
36346     else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
36347         PyOS_snprintf(warning, sizeof(warning),
36348             "%s.%s size changed, may indicate binary incompatibility. "
36349             "Expected %zd from C header, got %zd from PyObject",
36350             module_name, class_name, size, basicsize);
36351         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
36352     }
36353     return (PyTypeObject *)result;
36354 bad:
36355     Py_XDECREF(result);
36356     return NULL;
36357 }
36358 #endif
36359 
36360 /* GetVTable */
__Pyx_GetVtable(PyObject * dict)36361   static void* __Pyx_GetVtable(PyObject *dict) {
36362     void* ptr;
36363     PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
36364     if (!ob)
36365         goto bad;
36366 #if PY_VERSION_HEX >= 0x02070000
36367     ptr = PyCapsule_GetPointer(ob, 0);
36368 #else
36369     ptr = PyCObject_AsVoidPtr(ob);
36370 #endif
36371     if (!ptr && !PyErr_Occurred())
36372         PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
36373     Py_DECREF(ob);
36374     return ptr;
36375 bad:
36376     Py_XDECREF(ob);
36377     return NULL;
36378 }
36379 
36380 /* CLineInTraceback */
36381   #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState * tstate,int c_line)36382 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
36383     PyObject *use_cline;
36384     PyObject *ptype, *pvalue, *ptraceback;
36385 #if CYTHON_COMPILING_IN_CPYTHON
36386     PyObject **cython_runtime_dict;
36387 #endif
36388     if (unlikely(!__pyx_cython_runtime)) {
36389         return c_line;
36390     }
36391     __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
36392 #if CYTHON_COMPILING_IN_CPYTHON
36393     cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
36394     if (likely(cython_runtime_dict)) {
36395         __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
36396             use_cline, *cython_runtime_dict,
36397             __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
36398     } else
36399 #endif
36400     {
36401       PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
36402       if (use_cline_obj) {
36403         use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
36404         Py_DECREF(use_cline_obj);
36405       } else {
36406         PyErr_Clear();
36407         use_cline = NULL;
36408       }
36409     }
36410     if (!use_cline) {
36411         c_line = 0;
36412         PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
36413     }
36414     else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
36415         c_line = 0;
36416     }
36417     __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
36418     return c_line;
36419 }
36420 #endif
36421 
36422 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)36423   static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
36424     int start = 0, mid = 0, end = count - 1;
36425     if (end >= 0 && code_line > entries[end].code_line) {
36426         return count;
36427     }
36428     while (start < end) {
36429         mid = start + (end - start) / 2;
36430         if (code_line < entries[mid].code_line) {
36431             end = mid;
36432         } else if (code_line > entries[mid].code_line) {
36433              start = mid + 1;
36434         } else {
36435             return mid;
36436         }
36437     }
36438     if (code_line <= entries[mid].code_line) {
36439         return mid;
36440     } else {
36441         return mid + 1;
36442     }
36443 }
__pyx_find_code_object(int code_line)36444 static PyCodeObject *__pyx_find_code_object(int code_line) {
36445     PyCodeObject* code_object;
36446     int pos;
36447     if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
36448         return NULL;
36449     }
36450     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
36451     if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
36452         return NULL;
36453     }
36454     code_object = __pyx_code_cache.entries[pos].code_object;
36455     Py_INCREF(code_object);
36456     return code_object;
36457 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)36458 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
36459     int pos, i;
36460     __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
36461     if (unlikely(!code_line)) {
36462         return;
36463     }
36464     if (unlikely(!entries)) {
36465         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
36466         if (likely(entries)) {
36467             __pyx_code_cache.entries = entries;
36468             __pyx_code_cache.max_count = 64;
36469             __pyx_code_cache.count = 1;
36470             entries[0].code_line = code_line;
36471             entries[0].code_object = code_object;
36472             Py_INCREF(code_object);
36473         }
36474         return;
36475     }
36476     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
36477     if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
36478         PyCodeObject* tmp = entries[pos].code_object;
36479         entries[pos].code_object = code_object;
36480         Py_DECREF(tmp);
36481         return;
36482     }
36483     if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
36484         int new_max = __pyx_code_cache.max_count + 64;
36485         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
36486             __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
36487         if (unlikely(!entries)) {
36488             return;
36489         }
36490         __pyx_code_cache.entries = entries;
36491         __pyx_code_cache.max_count = new_max;
36492     }
36493     for (i=__pyx_code_cache.count; i>pos; i--) {
36494         entries[i] = entries[i-1];
36495     }
36496     entries[pos].code_line = code_line;
36497     entries[pos].code_object = code_object;
36498     __pyx_code_cache.count++;
36499     Py_INCREF(code_object);
36500 }
36501 
36502 /* AddTraceback */
36503   #include "compile.h"
36504 #include "frameobject.h"
36505 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)36506 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
36507             const char *funcname, int c_line,
36508             int py_line, const char *filename) {
36509     PyCodeObject *py_code = 0;
36510     PyObject *py_srcfile = 0;
36511     PyObject *py_funcname = 0;
36512     #if PY_MAJOR_VERSION < 3
36513     py_srcfile = PyString_FromString(filename);
36514     #else
36515     py_srcfile = PyUnicode_FromString(filename);
36516     #endif
36517     if (!py_srcfile) goto bad;
36518     if (c_line) {
36519         #if PY_MAJOR_VERSION < 3
36520         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
36521         #else
36522         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
36523         #endif
36524     }
36525     else {
36526         #if PY_MAJOR_VERSION < 3
36527         py_funcname = PyString_FromString(funcname);
36528         #else
36529         py_funcname = PyUnicode_FromString(funcname);
36530         #endif
36531     }
36532     if (!py_funcname) goto bad;
36533     py_code = __Pyx_PyCode_New(
36534         0,
36535         0,
36536         0,
36537         0,
36538         0,
36539         __pyx_empty_bytes, /*PyObject *code,*/
36540         __pyx_empty_tuple, /*PyObject *consts,*/
36541         __pyx_empty_tuple, /*PyObject *names,*/
36542         __pyx_empty_tuple, /*PyObject *varnames,*/
36543         __pyx_empty_tuple, /*PyObject *freevars,*/
36544         __pyx_empty_tuple, /*PyObject *cellvars,*/
36545         py_srcfile,   /*PyObject *filename,*/
36546         py_funcname,  /*PyObject *name,*/
36547         py_line,
36548         __pyx_empty_bytes  /*PyObject *lnotab*/
36549     );
36550     Py_DECREF(py_srcfile);
36551     Py_DECREF(py_funcname);
36552     return py_code;
36553 bad:
36554     Py_XDECREF(py_srcfile);
36555     Py_XDECREF(py_funcname);
36556     return NULL;
36557 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)36558 static void __Pyx_AddTraceback(const char *funcname, int c_line,
36559                                int py_line, const char *filename) {
36560     PyCodeObject *py_code = 0;
36561     PyFrameObject *py_frame = 0;
36562     PyThreadState *tstate = __Pyx_PyThreadState_Current;
36563     if (c_line) {
36564         c_line = __Pyx_CLineForTraceback(tstate, c_line);
36565     }
36566     py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
36567     if (!py_code) {
36568         py_code = __Pyx_CreateCodeObjectForTraceback(
36569             funcname, c_line, py_line, filename);
36570         if (!py_code) goto bad;
36571         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
36572     }
36573     py_frame = PyFrame_New(
36574         tstate,            /*PyThreadState *tstate,*/
36575         py_code,           /*PyCodeObject *code,*/
36576         __pyx_d,    /*PyObject *globals,*/
36577         0                  /*PyObject *locals*/
36578     );
36579     if (!py_frame) goto bad;
36580     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
36581     PyTraceBack_Here(py_frame);
36582 bad:
36583     Py_XDECREF(py_code);
36584     Py_XDECREF(py_frame);
36585 }
36586 
36587 /* Declarations */
36588   #if CYTHON_CCOMPLEX
36589   #ifdef __cplusplus
__pyx_t_double_complex_from_parts(double x,double y)36590     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
36591       return ::std::complex< double >(x, y);
36592     }
36593   #else
__pyx_t_double_complex_from_parts(double x,double y)36594     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
36595       return x + y*(__pyx_t_double_complex)_Complex_I;
36596     }
36597   #endif
36598 #else
__pyx_t_double_complex_from_parts(double x,double y)36599     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
36600       __pyx_t_double_complex z;
36601       z.real = x;
36602       z.imag = y;
36603       return z;
36604     }
36605 #endif
36606 
36607 /* Arithmetic */
36608   #if CYTHON_CCOMPLEX
36609 #else
__Pyx_c_eq_double(__pyx_t_double_complex a,__pyx_t_double_complex b)36610     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
36611        return (a.real == b.real) && (a.imag == b.imag);
36612     }
__Pyx_c_sum_double(__pyx_t_double_complex a,__pyx_t_double_complex b)36613     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
36614         __pyx_t_double_complex z;
36615         z.real = a.real + b.real;
36616         z.imag = a.imag + b.imag;
36617         return z;
36618     }
__Pyx_c_diff_double(__pyx_t_double_complex a,__pyx_t_double_complex b)36619     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
36620         __pyx_t_double_complex z;
36621         z.real = a.real - b.real;
36622         z.imag = a.imag - b.imag;
36623         return z;
36624     }
__Pyx_c_prod_double(__pyx_t_double_complex a,__pyx_t_double_complex b)36625     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
36626         __pyx_t_double_complex z;
36627         z.real = a.real * b.real - a.imag * b.imag;
36628         z.imag = a.real * b.imag + a.imag * b.real;
36629         return z;
36630     }
36631     #if 1
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)36632     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
36633         if (b.imag == 0) {
36634             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
36635         } else if (fabs(b.real) >= fabs(b.imag)) {
36636             if (b.real == 0 && b.imag == 0) {
36637                 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
36638             } else {
36639                 double r = b.imag / b.real;
36640                 double s = (double)(1.0) / (b.real + b.imag * r);
36641                 return __pyx_t_double_complex_from_parts(
36642                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
36643             }
36644         } else {
36645             double r = b.real / b.imag;
36646             double s = (double)(1.0) / (b.imag + b.real * r);
36647             return __pyx_t_double_complex_from_parts(
36648                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
36649         }
36650     }
36651     #else
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)36652     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
36653         if (b.imag == 0) {
36654             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
36655         } else {
36656             double denom = b.real * b.real + b.imag * b.imag;
36657             return __pyx_t_double_complex_from_parts(
36658                 (a.real * b.real + a.imag * b.imag) / denom,
36659                 (a.imag * b.real - a.real * b.imag) / denom);
36660         }
36661     }
36662     #endif
__Pyx_c_neg_double(__pyx_t_double_complex a)36663     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
36664         __pyx_t_double_complex z;
36665         z.real = -a.real;
36666         z.imag = -a.imag;
36667         return z;
36668     }
__Pyx_c_is_zero_double(__pyx_t_double_complex a)36669     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
36670        return (a.real == 0) && (a.imag == 0);
36671     }
__Pyx_c_conj_double(__pyx_t_double_complex a)36672     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
36673         __pyx_t_double_complex z;
36674         z.real =  a.real;
36675         z.imag = -a.imag;
36676         return z;
36677     }
36678     #if 1
__Pyx_c_abs_double(__pyx_t_double_complex z)36679         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
36680           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
36681             return sqrt(z.real*z.real + z.imag*z.imag);
36682           #else
36683             return hypot(z.real, z.imag);
36684           #endif
36685         }
__Pyx_c_pow_double(__pyx_t_double_complex a,__pyx_t_double_complex b)36686         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
36687             __pyx_t_double_complex z;
36688             double r, lnr, theta, z_r, z_theta;
36689             if (b.imag == 0 && b.real == (int)b.real) {
36690                 if (b.real < 0) {
36691                     double denom = a.real * a.real + a.imag * a.imag;
36692                     a.real = a.real / denom;
36693                     a.imag = -a.imag / denom;
36694                     b.real = -b.real;
36695                 }
36696                 switch ((int)b.real) {
36697                     case 0:
36698                         z.real = 1;
36699                         z.imag = 0;
36700                         return z;
36701                     case 1:
36702                         return a;
36703                     case 2:
36704                         return __Pyx_c_prod_double(a, a);
36705                     case 3:
36706                         z = __Pyx_c_prod_double(a, a);
36707                         return __Pyx_c_prod_double(z, a);
36708                     case 4:
36709                         z = __Pyx_c_prod_double(a, a);
36710                         return __Pyx_c_prod_double(z, z);
36711                 }
36712             }
36713             if (a.imag == 0) {
36714                 if (a.real == 0) {
36715                     return a;
36716                 } else if (b.imag == 0) {
36717                     z.real = pow(a.real, b.real);
36718                     z.imag = 0;
36719                     return z;
36720                 } else if (a.real > 0) {
36721                     r = a.real;
36722                     theta = 0;
36723                 } else {
36724                     r = -a.real;
36725                     theta = atan2(0.0, -1.0);
36726                 }
36727             } else {
36728                 r = __Pyx_c_abs_double(a);
36729                 theta = atan2(a.imag, a.real);
36730             }
36731             lnr = log(r);
36732             z_r = exp(lnr * b.real - theta * b.imag);
36733             z_theta = theta * b.real + lnr * b.imag;
36734             z.real = z_r * cos(z_theta);
36735             z.imag = z_r * sin(z_theta);
36736             return z;
36737         }
36738     #endif
36739 #endif
36740 
36741 #if PY_MAJOR_VERSION < 3
__Pyx_GetBuffer(PyObject * obj,Py_buffer * view,int flags)36742 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
36743     if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
36744         if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
36745         if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
36746     PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
36747     return -1;
36748 }
__Pyx_ReleaseBuffer(Py_buffer * view)36749 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
36750     PyObject *obj = view->obj;
36751     if (!obj) return;
36752     if (PyObject_CheckBuffer(obj)) {
36753         PyBuffer_Release(view);
36754         return;
36755     }
36756     if ((0)) {}
36757     view->obj = NULL;
36758     Py_DECREF(obj);
36759 }
36760 #endif
36761 
36762 
36763   /* MemviewSliceIsContig */
36764   static int
__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs,char order,int ndim)36765 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
36766 {
36767     int i, index, step, start;
36768     Py_ssize_t itemsize = mvs.memview->view.itemsize;
36769     if (order == 'F') {
36770         step = 1;
36771         start = 0;
36772     } else {
36773         step = -1;
36774         start = ndim - 1;
36775     }
36776     for (i = 0; i < ndim; i++) {
36777         index = start + step * i;
36778         if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
36779             return 0;
36780         itemsize *= mvs.shape[index];
36781     }
36782     return 1;
36783 }
36784 
36785 /* OverlappingSlices */
36786   static void
__pyx_get_array_memory_extents(__Pyx_memviewslice * slice,void ** out_start,void ** out_end,int ndim,size_t itemsize)36787 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
36788                                void **out_start, void **out_end,
36789                                int ndim, size_t itemsize)
36790 {
36791     char *start, *end;
36792     int i;
36793     start = end = slice->data;
36794     for (i = 0; i < ndim; i++) {
36795         Py_ssize_t stride = slice->strides[i];
36796         Py_ssize_t extent = slice->shape[i];
36797         if (extent == 0) {
36798             *out_start = *out_end = start;
36799             return;
36800         } else {
36801             if (stride > 0)
36802                 end += stride * (extent - 1);
36803             else
36804                 start += stride * (extent - 1);
36805         }
36806     }
36807     *out_start = start;
36808     *out_end = end + itemsize;
36809 }
36810 static int
__pyx_slices_overlap(__Pyx_memviewslice * slice1,__Pyx_memviewslice * slice2,int ndim,size_t itemsize)36811 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
36812                      __Pyx_memviewslice *slice2,
36813                      int ndim, size_t itemsize)
36814 {
36815     void *start1, *end1, *start2, *end2;
36816     __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
36817     __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
36818     return (start1 < end2) && (start2 < end1);
36819 }
36820 
36821 /* Capsule */
36822   static CYTHON_INLINE PyObject *
__pyx_capsule_create(void * p,CYTHON_UNUSED const char * sig)36823 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
36824 {
36825     PyObject *cobj;
36826 #if PY_VERSION_HEX >= 0x02070000
36827     cobj = PyCapsule_New(p, sig, NULL);
36828 #else
36829     cobj = PyCObject_FromVoidPtr(p, NULL);
36830 #endif
36831     return cobj;
36832 }
36833 
36834 /* CIntFromPyVerify */
36835   #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
36836     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
36837 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
36838     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
36839 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
36840     {\
36841         func_type value = func_value;\
36842         if (sizeof(target_type) < sizeof(func_type)) {\
36843             if (unlikely(value != (func_type) (target_type) value)) {\
36844                 func_type zero = 0;\
36845                 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
36846                     return (target_type) -1;\
36847                 if (is_unsigned && unlikely(value < zero))\
36848                     goto raise_neg_overflow;\
36849                 else\
36850                     goto raise_overflow;\
36851             }\
36852         }\
36853         return (target_type) value;\
36854     }
36855 
36856 /* FromPy */
__Pyx_PyComplex_As___pyx_t_double_complex(PyObject * o)36857   static __pyx_t_double_complex __Pyx_PyComplex_As___pyx_t_double_complex(PyObject* o) {
36858     Py_complex cval;
36859 #if !CYTHON_COMPILING_IN_PYPY
36860     if (PyComplex_CheckExact(o))
36861         cval = ((PyComplexObject *)o)->cval;
36862     else
36863 #endif
36864         cval = PyComplex_AsCComplex(o);
36865     return __pyx_t_double_complex_from_parts(
36866                (double)cval.real,
36867                (double)cval.imag);
36868 }
36869 
36870 /* MemviewDtypeToObject */
__pyx_memview_get___pyx_t_double_complex(const char * itemp)36871   static CYTHON_INLINE PyObject *__pyx_memview_get___pyx_t_double_complex(const char *itemp) {
36872     return (PyObject *) __pyx_PyComplex_FromComplex(*(__pyx_t_double_complex *) itemp);
36873 }
__pyx_memview_set___pyx_t_double_complex(const char * itemp,PyObject * obj)36874 static CYTHON_INLINE int __pyx_memview_set___pyx_t_double_complex(const char *itemp, PyObject *obj) {
36875     __pyx_t_double_complex value = __Pyx_PyComplex_As___pyx_t_double_complex(obj);
36876     if (PyErr_Occurred())
36877         return 0;
36878     *(__pyx_t_double_complex *) itemp = value;
36879     return 1;
36880 }
36881 
36882 /* TypeInfoCompare */
36883   static int
__pyx_typeinfo_cmp(__Pyx_TypeInfo * a,__Pyx_TypeInfo * b)36884 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
36885 {
36886     int i;
36887     if (!a || !b)
36888         return 0;
36889     if (a == b)
36890         return 1;
36891     if (a->size != b->size || a->typegroup != b->typegroup ||
36892             a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
36893         if (a->typegroup == 'H' || b->typegroup == 'H') {
36894             return a->size == b->size;
36895         } else {
36896             return 0;
36897         }
36898     }
36899     if (a->ndim) {
36900         for (i = 0; i < a->ndim; i++)
36901             if (a->arraysize[i] != b->arraysize[i])
36902                 return 0;
36903     }
36904     if (a->typegroup == 'S') {
36905         if (a->flags != b->flags)
36906             return 0;
36907         if (a->fields || b->fields) {
36908             if (!(a->fields && b->fields))
36909                 return 0;
36910             for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
36911                 __Pyx_StructField *field_a = a->fields + i;
36912                 __Pyx_StructField *field_b = b->fields + i;
36913                 if (field_a->offset != field_b->offset ||
36914                     !__pyx_typeinfo_cmp(field_a->type, field_b->type))
36915                     return 0;
36916             }
36917             return !a->fields[i].type && !b->fields[i].type;
36918         }
36919     }
36920     return 1;
36921 }
36922 
36923 /* MemviewSliceValidateAndInit */
36924   static int
__pyx_check_strides(Py_buffer * buf,int dim,int ndim,int spec)36925 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
36926 {
36927     if (buf->shape[dim] <= 1)
36928         return 1;
36929     if (buf->strides) {
36930         if (spec & __Pyx_MEMVIEW_CONTIG) {
36931             if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
36932                 if (unlikely(buf->strides[dim] != sizeof(void *))) {
36933                     PyErr_Format(PyExc_ValueError,
36934                                  "Buffer is not indirectly contiguous "
36935                                  "in dimension %d.", dim);
36936                     goto fail;
36937                 }
36938             } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
36939                 PyErr_SetString(PyExc_ValueError,
36940                                 "Buffer and memoryview are not contiguous "
36941                                 "in the same dimension.");
36942                 goto fail;
36943             }
36944         }
36945         if (spec & __Pyx_MEMVIEW_FOLLOW) {
36946             Py_ssize_t stride = buf->strides[dim];
36947             if (stride < 0)
36948                 stride = -stride;
36949             if (unlikely(stride < buf->itemsize)) {
36950                 PyErr_SetString(PyExc_ValueError,
36951                                 "Buffer and memoryview are not contiguous "
36952                                 "in the same dimension.");
36953                 goto fail;
36954             }
36955         }
36956     } else {
36957         if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
36958             PyErr_Format(PyExc_ValueError,
36959                          "C-contiguous buffer is not contiguous in "
36960                          "dimension %d", dim);
36961             goto fail;
36962         } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
36963             PyErr_Format(PyExc_ValueError,
36964                          "C-contiguous buffer is not indirect in "
36965                          "dimension %d", dim);
36966             goto fail;
36967         } else if (unlikely(buf->suboffsets)) {
36968             PyErr_SetString(PyExc_ValueError,
36969                             "Buffer exposes suboffsets but no strides");
36970             goto fail;
36971         }
36972     }
36973     return 1;
36974 fail:
36975     return 0;
36976 }
36977 static int
__pyx_check_suboffsets(Py_buffer * buf,int dim,CYTHON_UNUSED int ndim,int spec)36978 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
36979 {
36980     if (spec & __Pyx_MEMVIEW_DIRECT) {
36981         if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
36982             PyErr_Format(PyExc_ValueError,
36983                          "Buffer not compatible with direct access "
36984                          "in dimension %d.", dim);
36985             goto fail;
36986         }
36987     }
36988     if (spec & __Pyx_MEMVIEW_PTR) {
36989         if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
36990             PyErr_Format(PyExc_ValueError,
36991                          "Buffer is not indirectly accessible "
36992                          "in dimension %d.", dim);
36993             goto fail;
36994         }
36995     }
36996     return 1;
36997 fail:
36998     return 0;
36999 }
37000 static int
__pyx_verify_contig(Py_buffer * buf,int ndim,int c_or_f_flag)37001 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
37002 {
37003     int i;
37004     if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
37005         Py_ssize_t stride = 1;
37006         for (i = 0; i < ndim; i++) {
37007             if (unlikely(stride * buf->itemsize != buf->strides[i]  &&  buf->shape[i] > 1)) {
37008                 PyErr_SetString(PyExc_ValueError,
37009                     "Buffer not fortran contiguous.");
37010                 goto fail;
37011             }
37012             stride = stride * buf->shape[i];
37013         }
37014     } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
37015         Py_ssize_t stride = 1;
37016         for (i = ndim - 1; i >- 1; i--) {
37017             if (unlikely(stride * buf->itemsize != buf->strides[i]  &&  buf->shape[i] > 1)) {
37018                 PyErr_SetString(PyExc_ValueError,
37019                     "Buffer not C contiguous.");
37020                 goto fail;
37021             }
37022             stride = stride * buf->shape[i];
37023         }
37024     }
37025     return 1;
37026 fail:
37027     return 0;
37028 }
__Pyx_ValidateAndInit_memviewslice(int * axes_specs,int c_or_f_flag,int buf_flags,int ndim,__Pyx_TypeInfo * dtype,__Pyx_BufFmt_StackElem stack[],__Pyx_memviewslice * memviewslice,PyObject * original_obj)37029 static int __Pyx_ValidateAndInit_memviewslice(
37030                 int *axes_specs,
37031                 int c_or_f_flag,
37032                 int buf_flags,
37033                 int ndim,
37034                 __Pyx_TypeInfo *dtype,
37035                 __Pyx_BufFmt_StackElem stack[],
37036                 __Pyx_memviewslice *memviewslice,
37037                 PyObject *original_obj)
37038 {
37039     struct __pyx_memoryview_obj *memview, *new_memview;
37040     __Pyx_RefNannyDeclarations
37041     Py_buffer *buf;
37042     int i, spec = 0, retval = -1;
37043     __Pyx_BufFmt_Context ctx;
37044     int from_memoryview = __pyx_memoryview_check(original_obj);
37045     __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
37046     if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
37047                                                             original_obj)->typeinfo)) {
37048         memview = (struct __pyx_memoryview_obj *) original_obj;
37049         new_memview = NULL;
37050     } else {
37051         memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
37052                                             original_obj, buf_flags, 0, dtype);
37053         new_memview = memview;
37054         if (unlikely(!memview))
37055             goto fail;
37056     }
37057     buf = &memview->view;
37058     if (unlikely(buf->ndim != ndim)) {
37059         PyErr_Format(PyExc_ValueError,
37060                 "Buffer has wrong number of dimensions (expected %d, got %d)",
37061                 ndim, buf->ndim);
37062         goto fail;
37063     }
37064     if (new_memview) {
37065         __Pyx_BufFmt_Init(&ctx, stack, dtype);
37066         if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
37067     }
37068     if (unlikely((unsigned) buf->itemsize != dtype->size)) {
37069         PyErr_Format(PyExc_ValueError,
37070                      "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
37071                      "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
37072                      buf->itemsize,
37073                      (buf->itemsize > 1) ? "s" : "",
37074                      dtype->name,
37075                      dtype->size,
37076                      (dtype->size > 1) ? "s" : "");
37077         goto fail;
37078     }
37079     if (buf->len > 0) {
37080         for (i = 0; i < ndim; i++) {
37081             spec = axes_specs[i];
37082             if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
37083                 goto fail;
37084             if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
37085                 goto fail;
37086         }
37087         if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
37088             goto fail;
37089     }
37090     if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
37091                                          new_memview != NULL) == -1)) {
37092         goto fail;
37093     }
37094     retval = 0;
37095     goto no_fail;
37096 fail:
37097     Py_XDECREF(new_memview);
37098     retval = -1;
37099 no_fail:
37100     __Pyx_RefNannyFinishContext();
37101     return retval;
37102 }
37103 
37104 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(PyObject * obj,int writable_flag)37105   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(PyObject *obj, int writable_flag) {
37106     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
37107     __Pyx_BufFmt_StackElem stack[1];
37108     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
37109     int retcode;
37110     if (obj == Py_None) {
37111         result.memview = (struct __pyx_memoryview_obj *) Py_None;
37112         return result;
37113     }
37114     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
37115                                                  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
37116                                                  &__Pyx_TypeInfo___pyx_t_double_complex, stack,
37117                                                  &result, obj);
37118     if (unlikely(retcode == -1))
37119         goto __pyx_fail;
37120     return result;
37121 __pyx_fail:
37122     result.memview = NULL;
37123     result.data = NULL;
37124     return result;
37125 }
37126 
37127 /* MemviewDtypeToObject */
__pyx_memview_get_double(const char * itemp)37128   static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp) {
37129     return (PyObject *) PyFloat_FromDouble(*(double *) itemp);
37130 }
__pyx_memview_set_double(const char * itemp,PyObject * obj)37131 static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
37132     double value = __pyx_PyFloat_AsDouble(obj);
37133     if ((value == (double)-1) && PyErr_Occurred())
37134         return 0;
37135     *(double *) itemp = value;
37136     return 1;
37137 }
37138 
37139 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject * obj,int writable_flag)37140   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *obj, int writable_flag) {
37141     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
37142     __Pyx_BufFmt_StackElem stack[1];
37143     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
37144     int retcode;
37145     if (obj == Py_None) {
37146         result.memview = (struct __pyx_memoryview_obj *) Py_None;
37147         return result;
37148     }
37149     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
37150                                                  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
37151                                                  &__Pyx_TypeInfo_double, stack,
37152                                                  &result, obj);
37153     if (unlikely(retcode == -1))
37154         goto __pyx_fail;
37155     return result;
37156 __pyx_fail:
37157     result.memview = NULL;
37158     result.data = NULL;
37159     return result;
37160 }
37161 
37162 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(PyObject * obj,int writable_flag)37163   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(PyObject *obj, int writable_flag) {
37164     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
37165     __Pyx_BufFmt_StackElem stack[1];
37166     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
37167     int retcode;
37168     if (obj == Py_None) {
37169         result.memview = (struct __pyx_memoryview_obj *) Py_None;
37170         return result;
37171     }
37172     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
37173                                                  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
37174                                                  &__Pyx_TypeInfo___pyx_t_double_complex, stack,
37175                                                  &result, obj);
37176     if (unlikely(retcode == -1))
37177         goto __pyx_fail;
37178     return result;
37179 __pyx_fail:
37180     result.memview = NULL;
37181     result.data = NULL;
37182     return result;
37183 }
37184 
37185 /* Declarations */
37186   #if CYTHON_CCOMPLEX
37187   #ifdef __cplusplus
__pyx_t_float_complex_from_parts(float x,float y)37188     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
37189       return ::std::complex< float >(x, y);
37190     }
37191   #else
__pyx_t_float_complex_from_parts(float x,float y)37192     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
37193       return x + y*(__pyx_t_float_complex)_Complex_I;
37194     }
37195   #endif
37196 #else
__pyx_t_float_complex_from_parts(float x,float y)37197     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
37198       __pyx_t_float_complex z;
37199       z.real = x;
37200       z.imag = y;
37201       return z;
37202     }
37203 #endif
37204 
37205 /* Arithmetic */
37206   #if CYTHON_CCOMPLEX
37207 #else
__Pyx_c_eq_float(__pyx_t_float_complex a,__pyx_t_float_complex b)37208     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
37209        return (a.real == b.real) && (a.imag == b.imag);
37210     }
__Pyx_c_sum_float(__pyx_t_float_complex a,__pyx_t_float_complex b)37211     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
37212         __pyx_t_float_complex z;
37213         z.real = a.real + b.real;
37214         z.imag = a.imag + b.imag;
37215         return z;
37216     }
__Pyx_c_diff_float(__pyx_t_float_complex a,__pyx_t_float_complex b)37217     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
37218         __pyx_t_float_complex z;
37219         z.real = a.real - b.real;
37220         z.imag = a.imag - b.imag;
37221         return z;
37222     }
__Pyx_c_prod_float(__pyx_t_float_complex a,__pyx_t_float_complex b)37223     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
37224         __pyx_t_float_complex z;
37225         z.real = a.real * b.real - a.imag * b.imag;
37226         z.imag = a.real * b.imag + a.imag * b.real;
37227         return z;
37228     }
37229     #if 1
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)37230     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
37231         if (b.imag == 0) {
37232             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
37233         } else if (fabsf(b.real) >= fabsf(b.imag)) {
37234             if (b.real == 0 && b.imag == 0) {
37235                 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
37236             } else {
37237                 float r = b.imag / b.real;
37238                 float s = (float)(1.0) / (b.real + b.imag * r);
37239                 return __pyx_t_float_complex_from_parts(
37240                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
37241             }
37242         } else {
37243             float r = b.real / b.imag;
37244             float s = (float)(1.0) / (b.imag + b.real * r);
37245             return __pyx_t_float_complex_from_parts(
37246                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
37247         }
37248     }
37249     #else
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)37250     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
37251         if (b.imag == 0) {
37252             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
37253         } else {
37254             float denom = b.real * b.real + b.imag * b.imag;
37255             return __pyx_t_float_complex_from_parts(
37256                 (a.real * b.real + a.imag * b.imag) / denom,
37257                 (a.imag * b.real - a.real * b.imag) / denom);
37258         }
37259     }
37260     #endif
__Pyx_c_neg_float(__pyx_t_float_complex a)37261     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
37262         __pyx_t_float_complex z;
37263         z.real = -a.real;
37264         z.imag = -a.imag;
37265         return z;
37266     }
__Pyx_c_is_zero_float(__pyx_t_float_complex a)37267     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
37268        return (a.real == 0) && (a.imag == 0);
37269     }
__Pyx_c_conj_float(__pyx_t_float_complex a)37270     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
37271         __pyx_t_float_complex z;
37272         z.real =  a.real;
37273         z.imag = -a.imag;
37274         return z;
37275     }
37276     #if 1
__Pyx_c_abs_float(__pyx_t_float_complex z)37277         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
37278           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
37279             return sqrtf(z.real*z.real + z.imag*z.imag);
37280           #else
37281             return hypotf(z.real, z.imag);
37282           #endif
37283         }
__Pyx_c_pow_float(__pyx_t_float_complex a,__pyx_t_float_complex b)37284         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
37285             __pyx_t_float_complex z;
37286             float r, lnr, theta, z_r, z_theta;
37287             if (b.imag == 0 && b.real == (int)b.real) {
37288                 if (b.real < 0) {
37289                     float denom = a.real * a.real + a.imag * a.imag;
37290                     a.real = a.real / denom;
37291                     a.imag = -a.imag / denom;
37292                     b.real = -b.real;
37293                 }
37294                 switch ((int)b.real) {
37295                     case 0:
37296                         z.real = 1;
37297                         z.imag = 0;
37298                         return z;
37299                     case 1:
37300                         return a;
37301                     case 2:
37302                         return __Pyx_c_prod_float(a, a);
37303                     case 3:
37304                         z = __Pyx_c_prod_float(a, a);
37305                         return __Pyx_c_prod_float(z, a);
37306                     case 4:
37307                         z = __Pyx_c_prod_float(a, a);
37308                         return __Pyx_c_prod_float(z, z);
37309                 }
37310             }
37311             if (a.imag == 0) {
37312                 if (a.real == 0) {
37313                     return a;
37314                 } else if (b.imag == 0) {
37315                     z.real = powf(a.real, b.real);
37316                     z.imag = 0;
37317                     return z;
37318                 } else if (a.real > 0) {
37319                     r = a.real;
37320                     theta = 0;
37321                 } else {
37322                     r = -a.real;
37323                     theta = atan2f(0.0, -1.0);
37324                 }
37325             } else {
37326                 r = __Pyx_c_abs_float(a);
37327                 theta = atan2f(a.imag, a.real);
37328             }
37329             lnr = logf(r);
37330             z_r = expf(lnr * b.real - theta * b.imag);
37331             z_theta = theta * b.real + lnr * b.imag;
37332             z.real = z_r * cosf(z_theta);
37333             z.imag = z_r * sinf(z_theta);
37334             return z;
37335         }
37336     #endif
37337 #endif
37338 
37339 /* MemviewSliceCopyTemplate */
37340   static __Pyx_memviewslice
__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice * from_mvs,const char * mode,int ndim,size_t sizeof_dtype,int contig_flag,int dtype_is_object)37341 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
37342                                  const char *mode, int ndim,
37343                                  size_t sizeof_dtype, int contig_flag,
37344                                  int dtype_is_object)
37345 {
37346     __Pyx_RefNannyDeclarations
37347     int i;
37348     __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
37349     struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
37350     Py_buffer *buf = &from_memview->view;
37351     PyObject *shape_tuple = NULL;
37352     PyObject *temp_int = NULL;
37353     struct __pyx_array_obj *array_obj = NULL;
37354     struct __pyx_memoryview_obj *memview_obj = NULL;
37355     __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
37356     for (i = 0; i < ndim; i++) {
37357         if (unlikely(from_mvs->suboffsets[i] >= 0)) {
37358             PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
37359                                            "indirect dimensions (axis %d)", i);
37360             goto fail;
37361         }
37362     }
37363     shape_tuple = PyTuple_New(ndim);
37364     if (unlikely(!shape_tuple)) {
37365         goto fail;
37366     }
37367     __Pyx_GOTREF(shape_tuple);
37368     for(i = 0; i < ndim; i++) {
37369         temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
37370         if(unlikely(!temp_int)) {
37371             goto fail;
37372         } else {
37373             PyTuple_SET_ITEM(shape_tuple, i, temp_int);
37374             temp_int = NULL;
37375         }
37376     }
37377     array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
37378     if (unlikely(!array_obj)) {
37379         goto fail;
37380     }
37381     __Pyx_GOTREF(array_obj);
37382     memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
37383                                     (PyObject *) array_obj, contig_flag,
37384                                     dtype_is_object,
37385                                     from_mvs->memview->typeinfo);
37386     if (unlikely(!memview_obj))
37387         goto fail;
37388     if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
37389         goto fail;
37390     if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
37391                                                 dtype_is_object) < 0))
37392         goto fail;
37393     goto no_fail;
37394 fail:
37395     __Pyx_XDECREF(new_mvs.memview);
37396     new_mvs.memview = NULL;
37397     new_mvs.data = NULL;
37398 no_fail:
37399     __Pyx_XDECREF(shape_tuple);
37400     __Pyx_XDECREF(temp_int);
37401     __Pyx_XDECREF(array_obj);
37402     __Pyx_RefNannyFinishContext();
37403     return new_mvs;
37404 }
37405 
37406 /* CIntToPy */
__Pyx_PyInt_From_int(int value)37407   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
37408 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37409 #pragma GCC diagnostic push
37410 #pragma GCC diagnostic ignored "-Wconversion"
37411 #endif
37412     const int neg_one = (int) -1, const_zero = (int) 0;
37413 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37414 #pragma GCC diagnostic pop
37415 #endif
37416     const int is_unsigned = neg_one > const_zero;
37417     if (is_unsigned) {
37418         if (sizeof(int) < sizeof(long)) {
37419             return PyInt_FromLong((long) value);
37420         } else if (sizeof(int) <= sizeof(unsigned long)) {
37421             return PyLong_FromUnsignedLong((unsigned long) value);
37422 #ifdef HAVE_LONG_LONG
37423         } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
37424             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
37425 #endif
37426         }
37427     } else {
37428         if (sizeof(int) <= sizeof(long)) {
37429             return PyInt_FromLong((long) value);
37430 #ifdef HAVE_LONG_LONG
37431         } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
37432             return PyLong_FromLongLong((PY_LONG_LONG) value);
37433 #endif
37434         }
37435     }
37436     {
37437         int one = 1; int little = (int)*(unsigned char *)&one;
37438         unsigned char *bytes = (unsigned char *)&value;
37439         return _PyLong_FromByteArray(bytes, sizeof(int),
37440                                      little, !is_unsigned);
37441     }
37442 }
37443 
37444 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)37445   static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
37446 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37447 #pragma GCC diagnostic push
37448 #pragma GCC diagnostic ignored "-Wconversion"
37449 #endif
37450     const int neg_one = (int) -1, const_zero = (int) 0;
37451 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37452 #pragma GCC diagnostic pop
37453 #endif
37454     const int is_unsigned = neg_one > const_zero;
37455 #if PY_MAJOR_VERSION < 3
37456     if (likely(PyInt_Check(x))) {
37457         if (sizeof(int) < sizeof(long)) {
37458             __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
37459         } else {
37460             long val = PyInt_AS_LONG(x);
37461             if (is_unsigned && unlikely(val < 0)) {
37462                 goto raise_neg_overflow;
37463             }
37464             return (int) val;
37465         }
37466     } else
37467 #endif
37468     if (likely(PyLong_Check(x))) {
37469         if (is_unsigned) {
37470 #if CYTHON_USE_PYLONG_INTERNALS
37471             const digit* digits = ((PyLongObject*)x)->ob_digit;
37472             switch (Py_SIZE(x)) {
37473                 case  0: return (int) 0;
37474                 case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
37475                 case 2:
37476                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
37477                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
37478                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37479                         } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
37480                             return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37481                         }
37482                     }
37483                     break;
37484                 case 3:
37485                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
37486                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
37487                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37488                         } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
37489                             return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37490                         }
37491                     }
37492                     break;
37493                 case 4:
37494                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
37495                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
37496                             __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])))
37497                         } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
37498                             return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37499                         }
37500                     }
37501                     break;
37502             }
37503 #endif
37504 #if CYTHON_COMPILING_IN_CPYTHON
37505             if (unlikely(Py_SIZE(x) < 0)) {
37506                 goto raise_neg_overflow;
37507             }
37508 #else
37509             {
37510                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
37511                 if (unlikely(result < 0))
37512                     return (int) -1;
37513                 if (unlikely(result == 1))
37514                     goto raise_neg_overflow;
37515             }
37516 #endif
37517             if (sizeof(int) <= sizeof(unsigned long)) {
37518                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
37519 #ifdef HAVE_LONG_LONG
37520             } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
37521                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
37522 #endif
37523             }
37524         } else {
37525 #if CYTHON_USE_PYLONG_INTERNALS
37526             const digit* digits = ((PyLongObject*)x)->ob_digit;
37527             switch (Py_SIZE(x)) {
37528                 case  0: return (int) 0;
37529                 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
37530                 case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
37531                 case -2:
37532                     if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
37533                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
37534                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37535                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
37536                             return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
37537                         }
37538                     }
37539                     break;
37540                 case 2:
37541                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
37542                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
37543                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37544                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
37545                             return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
37546                         }
37547                     }
37548                     break;
37549                 case -3:
37550                     if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
37551                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
37552                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37553                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
37554                             return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
37555                         }
37556                     }
37557                     break;
37558                 case 3:
37559                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
37560                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
37561                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37562                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
37563                             return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
37564                         }
37565                     }
37566                     break;
37567                 case -4:
37568                     if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
37569                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
37570                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37571                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
37572                             return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
37573                         }
37574                     }
37575                     break;
37576                 case 4:
37577                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
37578                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
37579                             __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])))
37580                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
37581                             return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
37582                         }
37583                     }
37584                     break;
37585             }
37586 #endif
37587             if (sizeof(int) <= sizeof(long)) {
37588                 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
37589 #ifdef HAVE_LONG_LONG
37590             } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
37591                 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
37592 #endif
37593             }
37594         }
37595         {
37596 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
37597             PyErr_SetString(PyExc_RuntimeError,
37598                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
37599 #else
37600             int val;
37601             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
37602  #if PY_MAJOR_VERSION < 3
37603             if (likely(v) && !PyLong_Check(v)) {
37604                 PyObject *tmp = v;
37605                 v = PyNumber_Long(tmp);
37606                 Py_DECREF(tmp);
37607             }
37608  #endif
37609             if (likely(v)) {
37610                 int one = 1; int is_little = (int)*(unsigned char *)&one;
37611                 unsigned char *bytes = (unsigned char *)&val;
37612                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
37613                                               bytes, sizeof(val),
37614                                               is_little, !is_unsigned);
37615                 Py_DECREF(v);
37616                 if (likely(!ret))
37617                     return val;
37618             }
37619 #endif
37620             return (int) -1;
37621         }
37622     } else {
37623         int val;
37624         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
37625         if (!tmp) return (int) -1;
37626         val = __Pyx_PyInt_As_int(tmp);
37627         Py_DECREF(tmp);
37628         return val;
37629     }
37630 raise_overflow:
37631     PyErr_SetString(PyExc_OverflowError,
37632         "value too large to convert to int");
37633     return (int) -1;
37634 raise_neg_overflow:
37635     PyErr_SetString(PyExc_OverflowError,
37636         "can't convert negative value to int");
37637     return (int) -1;
37638 }
37639 
37640 /* TypeInfoToFormat */
__Pyx_TypeInfoToFormat(__Pyx_TypeInfo * type)37641   static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) {
37642     struct __pyx_typeinfo_string result = { {0} };
37643     char *buf = (char *) result.string;
37644     size_t size = type->size;
37645     switch (type->typegroup) {
37646         case 'H':
37647             *buf = 'c';
37648             break;
37649         case 'I':
37650         case 'U':
37651             if (size == 1)
37652                 *buf = (type->is_unsigned) ? 'B' : 'b';
37653             else if (size == 2)
37654                 *buf = (type->is_unsigned) ? 'H' : 'h';
37655             else if (size == 4)
37656                 *buf = (type->is_unsigned) ? 'I' : 'i';
37657             else if (size == 8)
37658                 *buf = (type->is_unsigned) ? 'Q' : 'q';
37659             break;
37660         case 'P':
37661             *buf = 'P';
37662             break;
37663         case 'C':
37664          {
37665             __Pyx_TypeInfo complex_type = *type;
37666             complex_type.typegroup = 'R';
37667             complex_type.size /= 2;
37668             *buf++ = 'Z';
37669             *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0];
37670             break;
37671          }
37672         case 'R':
37673             if (size == 4)
37674                 *buf = 'f';
37675             else if (size == 8)
37676                 *buf = 'd';
37677             else
37678                 *buf = 'g';
37679             break;
37680     }
37681     return result;
37682 }
37683 
37684 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)37685   static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
37686 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37687 #pragma GCC diagnostic push
37688 #pragma GCC diagnostic ignored "-Wconversion"
37689 #endif
37690     const long neg_one = (long) -1, const_zero = (long) 0;
37691 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37692 #pragma GCC diagnostic pop
37693 #endif
37694     const int is_unsigned = neg_one > const_zero;
37695 #if PY_MAJOR_VERSION < 3
37696     if (likely(PyInt_Check(x))) {
37697         if (sizeof(long) < sizeof(long)) {
37698             __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
37699         } else {
37700             long val = PyInt_AS_LONG(x);
37701             if (is_unsigned && unlikely(val < 0)) {
37702                 goto raise_neg_overflow;
37703             }
37704             return (long) val;
37705         }
37706     } else
37707 #endif
37708     if (likely(PyLong_Check(x))) {
37709         if (is_unsigned) {
37710 #if CYTHON_USE_PYLONG_INTERNALS
37711             const digit* digits = ((PyLongObject*)x)->ob_digit;
37712             switch (Py_SIZE(x)) {
37713                 case  0: return (long) 0;
37714                 case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
37715                 case 2:
37716                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
37717                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
37718                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37719                         } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
37720                             return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
37721                         }
37722                     }
37723                     break;
37724                 case 3:
37725                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
37726                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
37727                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37728                         } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
37729                             return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
37730                         }
37731                     }
37732                     break;
37733                 case 4:
37734                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
37735                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
37736                             __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])))
37737                         } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
37738                             return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
37739                         }
37740                     }
37741                     break;
37742             }
37743 #endif
37744 #if CYTHON_COMPILING_IN_CPYTHON
37745             if (unlikely(Py_SIZE(x) < 0)) {
37746                 goto raise_neg_overflow;
37747             }
37748 #else
37749             {
37750                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
37751                 if (unlikely(result < 0))
37752                     return (long) -1;
37753                 if (unlikely(result == 1))
37754                     goto raise_neg_overflow;
37755             }
37756 #endif
37757             if (sizeof(long) <= sizeof(unsigned long)) {
37758                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
37759 #ifdef HAVE_LONG_LONG
37760             } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
37761                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
37762 #endif
37763             }
37764         } else {
37765 #if CYTHON_USE_PYLONG_INTERNALS
37766             const digit* digits = ((PyLongObject*)x)->ob_digit;
37767             switch (Py_SIZE(x)) {
37768                 case  0: return (long) 0;
37769                 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
37770                 case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
37771                 case -2:
37772                     if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
37773                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
37774                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37775                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
37776                             return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
37777                         }
37778                     }
37779                     break;
37780                 case 2:
37781                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
37782                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
37783                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37784                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
37785                             return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
37786                         }
37787                     }
37788                     break;
37789                 case -3:
37790                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
37791                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
37792                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37793                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
37794                             return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
37795                         }
37796                     }
37797                     break;
37798                 case 3:
37799                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
37800                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
37801                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37802                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
37803                             return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
37804                         }
37805                     }
37806                     break;
37807                 case -4:
37808                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
37809                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
37810                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37811                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
37812                             return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
37813                         }
37814                     }
37815                     break;
37816                 case 4:
37817                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
37818                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
37819                             __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])))
37820                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
37821                             return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
37822                         }
37823                     }
37824                     break;
37825             }
37826 #endif
37827             if (sizeof(long) <= sizeof(long)) {
37828                 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
37829 #ifdef HAVE_LONG_LONG
37830             } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
37831                 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
37832 #endif
37833             }
37834         }
37835         {
37836 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
37837             PyErr_SetString(PyExc_RuntimeError,
37838                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
37839 #else
37840             long val;
37841             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
37842  #if PY_MAJOR_VERSION < 3
37843             if (likely(v) && !PyLong_Check(v)) {
37844                 PyObject *tmp = v;
37845                 v = PyNumber_Long(tmp);
37846                 Py_DECREF(tmp);
37847             }
37848  #endif
37849             if (likely(v)) {
37850                 int one = 1; int is_little = (int)*(unsigned char *)&one;
37851                 unsigned char *bytes = (unsigned char *)&val;
37852                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
37853                                               bytes, sizeof(val),
37854                                               is_little, !is_unsigned);
37855                 Py_DECREF(v);
37856                 if (likely(!ret))
37857                     return val;
37858             }
37859 #endif
37860             return (long) -1;
37861         }
37862     } else {
37863         long val;
37864         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
37865         if (!tmp) return (long) -1;
37866         val = __Pyx_PyInt_As_long(tmp);
37867         Py_DECREF(tmp);
37868         return val;
37869     }
37870 raise_overflow:
37871     PyErr_SetString(PyExc_OverflowError,
37872         "value too large to convert to long");
37873     return (long) -1;
37874 raise_neg_overflow:
37875     PyErr_SetString(PyExc_OverflowError,
37876         "can't convert negative value to long");
37877     return (long) -1;
37878 }
37879 
37880 /* CIntToPy */
__Pyx_PyInt_From_long(long value)37881   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
37882 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37883 #pragma GCC diagnostic push
37884 #pragma GCC diagnostic ignored "-Wconversion"
37885 #endif
37886     const long neg_one = (long) -1, const_zero = (long) 0;
37887 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37888 #pragma GCC diagnostic pop
37889 #endif
37890     const int is_unsigned = neg_one > const_zero;
37891     if (is_unsigned) {
37892         if (sizeof(long) < sizeof(long)) {
37893             return PyInt_FromLong((long) value);
37894         } else if (sizeof(long) <= sizeof(unsigned long)) {
37895             return PyLong_FromUnsignedLong((unsigned long) value);
37896 #ifdef HAVE_LONG_LONG
37897         } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
37898             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
37899 #endif
37900         }
37901     } else {
37902         if (sizeof(long) <= sizeof(long)) {
37903             return PyInt_FromLong((long) value);
37904 #ifdef HAVE_LONG_LONG
37905         } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
37906             return PyLong_FromLongLong((PY_LONG_LONG) value);
37907 #endif
37908         }
37909     }
37910     {
37911         int one = 1; int little = (int)*(unsigned char *)&one;
37912         unsigned char *bytes = (unsigned char *)&value;
37913         return _PyLong_FromByteArray(bytes, sizeof(long),
37914                                      little, !is_unsigned);
37915     }
37916 }
37917 
37918 /* CIntFromPy */
__Pyx_PyInt_As_size_t(PyObject * x)37919   static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
37920 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37921 #pragma GCC diagnostic push
37922 #pragma GCC diagnostic ignored "-Wconversion"
37923 #endif
37924     const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
37925 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37926 #pragma GCC diagnostic pop
37927 #endif
37928     const int is_unsigned = neg_one > const_zero;
37929 #if PY_MAJOR_VERSION < 3
37930     if (likely(PyInt_Check(x))) {
37931         if (sizeof(size_t) < sizeof(long)) {
37932             __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
37933         } else {
37934             long val = PyInt_AS_LONG(x);
37935             if (is_unsigned && unlikely(val < 0)) {
37936                 goto raise_neg_overflow;
37937             }
37938             return (size_t) val;
37939         }
37940     } else
37941 #endif
37942     if (likely(PyLong_Check(x))) {
37943         if (is_unsigned) {
37944 #if CYTHON_USE_PYLONG_INTERNALS
37945             const digit* digits = ((PyLongObject*)x)->ob_digit;
37946             switch (Py_SIZE(x)) {
37947                 case  0: return (size_t) 0;
37948                 case  1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
37949                 case 2:
37950                     if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
37951                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
37952                             __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37953                         } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
37954                             return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
37955                         }
37956                     }
37957                     break;
37958                 case 3:
37959                     if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
37960                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
37961                             __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37962                         } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
37963                             return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
37964                         }
37965                     }
37966                     break;
37967                 case 4:
37968                     if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
37969                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
37970                             __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37971                         } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) {
37972                             return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
37973                         }
37974                     }
37975                     break;
37976             }
37977 #endif
37978 #if CYTHON_COMPILING_IN_CPYTHON
37979             if (unlikely(Py_SIZE(x) < 0)) {
37980                 goto raise_neg_overflow;
37981             }
37982 #else
37983             {
37984                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
37985                 if (unlikely(result < 0))
37986                     return (size_t) -1;
37987                 if (unlikely(result == 1))
37988                     goto raise_neg_overflow;
37989             }
37990 #endif
37991             if (sizeof(size_t) <= sizeof(unsigned long)) {
37992                 __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
37993 #ifdef HAVE_LONG_LONG
37994             } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
37995                 __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
37996 #endif
37997             }
37998         } else {
37999 #if CYTHON_USE_PYLONG_INTERNALS
38000             const digit* digits = ((PyLongObject*)x)->ob_digit;
38001             switch (Py_SIZE(x)) {
38002                 case  0: return (size_t) 0;
38003                 case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
38004                 case  1: __PYX_VERIFY_RETURN_INT(size_t,  digit, +digits[0])
38005                 case -2:
38006                     if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
38007                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
38008                             __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38009                         } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
38010                             return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
38011                         }
38012                     }
38013                     break;
38014                 case 2:
38015                     if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
38016                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
38017                             __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38018                         } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
38019                             return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
38020                         }
38021                     }
38022                     break;
38023                 case -3:
38024                     if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
38025                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
38026                             __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38027                         } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
38028                             return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
38029                         }
38030                     }
38031                     break;
38032                 case 3:
38033                     if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
38034                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
38035                             __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38036                         } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
38037                             return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
38038                         }
38039                     }
38040                     break;
38041                 case -4:
38042                     if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
38043                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
38044                             __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38045                         } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
38046                             return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
38047                         }
38048                     }
38049                     break;
38050                 case 4:
38051                     if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
38052                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
38053                             __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38054                         } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
38055                             return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
38056                         }
38057                     }
38058                     break;
38059             }
38060 #endif
38061             if (sizeof(size_t) <= sizeof(long)) {
38062                 __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
38063 #ifdef HAVE_LONG_LONG
38064             } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
38065                 __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
38066 #endif
38067             }
38068         }
38069         {
38070 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
38071             PyErr_SetString(PyExc_RuntimeError,
38072                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
38073 #else
38074             size_t val;
38075             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
38076  #if PY_MAJOR_VERSION < 3
38077             if (likely(v) && !PyLong_Check(v)) {
38078                 PyObject *tmp = v;
38079                 v = PyNumber_Long(tmp);
38080                 Py_DECREF(tmp);
38081             }
38082  #endif
38083             if (likely(v)) {
38084                 int one = 1; int is_little = (int)*(unsigned char *)&one;
38085                 unsigned char *bytes = (unsigned char *)&val;
38086                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
38087                                               bytes, sizeof(val),
38088                                               is_little, !is_unsigned);
38089                 Py_DECREF(v);
38090                 if (likely(!ret))
38091                     return val;
38092             }
38093 #endif
38094             return (size_t) -1;
38095         }
38096     } else {
38097         size_t val;
38098         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
38099         if (!tmp) return (size_t) -1;
38100         val = __Pyx_PyInt_As_size_t(tmp);
38101         Py_DECREF(tmp);
38102         return val;
38103     }
38104 raise_overflow:
38105     PyErr_SetString(PyExc_OverflowError,
38106         "value too large to convert to size_t");
38107     return (size_t) -1;
38108 raise_neg_overflow:
38109     PyErr_SetString(PyExc_OverflowError,
38110         "can't convert negative value to size_t");
38111     return (size_t) -1;
38112 }
38113 
38114 /* CIntFromPy */
__Pyx_PyInt_As_char(PyObject * x)38115   static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
38116 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38117 #pragma GCC diagnostic push
38118 #pragma GCC diagnostic ignored "-Wconversion"
38119 #endif
38120     const char neg_one = (char) -1, const_zero = (char) 0;
38121 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38122 #pragma GCC diagnostic pop
38123 #endif
38124     const int is_unsigned = neg_one > const_zero;
38125 #if PY_MAJOR_VERSION < 3
38126     if (likely(PyInt_Check(x))) {
38127         if (sizeof(char) < sizeof(long)) {
38128             __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
38129         } else {
38130             long val = PyInt_AS_LONG(x);
38131             if (is_unsigned && unlikely(val < 0)) {
38132                 goto raise_neg_overflow;
38133             }
38134             return (char) val;
38135         }
38136     } else
38137 #endif
38138     if (likely(PyLong_Check(x))) {
38139         if (is_unsigned) {
38140 #if CYTHON_USE_PYLONG_INTERNALS
38141             const digit* digits = ((PyLongObject*)x)->ob_digit;
38142             switch (Py_SIZE(x)) {
38143                 case  0: return (char) 0;
38144                 case  1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
38145                 case 2:
38146                     if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
38147                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
38148                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38149                         } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
38150                             return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
38151                         }
38152                     }
38153                     break;
38154                 case 3:
38155                     if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
38156                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
38157                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38158                         } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
38159                             return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
38160                         }
38161                     }
38162                     break;
38163                 case 4:
38164                     if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
38165                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
38166                             __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])))
38167                         } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
38168                             return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
38169                         }
38170                     }
38171                     break;
38172             }
38173 #endif
38174 #if CYTHON_COMPILING_IN_CPYTHON
38175             if (unlikely(Py_SIZE(x) < 0)) {
38176                 goto raise_neg_overflow;
38177             }
38178 #else
38179             {
38180                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
38181                 if (unlikely(result < 0))
38182                     return (char) -1;
38183                 if (unlikely(result == 1))
38184                     goto raise_neg_overflow;
38185             }
38186 #endif
38187             if (sizeof(char) <= sizeof(unsigned long)) {
38188                 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
38189 #ifdef HAVE_LONG_LONG
38190             } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
38191                 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
38192 #endif
38193             }
38194         } else {
38195 #if CYTHON_USE_PYLONG_INTERNALS
38196             const digit* digits = ((PyLongObject*)x)->ob_digit;
38197             switch (Py_SIZE(x)) {
38198                 case  0: return (char) 0;
38199                 case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
38200                 case  1: __PYX_VERIFY_RETURN_INT(char,  digit, +digits[0])
38201                 case -2:
38202                     if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
38203                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
38204                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38205                         } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
38206                             return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
38207                         }
38208                     }
38209                     break;
38210                 case 2:
38211                     if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
38212                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
38213                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38214                         } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
38215                             return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
38216                         }
38217                     }
38218                     break;
38219                 case -3:
38220                     if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
38221                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
38222                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38223                         } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
38224                             return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
38225                         }
38226                     }
38227                     break;
38228                 case 3:
38229                     if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
38230                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
38231                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38232                         } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
38233                             return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
38234                         }
38235                     }
38236                     break;
38237                 case -4:
38238                     if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
38239                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
38240                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38241                         } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
38242                             return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
38243                         }
38244                     }
38245                     break;
38246                 case 4:
38247                     if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
38248                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
38249                             __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])))
38250                         } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
38251                             return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
38252                         }
38253                     }
38254                     break;
38255             }
38256 #endif
38257             if (sizeof(char) <= sizeof(long)) {
38258                 __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
38259 #ifdef HAVE_LONG_LONG
38260             } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
38261                 __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
38262 #endif
38263             }
38264         }
38265         {
38266 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
38267             PyErr_SetString(PyExc_RuntimeError,
38268                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
38269 #else
38270             char val;
38271             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
38272  #if PY_MAJOR_VERSION < 3
38273             if (likely(v) && !PyLong_Check(v)) {
38274                 PyObject *tmp = v;
38275                 v = PyNumber_Long(tmp);
38276                 Py_DECREF(tmp);
38277             }
38278  #endif
38279             if (likely(v)) {
38280                 int one = 1; int is_little = (int)*(unsigned char *)&one;
38281                 unsigned char *bytes = (unsigned char *)&val;
38282                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
38283                                               bytes, sizeof(val),
38284                                               is_little, !is_unsigned);
38285                 Py_DECREF(v);
38286                 if (likely(!ret))
38287                     return val;
38288             }
38289 #endif
38290             return (char) -1;
38291         }
38292     } else {
38293         char val;
38294         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
38295         if (!tmp) return (char) -1;
38296         val = __Pyx_PyInt_As_char(tmp);
38297         Py_DECREF(tmp);
38298         return val;
38299     }
38300 raise_overflow:
38301     PyErr_SetString(PyExc_OverflowError,
38302         "value too large to convert to char");
38303     return (char) -1;
38304 raise_neg_overflow:
38305     PyErr_SetString(PyExc_OverflowError,
38306         "can't convert negative value to char");
38307     return (char) -1;
38308 }
38309 
38310 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_dc_int(PyObject * obj,int writable_flag)38311   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_int(PyObject *obj, int writable_flag) {
38312     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
38313     __Pyx_BufFmt_StackElem stack[1];
38314     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
38315     int retcode;
38316     if (obj == Py_None) {
38317         result.memview = (struct __pyx_memoryview_obj *) Py_None;
38318         return result;
38319     }
38320     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
38321                                                  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
38322                                                  &__Pyx_TypeInfo_int, stack,
38323                                                  &result, obj);
38324     if (unlikely(retcode == -1))
38325         goto __pyx_fail;
38326     return result;
38327 __pyx_fail:
38328     result.memview = NULL;
38329     result.data = NULL;
38330     return result;
38331 }
38332 
38333 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)38334   static int __Pyx_check_binary_version(void) {
38335     char ctversion[4], rtversion[4];
38336     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
38337     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
38338     if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
38339         char message[200];
38340         PyOS_snprintf(message, sizeof(message),
38341                       "compiletime version %s of module '%.100s' "
38342                       "does not match runtime version %s",
38343                       ctversion, __Pyx_MODULE_NAME, rtversion);
38344         return PyErr_WarnEx(NULL, message, 1);
38345     }
38346     return 0;
38347 }
38348 
38349 /* FunctionExport */
__Pyx_ExportFunction(const char * name,void (* f)(void),const char * sig)38350   static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
38351     PyObject *d = 0;
38352     PyObject *cobj = 0;
38353     union {
38354         void (*fp)(void);
38355         void *p;
38356     } tmp;
38357     d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
38358     if (!d) {
38359         PyErr_Clear();
38360         d = PyDict_New();
38361         if (!d)
38362             goto bad;
38363         Py_INCREF(d);
38364         if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
38365             goto bad;
38366     }
38367     tmp.fp = f;
38368 #if PY_VERSION_HEX >= 0x02070000
38369     cobj = PyCapsule_New(tmp.p, sig, 0);
38370 #else
38371     cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
38372 #endif
38373     if (!cobj)
38374         goto bad;
38375     if (PyDict_SetItemString(d, name, cobj) < 0)
38376         goto bad;
38377     Py_DECREF(cobj);
38378     Py_DECREF(d);
38379     return 0;
38380 bad:
38381     Py_XDECREF(cobj);
38382     Py_XDECREF(d);
38383     return -1;
38384 }
38385 
38386 /* FunctionImport */
38387   #ifndef __PYX_HAVE_RT_ImportFunction
38388 #define __PYX_HAVE_RT_ImportFunction
__Pyx_ImportFunction(PyObject * module,const char * funcname,void (** f)(void),const char * sig)38389 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
38390     PyObject *d = 0;
38391     PyObject *cobj = 0;
38392     union {
38393         void (*fp)(void);
38394         void *p;
38395     } tmp;
38396     d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
38397     if (!d)
38398         goto bad;
38399     cobj = PyDict_GetItemString(d, funcname);
38400     if (!cobj) {
38401         PyErr_Format(PyExc_ImportError,
38402             "%.200s does not export expected C function %.200s",
38403                 PyModule_GetName(module), funcname);
38404         goto bad;
38405     }
38406 #if PY_VERSION_HEX >= 0x02070000
38407     if (!PyCapsule_IsValid(cobj, sig)) {
38408         PyErr_Format(PyExc_TypeError,
38409             "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
38410              PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
38411         goto bad;
38412     }
38413     tmp.p = PyCapsule_GetPointer(cobj, sig);
38414 #else
38415     {const char *desc, *s1, *s2;
38416     desc = (const char *)PyCObject_GetDesc(cobj);
38417     if (!desc)
38418         goto bad;
38419     s1 = desc; s2 = sig;
38420     while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
38421     if (*s1 != *s2) {
38422         PyErr_Format(PyExc_TypeError,
38423             "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
38424              PyModule_GetName(module), funcname, sig, desc);
38425         goto bad;
38426     }
38427     tmp.p = PyCObject_AsVoidPtr(cobj);}
38428 #endif
38429     *f = tmp.fp;
38430     if (!(*f))
38431         goto bad;
38432     Py_DECREF(d);
38433     return 0;
38434 bad:
38435     Py_XDECREF(d);
38436     return -1;
38437 }
38438 #endif
38439 
38440 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)38441   static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
38442     while (t->p) {
38443         #if PY_MAJOR_VERSION < 3
38444         if (t->is_unicode) {
38445             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
38446         } else if (t->intern) {
38447             *t->p = PyString_InternFromString(t->s);
38448         } else {
38449             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
38450         }
38451         #else
38452         if (t->is_unicode | t->is_str) {
38453             if (t->intern) {
38454                 *t->p = PyUnicode_InternFromString(t->s);
38455             } else if (t->encoding) {
38456                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
38457             } else {
38458                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
38459             }
38460         } else {
38461             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
38462         }
38463         #endif
38464         if (!*t->p)
38465             return -1;
38466         if (PyObject_Hash(*t->p) == -1)
38467             return -1;
38468         ++t;
38469     }
38470     return 0;
38471 }
38472 
__Pyx_PyUnicode_FromString(const char * c_str)38473 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
38474     return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
38475 }
__Pyx_PyObject_AsString(PyObject * o)38476 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
38477     Py_ssize_t ignore;
38478     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
38479 }
38480 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
38481 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)38482 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
38483     char* defenc_c;
38484     PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
38485     if (!defenc) return NULL;
38486     defenc_c = PyBytes_AS_STRING(defenc);
38487 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
38488     {
38489         char* end = defenc_c + PyBytes_GET_SIZE(defenc);
38490         char* c;
38491         for (c = defenc_c; c < end; c++) {
38492             if ((unsigned char) (*c) >= 128) {
38493                 PyUnicode_AsASCIIString(o);
38494                 return NULL;
38495             }
38496         }
38497     }
38498 #endif
38499     *length = PyBytes_GET_SIZE(defenc);
38500     return defenc_c;
38501 }
38502 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)38503 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
38504     if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
38505 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
38506     if (likely(PyUnicode_IS_ASCII(o))) {
38507         *length = PyUnicode_GET_LENGTH(o);
38508         return PyUnicode_AsUTF8(o);
38509     } else {
38510         PyUnicode_AsASCIIString(o);
38511         return NULL;
38512     }
38513 #else
38514     return PyUnicode_AsUTF8AndSize(o, length);
38515 #endif
38516 }
38517 #endif
38518 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)38519 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
38520 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
38521     if (
38522 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
38523             __Pyx_sys_getdefaultencoding_not_ascii &&
38524 #endif
38525             PyUnicode_Check(o)) {
38526         return __Pyx_PyUnicode_AsStringAndSize(o, length);
38527     } else
38528 #endif
38529 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
38530     if (PyByteArray_Check(o)) {
38531         *length = PyByteArray_GET_SIZE(o);
38532         return PyByteArray_AS_STRING(o);
38533     } else
38534 #endif
38535     {
38536         char* result;
38537         int r = PyBytes_AsStringAndSize(o, &result, length);
38538         if (unlikely(r < 0)) {
38539             return NULL;
38540         } else {
38541             return result;
38542         }
38543     }
38544 }
__Pyx_PyObject_IsTrue(PyObject * x)38545 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
38546    int is_true = x == Py_True;
38547    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
38548    else return PyObject_IsTrue(x);
38549 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)38550 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
38551     int retval;
38552     if (unlikely(!x)) return -1;
38553     retval = __Pyx_PyObject_IsTrue(x);
38554     Py_DECREF(x);
38555     return retval;
38556 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)38557 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
38558 #if PY_MAJOR_VERSION >= 3
38559     if (PyLong_Check(result)) {
38560         if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
38561                 "__int__ returned non-int (type %.200s).  "
38562                 "The ability to return an instance of a strict subclass of int "
38563                 "is deprecated, and may be removed in a future version of Python.",
38564                 Py_TYPE(result)->tp_name)) {
38565             Py_DECREF(result);
38566             return NULL;
38567         }
38568         return result;
38569     }
38570 #endif
38571     PyErr_Format(PyExc_TypeError,
38572                  "__%.4s__ returned non-%.4s (type %.200s)",
38573                  type_name, type_name, Py_TYPE(result)->tp_name);
38574     Py_DECREF(result);
38575     return NULL;
38576 }
__Pyx_PyNumber_IntOrLong(PyObject * x)38577 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
38578 #if CYTHON_USE_TYPE_SLOTS
38579   PyNumberMethods *m;
38580 #endif
38581   const char *name = NULL;
38582   PyObject *res = NULL;
38583 #if PY_MAJOR_VERSION < 3
38584   if (likely(PyInt_Check(x) || PyLong_Check(x)))
38585 #else
38586   if (likely(PyLong_Check(x)))
38587 #endif
38588     return __Pyx_NewRef(x);
38589 #if CYTHON_USE_TYPE_SLOTS
38590   m = Py_TYPE(x)->tp_as_number;
38591   #if PY_MAJOR_VERSION < 3
38592   if (m && m->nb_int) {
38593     name = "int";
38594     res = m->nb_int(x);
38595   }
38596   else if (m && m->nb_long) {
38597     name = "long";
38598     res = m->nb_long(x);
38599   }
38600   #else
38601   if (likely(m && m->nb_int)) {
38602     name = "int";
38603     res = m->nb_int(x);
38604   }
38605   #endif
38606 #else
38607   if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
38608     res = PyNumber_Int(x);
38609   }
38610 #endif
38611   if (likely(res)) {
38612 #if PY_MAJOR_VERSION < 3
38613     if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
38614 #else
38615     if (unlikely(!PyLong_CheckExact(res))) {
38616 #endif
38617         return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
38618     }
38619   }
38620   else if (!PyErr_Occurred()) {
38621     PyErr_SetString(PyExc_TypeError,
38622                     "an integer is required");
38623   }
38624   return res;
38625 }
38626 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
38627   Py_ssize_t ival;
38628   PyObject *x;
38629 #if PY_MAJOR_VERSION < 3
38630   if (likely(PyInt_CheckExact(b))) {
38631     if (sizeof(Py_ssize_t) >= sizeof(long))
38632         return PyInt_AS_LONG(b);
38633     else
38634         return PyInt_AsSsize_t(b);
38635   }
38636 #endif
38637   if (likely(PyLong_CheckExact(b))) {
38638     #if CYTHON_USE_PYLONG_INTERNALS
38639     const digit* digits = ((PyLongObject*)b)->ob_digit;
38640     const Py_ssize_t size = Py_SIZE(b);
38641     if (likely(__Pyx_sst_abs(size) <= 1)) {
38642         ival = likely(size) ? digits[0] : 0;
38643         if (size == -1) ival = -ival;
38644         return ival;
38645     } else {
38646       switch (size) {
38647          case 2:
38648            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
38649              return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
38650            }
38651            break;
38652          case -2:
38653            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
38654              return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
38655            }
38656            break;
38657          case 3:
38658            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
38659              return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
38660            }
38661            break;
38662          case -3:
38663            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
38664              return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
38665            }
38666            break;
38667          case 4:
38668            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
38669              return (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]));
38670            }
38671            break;
38672          case -4:
38673            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
38674              return -(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]));
38675            }
38676            break;
38677       }
38678     }
38679     #endif
38680     return PyLong_AsSsize_t(b);
38681   }
38682   x = PyNumber_Index(b);
38683   if (!x) return -1;
38684   ival = PyInt_AsSsize_t(x);
38685   Py_DECREF(x);
38686   return ival;
38687 }
38688 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
38689   return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
38690 }
38691 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
38692     return PyInt_FromSize_t(ival);
38693 }
38694 
38695 
38696 #endif /* Py_PYTHON_H */
38697