1 /* Generated by Cython 0.29.12 */
2 
3 /* BEGIN: Cython Metadata
4 {
5     "distutils": {
6         "depends": [
7             "yt/utilities/lib/platform_dep.h",
8             "yt/utilities/lib/tsearch.h"
9         ],
10         "include_dirs": [
11             "yt/utilities/lib/"
12         ],
13         "libraries": [
14             "m"
15         ],
16         "name": "yt.geometry.particle_smooth",
17         "sources": [
18             "yt/geometry/particle_smooth.pyx"
19         ]
20     },
21     "module_name": "yt.geometry.particle_smooth"
22 }
23 END: Cython Metadata */
24 
25 #define PY_SSIZE_T_CLEAN
26 #include "Python.h"
27 #ifndef Py_PYTHON_H
28     #error Python headers needed to compile C extensions, please install development version of Python.
29 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
30     #error Cython requires Python 2.6+ or Python 3.3+.
31 #else
32 #define CYTHON_ABI "0_29_12"
33 #define CYTHON_HEX_VERSION 0x001D0CF0
34 #define CYTHON_FUTURE_DIVISION 0
35 #include <stddef.h>
36 #ifndef offsetof
37   #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
38 #endif
39 #if !defined(WIN32) && !defined(MS_WINDOWS)
40   #ifndef __stdcall
41     #define __stdcall
42   #endif
43   #ifndef __cdecl
44     #define __cdecl
45   #endif
46   #ifndef __fastcall
47     #define __fastcall
48   #endif
49 #endif
50 #ifndef DL_IMPORT
51   #define DL_IMPORT(t) t
52 #endif
53 #ifndef DL_EXPORT
54   #define DL_EXPORT(t) t
55 #endif
56 #define __PYX_COMMA ,
57 #ifndef HAVE_LONG_LONG
58   #if PY_VERSION_HEX >= 0x02070000
59     #define HAVE_LONG_LONG
60   #endif
61 #endif
62 #ifndef PY_LONG_LONG
63   #define PY_LONG_LONG LONG_LONG
64 #endif
65 #ifndef Py_HUGE_VAL
66   #define Py_HUGE_VAL HUGE_VAL
67 #endif
68 #ifdef PYPY_VERSION
69   #define CYTHON_COMPILING_IN_PYPY 1
70   #define CYTHON_COMPILING_IN_PYSTON 0
71   #define CYTHON_COMPILING_IN_CPYTHON 0
72   #undef CYTHON_USE_TYPE_SLOTS
73   #define CYTHON_USE_TYPE_SLOTS 0
74   #undef CYTHON_USE_PYTYPE_LOOKUP
75   #define CYTHON_USE_PYTYPE_LOOKUP 0
76   #if PY_VERSION_HEX < 0x03050000
77     #undef CYTHON_USE_ASYNC_SLOTS
78     #define CYTHON_USE_ASYNC_SLOTS 0
79   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
80     #define CYTHON_USE_ASYNC_SLOTS 1
81   #endif
82   #undef CYTHON_USE_PYLIST_INTERNALS
83   #define CYTHON_USE_PYLIST_INTERNALS 0
84   #undef CYTHON_USE_UNICODE_INTERNALS
85   #define CYTHON_USE_UNICODE_INTERNALS 0
86   #undef CYTHON_USE_UNICODE_WRITER
87   #define CYTHON_USE_UNICODE_WRITER 0
88   #undef CYTHON_USE_PYLONG_INTERNALS
89   #define CYTHON_USE_PYLONG_INTERNALS 0
90   #undef CYTHON_AVOID_BORROWED_REFS
91   #define CYTHON_AVOID_BORROWED_REFS 1
92   #undef CYTHON_ASSUME_SAFE_MACROS
93   #define CYTHON_ASSUME_SAFE_MACROS 0
94   #undef CYTHON_UNPACK_METHODS
95   #define CYTHON_UNPACK_METHODS 0
96   #undef CYTHON_FAST_THREAD_STATE
97   #define CYTHON_FAST_THREAD_STATE 0
98   #undef CYTHON_FAST_PYCALL
99   #define CYTHON_FAST_PYCALL 0
100   #undef CYTHON_PEP489_MULTI_PHASE_INIT
101   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
102   #undef CYTHON_USE_TP_FINALIZE
103   #define CYTHON_USE_TP_FINALIZE 0
104   #undef CYTHON_USE_DICT_VERSIONS
105   #define CYTHON_USE_DICT_VERSIONS 0
106   #undef CYTHON_USE_EXC_INFO_STACK
107   #define CYTHON_USE_EXC_INFO_STACK 0
108 #elif defined(PYSTON_VERSION)
109   #define CYTHON_COMPILING_IN_PYPY 0
110   #define CYTHON_COMPILING_IN_PYSTON 1
111   #define CYTHON_COMPILING_IN_CPYTHON 0
112   #ifndef CYTHON_USE_TYPE_SLOTS
113     #define CYTHON_USE_TYPE_SLOTS 1
114   #endif
115   #undef CYTHON_USE_PYTYPE_LOOKUP
116   #define CYTHON_USE_PYTYPE_LOOKUP 0
117   #undef CYTHON_USE_ASYNC_SLOTS
118   #define CYTHON_USE_ASYNC_SLOTS 0
119   #undef CYTHON_USE_PYLIST_INTERNALS
120   #define CYTHON_USE_PYLIST_INTERNALS 0
121   #ifndef CYTHON_USE_UNICODE_INTERNALS
122     #define CYTHON_USE_UNICODE_INTERNALS 1
123   #endif
124   #undef CYTHON_USE_UNICODE_WRITER
125   #define CYTHON_USE_UNICODE_WRITER 0
126   #undef CYTHON_USE_PYLONG_INTERNALS
127   #define CYTHON_USE_PYLONG_INTERNALS 0
128   #ifndef CYTHON_AVOID_BORROWED_REFS
129     #define CYTHON_AVOID_BORROWED_REFS 0
130   #endif
131   #ifndef CYTHON_ASSUME_SAFE_MACROS
132     #define CYTHON_ASSUME_SAFE_MACROS 1
133   #endif
134   #ifndef CYTHON_UNPACK_METHODS
135     #define CYTHON_UNPACK_METHODS 1
136   #endif
137   #undef CYTHON_FAST_THREAD_STATE
138   #define CYTHON_FAST_THREAD_STATE 0
139   #undef CYTHON_FAST_PYCALL
140   #define CYTHON_FAST_PYCALL 0
141   #undef CYTHON_PEP489_MULTI_PHASE_INIT
142   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
143   #undef CYTHON_USE_TP_FINALIZE
144   #define CYTHON_USE_TP_FINALIZE 0
145   #undef CYTHON_USE_DICT_VERSIONS
146   #define CYTHON_USE_DICT_VERSIONS 0
147   #undef CYTHON_USE_EXC_INFO_STACK
148   #define CYTHON_USE_EXC_INFO_STACK 0
149 #else
150   #define CYTHON_COMPILING_IN_PYPY 0
151   #define CYTHON_COMPILING_IN_PYSTON 0
152   #define CYTHON_COMPILING_IN_CPYTHON 1
153   #ifndef CYTHON_USE_TYPE_SLOTS
154     #define CYTHON_USE_TYPE_SLOTS 1
155   #endif
156   #if PY_VERSION_HEX < 0x02070000
157     #undef CYTHON_USE_PYTYPE_LOOKUP
158     #define CYTHON_USE_PYTYPE_LOOKUP 0
159   #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
160     #define CYTHON_USE_PYTYPE_LOOKUP 1
161   #endif
162   #if PY_MAJOR_VERSION < 3
163     #undef CYTHON_USE_ASYNC_SLOTS
164     #define CYTHON_USE_ASYNC_SLOTS 0
165   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
166     #define CYTHON_USE_ASYNC_SLOTS 1
167   #endif
168   #if PY_VERSION_HEX < 0x02070000
169     #undef CYTHON_USE_PYLONG_INTERNALS
170     #define CYTHON_USE_PYLONG_INTERNALS 0
171   #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
172     #define CYTHON_USE_PYLONG_INTERNALS 1
173   #endif
174   #ifndef CYTHON_USE_PYLIST_INTERNALS
175     #define CYTHON_USE_PYLIST_INTERNALS 1
176   #endif
177   #ifndef CYTHON_USE_UNICODE_INTERNALS
178     #define CYTHON_USE_UNICODE_INTERNALS 1
179   #endif
180   #if PY_VERSION_HEX < 0x030300F0
181     #undef CYTHON_USE_UNICODE_WRITER
182     #define CYTHON_USE_UNICODE_WRITER 0
183   #elif !defined(CYTHON_USE_UNICODE_WRITER)
184     #define CYTHON_USE_UNICODE_WRITER 1
185   #endif
186   #ifndef CYTHON_AVOID_BORROWED_REFS
187     #define CYTHON_AVOID_BORROWED_REFS 0
188   #endif
189   #ifndef CYTHON_ASSUME_SAFE_MACROS
190     #define CYTHON_ASSUME_SAFE_MACROS 1
191   #endif
192   #ifndef CYTHON_UNPACK_METHODS
193     #define CYTHON_UNPACK_METHODS 1
194   #endif
195   #ifndef CYTHON_FAST_THREAD_STATE
196     #define CYTHON_FAST_THREAD_STATE 1
197   #endif
198   #ifndef CYTHON_FAST_PYCALL
199     #define CYTHON_FAST_PYCALL 1
200   #endif
201   #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
202     #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
203   #endif
204   #ifndef CYTHON_USE_TP_FINALIZE
205     #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
206   #endif
207   #ifndef CYTHON_USE_DICT_VERSIONS
208     #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
209   #endif
210   #ifndef CYTHON_USE_EXC_INFO_STACK
211     #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
212   #endif
213 #endif
214 #if !defined(CYTHON_FAST_PYCCALL)
215 #define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
216 #endif
217 #if CYTHON_USE_PYLONG_INTERNALS
218   #include "longintrepr.h"
219   #undef SHIFT
220   #undef BASE
221   #undef MASK
222   #ifdef SIZEOF_VOID_P
223     enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
224   #endif
225 #endif
226 #ifndef __has_attribute
227   #define __has_attribute(x) 0
228 #endif
229 #ifndef __has_cpp_attribute
230   #define __has_cpp_attribute(x) 0
231 #endif
232 #ifndef CYTHON_RESTRICT
233   #if defined(__GNUC__)
234     #define CYTHON_RESTRICT __restrict__
235   #elif defined(_MSC_VER) && _MSC_VER >= 1400
236     #define CYTHON_RESTRICT __restrict
237   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
238     #define CYTHON_RESTRICT restrict
239   #else
240     #define CYTHON_RESTRICT
241   #endif
242 #endif
243 #ifndef CYTHON_UNUSED
244 # if defined(__GNUC__)
245 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
246 #     define CYTHON_UNUSED __attribute__ ((__unused__))
247 #   else
248 #     define CYTHON_UNUSED
249 #   endif
250 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
251 #   define CYTHON_UNUSED __attribute__ ((__unused__))
252 # else
253 #   define CYTHON_UNUSED
254 # endif
255 #endif
256 #ifndef CYTHON_MAYBE_UNUSED_VAR
257 #  if defined(__cplusplus)
CYTHON_MAYBE_UNUSED_VAR(const T &)258      template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
259 #  else
260 #    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
261 #  endif
262 #endif
263 #ifndef CYTHON_NCP_UNUSED
264 # if CYTHON_COMPILING_IN_CPYTHON
265 #  define CYTHON_NCP_UNUSED
266 # else
267 #  define CYTHON_NCP_UNUSED CYTHON_UNUSED
268 # endif
269 #endif
270 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
271 #ifdef _MSC_VER
272     #ifndef _MSC_STDINT_H_
273         #if _MSC_VER < 1300
274            typedef unsigned char     uint8_t;
275            typedef unsigned int      uint32_t;
276         #else
277            typedef unsigned __int8   uint8_t;
278            typedef unsigned __int32  uint32_t;
279         #endif
280     #endif
281 #else
282    #include <stdint.h>
283 #endif
284 #ifndef CYTHON_FALLTHROUGH
285   #if defined(__cplusplus) && __cplusplus >= 201103L
286     #if __has_cpp_attribute(fallthrough)
287       #define CYTHON_FALLTHROUGH [[fallthrough]]
288     #elif __has_cpp_attribute(clang::fallthrough)
289       #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
290     #elif __has_cpp_attribute(gnu::fallthrough)
291       #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
292     #endif
293   #endif
294   #ifndef CYTHON_FALLTHROUGH
295     #if __has_attribute(fallthrough)
296       #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
297     #else
298       #define CYTHON_FALLTHROUGH
299     #endif
300   #endif
301   #if defined(__clang__ ) && defined(__apple_build_version__)
302     #if __apple_build_version__ < 7000000
303       #undef  CYTHON_FALLTHROUGH
304       #define CYTHON_FALLTHROUGH
305     #endif
306   #endif
307 #endif
308 
309 #ifndef CYTHON_INLINE
310   #if defined(__clang__)
311     #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
312   #elif defined(__GNUC__)
313     #define CYTHON_INLINE __inline__
314   #elif defined(_MSC_VER)
315     #define CYTHON_INLINE __inline
316   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
317     #define CYTHON_INLINE inline
318   #else
319     #define CYTHON_INLINE
320   #endif
321 #endif
322 
323 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
324   #define Py_OptimizeFlag 0
325 #endif
326 #define __PYX_BUILD_PY_SSIZE_T "n"
327 #define CYTHON_FORMAT_SSIZE_T "z"
328 #if PY_MAJOR_VERSION < 3
329   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
330   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
331           PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
332   #define __Pyx_DefaultClassType PyClass_Type
333 #else
334   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
335 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
336   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
337           PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
338 #else
339   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
340           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
341 #endif
342   #define __Pyx_DefaultClassType PyType_Type
343 #endif
344 #ifndef Py_TPFLAGS_CHECKTYPES
345   #define Py_TPFLAGS_CHECKTYPES 0
346 #endif
347 #ifndef Py_TPFLAGS_HAVE_INDEX
348   #define Py_TPFLAGS_HAVE_INDEX 0
349 #endif
350 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
351   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
352 #endif
353 #ifndef Py_TPFLAGS_HAVE_FINALIZE
354   #define Py_TPFLAGS_HAVE_FINALIZE 0
355 #endif
356 #ifndef METH_STACKLESS
357   #define METH_STACKLESS 0
358 #endif
359 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
360   #ifndef METH_FASTCALL
361      #define METH_FASTCALL 0x80
362   #endif
363   typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
364   typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
365                                                           Py_ssize_t nargs, PyObject *kwnames);
366 #else
367   #define __Pyx_PyCFunctionFast _PyCFunctionFast
368   #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
369 #endif
370 #if CYTHON_FAST_PYCCALL
371 #define __Pyx_PyFastCFunction_Check(func)\
372     ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
373 #else
374 #define __Pyx_PyFastCFunction_Check(func) 0
375 #endif
376 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
377   #define PyObject_Malloc(s)   PyMem_Malloc(s)
378   #define PyObject_Free(p)     PyMem_Free(p)
379   #define PyObject_Realloc(p)  PyMem_Realloc(p)
380 #endif
381 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
382   #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
383   #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
384   #define PyMem_RawFree(p)             PyMem_Free(p)
385 #endif
386 #if CYTHON_COMPILING_IN_PYSTON
387   #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
388   #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
389 #else
390   #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
391   #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
392 #endif
393 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
394   #define __Pyx_PyThreadState_Current PyThreadState_GET()
395 #elif PY_VERSION_HEX >= 0x03060000
396   #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
397 #elif PY_VERSION_HEX >= 0x03000000
398   #define __Pyx_PyThreadState_Current PyThreadState_GET()
399 #else
400   #define __Pyx_PyThreadState_Current _PyThreadState_Current
401 #endif
402 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
403 #include "pythread.h"
404 #define Py_tss_NEEDS_INIT 0
405 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)406 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
407   *key = PyThread_create_key();
408   return 0;
409 }
PyThread_tss_alloc(void)410 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
411   Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
412   *key = Py_tss_NEEDS_INIT;
413   return key;
414 }
PyThread_tss_free(Py_tss_t * key)415 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
416   PyObject_Free(key);
417 }
PyThread_tss_is_created(Py_tss_t * key)418 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
419   return *key != Py_tss_NEEDS_INIT;
420 }
PyThread_tss_delete(Py_tss_t * key)421 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
422   PyThread_delete_key(*key);
423   *key = Py_tss_NEEDS_INIT;
424 }
PyThread_tss_set(Py_tss_t * key,void * value)425 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
426   return PyThread_set_key_value(*key, value);
427 }
PyThread_tss_get(Py_tss_t * key)428 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
429   return PyThread_get_key_value(*key);
430 }
431 #endif
432 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
433 #define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
434 #else
435 #define __Pyx_PyDict_NewPresized(n)  PyDict_New()
436 #endif
437 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
438   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
439   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
440 #else
441   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
442   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
443 #endif
444 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
445 #define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
446 #else
447 #define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
448 #endif
449 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
450   #define CYTHON_PEP393_ENABLED 1
451   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
452                                               0 : _PyUnicode_Ready((PyObject *)(op)))
453   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
454   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
455   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
456   #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
457   #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
458   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
459   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
460   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
461 #else
462   #define CYTHON_PEP393_ENABLED 0
463   #define PyUnicode_1BYTE_KIND  1
464   #define PyUnicode_2BYTE_KIND  2
465   #define PyUnicode_4BYTE_KIND  4
466   #define __Pyx_PyUnicode_READY(op)       (0)
467   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
468   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
469   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
470   #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
471   #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
472   #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
473   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
474   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
475 #endif
476 #if CYTHON_COMPILING_IN_PYPY
477   #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
478   #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
479 #else
480   #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
481   #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
482       PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
483 #endif
484 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
485   #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
486 #endif
487 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
488   #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
489 #endif
490 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
491   #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
492 #endif
493 #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))
494 #define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
495 #if PY_MAJOR_VERSION >= 3
496   #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
497 #else
498   #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
499 #endif
500 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
501   #define PyObject_ASCII(o)            PyObject_Repr(o)
502 #endif
503 #if PY_MAJOR_VERSION >= 3
504   #define PyBaseString_Type            PyUnicode_Type
505   #define PyStringObject               PyUnicodeObject
506   #define PyString_Type                PyUnicode_Type
507   #define PyString_Check               PyUnicode_Check
508   #define PyString_CheckExact          PyUnicode_CheckExact
509   #define PyObject_Unicode             PyObject_Str
510 #endif
511 #if PY_MAJOR_VERSION >= 3
512   #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
513   #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
514 #else
515   #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
516   #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
517 #endif
518 #ifndef PySet_CheckExact
519   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
520 #endif
521 #if CYTHON_ASSUME_SAFE_MACROS
522   #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
523 #else
524   #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
525 #endif
526 #if PY_MAJOR_VERSION >= 3
527   #define PyIntObject                  PyLongObject
528   #define PyInt_Type                   PyLong_Type
529   #define PyInt_Check(op)              PyLong_Check(op)
530   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
531   #define PyInt_FromString             PyLong_FromString
532   #define PyInt_FromUnicode            PyLong_FromUnicode
533   #define PyInt_FromLong               PyLong_FromLong
534   #define PyInt_FromSize_t             PyLong_FromSize_t
535   #define PyInt_FromSsize_t            PyLong_FromSsize_t
536   #define PyInt_AsLong                 PyLong_AsLong
537   #define PyInt_AS_LONG                PyLong_AS_LONG
538   #define PyInt_AsSsize_t              PyLong_AsSsize_t
539   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
540   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
541   #define PyNumber_Int                 PyNumber_Long
542 #endif
543 #if PY_MAJOR_VERSION >= 3
544   #define PyBoolObject                 PyLongObject
545 #endif
546 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
547   #ifndef PyUnicode_InternFromString
548     #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
549   #endif
550 #endif
551 #if PY_VERSION_HEX < 0x030200A4
552   typedef long Py_hash_t;
553   #define __Pyx_PyInt_FromHash_t PyInt_FromLong
554   #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
555 #else
556   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
557   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
558 #endif
559 #if PY_MAJOR_VERSION >= 3
560   #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
561 #else
562   #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
563 #endif
564 #if CYTHON_USE_ASYNC_SLOTS
565   #if PY_VERSION_HEX >= 0x030500B1
566     #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
567     #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
568   #else
569     #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
570   #endif
571 #else
572   #define __Pyx_PyType_AsAsync(obj) NULL
573 #endif
574 #ifndef __Pyx_PyAsyncMethodsStruct
575     typedef struct {
576         unaryfunc am_await;
577         unaryfunc am_aiter;
578         unaryfunc am_anext;
579     } __Pyx_PyAsyncMethodsStruct;
580 #endif
581 
582 #if defined(WIN32) || defined(MS_WINDOWS)
583   #define _USE_MATH_DEFINES
584 #endif
585 #include <math.h>
586 #ifdef NAN
587 #define __PYX_NAN() ((float) NAN)
588 #else
__PYX_NAN()589 static CYTHON_INLINE float __PYX_NAN() {
590   float value;
591   memset(&value, 0xFF, sizeof(value));
592   return value;
593 }
594 #endif
595 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
596 #define __Pyx_truncl trunc
597 #else
598 #define __Pyx_truncl truncl
599 #endif
600 
601 
602 #define __PYX_ERR(f_index, lineno, Ln_error) \
603 { \
604   __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
605 }
606 
607 #ifndef __PYX_EXTERN_C
608   #ifdef __cplusplus
609     #define __PYX_EXTERN_C extern "C"
610   #else
611     #define __PYX_EXTERN_C extern
612   #endif
613 #endif
614 
615 #define __PYX_HAVE__yt__geometry__particle_smooth
616 #define __PYX_HAVE_API__yt__geometry__particle_smooth
617 /* Early includes */
618 #include <string.h>
619 #include <stdio.h>
620 #include "numpy/arrayobject.h"
621 #include "numpy/ufuncobject.h"
622 #include <math.h>
623 #include <stdlib.h>
624 #include <float.h>
625 #include "tsearch.h"
626 #include "numpy/npy_math.h"
627 #include "platform_dep.h"
628 #include "pythread.h"
629 #include "pystate.h"
630 #ifdef _OPENMP
631 #include <omp.h>
632 #endif /* _OPENMP */
633 
634 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
635 #define CYTHON_WITHOUT_ASSERTIONS
636 #endif
637 
638 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
639                 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
640 
641 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
642 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
643 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
644 #define __PYX_DEFAULT_STRING_ENCODING ""
645 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
646 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
647 #define __Pyx_uchar_cast(c) ((unsigned char)c)
648 #define __Pyx_long_cast(x) ((long)x)
649 #define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
650     (sizeof(type) < sizeof(Py_ssize_t))  ||\
651     (sizeof(type) > sizeof(Py_ssize_t) &&\
652           likely(v < (type)PY_SSIZE_T_MAX ||\
653                  v == (type)PY_SSIZE_T_MAX)  &&\
654           (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
655                                 v == (type)PY_SSIZE_T_MIN)))  ||\
656     (sizeof(type) == sizeof(Py_ssize_t) &&\
657           (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
658                                v == (type)PY_SSIZE_T_MAX)))  )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)659 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
660     return (size_t) i < (size_t) limit;
661 }
662 #if defined (__cplusplus) && __cplusplus >= 201103L
663     #include <cstdlib>
664     #define __Pyx_sst_abs(value) std::abs(value)
665 #elif SIZEOF_INT >= SIZEOF_SIZE_T
666     #define __Pyx_sst_abs(value) abs(value)
667 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
668     #define __Pyx_sst_abs(value) labs(value)
669 #elif defined (_MSC_VER)
670     #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
671 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
672     #define __Pyx_sst_abs(value) llabs(value)
673 #elif defined (__GNUC__)
674     #define __Pyx_sst_abs(value) __builtin_llabs(value)
675 #else
676     #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
677 #endif
678 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
679 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
680 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
681 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
682 #define __Pyx_PyBytes_FromString        PyBytes_FromString
683 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
684 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
685 #if PY_MAJOR_VERSION < 3
686     #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
687     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
688 #else
689     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
690     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
691 #endif
692 #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
693 #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
694 #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
695 #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
696 #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
697 #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
698 #define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
699 #define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
700 #define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
701 #define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
702 #define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
703 #define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
704 #define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
705 #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
706 #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
707 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)708 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
709     const Py_UNICODE *u_end = u;
710     while (*u_end++) ;
711     return (size_t)(u_end - u - 1);
712 }
713 #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
714 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
715 #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
716 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
717 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
718 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
719 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
720 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
721 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
722 #define __Pyx_PySequence_Tuple(obj)\
723     (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
724 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
725 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
726 #if CYTHON_ASSUME_SAFE_MACROS
727 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
728 #else
729 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
730 #endif
731 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
732 #if PY_MAJOR_VERSION >= 3
733 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
734 #else
735 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
736 #endif
737 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
738 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
739 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)740 static int __Pyx_init_sys_getdefaultencoding_params(void) {
741     PyObject* sys;
742     PyObject* default_encoding = NULL;
743     PyObject* ascii_chars_u = NULL;
744     PyObject* ascii_chars_b = NULL;
745     const char* default_encoding_c;
746     sys = PyImport_ImportModule("sys");
747     if (!sys) goto bad;
748     default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
749     Py_DECREF(sys);
750     if (!default_encoding) goto bad;
751     default_encoding_c = PyBytes_AsString(default_encoding);
752     if (!default_encoding_c) goto bad;
753     if (strcmp(default_encoding_c, "ascii") == 0) {
754         __Pyx_sys_getdefaultencoding_not_ascii = 0;
755     } else {
756         char ascii_chars[128];
757         int c;
758         for (c = 0; c < 128; c++) {
759             ascii_chars[c] = c;
760         }
761         __Pyx_sys_getdefaultencoding_not_ascii = 1;
762         ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
763         if (!ascii_chars_u) goto bad;
764         ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
765         if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
766             PyErr_Format(
767                 PyExc_ValueError,
768                 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
769                 default_encoding_c);
770             goto bad;
771         }
772         Py_DECREF(ascii_chars_u);
773         Py_DECREF(ascii_chars_b);
774     }
775     Py_DECREF(default_encoding);
776     return 0;
777 bad:
778     Py_XDECREF(default_encoding);
779     Py_XDECREF(ascii_chars_u);
780     Py_XDECREF(ascii_chars_b);
781     return -1;
782 }
783 #endif
784 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
785 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
786 #else
787 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
788 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
789 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)790 static int __Pyx_init_sys_getdefaultencoding_params(void) {
791     PyObject* sys;
792     PyObject* default_encoding = NULL;
793     char* default_encoding_c;
794     sys = PyImport_ImportModule("sys");
795     if (!sys) goto bad;
796     default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
797     Py_DECREF(sys);
798     if (!default_encoding) goto bad;
799     default_encoding_c = PyBytes_AsString(default_encoding);
800     if (!default_encoding_c) goto bad;
801     __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
802     if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
803     strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
804     Py_DECREF(default_encoding);
805     return 0;
806 bad:
807     Py_XDECREF(default_encoding);
808     return -1;
809 }
810 #endif
811 #endif
812 
813 
814 /* Test for GCC > 2.95 */
815 #if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
816   #define likely(x)   __builtin_expect(!!(x), 1)
817   #define unlikely(x) __builtin_expect(!!(x), 0)
818 #else /* !__GNUC__ or GCC < 2.95 */
819   #define likely(x)   (x)
820   #define unlikely(x) (x)
821 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)822 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
823 
824 static PyObject *__pyx_m = NULL;
825 static PyObject *__pyx_d;
826 static PyObject *__pyx_b;
827 static PyObject *__pyx_cython_runtime = NULL;
828 static PyObject *__pyx_empty_tuple;
829 static PyObject *__pyx_empty_bytes;
830 static PyObject *__pyx_empty_unicode;
831 static int __pyx_lineno;
832 static int __pyx_clineno = 0;
833 static const char * __pyx_cfilenm= __FILE__;
834 static const char *__pyx_filename;
835 
836 /* Header.proto */
837 #if !defined(CYTHON_CCOMPLEX)
838   #if defined(__cplusplus)
839     #define CYTHON_CCOMPLEX 1
840   #elif defined(_Complex_I)
841     #define CYTHON_CCOMPLEX 1
842   #else
843     #define CYTHON_CCOMPLEX 0
844   #endif
845 #endif
846 #if CYTHON_CCOMPLEX
847   #ifdef __cplusplus
848     #include <complex>
849   #else
850     #include <complex.h>
851   #endif
852 #endif
853 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
854   #undef _Complex_I
855   #define _Complex_I 1.0fj
856 #endif
857 
858 
859 static const char *__pyx_f[] = {
860   "yt/geometry/particle_smooth.pyx",
861   "stringsource",
862   "__init__.pxd",
863   "yt/utilities/lib/fp_utils.pxd",
864   "yt/utilities/lib/geometry_utils.pxd",
865   "yt/geometry/particle_deposit.pxd",
866   "type.pxd",
867   "yt/geometry/oct_visitors.pxd",
868   "yt/geometry/selection_routines.pxd",
869   "yt/utilities/lib/allocation_container.pxd",
870   "yt/geometry/oct_container.pxd",
871   "yt/utilities/lib/distance_queue.pxd",
872 };
873 /* MemviewSliceStruct.proto */
874 struct __pyx_memoryview_obj;
875 typedef struct {
876   struct __pyx_memoryview_obj *memview;
877   char *data;
878   Py_ssize_t shape[8];
879   Py_ssize_t strides[8];
880   Py_ssize_t suboffsets[8];
881 } __Pyx_memviewslice;
882 #define __Pyx_MemoryView_Len(m)  (m.shape[0])
883 
884 /* Atomics.proto */
885 #include <pythread.h>
886 #ifndef CYTHON_ATOMICS
887     #define CYTHON_ATOMICS 1
888 #endif
889 #define __pyx_atomic_int_type int
890 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
891                     (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
892                     !defined(__i386__)
893     #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
894     #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
895     #ifdef __PYX_DEBUG_ATOMICS
896         #warning "Using GNU atomics"
897     #endif
898 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
899     #include <Windows.h>
900     #undef __pyx_atomic_int_type
901     #define __pyx_atomic_int_type LONG
902     #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
903     #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
904     #ifdef __PYX_DEBUG_ATOMICS
905         #pragma message ("Using MSVC atomics")
906     #endif
907 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
908     #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
909     #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
910     #ifdef __PYX_DEBUG_ATOMICS
911         #warning "Using Intel atomics"
912     #endif
913 #else
914     #undef CYTHON_ATOMICS
915     #define CYTHON_ATOMICS 0
916     #ifdef __PYX_DEBUG_ATOMICS
917         #warning "Not using atomics"
918     #endif
919 #endif
920 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
921 #if CYTHON_ATOMICS
922     #define __pyx_add_acquisition_count(memview)\
923              __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
924     #define __pyx_sub_acquisition_count(memview)\
925             __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
926 #else
927     #define __pyx_add_acquisition_count(memview)\
928             __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
929     #define __pyx_sub_acquisition_count(memview)\
930             __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
931 #endif
932 
933 /* BufferFormatStructs.proto */
934 #define IS_UNSIGNED(type) (((type) -1) > 0)
935 struct __Pyx_StructField_;
936 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
937 typedef struct {
938   const char* name;
939   struct __Pyx_StructField_* fields;
940   size_t size;
941   size_t arraysize[8];
942   int ndim;
943   char typegroup;
944   char is_unsigned;
945   int flags;
946 } __Pyx_TypeInfo;
947 typedef struct __Pyx_StructField_ {
948   __Pyx_TypeInfo* type;
949   const char* name;
950   size_t offset;
951 } __Pyx_StructField;
952 typedef struct {
953   __Pyx_StructField* field;
954   size_t parent_offset;
955 } __Pyx_BufFmt_StackElem;
956 typedef struct {
957   __Pyx_StructField root;
958   __Pyx_BufFmt_StackElem* head;
959   size_t fmt_offset;
960   size_t new_count, enc_count;
961   size_t struct_alignment;
962   int is_complex;
963   char enc_type;
964   char new_packmode;
965   char enc_packmode;
966   char is_valid_array;
967 } __Pyx_BufFmt_Context;
968 
969 /* ForceInitThreads.proto */
970 #ifndef __PYX_FORCE_INIT_THREADS
971   #define __PYX_FORCE_INIT_THREADS 0
972 #endif
973 
974 /* NoFastGil.proto */
975 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
976 #define __Pyx_PyGILState_Release PyGILState_Release
977 #define __Pyx_FastGIL_Remember()
978 #define __Pyx_FastGIL_Forget()
979 #define __Pyx_FastGilFuncInit()
980 
981 
982 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776
983  * # in Cython to enable them only on the right systems.
984  *
985  * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
986  * ctypedef npy_int16      int16_t
987  * ctypedef npy_int32      int32_t
988  */
989 typedef npy_int8 __pyx_t_5numpy_int8_t;
990 
991 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":777
992  *
993  * ctypedef npy_int8       int8_t
994  * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
995  * ctypedef npy_int32      int32_t
996  * ctypedef npy_int64      int64_t
997  */
998 typedef npy_int16 __pyx_t_5numpy_int16_t;
999 
1000 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778
1001  * ctypedef npy_int8       int8_t
1002  * ctypedef npy_int16      int16_t
1003  * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
1004  * ctypedef npy_int64      int64_t
1005  * #ctypedef npy_int96      int96_t
1006  */
1007 typedef npy_int32 __pyx_t_5numpy_int32_t;
1008 
1009 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779
1010  * ctypedef npy_int16      int16_t
1011  * ctypedef npy_int32      int32_t
1012  * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
1013  * #ctypedef npy_int96      int96_t
1014  * #ctypedef npy_int128     int128_t
1015  */
1016 typedef npy_int64 __pyx_t_5numpy_int64_t;
1017 
1018 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":783
1019  * #ctypedef npy_int128     int128_t
1020  *
1021  * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
1022  * ctypedef npy_uint16     uint16_t
1023  * ctypedef npy_uint32     uint32_t
1024  */
1025 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1026 
1027 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784
1028  *
1029  * ctypedef npy_uint8      uint8_t
1030  * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
1031  * ctypedef npy_uint32     uint32_t
1032  * ctypedef npy_uint64     uint64_t
1033  */
1034 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1035 
1036 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785
1037  * ctypedef npy_uint8      uint8_t
1038  * ctypedef npy_uint16     uint16_t
1039  * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
1040  * ctypedef npy_uint64     uint64_t
1041  * #ctypedef npy_uint96     uint96_t
1042  */
1043 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1044 
1045 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":786
1046  * ctypedef npy_uint16     uint16_t
1047  * ctypedef npy_uint32     uint32_t
1048  * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
1049  * #ctypedef npy_uint96     uint96_t
1050  * #ctypedef npy_uint128    uint128_t
1051  */
1052 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1053 
1054 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790
1055  * #ctypedef npy_uint128    uint128_t
1056  *
1057  * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
1058  * ctypedef npy_float64    float64_t
1059  * #ctypedef npy_float80    float80_t
1060  */
1061 typedef npy_float32 __pyx_t_5numpy_float32_t;
1062 
1063 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791
1064  *
1065  * ctypedef npy_float32    float32_t
1066  * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
1067  * #ctypedef npy_float80    float80_t
1068  * #ctypedef npy_float128   float128_t
1069  */
1070 typedef npy_float64 __pyx_t_5numpy_float64_t;
1071 
1072 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":800
1073  * # The int types are mapped a bit surprising --
1074  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1075  * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
1076  * ctypedef npy_longlong   long_t
1077  * ctypedef npy_longlong   longlong_t
1078  */
1079 typedef npy_long __pyx_t_5numpy_int_t;
1080 
1081 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801
1082  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1083  * ctypedef npy_long       int_t
1084  * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
1085  * ctypedef npy_longlong   longlong_t
1086  *
1087  */
1088 typedef npy_longlong __pyx_t_5numpy_long_t;
1089 
1090 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802
1091  * ctypedef npy_long       int_t
1092  * ctypedef npy_longlong   long_t
1093  * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
1094  *
1095  * ctypedef npy_ulong      uint_t
1096  */
1097 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1098 
1099 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":804
1100  * ctypedef npy_longlong   longlong_t
1101  *
1102  * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
1103  * ctypedef npy_ulonglong  ulong_t
1104  * ctypedef npy_ulonglong  ulonglong_t
1105  */
1106 typedef npy_ulong __pyx_t_5numpy_uint_t;
1107 
1108 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805
1109  *
1110  * ctypedef npy_ulong      uint_t
1111  * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
1112  * ctypedef npy_ulonglong  ulonglong_t
1113  *
1114  */
1115 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1116 
1117 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806
1118  * ctypedef npy_ulong      uint_t
1119  * ctypedef npy_ulonglong  ulong_t
1120  * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
1121  *
1122  * ctypedef npy_intp       intp_t
1123  */
1124 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1125 
1126 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":808
1127  * ctypedef npy_ulonglong  ulonglong_t
1128  *
1129  * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
1130  * ctypedef npy_uintp      uintp_t
1131  *
1132  */
1133 typedef npy_intp __pyx_t_5numpy_intp_t;
1134 
1135 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809
1136  *
1137  * ctypedef npy_intp       intp_t
1138  * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
1139  *
1140  * ctypedef npy_double     float_t
1141  */
1142 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1143 
1144 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":811
1145  * ctypedef npy_uintp      uintp_t
1146  *
1147  * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
1148  * ctypedef npy_double     double_t
1149  * ctypedef npy_longdouble longdouble_t
1150  */
1151 typedef npy_double __pyx_t_5numpy_float_t;
1152 
1153 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812
1154  *
1155  * ctypedef npy_double     float_t
1156  * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
1157  * ctypedef npy_longdouble longdouble_t
1158  *
1159  */
1160 typedef npy_double __pyx_t_5numpy_double_t;
1161 
1162 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813
1163  * ctypedef npy_double     float_t
1164  * ctypedef npy_double     double_t
1165  * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
1166  *
1167  * ctypedef npy_cfloat      cfloat_t
1168  */
1169 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1170 /* Declarations.proto */
1171 #if CYTHON_CCOMPLEX
1172   #ifdef __cplusplus
1173     typedef ::std::complex< float > __pyx_t_float_complex;
1174   #else
1175     typedef float _Complex __pyx_t_float_complex;
1176   #endif
1177 #else
1178     typedef struct { float real, imag; } __pyx_t_float_complex;
1179 #endif
1180 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1181 
1182 /* Declarations.proto */
1183 #if CYTHON_CCOMPLEX
1184   #ifdef __cplusplus
1185     typedef ::std::complex< double > __pyx_t_double_complex;
1186   #else
1187     typedef double _Complex __pyx_t_double_complex;
1188   #endif
1189 #else
1190     typedef struct { double real, imag; } __pyx_t_double_complex;
1191 #endif
1192 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1193 
1194 
1195 /*--- Type declarations ---*/
1196 struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor;
1197 struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts;
1198 struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells;
1199 struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts;
1200 struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts;
1201 struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts;
1202 struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskedIndexOcts;
1203 struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexMaskMapOcts;
1204 struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts;
1205 struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts;
1206 struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts;
1207 struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts;
1208 struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64;
1209 struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64;
1210 struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8;
1211 struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts;
1212 struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd;
1213 struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO;
1214 struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR;
1215 struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain;
1216 struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree;
1217 struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree;
1218 struct __pyx_obj_2yt_8geometry_12oct_visitors_MortonIndexOcts;
1219 struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreIndex;
1220 struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor;
1221 struct __pyx_obj_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor;
1222 struct __pyx_obj_2yt_8geometry_12oct_visitors_NeighbourCellVisitor;
1223 struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject;
1224 struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector;
1225 struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector;
1226 struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector;
1227 struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool;
1228 struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool;
1229 struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer;
1230 struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer;
1231 struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer;
1232 struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue;
1233 struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue;
1234 struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation;
1235 struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation;
1236 struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth;
1237 struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth;
1238 struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth;
1239 struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth;
1240 struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate;
1241 struct __pyx_array_obj;
1242 struct __pyx_MemviewEnum_obj;
1243 struct __pyx_memoryview_obj;
1244 struct __pyx_memoryviewslice_obj;
1245 
1246 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":815
1247  * ctypedef npy_longdouble longdouble_t
1248  *
1249  * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
1250  * ctypedef npy_cdouble     cdouble_t
1251  * ctypedef npy_clongdouble clongdouble_t
1252  */
1253 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1254 
1255 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":816
1256  *
1257  * ctypedef npy_cfloat      cfloat_t
1258  * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
1259  * ctypedef npy_clongdouble clongdouble_t
1260  *
1261  */
1262 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1263 
1264 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":817
1265  * ctypedef npy_cfloat      cfloat_t
1266  * ctypedef npy_cdouble     cdouble_t
1267  * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
1268  *
1269  * ctypedef npy_cdouble     complex_t
1270  */
1271 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1272 
1273 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":819
1274  * ctypedef npy_clongdouble clongdouble_t
1275  *
1276  * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
1277  *
1278  * cdef inline object PyArray_MultiIterNew1(a):
1279  */
1280 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1281 struct __pyx_t_2yt_8geometry_12oct_visitors_Oct;
1282 struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo;
1283 struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded;
1284 
1285 /* "oct_visitors.pxd":13
1286  *
1287  *
1288  * cdef struct Oct             # <<<<<<<<<<<<<<
1289  * cdef struct Oct:
1290  *     np.int64_t file_ind     # index with respect to the order in which it was
1291  */
1292 struct __pyx_t_2yt_8geometry_12oct_visitors_Oct {
1293   __pyx_t_5numpy_int64_t file_ind;
1294   __pyx_t_5numpy_int64_t domain_ind;
1295   __pyx_t_5numpy_int64_t domain;
1296   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **children;
1297 };
1298 
1299 /* "oct_visitors.pxd":21
1300  *     Oct **children          # Up to 8 long
1301  *
1302  * cdef struct OctInfo:             # <<<<<<<<<<<<<<
1303  *     np.float64_t left_edge[3]
1304  *     np.float64_t dds[3]
1305  */
1306 struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo {
1307   __pyx_t_5numpy_float64_t left_edge[3];
1308   __pyx_t_5numpy_float64_t dds[3];
1309   __pyx_t_5numpy_int64_t ipos[3];
1310   __pyx_t_5numpy_int32_t level;
1311 };
1312 
1313 /* "oct_visitors.pxd":27
1314  *     np.int32_t level
1315  *
1316  * cdef struct OctPadded:             # <<<<<<<<<<<<<<
1317  *     np.int64_t file_ind
1318  *     np.int64_t domain_ind
1319  */
1320 struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded {
1321   __pyx_t_5numpy_int64_t file_ind;
1322   __pyx_t_5numpy_int64_t domain_ind;
1323   __pyx_t_5numpy_int64_t domain;
1324   __pyx_t_5numpy_int64_t padding;
1325 };
1326 struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode;
1327 struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded;
1328 struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData;
1329 
1330 /* "grid_visitors.pxd":13
1331  *
1332  *
1333  * cdef struct GridTreeNode:             # <<<<<<<<<<<<<<
1334  *     np.int32_t num_children
1335  *     np.int32_t level
1336  */
1337 struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode {
1338   __pyx_t_5numpy_int32_t num_children;
1339   __pyx_t_5numpy_int32_t level;
1340   __pyx_t_5numpy_int64_t index;
1341   __pyx_t_5numpy_float64_t left_edge[3];
1342   __pyx_t_5numpy_float64_t right_edge[3];
1343   struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode **children;
1344   __pyx_t_5numpy_int64_t start_index[3];
1345   __pyx_t_5numpy_int32_t dims[3];
1346   __pyx_t_5numpy_float64_t dds[3];
1347 };
1348 
1349 /* "grid_visitors.pxd":24
1350  *     np.float64_t dds[3]
1351  *
1352  * cdef struct GridTreeNodePadded:             # <<<<<<<<<<<<<<
1353  *     np.int32_t num_children
1354  *     np.int32_t level
1355  */
1356 struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded {
1357   __pyx_t_5numpy_int32_t num_children;
1358   __pyx_t_5numpy_int32_t level;
1359   __pyx_t_5numpy_int64_t index;
1360   __pyx_t_5numpy_float64_t left_edge_x;
1361   __pyx_t_5numpy_float64_t left_edge_y;
1362   __pyx_t_5numpy_float64_t left_edge_z;
1363   __pyx_t_5numpy_float64_t right_edge_x;
1364   __pyx_t_5numpy_float64_t right_edge_y;
1365   __pyx_t_5numpy_float64_t right_edge_z;
1366   __pyx_t_5numpy_int_t children_pointers;
1367   __pyx_t_5numpy_int64_t start_index_x;
1368   __pyx_t_5numpy_int64_t start_index_y;
1369   __pyx_t_5numpy_int64_t start_index_z;
1370   __pyx_t_5numpy_int32_t dims_x;
1371   __pyx_t_5numpy_int32_t dims_y;
1372   __pyx_t_5numpy_int32_t dims_z;
1373   __pyx_t_5numpy_float64_t dds_x;
1374   __pyx_t_5numpy_float64_t dds_y;
1375   __pyx_t_5numpy_float64_t dds_z;
1376 };
1377 
1378 /* "grid_visitors.pxd":45
1379  *     np.float64_t dds_z
1380  *
1381  * cdef struct GridVisitorData:             # <<<<<<<<<<<<<<
1382  *     GridTreeNode *grid
1383  *     np.uint64_t index
1384  */
1385 struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData {
1386   struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *grid;
1387   __pyx_t_5numpy_uint64_t index;
1388   __pyx_t_5numpy_uint64_t global_index;
1389   __pyx_t_5numpy_int64_t pos[3];
1390   int n_tuples;
1391   int **child_tuples;
1392   void *array;
1393   int ref_factor;
1394 };
1395 
1396 /* "grid_visitors.pxd":61
1397  * cdef np.uint8_t check_child_masked(GridVisitorData *data) nogil
1398  *
1399  * ctypedef void grid_visitor_function(GridVisitorData *data,             # <<<<<<<<<<<<<<
1400  *                                          np.uint8_t selected) nogil
1401  * # This is similar in spirit to the way oct visitor functions work.  However,
1402  */
1403 typedef void __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *, __pyx_t_5numpy_uint8_t);
1404 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_recursively_visit_octs;
1405 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid;
1406 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid_edge;
1407 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells;
1408 
1409 /* "selection_routines.pxd":34
1410  *     cdef np.int64_t _hash
1411  *
1412  *     cdef void recursively_visit_octs(self, Oct *root,             # <<<<<<<<<<<<<<
1413  *                         np.float64_t pos[3], np.float64_t dds[3],
1414  *                         int level,
1415  */
1416 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_recursively_visit_octs {
1417   int __pyx_n;
1418   int visit_covered;
1419 };
1420 
1421 /* "selection_routines.pxd":42
1422  *                               np.float64_t spos[3], np.float64_t sdds[3],
1423  *                               OctVisitor visitor, int i, int j, int k)
1424  *     cdef int select_grid(self, np.float64_t left_edge[3],             # <<<<<<<<<<<<<<
1425  *                                np.float64_t right_edge[3],
1426  *                                np.int32_t level, Oct *o = ?) nogil
1427  */
1428 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid {
1429   int __pyx_n;
1430   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o;
1431 };
1432 
1433 /* "selection_routines.pxd":45
1434  *                                np.float64_t right_edge[3],
1435  *                                np.int32_t level, Oct *o = ?) nogil
1436  *     cdef int select_grid_edge(self, np.float64_t left_edge[3],             # <<<<<<<<<<<<<<
1437  *                                     np.float64_t right_edge[3],
1438  *                                     np.int32_t level, Oct *o = ?) nogil
1439  */
1440 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid_edge {
1441   int __pyx_n;
1442   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o;
1443 };
1444 
1445 /* "selection_routines.pxd":62
1446  *                                 np.ndarray[np.uint8_t, ndim=3] mask,
1447  *                                 int level)
1448  *     cdef void visit_grid_cells(self, GridVisitorData *data,             # <<<<<<<<<<<<<<
1449  *                     grid_visitor_function *func, np.uint8_t *cached_mask = ?)
1450  *
1451  */
1452 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells {
1453   int __pyx_n;
1454   __pyx_t_5numpy_uint8_t *cached_mask;
1455 };
1456 struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer;
1457 struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs;
1458 
1459 /* "yt/utilities/lib/allocation_container.pxd":13
1460  *
1461  *
1462  * cdef struct AllocationContainer:             # <<<<<<<<<<<<<<
1463  *     np.uint64_t n
1464  *     np.uint64_t n_assigned
1465  */
1466 struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer {
1467   __pyx_t_5numpy_uint64_t n;
1468   __pyx_t_5numpy_uint64_t n_assigned;
1469   __pyx_t_5numpy_uint64_t offset;
1470   __pyx_t_5numpy_int64_t con_id;
1471   void *my_objs;
1472 };
1473 
1474 /* "yt/utilities/lib/allocation_container.pxd":24
1475  *     cdef np.uint64_t n_con
1476  *     cdef AllocationContainer* containers
1477  *     cdef void allocate_objs(self, int n_objs, np.int64_t con_id = ?) except *             # <<<<<<<<<<<<<<
1478  *     cdef void setup_objs(self, void *obj, np.uint64_t count,
1479  *                          np.uint64_t offset, np.int64_t con_id)
1480  */
1481 struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs {
1482   int __pyx_n;
1483   __pyx_t_5numpy_int64_t con_id;
1484 };
1485 struct __pyx_t_2yt_8geometry_13oct_container_OctKey;
1486 struct __pyx_t_2yt_8geometry_13oct_container_OctList;
1487 struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer;
1488 struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get;
1489 struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs;
1490 
1491 /* "oct_container.pxd":25
1492  * cdef int ORDER_MAX
1493  *
1494  * cdef struct OctKey:             # <<<<<<<<<<<<<<
1495  *     np.int64_t key
1496  *     Oct *node
1497  */
1498 struct __pyx_t_2yt_8geometry_13oct_container_OctKey {
1499   __pyx_t_5numpy_int64_t key;
1500   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *node;
1501   __pyx_t_5numpy_int64_t *indices;
1502   __pyx_t_5numpy_int64_t pcount;
1503 };
1504 
1505 /* "oct_container.pxd":32
1506  *     np.int64_t pcount
1507  *
1508  * cdef struct OctList             # <<<<<<<<<<<<<<
1509  *
1510  * cdef struct OctList:
1511  */
1512 struct __pyx_t_2yt_8geometry_13oct_container_OctList {
1513   struct __pyx_t_2yt_8geometry_13oct_container_OctList *next;
1514   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o;
1515 };
1516 
1517 /* "oct_container.pxd":40
1518  * # NOTE: This object *has* to be the same size as the AllocationContainer
1519  * # object.  There's an assert in the __cinit__ function.
1520  * cdef struct OctAllocationContainer:             # <<<<<<<<<<<<<<
1521  *     np.uint64_t n
1522  *     np.uint64_t n_assigned
1523  */
1524 struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer {
1525   __pyx_t_5numpy_uint64_t n;
1526   __pyx_t_5numpy_uint64_t n_assigned;
1527   __pyx_t_5numpy_uint64_t offset;
1528   __pyx_t_5numpy_int64_t con_id;
1529   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *my_objs;
1530 };
1531 
1532 /* "oct_container.pxd":66
1533  *     cdef public np.int64_t nocts
1534  *     cdef public int num_domains
1535  *     cdef Oct *get(self, np.float64_t ppos[3], OctInfo *oinfo = ?,             # <<<<<<<<<<<<<<
1536  *                   int max_level = ?) nogil
1537  *     cdef int get_root(self, int ind[3], Oct **o) nogil
1538  */
1539 struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get {
1540   int __pyx_n;
1541   struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo *oinfo;
1542   int max_level;
1543 };
1544 
1545 /* "oct_container.pxd":74
1546  *     # AllocationContainer.offset if such a thing exists.
1547  *     cdef np.int64_t get_domain_offset(self, int domain_id)
1548  *     cdef void visit_all_octs(self,             # <<<<<<<<<<<<<<
1549  *                         selection_routines.SelectorObject selector,
1550  *                         OctVisitor visitor,
1551  */
1552 struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs {
1553   int __pyx_n;
1554   int vc;
1555   __pyx_t_5numpy_int64_t *indices;
1556 };
1557 struct __pyx_t_2yt_9utilities_3lib_14distance_queue_ItemList;
1558 struct __pyx_t_2yt_9utilities_3lib_14distance_queue_NeighborList;
1559 
1560 /* "yt/utilities/lib/distance_queue.pxd":20
1561  * # THESE TWO STRUCTS MUST BE EQUIVALENT
1562  *
1563  * cdef struct ItemList:             # <<<<<<<<<<<<<<
1564  *     np.int64_t ind
1565  *     np.float64_t value
1566  */
1567 struct __pyx_t_2yt_9utilities_3lib_14distance_queue_ItemList {
1568   __pyx_t_5numpy_int64_t ind;
1569   __pyx_t_5numpy_float64_t value;
1570 };
1571 
1572 /* "yt/utilities/lib/distance_queue.pxd":24
1573  *     np.float64_t value
1574  *
1575  * cdef struct NeighborList:             # <<<<<<<<<<<<<<
1576  *     np.int64_t pn       # Particle number
1577  *     np.float64_t r2     # radius**2
1578  */
1579 struct __pyx_t_2yt_9utilities_3lib_14distance_queue_NeighborList {
1580   __pyx_t_5numpy_int64_t pn;
1581   __pyx_t_5numpy_float64_t r2;
1582 };
1583 
1584 /* "particle_deposit.pxd":119
1585  * # So in order to mimic a registry functionality,
1586  * # I manually created a function to lookup the kernel functions.
1587  * ctypedef np.float64_t (*kernel_func) (np.float64_t) nogil             # <<<<<<<<<<<<<<
1588  * cdef inline kernel_func get_kernel_func(str kernel_name) nogil:
1589  *     with gil:
1590  */
1591 typedef __pyx_t_5numpy_float64_t (*__pyx_t_2yt_8geometry_16particle_deposit_kernel_func)(__pyx_t_5numpy_float64_t);
1592 struct __pyx_opt_args_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_search;
1593 
1594 /* "yt/geometry/particle_smooth.pxd":52
1595  *                                int *nsize, np.float64_t[:,:] oct_left_edges,
1596  *                                np.float64_t[:,:] oct_dds, DistanceQueue dq)
1597  *     cdef int neighbor_search(self, np.float64_t pos[3], OctreeContainer octree,             # <<<<<<<<<<<<<<
1598  *                              np.int64_t **nind, int *nsize,
1599  *                              np.int64_t nneighbors, np.int64_t domain_id,
1600  */
1601 struct __pyx_opt_args_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_search {
1602   int __pyx_n;
1603   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **oct;
1604   int extra_layer;
1605 };
1606 
1607 /* "oct_visitors.pxd":33
1608  *     np.int64_t padding
1609  *
1610  * cdef class OctVisitor:             # <<<<<<<<<<<<<<
1611  *     cdef np.uint64_t index
1612  *     cdef np.uint64_t last
1613  */
1614 struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor {
1615   PyObject_HEAD
1616   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_vtab;
1617   __pyx_t_5numpy_uint64_t index;
1618   __pyx_t_5numpy_uint64_t last;
1619   __pyx_t_5numpy_int64_t global_index;
1620   __pyx_t_5numpy_int64_t pos[3];
1621   __pyx_t_5numpy_uint8_t ind[3];
1622   int dims;
1623   __pyx_t_5numpy_int32_t domain;
1624   __pyx_t_5numpy_int8_t level;
1625   __pyx_t_5numpy_int8_t oref;
1626   __pyx_t_5numpy_int32_t nz;
1627 };
1628 
1629 
1630 /* "oct_visitors.pxd":59
1631  *         return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0])
1632  *
1633  * cdef class CountTotalOcts(OctVisitor):             # <<<<<<<<<<<<<<
1634  *     pass
1635  *
1636  */
1637 struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts {
1638   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1639 };
1640 
1641 
1642 /* "oct_visitors.pxd":62
1643  *     pass
1644  *
1645  * cdef class CountTotalCells(OctVisitor):             # <<<<<<<<<<<<<<
1646  *     pass
1647  *
1648  */
1649 struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells {
1650   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1651 };
1652 
1653 
1654 /* "oct_visitors.pxd":65
1655  *     pass
1656  *
1657  * cdef class MarkOcts(OctVisitor):             # <<<<<<<<<<<<<<
1658  *     # Unused
1659  *     cdef np.uint8_t[:,:,:,:] mark
1660  */
1661 struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts {
1662   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1663   __Pyx_memviewslice mark;
1664 };
1665 
1666 
1667 /* "oct_visitors.pxd":69
1668  *     cdef np.uint8_t[:,:,:,:] mark
1669  *
1670  * cdef class MaskOcts(OctVisitor):             # <<<<<<<<<<<<<<
1671  *     cdef np.uint8_t[:,:,:,:] mask
1672  *
1673  */
1674 struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts {
1675   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1676   __Pyx_memviewslice mask;
1677 };
1678 
1679 
1680 /* "oct_visitors.pxd":72
1681  *     cdef np.uint8_t[:,:,:,:] mask
1682  *
1683  * cdef class IndexOcts(OctVisitor):             # <<<<<<<<<<<<<<
1684  *     cdef np.int64_t[:] oct_index
1685  *
1686  */
1687 struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts {
1688   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1689   __Pyx_memviewslice oct_index;
1690 };
1691 
1692 
1693 /* "oct_visitors.pxd":75
1694  *     cdef np.int64_t[:] oct_index
1695  *
1696  * cdef class MaskedIndexOcts(OctVisitor):             # <<<<<<<<<<<<<<
1697  *     cdef np.int64_t[:] oct_index
1698  *     cdef np.uint8_t[:] oct_mask
1699  */
1700 struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskedIndexOcts {
1701   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1702   __Pyx_memviewslice oct_index;
1703   __Pyx_memviewslice oct_mask;
1704 };
1705 
1706 
1707 /* "oct_visitors.pxd":79
1708  *     cdef np.uint8_t[:] oct_mask
1709  *
1710  * cdef class IndexMaskMapOcts(OctVisitor):             # <<<<<<<<<<<<<<
1711  *     cdef np.int64_t[:] oct_index
1712  *     cdef np.uint8_t[:] oct_mask
1713  */
1714 struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexMaskMapOcts {
1715   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1716   __Pyx_memviewslice oct_index;
1717   __Pyx_memviewslice oct_mask;
1718   __Pyx_memviewslice map_domain_ind;
1719   __pyx_t_5numpy_uint64_t map_index;
1720 };
1721 
1722 
1723 /* "oct_visitors.pxd":85
1724  *     cdef np.uint64_t map_index
1725  *
1726  * cdef class ICoordsOcts(OctVisitor):             # <<<<<<<<<<<<<<
1727  *     cdef np.int64_t[:,:] icoords
1728  *
1729  */
1730 struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts {
1731   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1732   __Pyx_memviewslice icoords;
1733 };
1734 
1735 
1736 /* "oct_visitors.pxd":88
1737  *     cdef np.int64_t[:,:] icoords
1738  *
1739  * cdef class IResOcts(OctVisitor):             # <<<<<<<<<<<<<<
1740  *     cdef np.int64_t[:] ires
1741  *
1742  */
1743 struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts {
1744   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1745   __Pyx_memviewslice ires;
1746 };
1747 
1748 
1749 /* "oct_visitors.pxd":91
1750  *     cdef np.int64_t[:] ires
1751  *
1752  * cdef class FCoordsOcts(OctVisitor):             # <<<<<<<<<<<<<<
1753  *     cdef np.float64_t[:,:] fcoords
1754  *
1755  */
1756 struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts {
1757   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1758   __Pyx_memviewslice fcoords;
1759 };
1760 
1761 
1762 /* "oct_visitors.pxd":94
1763  *     cdef np.float64_t[:,:] fcoords
1764  *
1765  * cdef class FWidthOcts(OctVisitor):             # <<<<<<<<<<<<<<
1766  *     cdef np.float64_t[:,:] fwidth
1767  *
1768  */
1769 struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts {
1770   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1771   __Pyx_memviewslice fwidth;
1772 };
1773 
1774 
1775 /* "oct_visitors.pxd":97
1776  *     cdef np.float64_t[:,:] fwidth
1777  *
1778  * cdef class CopyArrayI64(OctVisitor):             # <<<<<<<<<<<<<<
1779  *     cdef np.int64_t[:,:,:,:,:,:] source
1780  *     cdef np.int64_t[:,:] dest
1781  */
1782 struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64 {
1783   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1784   __Pyx_memviewslice source;
1785   __Pyx_memviewslice dest;
1786 };
1787 
1788 
1789 /* "oct_visitors.pxd":101
1790  *     cdef np.int64_t[:,:] dest
1791  *
1792  * cdef class CopyArrayF64(OctVisitor):             # <<<<<<<<<<<<<<
1793  *     cdef np.float64_t[:,:,:,:,:] source
1794  *     cdef np.float64_t[:,:] dest
1795  */
1796 struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64 {
1797   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1798   __Pyx_memviewslice source;
1799   __Pyx_memviewslice dest;
1800 };
1801 
1802 
1803 /* "oct_visitors.pxd":105
1804  *     cdef np.float64_t[:,:] dest
1805  *
1806  * cdef class CopyFileIndArrayI8(OctVisitor):             # <<<<<<<<<<<<<<
1807  *     cdef np.int64_t root
1808  *     cdef np.uint8_t[:] source
1809  */
1810 struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8 {
1811   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1812   __pyx_t_5numpy_int64_t root;
1813   __Pyx_memviewslice source;
1814   __Pyx_memviewslice dest;
1815 };
1816 
1817 
1818 /* "oct_visitors.pxd":110
1819  *     cdef np.uint8_t[:] dest
1820  *
1821  * cdef class IdentifyOcts(OctVisitor):             # <<<<<<<<<<<<<<
1822  *     cdef np.uint8_t[:] domain_mask
1823  *
1824  */
1825 struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts {
1826   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1827   __Pyx_memviewslice domain_mask;
1828 };
1829 
1830 
1831 /* "oct_visitors.pxd":113
1832  *     cdef np.uint8_t[:] domain_mask
1833  *
1834  * cdef class AssignDomainInd(OctVisitor):             # <<<<<<<<<<<<<<
1835  *     pass
1836  *
1837  */
1838 struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd {
1839   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1840 };
1841 
1842 
1843 /* "oct_visitors.pxd":116
1844  *     pass
1845  *
1846  * cdef class FillFileIndicesO(OctVisitor):             # <<<<<<<<<<<<<<
1847  *     cdef np.uint8_t[:] levels
1848  *     cdef np.int64_t[:] file_inds
1849  */
1850 struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO {
1851   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1852   __Pyx_memviewslice levels;
1853   __Pyx_memviewslice file_inds;
1854   __Pyx_memviewslice cell_inds;
1855 };
1856 
1857 
1858 /* "oct_visitors.pxd":121
1859  *     cdef np.uint8_t[:] cell_inds
1860  *
1861  * cdef class FillFileIndicesR(OctVisitor):             # <<<<<<<<<<<<<<
1862  *     cdef np.uint8_t[:] levels
1863  *     cdef np.int64_t[:] file_inds
1864  */
1865 struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR {
1866   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1867   __Pyx_memviewslice levels;
1868   __Pyx_memviewslice file_inds;
1869   __Pyx_memviewslice cell_inds;
1870 };
1871 
1872 
1873 /* "oct_visitors.pxd":126
1874  *     cdef np.uint8_t[:] cell_inds
1875  *
1876  * cdef class CountByDomain(OctVisitor):             # <<<<<<<<<<<<<<
1877  *     cdef np.int64_t[:] domain_counts
1878  *
1879  */
1880 struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain {
1881   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1882   __Pyx_memviewslice domain_counts;
1883 };
1884 
1885 
1886 /* "oct_visitors.pxd":129
1887  *     cdef np.int64_t[:] domain_counts
1888  *
1889  * cdef class StoreOctree(OctVisitor):             # <<<<<<<<<<<<<<
1890  *     cdef np.uint8_t[:] ref_mask
1891  *
1892  */
1893 struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree {
1894   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1895   __Pyx_memviewslice ref_mask;
1896 };
1897 
1898 
1899 /* "oct_visitors.pxd":132
1900  *     cdef np.uint8_t[:] ref_mask
1901  *
1902  * cdef class LoadOctree(OctVisitor):             # <<<<<<<<<<<<<<
1903  *     cdef np.uint8_t[:] ref_mask
1904  *     cdef Oct* octs
1905  */
1906 struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree {
1907   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1908   __Pyx_memviewslice ref_mask;
1909   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *octs;
1910   __pyx_t_5numpy_uint64_t *nocts;
1911   __pyx_t_5numpy_uint64_t *nfinest;
1912 };
1913 
1914 
1915 /* "oct_visitors.pxd":138
1916  *     cdef np.uint64_t *nfinest
1917  *
1918  * cdef class MortonIndexOcts(OctVisitor):             # <<<<<<<<<<<<<<
1919  *     cdef np.uint8_t[:] level_arr
1920  *     cdef np.uint64_t[:] morton_ind
1921  */
1922 struct __pyx_obj_2yt_8geometry_12oct_visitors_MortonIndexOcts {
1923   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1924   __Pyx_memviewslice level_arr;
1925   __Pyx_memviewslice morton_ind;
1926 };
1927 
1928 
1929 /* "oct_visitors.pxd":149
1930  *
1931  *
1932  * cdef class StoreIndex(OctVisitor):             # <<<<<<<<<<<<<<
1933  *     cdef np.int64_t[:,:,:,:] cell_inds
1934  *
1935  */
1936 struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreIndex {
1937   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1938   __Pyx_memviewslice cell_inds;
1939 };
1940 
1941 
1942 /* "oct_visitors.pxd":153
1943  *
1944  * # cimport oct_container
1945  * cdef class BaseNeighbourVisitor(OctVisitor):             # <<<<<<<<<<<<<<
1946  *     cdef int idim      # 0,1,2 for x,y,z
1947  *     cdef int direction # +1 for +x, -1 for -x
1948  */
1949 struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor {
1950   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1951   int idim;
1952   int direction;
1953   __pyx_t_5numpy_uint8_t neigh_ind[3];
1954   int other_oct;
1955   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *neighbour;
1956   struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *octree;
1957   struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo oi;
1958   int n_ghost_zones;
1959 };
1960 
1961 
1962 /* "oct_visitors.pxd":169
1963  *         return (((self.neigh_ind[2]*d)+self.neigh_ind[1])*d+self.neigh_ind[0])
1964  *
1965  * cdef class NeighbourCellIndexVisitor(BaseNeighbourVisitor):             # <<<<<<<<<<<<<<
1966  *     cdef np.uint8_t[::1] cell_inds
1967  *     cdef np.int64_t[::1] domain_inds
1968  */
1969 struct __pyx_obj_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor {
1970   struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor __pyx_base;
1971   __Pyx_memviewslice cell_inds;
1972   __Pyx_memviewslice domain_inds;
1973 };
1974 
1975 
1976 /* "oct_visitors.pxd":173
1977  *     cdef np.int64_t[::1] domain_inds
1978  *
1979  * cdef class NeighbourCellVisitor(BaseNeighbourVisitor):             # <<<<<<<<<<<<<<
1980  *     cdef np.uint8_t[::1] levels
1981  *     cdef np.int64_t[::1] file_inds
1982  */
1983 struct __pyx_obj_2yt_8geometry_12oct_visitors_NeighbourCellVisitor {
1984   struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor __pyx_base;
1985   __Pyx_memviewslice levels;
1986   __Pyx_memviewslice file_inds;
1987   __Pyx_memviewslice cell_inds;
1988   __Pyx_memviewslice domains;
1989 };
1990 
1991 
1992 /* "selection_routines.pxd":24
1993  *
1994  *
1995  * cdef class SelectorObject:             # <<<<<<<<<<<<<<
1996  *     cdef public np.int32_t min_level
1997  *     cdef public np.int32_t max_level
1998  */
1999 struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject {
2000   PyObject_HEAD
2001   struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *__pyx_vtab;
2002   __pyx_t_5numpy_int32_t min_level;
2003   __pyx_t_5numpy_int32_t max_level;
2004   int overlap_cells;
2005   __pyx_t_5numpy_float64_t domain_width[3];
2006   __pyx_t_5numpy_float64_t domain_center[3];
2007   int periodicity[3];
2008   int _hash_initialized;
2009   __pyx_t_5numpy_int64_t _hash;
2010 };
2011 
2012 
2013 /* "selection_routines.pxd":70
2014  *         self, np.float64_t x1, np.float64_t x2, int d) nogil
2015  *
2016  * cdef class AlwaysSelector(SelectorObject):             # <<<<<<<<<<<<<<
2017  *     pass
2018  *
2019  */
2020 struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector {
2021   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
2022 };
2023 
2024 
2025 /* "selection_routines.pxd":73
2026  *     pass
2027  *
2028  * cdef class OctreeSubsetSelector(SelectorObject):             # <<<<<<<<<<<<<<
2029  *     cdef public SelectorObject base_selector
2030  *     cdef public np.int64_t domain_id
2031  */
2032 struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector {
2033   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
2034   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *base_selector;
2035   __pyx_t_5numpy_int64_t domain_id;
2036 };
2037 
2038 
2039 /* "selection_routines.pxd":77
2040  *     cdef public np.int64_t domain_id
2041  *
2042  * cdef class BooleanSelector(SelectorObject):             # <<<<<<<<<<<<<<
2043  *     cdef public SelectorObject sel1
2044  *     cdef public SelectorObject sel2
2045  */
2046 struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector {
2047   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
2048   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel1;
2049   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel2;
2050 };
2051 
2052 
2053 /* "yt/utilities/lib/allocation_container.pxd":20
2054  *     void *my_objs
2055  *
2056  * cdef class ObjectPool:             # <<<<<<<<<<<<<<
2057  *     cdef public np.uint64_t itemsize
2058  *     cdef np.uint64_t n_con
2059  */
2060 struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool {
2061   PyObject_HEAD
2062   struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtab;
2063   __pyx_t_5numpy_uint64_t itemsize;
2064   __pyx_t_5numpy_uint64_t n_con;
2065   struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer *containers;
2066 };
2067 
2068 
2069 /* "oct_container.pxd":47
2070  *     Oct *my_objs
2071  *
2072  * cdef class OctObjectPool(ObjectPool):             # <<<<<<<<<<<<<<
2073  *     cdef inline OctAllocationContainer *get_cont(self, int i):
2074  *         return <OctAllocationContainer*> (&self.containers[i])
2075  */
2076 struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool {
2077   struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base;
2078 };
2079 
2080 
2081 /* "oct_container.pxd":55
2082  * cdef void OctList_delete(OctList *list)
2083  *
2084  * cdef class OctreeContainer:             # <<<<<<<<<<<<<<
2085  *     cdef public OctObjectPool domains
2086  *     cdef Oct ****root_mesh
2087  */
2088 struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer {
2089   PyObject_HEAD
2090   struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtab;
2091   struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *domains;
2092   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct ****root_mesh;
2093   int partial_coverage;
2094   int level_offset;
2095   int nn[3];
2096   __pyx_t_5numpy_uint8_t oref;
2097   __pyx_t_5numpy_float64_t DLE[3];
2098   __pyx_t_5numpy_float64_t DRE[3];
2099   __pyx_t_5numpy_int64_t nocts;
2100   int num_domains;
2101   PyObject *fill_style;
2102 };
2103 
2104 
2105 /* "oct_container.pxd":85
2106  *     cdef public object fill_style
2107  *
2108  * cdef class SparseOctreeContainer(OctreeContainer):             # <<<<<<<<<<<<<<
2109  *     cdef OctKey *root_nodes
2110  *     cdef void *tree_root
2111  */
2112 struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer {
2113   struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer __pyx_base;
2114   struct __pyx_t_2yt_8geometry_13oct_container_OctKey *root_nodes;
2115   void *tree_root;
2116   int num_root;
2117   int max_root;
2118 };
2119 
2120 
2121 /* "oct_container.pxd":93
2122  *     cdef np.int64_t ipos_to_key(self, int pos[3]) nogil
2123  *
2124  * cdef class RAMSESOctreeContainer(SparseOctreeContainer):             # <<<<<<<<<<<<<<
2125  *     pass
2126  *
2127  */
2128 struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer {
2129   struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer __pyx_base;
2130 };
2131 
2132 
2133 /* "yt/utilities/lib/distance_queue.pxd":35
2134  *                          np.float64_t max_dist2)
2135  *
2136  * cdef class PriorityQueue:             # <<<<<<<<<<<<<<
2137  *     cdef int maxn
2138  *     cdef int curn
2139  */
2140 struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue {
2141   PyObject_HEAD
2142   struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_PriorityQueue *__pyx_vtab;
2143   int maxn;
2144   int curn;
2145   struct __pyx_t_2yt_9utilities_3lib_14distance_queue_ItemList *items;
2146 };
2147 
2148 
2149 /* "yt/utilities/lib/distance_queue.pxd":42
2150  *     cdef int item_insert(self, np.int64_t i, np.float64_t value)
2151  *
2152  * cdef class DistanceQueue(PriorityQueue):             # <<<<<<<<<<<<<<
2153  *     cdef np.float64_t DW[3]
2154  *     cdef bint periodicity[3]
2155  */
2156 struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue {
2157   struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue __pyx_base;
2158   __pyx_t_5numpy_float64_t DW[3];
2159   int periodicity[3];
2160   struct __pyx_t_2yt_9utilities_3lib_14distance_queue_NeighborList *neighbors;
2161 };
2162 
2163 
2164 /* "particle_deposit.pxd":139
2165  *             raise NotImplementedError
2166  *
2167  * cdef class ParticleDepositOperation:             # <<<<<<<<<<<<<<
2168  *     # We assume each will allocate and define their own temporary storage
2169  *     cdef kernel_func sph_kernel
2170  */
2171 struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation {
2172   PyObject_HEAD
2173   struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_ParticleDepositOperation *__pyx_vtab;
2174   __pyx_t_2yt_8geometry_16particle_deposit_kernel_func sph_kernel;
2175   PyObject *nvals;
2176   int update_values;
2177 };
2178 
2179 
2180 /* "yt/geometry/particle_smooth.pxd":33
2181  *     void *alloca(int)
2182  *
2183  * cdef class ParticleSmoothOperation:             # <<<<<<<<<<<<<<
2184  *     # We assume each will allocate and define their own temporary storage
2185  *     cdef kernel_func sph_kernel
2186  */
2187 struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation {
2188   PyObject_HEAD
2189   struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_vtab;
2190   __pyx_t_2yt_8geometry_16particle_deposit_kernel_func sph_kernel;
2191   PyObject *nvals;
2192   __pyx_t_5numpy_float64_t DW[3];
2193   int nfields;
2194   int maxn;
2195   int periodicity[3];
2196   void (*pos_setup)(__pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *);
2197 };
2198 
2199 
2200 /* "yt/geometry/particle_smooth.pyx":577
2201  *         self.process(offset, i, j, k, dim, opos, fields, index_fields, dq)
2202  *
2203  * cdef class VolumeWeightedSmooth(ParticleSmoothOperation):             # <<<<<<<<<<<<<<
2204  *     # This smoothing function evaluates the field, *without* normalization, at
2205  *     # every point in the *mesh*.  Applying a normalization results in
2206  */
2207 struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth {
2208   struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation __pyx_base;
2209   __pyx_t_5numpy_float64_t **fp;
2210   PyObject *vals;
2211 };
2212 
2213 
2214 /* "yt/geometry/particle_smooth.pyx":654
2215  * volume_weighted_smooth = VolumeWeightedSmooth
2216  *
2217  * cdef class NearestNeighborSmooth(ParticleSmoothOperation):             # <<<<<<<<<<<<<<
2218  *     cdef np.float64_t *fp
2219  *     cdef public object vals
2220  */
2221 struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth {
2222   struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation __pyx_base;
2223   __pyx_t_5numpy_float64_t *fp;
2224   PyObject *vals;
2225 };
2226 
2227 
2228 /* "yt/geometry/particle_smooth.pyx":686
2229  * nearest_smooth = NearestNeighborSmooth
2230  *
2231  * cdef class IDWInterpolationSmooth(ParticleSmoothOperation):             # <<<<<<<<<<<<<<
2232  *     cdef np.float64_t *fp
2233  *     cdef public int p2
2234  */
2235 struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth {
2236   struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation __pyx_base;
2237   __pyx_t_5numpy_float64_t *fp;
2238   int p2;
2239   PyObject *vals;
2240 };
2241 
2242 
2243 /* "yt/geometry/particle_smooth.pyx":729
2244  * idw_smooth = IDWInterpolationSmooth
2245  *
2246  * cdef class NthNeighborDistanceSmooth(ParticleSmoothOperation):             # <<<<<<<<<<<<<<
2247  *
2248  *     def initialize(self):
2249  */
2250 struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth {
2251   struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation __pyx_base;
2252 };
2253 
2254 
2255 /* "yt/geometry/particle_smooth.pyx":751
2256  * nth_neighbor_smooth = NthNeighborDistanceSmooth
2257  *
2258  * cdef class SmoothedDensityEstimate(ParticleSmoothOperation):             # <<<<<<<<<<<<<<
2259  *     def initialize(self):
2260  *         return
2261  */
2262 struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate {
2263   struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation __pyx_base;
2264 };
2265 
2266 
2267 /* "View.MemoryView":105
2268  *
2269  * @cname("__pyx_array")
2270  * cdef class array:             # <<<<<<<<<<<<<<
2271  *
2272  *     cdef:
2273  */
2274 struct __pyx_array_obj {
2275   PyObject_HEAD
2276   struct __pyx_vtabstruct_array *__pyx_vtab;
2277   char *data;
2278   Py_ssize_t len;
2279   char *format;
2280   int ndim;
2281   Py_ssize_t *_shape;
2282   Py_ssize_t *_strides;
2283   Py_ssize_t itemsize;
2284   PyObject *mode;
2285   PyObject *_format;
2286   void (*callback_free_data)(void *);
2287   int free_data;
2288   int dtype_is_object;
2289 };
2290 
2291 
2292 /* "View.MemoryView":279
2293  *
2294  * @cname('__pyx_MemviewEnum')
2295  * cdef class Enum(object):             # <<<<<<<<<<<<<<
2296  *     cdef object name
2297  *     def __init__(self, name):
2298  */
2299 struct __pyx_MemviewEnum_obj {
2300   PyObject_HEAD
2301   PyObject *name;
2302 };
2303 
2304 
2305 /* "View.MemoryView":330
2306  *
2307  * @cname('__pyx_memoryview')
2308  * cdef class memoryview(object):             # <<<<<<<<<<<<<<
2309  *
2310  *     cdef object obj
2311  */
2312 struct __pyx_memoryview_obj {
2313   PyObject_HEAD
2314   struct __pyx_vtabstruct_memoryview *__pyx_vtab;
2315   PyObject *obj;
2316   PyObject *_size;
2317   PyObject *_array_interface;
2318   PyThread_type_lock lock;
2319   __pyx_atomic_int acquisition_count[2];
2320   __pyx_atomic_int *acquisition_count_aligned_p;
2321   Py_buffer view;
2322   int flags;
2323   int dtype_is_object;
2324   __Pyx_TypeInfo *typeinfo;
2325 };
2326 
2327 
2328 /* "View.MemoryView":961
2329  *
2330  * @cname('__pyx_memoryviewslice')
2331  * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
2332  *     "Internal class for passing memoryview slices to Python"
2333  *
2334  */
2335 struct __pyx_memoryviewslice_obj {
2336   struct __pyx_memoryview_obj __pyx_base;
2337   __Pyx_memviewslice from_slice;
2338   PyObject *from_object;
2339   PyObject *(*to_object_func)(char *);
2340   int (*to_dtype_func)(char *, PyObject *);
2341 };
2342 
2343 
2344 
2345 /* "oct_visitors.pxd":33
2346  *     np.int64_t padding
2347  *
2348  * cdef class OctVisitor:             # <<<<<<<<<<<<<<
2349  *     cdef np.uint64_t index
2350  *     cdef np.uint64_t last
2351  */
2352 
2353 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor {
2354   void (*visit)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t);
2355   int (*oind)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *);
2356   int (*rind)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *);
2357 };
2358 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor;
2359 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *);
2360 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *);
2361 
2362 
2363 /* "oct_visitors.pxd":59
2364  *         return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0])
2365  *
2366  * cdef class CountTotalOcts(OctVisitor):             # <<<<<<<<<<<<<<
2367  *     pass
2368  *
2369  */
2370 
2371 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountTotalOcts {
2372   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2373 };
2374 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountTotalOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalOcts;
2375 
2376 
2377 /* "oct_visitors.pxd":62
2378  *     pass
2379  *
2380  * cdef class CountTotalCells(OctVisitor):             # <<<<<<<<<<<<<<
2381  *     pass
2382  *
2383  */
2384 
2385 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountTotalCells {
2386   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2387 };
2388 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountTotalCells *__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalCells;
2389 
2390 
2391 /* "oct_visitors.pxd":65
2392  *     pass
2393  *
2394  * cdef class MarkOcts(OctVisitor):             # <<<<<<<<<<<<<<
2395  *     # Unused
2396  *     cdef np.uint8_t[:,:,:,:] mark
2397  */
2398 
2399 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MarkOcts {
2400   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2401 };
2402 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MarkOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_MarkOcts;
2403 
2404 
2405 /* "oct_visitors.pxd":69
2406  *     cdef np.uint8_t[:,:,:,:] mark
2407  *
2408  * cdef class MaskOcts(OctVisitor):             # <<<<<<<<<<<<<<
2409  *     cdef np.uint8_t[:,:,:,:] mask
2410  *
2411  */
2412 
2413 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MaskOcts {
2414   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2415 };
2416 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MaskOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_MaskOcts;
2417 
2418 
2419 /* "oct_visitors.pxd":72
2420  *     cdef np.uint8_t[:,:,:,:] mask
2421  *
2422  * cdef class IndexOcts(OctVisitor):             # <<<<<<<<<<<<<<
2423  *     cdef np.int64_t[:] oct_index
2424  *
2425  */
2426 
2427 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IndexOcts {
2428   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2429 };
2430 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IndexOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_IndexOcts;
2431 
2432 
2433 /* "oct_visitors.pxd":75
2434  *     cdef np.int64_t[:] oct_index
2435  *
2436  * cdef class MaskedIndexOcts(OctVisitor):             # <<<<<<<<<<<<<<
2437  *     cdef np.int64_t[:] oct_index
2438  *     cdef np.uint8_t[:] oct_mask
2439  */
2440 
2441 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MaskedIndexOcts {
2442   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2443 };
2444 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MaskedIndexOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_MaskedIndexOcts;
2445 
2446 
2447 /* "oct_visitors.pxd":79
2448  *     cdef np.uint8_t[:] oct_mask
2449  *
2450  * cdef class IndexMaskMapOcts(OctVisitor):             # <<<<<<<<<<<<<<
2451  *     cdef np.int64_t[:] oct_index
2452  *     cdef np.uint8_t[:] oct_mask
2453  */
2454 
2455 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IndexMaskMapOcts {
2456   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2457 };
2458 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IndexMaskMapOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_IndexMaskMapOcts;
2459 
2460 
2461 /* "oct_visitors.pxd":85
2462  *     cdef np.uint64_t map_index
2463  *
2464  * cdef class ICoordsOcts(OctVisitor):             # <<<<<<<<<<<<<<
2465  *     cdef np.int64_t[:,:] icoords
2466  *
2467  */
2468 
2469 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_ICoordsOcts {
2470   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2471 };
2472 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_ICoordsOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_ICoordsOcts;
2473 
2474 
2475 /* "oct_visitors.pxd":88
2476  *     cdef np.int64_t[:,:] icoords
2477  *
2478  * cdef class IResOcts(OctVisitor):             # <<<<<<<<<<<<<<
2479  *     cdef np.int64_t[:] ires
2480  *
2481  */
2482 
2483 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IResOcts {
2484   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2485 };
2486 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IResOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_IResOcts;
2487 
2488 
2489 /* "oct_visitors.pxd":91
2490  *     cdef np.int64_t[:] ires
2491  *
2492  * cdef class FCoordsOcts(OctVisitor):             # <<<<<<<<<<<<<<
2493  *     cdef np.float64_t[:,:] fcoords
2494  *
2495  */
2496 
2497 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FCoordsOcts {
2498   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2499 };
2500 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FCoordsOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_FCoordsOcts;
2501 
2502 
2503 /* "oct_visitors.pxd":94
2504  *     cdef np.float64_t[:,:] fcoords
2505  *
2506  * cdef class FWidthOcts(OctVisitor):             # <<<<<<<<<<<<<<
2507  *     cdef np.float64_t[:,:] fwidth
2508  *
2509  */
2510 
2511 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FWidthOcts {
2512   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2513 };
2514 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FWidthOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_FWidthOcts;
2515 
2516 
2517 /* "oct_visitors.pxd":97
2518  *     cdef np.float64_t[:,:] fwidth
2519  *
2520  * cdef class CopyArrayI64(OctVisitor):             # <<<<<<<<<<<<<<
2521  *     cdef np.int64_t[:,:,:,:,:,:] source
2522  *     cdef np.int64_t[:,:] dest
2523  */
2524 
2525 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyArrayI64 {
2526   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2527 };
2528 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyArrayI64 *__pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayI64;
2529 
2530 
2531 /* "oct_visitors.pxd":101
2532  *     cdef np.int64_t[:,:] dest
2533  *
2534  * cdef class CopyArrayF64(OctVisitor):             # <<<<<<<<<<<<<<
2535  *     cdef np.float64_t[:,:,:,:,:] source
2536  *     cdef np.float64_t[:,:] dest
2537  */
2538 
2539 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyArrayF64 {
2540   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2541 };
2542 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyArrayF64 *__pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayF64;
2543 
2544 
2545 /* "oct_visitors.pxd":105
2546  *     cdef np.float64_t[:,:] dest
2547  *
2548  * cdef class CopyFileIndArrayI8(OctVisitor):             # <<<<<<<<<<<<<<
2549  *     cdef np.int64_t root
2550  *     cdef np.uint8_t[:] source
2551  */
2552 
2553 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8 {
2554   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2555 };
2556 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8 *__pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8;
2557 
2558 
2559 /* "oct_visitors.pxd":110
2560  *     cdef np.uint8_t[:] dest
2561  *
2562  * cdef class IdentifyOcts(OctVisitor):             # <<<<<<<<<<<<<<
2563  *     cdef np.uint8_t[:] domain_mask
2564  *
2565  */
2566 
2567 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IdentifyOcts {
2568   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2569 };
2570 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IdentifyOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_IdentifyOcts;
2571 
2572 
2573 /* "oct_visitors.pxd":113
2574  *     cdef np.uint8_t[:] domain_mask
2575  *
2576  * cdef class AssignDomainInd(OctVisitor):             # <<<<<<<<<<<<<<
2577  *     pass
2578  *
2579  */
2580 
2581 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_AssignDomainInd {
2582   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2583 };
2584 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_AssignDomainInd *__pyx_vtabptr_2yt_8geometry_12oct_visitors_AssignDomainInd;
2585 
2586 
2587 /* "oct_visitors.pxd":116
2588  *     pass
2589  *
2590  * cdef class FillFileIndicesO(OctVisitor):             # <<<<<<<<<<<<<<
2591  *     cdef np.uint8_t[:] levels
2592  *     cdef np.int64_t[:] file_inds
2593  */
2594 
2595 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FillFileIndicesO {
2596   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2597 };
2598 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FillFileIndicesO *__pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesO;
2599 
2600 
2601 /* "oct_visitors.pxd":121
2602  *     cdef np.uint8_t[:] cell_inds
2603  *
2604  * cdef class FillFileIndicesR(OctVisitor):             # <<<<<<<<<<<<<<
2605  *     cdef np.uint8_t[:] levels
2606  *     cdef np.int64_t[:] file_inds
2607  */
2608 
2609 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FillFileIndicesR {
2610   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2611 };
2612 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FillFileIndicesR *__pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesR;
2613 
2614 
2615 /* "oct_visitors.pxd":126
2616  *     cdef np.uint8_t[:] cell_inds
2617  *
2618  * cdef class CountByDomain(OctVisitor):             # <<<<<<<<<<<<<<
2619  *     cdef np.int64_t[:] domain_counts
2620  *
2621  */
2622 
2623 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountByDomain {
2624   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2625 };
2626 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountByDomain *__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountByDomain;
2627 
2628 
2629 /* "oct_visitors.pxd":129
2630  *     cdef np.int64_t[:] domain_counts
2631  *
2632  * cdef class StoreOctree(OctVisitor):             # <<<<<<<<<<<<<<
2633  *     cdef np.uint8_t[:] ref_mask
2634  *
2635  */
2636 
2637 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreOctree {
2638   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2639 };
2640 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreOctree *__pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree;
2641 
2642 
2643 /* "oct_visitors.pxd":132
2644  *     cdef np.uint8_t[:] ref_mask
2645  *
2646  * cdef class LoadOctree(OctVisitor):             # <<<<<<<<<<<<<<
2647  *     cdef np.uint8_t[:] ref_mask
2648  *     cdef Oct* octs
2649  */
2650 
2651 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree {
2652   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2653 };
2654 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree *__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree;
2655 
2656 
2657 /* "oct_visitors.pxd":138
2658  *     cdef np.uint64_t *nfinest
2659  *
2660  * cdef class MortonIndexOcts(OctVisitor):             # <<<<<<<<<<<<<<
2661  *     cdef np.uint8_t[:] level_arr
2662  *     cdef np.uint64_t[:] morton_ind
2663  */
2664 
2665 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MortonIndexOcts {
2666   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2667 };
2668 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MortonIndexOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_MortonIndexOcts;
2669 
2670 
2671 /* "oct_visitors.pxd":149
2672  *
2673  *
2674  * cdef class StoreIndex(OctVisitor):             # <<<<<<<<<<<<<<
2675  *     cdef np.int64_t[:,:,:,:] cell_inds
2676  *
2677  */
2678 
2679 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreIndex {
2680   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2681 };
2682 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreIndex *__pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreIndex;
2683 
2684 
2685 /* "oct_visitors.pxd":153
2686  *
2687  * # cimport oct_container
2688  * cdef class BaseNeighbourVisitor(OctVisitor):             # <<<<<<<<<<<<<<
2689  *     cdef int idim      # 0,1,2 for x,y,z
2690  *     cdef int direction # +1 for +x, -1 for -x
2691  */
2692 
2693 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor {
2694   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2695   void (*set_neighbour_info)(struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, int *);
2696   __pyx_t_5numpy_uint8_t (*neighbour_rind)(struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor *);
2697 };
2698 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor *__pyx_vtabptr_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor;
2699 static CYTHON_INLINE __pyx_t_5numpy_uint8_t __pyx_f_2yt_8geometry_12oct_visitors_20BaseNeighbourVisitor_neighbour_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor *);
2700 
2701 
2702 /* "oct_visitors.pxd":169
2703  *         return (((self.neigh_ind[2]*d)+self.neigh_ind[1])*d+self.neigh_ind[0])
2704  *
2705  * cdef class NeighbourCellIndexVisitor(BaseNeighbourVisitor):             # <<<<<<<<<<<<<<
2706  *     cdef np.uint8_t[::1] cell_inds
2707  *     cdef np.int64_t[::1] domain_inds
2708  */
2709 
2710 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor {
2711   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor __pyx_base;
2712 };
2713 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor *__pyx_vtabptr_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor;
2714 
2715 
2716 /* "oct_visitors.pxd":173
2717  *     cdef np.int64_t[::1] domain_inds
2718  *
2719  * cdef class NeighbourCellVisitor(BaseNeighbourVisitor):             # <<<<<<<<<<<<<<
2720  *     cdef np.uint8_t[::1] levels
2721  *     cdef np.int64_t[::1] file_inds
2722  */
2723 
2724 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_NeighbourCellVisitor {
2725   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor __pyx_base;
2726 };
2727 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_NeighbourCellVisitor *__pyx_vtabptr_2yt_8geometry_12oct_visitors_NeighbourCellVisitor;
2728 
2729 
2730 /* "selection_routines.pxd":24
2731  *
2732  *
2733  * cdef class SelectorObject:             # <<<<<<<<<<<<<<
2734  *     cdef public np.int32_t min_level
2735  *     cdef public np.int32_t max_level
2736  */
2737 
2738 struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject {
2739   void (*recursively_visit_octs)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, int, struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_recursively_visit_octs *__pyx_optional_args);
2740   void (*visit_oct_cells)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, int, int, int);
2741   int (*select_grid)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int32_t, struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid *__pyx_optional_args);
2742   int (*select_grid_edge)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int32_t, struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid_edge *__pyx_optional_args);
2743   int (*select_cell)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *);
2744   int (*select_point)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *);
2745   int (*select_sphere)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t);
2746   int (*select_bbox)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *);
2747   int (*select_bbox_edge)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *);
2748   int (*fill_mask_selector)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, int *, PyArrayObject *, PyArrayObject *, int);
2749   void (*visit_grid_cells)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *, __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function *, struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells *__pyx_optional_args);
2750   __pyx_t_5numpy_float64_t (*periodic_difference)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, int);
2751 };
2752 static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject;
2753 
2754 
2755 /* "selection_routines.pxd":70
2756  *         self, np.float64_t x1, np.float64_t x2, int d) nogil
2757  *
2758  * cdef class AlwaysSelector(SelectorObject):             # <<<<<<<<<<<<<<
2759  *     pass
2760  *
2761  */
2762 
2763 struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector {
2764   struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
2765 };
2766 static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector;
2767 
2768 
2769 /* "selection_routines.pxd":73
2770  *     pass
2771  *
2772  * cdef class OctreeSubsetSelector(SelectorObject):             # <<<<<<<<<<<<<<
2773  *     cdef public SelectorObject base_selector
2774  *     cdef public np.int64_t domain_id
2775  */
2776 
2777 struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector {
2778   struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
2779 };
2780 static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector;
2781 
2782 
2783 /* "selection_routines.pxd":77
2784  *     cdef public np.int64_t domain_id
2785  *
2786  * cdef class BooleanSelector(SelectorObject):             # <<<<<<<<<<<<<<
2787  *     cdef public SelectorObject sel1
2788  *     cdef public SelectorObject sel2
2789  */
2790 
2791 struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector {
2792   struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
2793 };
2794 static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector;
2795 
2796 
2797 /* "yt/utilities/lib/allocation_container.pxd":20
2798  *     void *my_objs
2799  *
2800  * cdef class ObjectPool:             # <<<<<<<<<<<<<<
2801  *     cdef public np.uint64_t itemsize
2802  *     cdef np.uint64_t n_con
2803  */
2804 
2805 struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool {
2806   void (*allocate_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, int, struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs *__pyx_optional_args);
2807   void (*setup_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t);
2808   void (*teardown_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t);
2809 };
2810 static struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool;
2811 
2812 
2813 /* "oct_container.pxd":47
2814  *     Oct *my_objs
2815  *
2816  * cdef class OctObjectPool(ObjectPool):             # <<<<<<<<<<<<<<
2817  *     cdef inline OctAllocationContainer *get_cont(self, int i):
2818  *         return <OctAllocationContainer*> (&self.containers[i])
2819  */
2820 
2821 struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool {
2822   struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base;
2823   struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *(*get_cont)(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int);
2824 };
2825 static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool *__pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool;
2826 static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int);
2827 
2828 
2829 /* "oct_container.pxd":55
2830  * cdef void OctList_delete(OctList *list)
2831  *
2832  * cdef class OctreeContainer:             # <<<<<<<<<<<<<<
2833  *     cdef public OctObjectPool domains
2834  *     cdef Oct ****root_mesh
2835  */
2836 
2837 struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer {
2838   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *(*get)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_float64_t *, struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get *__pyx_optional_args);
2839   int (*get_root)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **);
2840   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **(*neighbors)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo *, __pyx_t_5numpy_int64_t *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, int *);
2841   __pyx_t_5numpy_int64_t (*get_domain_offset)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int);
2842   void (*visit_all_octs)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs *__pyx_optional_args);
2843   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *(*next_root)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int, int *);
2844   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *(*next_child)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int, int *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *);
2845   void (*append_domain)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_int64_t);
2846 };
2847 static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer;
2848 
2849 
2850 /* "oct_container.pxd":85
2851  *     cdef public object fill_style
2852  *
2853  * cdef class SparseOctreeContainer(OctreeContainer):             # <<<<<<<<<<<<<<
2854  *     cdef OctKey *root_nodes
2855  *     cdef void *tree_root
2856  */
2857 
2858 struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer {
2859   struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer __pyx_base;
2860   void (*key_to_ipos)(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t *);
2861   __pyx_t_5numpy_int64_t (*ipos_to_key)(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *, int *);
2862 };
2863 static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer;
2864 
2865 
2866 /* "oct_container.pxd":93
2867  *     cdef np.int64_t ipos_to_key(self, int pos[3]) nogil
2868  *
2869  * cdef class RAMSESOctreeContainer(SparseOctreeContainer):             # <<<<<<<<<<<<<<
2870  *     pass
2871  *
2872  */
2873 
2874 struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer {
2875   struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer __pyx_base;
2876 };
2877 static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer;
2878 
2879 
2880 /* "yt/utilities/lib/distance_queue.pxd":35
2881  *                          np.float64_t max_dist2)
2882  *
2883  * cdef class PriorityQueue:             # <<<<<<<<<<<<<<
2884  *     cdef int maxn
2885  *     cdef int curn
2886  */
2887 
2888 struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_PriorityQueue {
2889   void (*item_reset)(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue *);
2890   int (*item_insert)(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t);
2891 };
2892 static struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_PriorityQueue *__pyx_vtabptr_2yt_9utilities_3lib_14distance_queue_PriorityQueue;
2893 
2894 
2895 /* "yt/utilities/lib/distance_queue.pxd":42
2896  *     cdef int item_insert(self, np.int64_t i, np.float64_t value)
2897  *
2898  * cdef class DistanceQueue(PriorityQueue):             # <<<<<<<<<<<<<<
2899  *     cdef np.float64_t DW[3]
2900  *     cdef bint periodicity[3]
2901  */
2902 
2903 struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_DistanceQueue {
2904   struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_PriorityQueue __pyx_base;
2905   void (*_setup)(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *, __pyx_t_5numpy_float64_t *, int *);
2906   void (*neighbor_eval)(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *);
2907   void (*neighbor_reset)(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *);
2908 };
2909 static struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_vtabptr_2yt_9utilities_3lib_14distance_queue_DistanceQueue;
2910 
2911 
2912 /* "particle_deposit.pxd":139
2913  *             raise NotImplementedError
2914  *
2915  * cdef class ParticleDepositOperation:             # <<<<<<<<<<<<<<
2916  *     # We assume each will allocate and define their own temporary storage
2917  *     cdef kernel_func sph_kernel
2918  */
2919 
2920 struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_ParticleDepositOperation {
2921   int (*process)(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *, int *, int, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_int64_t);
2922 };
2923 static struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_ParticleDepositOperation *__pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation;
2924 
2925 
2926 /* "yt/geometry/particle_smooth.pyx":34
2927  *     opos[2] = ipos[2]
2928  *
2929  * cdef class ParticleSmoothOperation:             # <<<<<<<<<<<<<<
2930  *     def __init__(self, nvals, nfields, max_neighbors, kernel_name):
2931  *         # This is the set of cells, in grids, blocks or octs, we are handling.
2932  */
2933 
2934 struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation {
2935   void (*neighbor_process)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_float64_t **, __Pyx_memviewslice, __pyx_t_5numpy_int64_t **, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t **, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_int64_t, int *, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *);
2936   int (*neighbor_search)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_float64_t *, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_int64_t **, int *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, struct __pyx_opt_args_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_search *__pyx_optional_args);
2937   void (*neighbor_process_particle)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_float64_t **, __Pyx_memviewslice, __pyx_t_5numpy_int64_t **, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t **, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_int64_t, int *, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *);
2938   void (*neighbor_find)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *);
2939   void (*process)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, int, int, int, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t **, __pyx_t_5numpy_float64_t **, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *);
2940 };
2941 static struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_vtabptr_2yt_8geometry_15particle_smooth_ParticleSmoothOperation;
2942 
2943 
2944 /* "yt/geometry/particle_smooth.pyx":577
2945  *         self.process(offset, i, j, k, dim, opos, fields, index_fields, dq)
2946  *
2947  * cdef class VolumeWeightedSmooth(ParticleSmoothOperation):             # <<<<<<<<<<<<<<
2948  *     # This smoothing function evaluates the field, *without* normalization, at
2949  *     # every point in the *mesh*.  Applying a normalization results in
2950  */
2951 
2952 struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth {
2953   struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation __pyx_base;
2954 };
2955 static struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_vtabptr_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth;
2956 
2957 
2958 /* "yt/geometry/particle_smooth.pyx":654
2959  * volume_weighted_smooth = VolumeWeightedSmooth
2960  *
2961  * cdef class NearestNeighborSmooth(ParticleSmoothOperation):             # <<<<<<<<<<<<<<
2962  *     cdef np.float64_t *fp
2963  *     cdef public object vals
2964  */
2965 
2966 struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_NearestNeighborSmooth {
2967   struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation __pyx_base;
2968 };
2969 static struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_vtabptr_2yt_8geometry_15particle_smooth_NearestNeighborSmooth;
2970 
2971 
2972 /* "yt/geometry/particle_smooth.pyx":686
2973  * nearest_smooth = NearestNeighborSmooth
2974  *
2975  * cdef class IDWInterpolationSmooth(ParticleSmoothOperation):             # <<<<<<<<<<<<<<
2976  *     cdef np.float64_t *fp
2977  *     cdef public int p2
2978  */
2979 
2980 struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth {
2981   struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation __pyx_base;
2982 };
2983 static struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_vtabptr_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth;
2984 
2985 
2986 /* "yt/geometry/particle_smooth.pyx":729
2987  * idw_smooth = IDWInterpolationSmooth
2988  *
2989  * cdef class NthNeighborDistanceSmooth(ParticleSmoothOperation):             # <<<<<<<<<<<<<<
2990  *
2991  *     def initialize(self):
2992  */
2993 
2994 struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth {
2995   struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation __pyx_base;
2996 };
2997 static struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *__pyx_vtabptr_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth;
2998 
2999 
3000 /* "yt/geometry/particle_smooth.pyx":751
3001  * nth_neighbor_smooth = NthNeighborDistanceSmooth
3002  *
3003  * cdef class SmoothedDensityEstimate(ParticleSmoothOperation):             # <<<<<<<<<<<<<<
3004  *     def initialize(self):
3005  *         return
3006  */
3007 
3008 struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate {
3009   struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation __pyx_base;
3010 };
3011 static struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *__pyx_vtabptr_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate;
3012 
3013 
3014 /* "View.MemoryView":105
3015  *
3016  * @cname("__pyx_array")
3017  * cdef class array:             # <<<<<<<<<<<<<<
3018  *
3019  *     cdef:
3020  */
3021 
3022 struct __pyx_vtabstruct_array {
3023   PyObject *(*get_memview)(struct __pyx_array_obj *);
3024 };
3025 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
3026 
3027 
3028 /* "View.MemoryView":330
3029  *
3030  * @cname('__pyx_memoryview')
3031  * cdef class memoryview(object):             # <<<<<<<<<<<<<<
3032  *
3033  *     cdef object obj
3034  */
3035 
3036 struct __pyx_vtabstruct_memoryview {
3037   char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
3038   PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
3039   PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
3040   PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
3041   PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
3042   PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
3043   PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
3044 };
3045 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
3046 
3047 
3048 /* "View.MemoryView":961
3049  *
3050  * @cname('__pyx_memoryviewslice')
3051  * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
3052  *     "Internal class for passing memoryview slices to Python"
3053  *
3054  */
3055 
3056 struct __pyx_vtabstruct__memoryviewslice {
3057   struct __pyx_vtabstruct_memoryview __pyx_base;
3058 };
3059 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
3060 
3061 /* --- Runtime support code (head) --- */
3062 /* Refnanny.proto */
3063 #ifndef CYTHON_REFNANNY
3064   #define CYTHON_REFNANNY 0
3065 #endif
3066 #if CYTHON_REFNANNY
3067   typedef struct {
3068     void (*INCREF)(void*, PyObject*, int);
3069     void (*DECREF)(void*, PyObject*, int);
3070     void (*GOTREF)(void*, PyObject*, int);
3071     void (*GIVEREF)(void*, PyObject*, int);
3072     void* (*SetupContext)(const char*, int, const char*);
3073     void (*FinishContext)(void**);
3074   } __Pyx_RefNannyAPIStruct;
3075   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
3076   static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
3077   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
3078 #ifdef WITH_THREAD
3079   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
3080           if (acquire_gil) {\
3081               PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
3082               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
3083               PyGILState_Release(__pyx_gilstate_save);\
3084           } else {\
3085               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
3086           }
3087 #else
3088   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
3089           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
3090 #endif
3091   #define __Pyx_RefNannyFinishContext()\
3092           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
3093   #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
3094   #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
3095   #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
3096   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
3097   #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
3098   #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
3099   #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
3100   #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
3101 #else
3102   #define __Pyx_RefNannyDeclarations
3103   #define __Pyx_RefNannySetupContext(name, acquire_gil)
3104   #define __Pyx_RefNannyFinishContext()
3105   #define __Pyx_INCREF(r) Py_INCREF(r)
3106   #define __Pyx_DECREF(r) Py_DECREF(r)
3107   #define __Pyx_GOTREF(r)
3108   #define __Pyx_GIVEREF(r)
3109   #define __Pyx_XINCREF(r) Py_XINCREF(r)
3110   #define __Pyx_XDECREF(r) Py_XDECREF(r)
3111   #define __Pyx_XGOTREF(r)
3112   #define __Pyx_XGIVEREF(r)
3113 #endif
3114 #define __Pyx_XDECREF_SET(r, v) do {\
3115         PyObject *tmp = (PyObject *) r;\
3116         r = v; __Pyx_XDECREF(tmp);\
3117     } while (0)
3118 #define __Pyx_DECREF_SET(r, v) do {\
3119         PyObject *tmp = (PyObject *) r;\
3120         r = v; __Pyx_DECREF(tmp);\
3121     } while (0)
3122 #define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
3123 #define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
3124 
3125 /* PyObjectGetAttrStr.proto */
3126 #if CYTHON_USE_TYPE_SLOTS
3127 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
3128 #else
3129 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
3130 #endif
3131 
3132 /* GetBuiltinName.proto */
3133 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
3134 
3135 /* RaiseArgTupleInvalid.proto */
3136 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
3137     Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
3138 
3139 /* RaiseDoubleKeywords.proto */
3140 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
3141 
3142 /* ParseKeywords.proto */
3143 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
3144     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
3145     const char* function_name);
3146 
3147 /* KeywordStringCheck.proto */
3148 static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
3149 
3150 /* PyThreadStateGet.proto */
3151 #if CYTHON_FAST_THREAD_STATE
3152 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
3153 #define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
3154 #define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
3155 #else
3156 #define __Pyx_PyThreadState_declare
3157 #define __Pyx_PyThreadState_assign
3158 #define __Pyx_PyErr_Occurred()  PyErr_Occurred()
3159 #endif
3160 
3161 /* PyErrFetchRestore.proto */
3162 #if CYTHON_FAST_THREAD_STATE
3163 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
3164 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
3165 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
3166 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
3167 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
3168 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
3169 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3170 #if CYTHON_COMPILING_IN_CPYTHON
3171 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
3172 #else
3173 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
3174 #endif
3175 #else
3176 #define __Pyx_PyErr_Clear() PyErr_Clear()
3177 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
3178 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
3179 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
3180 #define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
3181 #define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
3182 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
3183 #define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
3184 #endif
3185 
3186 /* RaiseException.proto */
3187 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
3188 
3189 /* MemviewSliceInit.proto */
3190 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
3191 #define __Pyx_MEMVIEW_DIRECT   1
3192 #define __Pyx_MEMVIEW_PTR      2
3193 #define __Pyx_MEMVIEW_FULL     4
3194 #define __Pyx_MEMVIEW_CONTIG   8
3195 #define __Pyx_MEMVIEW_STRIDED  16
3196 #define __Pyx_MEMVIEW_FOLLOW   32
3197 #define __Pyx_IS_C_CONTIG 1
3198 #define __Pyx_IS_F_CONTIG 2
3199 static int __Pyx_init_memviewslice(
3200                 struct __pyx_memoryview_obj *memview,
3201                 int ndim,
3202                 __Pyx_memviewslice *memviewslice,
3203                 int memview_is_new_reference);
3204 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
3205     __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
3206 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
3207     __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
3208 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
3209 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
3210 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
3211 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
3212 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
3213 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
3214 
3215 /* ArgTypeTest.proto */
3216 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
3217     ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
3218         __Pyx__ArgTypeTest(obj, type, name, exact))
3219 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
3220 
3221 /* IncludeStringH.proto */
3222 #include <string.h>
3223 
3224 /* BytesEquals.proto */
3225 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
3226 
3227 /* UnicodeEquals.proto */
3228 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
3229 
3230 /* StrEquals.proto */
3231 #if PY_MAJOR_VERSION >= 3
3232 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
3233 #else
3234 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
3235 #endif
3236 
3237 /* PyDictVersioning.proto */
3238 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
3239 #define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
3240 #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
3241 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
3242     (version_var) = __PYX_GET_DICT_VERSION(dict);\
3243     (cache_var) = (value);
3244 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
3245     static PY_UINT64_T __pyx_dict_version = 0;\
3246     static PyObject *__pyx_dict_cached_value = NULL;\
3247     if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
3248         (VAR) = __pyx_dict_cached_value;\
3249     } else {\
3250         (VAR) = __pyx_dict_cached_value = (LOOKUP);\
3251         __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
3252     }\
3253 }
3254 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
3255 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
3256 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
3257 #else
3258 #define __PYX_GET_DICT_VERSION(dict)  (0)
3259 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
3260 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
3261 #endif
3262 
3263 /* GetModuleGlobalName.proto */
3264 #if CYTHON_USE_DICT_VERSIONS
3265 #define __Pyx_GetModuleGlobalName(var, name)  {\
3266     static PY_UINT64_T __pyx_dict_version = 0;\
3267     static PyObject *__pyx_dict_cached_value = NULL;\
3268     (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
3269         (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
3270         __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
3271 }
3272 #define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
3273     PY_UINT64_T __pyx_dict_version;\
3274     PyObject *__pyx_dict_cached_value;\
3275     (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
3276 }
3277 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
3278 #else
3279 #define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
3280 #define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
3281 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
3282 #endif
3283 
3284 /* PyObjectCall.proto */
3285 #if CYTHON_COMPILING_IN_CPYTHON
3286 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
3287 #else
3288 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
3289 #endif
3290 
3291 /* PyCFunctionFastCall.proto */
3292 #if CYTHON_FAST_PYCCALL
3293 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
3294 #else
3295 #define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
3296 #endif
3297 
3298 /* PyFunctionFastCall.proto */
3299 #if CYTHON_FAST_PYCALL
3300 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
3301     __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
3302 #if 1 || PY_VERSION_HEX < 0x030600B1
3303 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
3304 #else
3305 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
3306 #endif
3307 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
3308     (sizeof(char [1 - 2*!(cond)]) - 1)
3309 #ifndef Py_MEMBER_SIZE
3310 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
3311 #endif
3312   static size_t __pyx_pyframe_localsplus_offset = 0;
3313   #include "frameobject.h"
3314   #define __Pxy_PyFrame_Initialize_Offsets()\
3315     ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
3316      (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
3317   #define __Pyx_PyFrame_GetLocalsplus(frame)\
3318     (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
3319 #endif
3320 
3321 /* PyObjectCall2Args.proto */
3322 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
3323 
3324 /* PyObjectCallMethO.proto */
3325 #if CYTHON_COMPILING_IN_CPYTHON
3326 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
3327 #endif
3328 
3329 /* PyObjectCallOneArg.proto */
3330 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
3331 
3332 /* PyIntBinop.proto */
3333 #if !CYTHON_COMPILING_IN_PYPY
3334 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
3335 #else
3336 #define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\
3337     (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
3338 #endif
3339 
3340 /* GetItemInt.proto */
3341 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
3342     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
3343     __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
3344     (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
3345                __Pyx_GetItemInt_Generic(o, to_py_func(i))))
3346 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
3347     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
3348     __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
3349     (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
3350 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
3351                                                               int wraparound, int boundscheck);
3352 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
3353     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
3354     __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
3355     (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
3356 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
3357                                                               int wraparound, int boundscheck);
3358 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
3359 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
3360                                                      int is_list, int wraparound, int boundscheck);
3361 
3362 /* ExtTypeTest.proto */
3363 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
3364 
3365 /* IsLittleEndian.proto */
3366 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
3367 
3368 /* BufferFormatCheck.proto */
3369 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
3370 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
3371                               __Pyx_BufFmt_StackElem* stack,
3372                               __Pyx_TypeInfo* type);
3373 
3374 /* BufferGetAndValidate.proto */
3375 #define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
3376     ((obj == Py_None || obj == NULL) ?\
3377     (__Pyx_ZeroBuffer(buf), 0) :\
3378     __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
3379 static int  __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
3380     __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
3381 static void __Pyx_ZeroBuffer(Py_buffer* buf);
3382 static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
3383 static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
3384 static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
3385 
3386 /* BufferFallbackError.proto */
3387 static void __Pyx_RaiseBufferFallbackError(void);
3388 
3389 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
3390 /* ObjectGetItem.proto */
3391 #if CYTHON_USE_TYPE_SLOTS
3392 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
3393 #else
3394 #define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
3395 #endif
3396 
3397 #define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)
3398 /* WriteUnraisableException.proto */
3399 static void __Pyx_WriteUnraisable(const char *name, int clineno,
3400                                   int lineno, const char *filename,
3401                                   int full_traceback, int nogil);
3402 
3403 /* ListAppend.proto */
3404 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_PyList_Append(PyObject * list,PyObject * x)3405 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
3406     PyListObject* L = (PyListObject*) list;
3407     Py_ssize_t len = Py_SIZE(list);
3408     if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
3409         Py_INCREF(x);
3410         PyList_SET_ITEM(list, len, x);
3411         Py_SIZE(list) = len+1;
3412         return 0;
3413     }
3414     return PyList_Append(list, x);
3415 }
3416 #else
3417 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
3418 #endif
3419 
3420 /* PyObjectGetMethod.proto */
3421 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
3422 
3423 /* PyObjectCallMethod1.proto */
3424 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
3425 
3426 /* append.proto */
3427 static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);
3428 
3429 /* DictGetItem.proto */
3430 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
3431 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
3432 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
3433     (likely(PyDict_CheckExact(obj)) ?\
3434      __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
3435 #else
3436 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
3437 #define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
3438 #endif
3439 
3440 /* RaiseTooManyValuesToUnpack.proto */
3441 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
3442 
3443 /* RaiseNeedMoreValuesToUnpack.proto */
3444 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
3445 
3446 /* RaiseNoneIterError.proto */
3447 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
3448 
3449 /* GetTopmostException.proto */
3450 #if CYTHON_USE_EXC_INFO_STACK
3451 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
3452 #endif
3453 
3454 /* SaveResetException.proto */
3455 #if CYTHON_FAST_THREAD_STATE
3456 #define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
3457 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3458 #define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
3459 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
3460 #else
3461 #define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
3462 #define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
3463 #endif
3464 
3465 /* PyErrExceptionMatches.proto */
3466 #if CYTHON_FAST_THREAD_STATE
3467 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
3468 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
3469 #else
3470 #define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
3471 #endif
3472 
3473 /* GetException.proto */
3474 #if CYTHON_FAST_THREAD_STATE
3475 #define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
3476 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3477 #else
3478 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
3479 #endif
3480 
3481 /* GetAttr.proto */
3482 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
3483 
3484 /* HasAttr.proto */
3485 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
3486 
3487 /* BufferIndexError.proto */
3488 static void __Pyx_RaiseBufferIndexError(int axis);
3489 
3490 /* None.proto */
3491 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
3492 
3493 /* UnaryNegOverflows.proto */
3494 #define UNARY_NEG_WOULD_OVERFLOW(x)\
3495         (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
3496 
3497 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
3498 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
3499 /* decode_c_string_utf16.proto */
__Pyx_PyUnicode_DecodeUTF16(const char * s,Py_ssize_t size,const char * errors)3500 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
3501     int byteorder = 0;
3502     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
3503 }
__Pyx_PyUnicode_DecodeUTF16LE(const char * s,Py_ssize_t size,const char * errors)3504 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
3505     int byteorder = -1;
3506     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
3507 }
__Pyx_PyUnicode_DecodeUTF16BE(const char * s,Py_ssize_t size,const char * errors)3508 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
3509     int byteorder = 1;
3510     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
3511 }
3512 
3513 /* decode_c_string.proto */
3514 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
3515          const char* cstring, Py_ssize_t start, Py_ssize_t stop,
3516          const char* encoding, const char* errors,
3517          PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
3518 
3519 /* GetAttr3.proto */
3520 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
3521 
3522 /* SwapException.proto */
3523 #if CYTHON_FAST_THREAD_STATE
3524 #define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
3525 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3526 #else
3527 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
3528 #endif
3529 
3530 /* Import.proto */
3531 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
3532 
3533 /* FastTypeChecks.proto */
3534 #if CYTHON_COMPILING_IN_CPYTHON
3535 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
3536 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
3537 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
3538 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
3539 #else
3540 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
3541 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
3542 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
3543 #endif
3544 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
3545 
3546 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
3547 /* ListCompAppend.proto */
3548 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_ListComp_Append(PyObject * list,PyObject * x)3549 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
3550     PyListObject* L = (PyListObject*) list;
3551     Py_ssize_t len = Py_SIZE(list);
3552     if (likely(L->allocated > len)) {
3553         Py_INCREF(x);
3554         PyList_SET_ITEM(list, len, x);
3555         Py_SIZE(list) = len+1;
3556         return 0;
3557     }
3558     return PyList_Append(list, x);
3559 }
3560 #else
3561 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
3562 #endif
3563 
3564 /* PyIntBinop.proto */
3565 #if !CYTHON_COMPILING_IN_PYPY
3566 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
3567 #else
3568 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
3569     (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
3570 #endif
3571 
3572 /* ListExtend.proto */
__Pyx_PyList_Extend(PyObject * L,PyObject * v)3573 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
3574 #if CYTHON_COMPILING_IN_CPYTHON
3575     PyObject* none = _PyList_Extend((PyListObject*)L, v);
3576     if (unlikely(!none))
3577         return -1;
3578     Py_DECREF(none);
3579     return 0;
3580 #else
3581     return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
3582 #endif
3583 }
3584 
3585 /* None.proto */
3586 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
3587 
3588 /* None.proto */
3589 static CYTHON_INLINE long __Pyx_div_long(long, long);
3590 
3591 /* ImportFrom.proto */
3592 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
3593 
3594 /* PyObject_GenericGetAttrNoDict.proto */
3595 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
3596 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
3597 #else
3598 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
3599 #endif
3600 
3601 /* PyObject_GenericGetAttr.proto */
3602 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
3603 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
3604 #else
3605 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
3606 #endif
3607 
3608 /* SetVTable.proto */
3609 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
3610 
3611 /* SetupReduce.proto */
3612 static int __Pyx_setup_reduce(PyObject* type_obj);
3613 
3614 /* TypeImport.proto */
3615 #ifndef __PYX_HAVE_RT_ImportType_proto
3616 #define __PYX_HAVE_RT_ImportType_proto
3617 enum __Pyx_ImportType_CheckSize {
3618    __Pyx_ImportType_CheckSize_Error = 0,
3619    __Pyx_ImportType_CheckSize_Warn = 1,
3620    __Pyx_ImportType_CheckSize_Ignore = 2
3621 };
3622 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
3623 #endif
3624 
3625 /* GetVTable.proto */
3626 static void* __Pyx_GetVtable(PyObject *dict);
3627 
3628 /* CLineInTraceback.proto */
3629 #ifdef CYTHON_CLINE_IN_TRACEBACK
3630 #define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
3631 #else
3632 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
3633 #endif
3634 
3635 /* CodeObjectCache.proto */
3636 typedef struct {
3637     PyCodeObject* code_object;
3638     int code_line;
3639 } __Pyx_CodeObjectCacheEntry;
3640 struct __Pyx_CodeObjectCache {
3641     int count;
3642     int max_count;
3643     __Pyx_CodeObjectCacheEntry* entries;
3644 };
3645 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
3646 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
3647 static PyCodeObject *__pyx_find_code_object(int code_line);
3648 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
3649 
3650 /* AddTraceback.proto */
3651 static void __Pyx_AddTraceback(const char *funcname, int c_line,
3652                                int py_line, const char *filename);
3653 
3654 #if PY_MAJOR_VERSION < 3
3655     static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
3656     static void __Pyx_ReleaseBuffer(Py_buffer *view);
3657 #else
3658     #define __Pyx_GetBuffer PyObject_GetBuffer
3659     #define __Pyx_ReleaseBuffer PyBuffer_Release
3660 #endif
3661 
3662 
3663 /* BufferStructDeclare.proto */
3664 typedef struct {
3665   Py_ssize_t shape, strides, suboffsets;
3666 } __Pyx_Buf_DimInfo;
3667 typedef struct {
3668   size_t refcount;
3669   Py_buffer pybuffer;
3670 } __Pyx_Buffer;
3671 typedef struct {
3672   __Pyx_Buffer *rcbuffer;
3673   char *data;
3674   __Pyx_Buf_DimInfo diminfo[8];
3675 } __Pyx_LocalBuf_ND;
3676 
3677 /* MemviewSliceIsContig.proto */
3678 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
3679 
3680 /* OverlappingSlices.proto */
3681 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
3682                                 __Pyx_memviewslice *slice2,
3683                                 int ndim, size_t itemsize);
3684 
3685 /* Capsule.proto */
3686 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
3687 
3688 /* TypeInfoCompare.proto */
3689 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
3690 
3691 /* MemviewSliceValidateAndInit.proto */
3692 static int __Pyx_ValidateAndInit_memviewslice(
3693                 int *axes_specs,
3694                 int c_or_f_flag,
3695                 int buf_flags,
3696                 int ndim,
3697                 __Pyx_TypeInfo *dtype,
3698                 __Pyx_BufFmt_StackElem stack[],
3699                 __Pyx_memviewslice *memviewslice,
3700                 PyObject *original_obj);
3701 
3702 /* ObjectToMemviewSlice.proto */
3703 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *, int writable_flag);
3704 
3705 /* ObjectToMemviewSlice.proto */
3706 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *, int writable_flag);
3707 
3708 /* MemviewDtypeToObject.proto */
3709 static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp);
3710 static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj);
3711 
3712 /* CIntToPy.proto */
3713 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value);
3714 
3715 /* MemviewDtypeToObject.proto */
3716 static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char *itemp);
3717 static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_int64_t(const char *itemp, PyObject *obj);
3718 
3719 /* CIntToPy.proto */
3720 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
3721 
3722 /* CIntToPy.proto */
3723 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);
3724 
3725 /* Print.proto */
3726 static int __Pyx_Print(PyObject*, PyObject *, int);
3727 #if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
3728 static PyObject* __pyx_print = 0;
3729 static PyObject* __pyx_print_kwargs = 0;
3730 #endif
3731 
3732 /* CIntToPy.proto */
3733 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
3734 
3735 /* RealImag.proto */
3736 #if CYTHON_CCOMPLEX
3737   #ifdef __cplusplus
3738     #define __Pyx_CREAL(z) ((z).real())
3739     #define __Pyx_CIMAG(z) ((z).imag())
3740   #else
3741     #define __Pyx_CREAL(z) (__real__(z))
3742     #define __Pyx_CIMAG(z) (__imag__(z))
3743   #endif
3744 #else
3745     #define __Pyx_CREAL(z) ((z).real)
3746     #define __Pyx_CIMAG(z) ((z).imag)
3747 #endif
3748 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
3749         && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
3750     #define __Pyx_SET_CREAL(z,x) ((z).real(x))
3751     #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
3752 #else
3753     #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
3754     #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
3755 #endif
3756 
3757 /* Arithmetic.proto */
3758 #if CYTHON_CCOMPLEX
3759     #define __Pyx_c_eq_float(a, b)   ((a)==(b))
3760     #define __Pyx_c_sum_float(a, b)  ((a)+(b))
3761     #define __Pyx_c_diff_float(a, b) ((a)-(b))
3762     #define __Pyx_c_prod_float(a, b) ((a)*(b))
3763     #define __Pyx_c_quot_float(a, b) ((a)/(b))
3764     #define __Pyx_c_neg_float(a)     (-(a))
3765   #ifdef __cplusplus
3766     #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
3767     #define __Pyx_c_conj_float(z)    (::std::conj(z))
3768     #if 1
3769         #define __Pyx_c_abs_float(z)     (::std::abs(z))
3770         #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
3771     #endif
3772   #else
3773     #define __Pyx_c_is_zero_float(z) ((z)==0)
3774     #define __Pyx_c_conj_float(z)    (conjf(z))
3775     #if 1
3776         #define __Pyx_c_abs_float(z)     (cabsf(z))
3777         #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
3778     #endif
3779  #endif
3780 #else
3781     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
3782     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
3783     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
3784     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
3785     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
3786     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
3787     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
3788     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
3789     #if 1
3790         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
3791         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
3792     #endif
3793 #endif
3794 
3795 /* Arithmetic.proto */
3796 #if CYTHON_CCOMPLEX
3797     #define __Pyx_c_eq_double(a, b)   ((a)==(b))
3798     #define __Pyx_c_sum_double(a, b)  ((a)+(b))
3799     #define __Pyx_c_diff_double(a, b) ((a)-(b))
3800     #define __Pyx_c_prod_double(a, b) ((a)*(b))
3801     #define __Pyx_c_quot_double(a, b) ((a)/(b))
3802     #define __Pyx_c_neg_double(a)     (-(a))
3803   #ifdef __cplusplus
3804     #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
3805     #define __Pyx_c_conj_double(z)    (::std::conj(z))
3806     #if 1
3807         #define __Pyx_c_abs_double(z)     (::std::abs(z))
3808         #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
3809     #endif
3810   #else
3811     #define __Pyx_c_is_zero_double(z) ((z)==0)
3812     #define __Pyx_c_conj_double(z)    (conj(z))
3813     #if 1
3814         #define __Pyx_c_abs_double(z)     (cabs(z))
3815         #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
3816     #endif
3817  #endif
3818 #else
3819     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
3820     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
3821     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
3822     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
3823     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
3824     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
3825     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
3826     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
3827     #if 1
3828         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
3829         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
3830     #endif
3831 #endif
3832 
3833 /* CIntToPy.proto */
3834 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
3835 
3836 /* MemviewSliceCopyTemplate.proto */
3837 static __Pyx_memviewslice
3838 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
3839                                  const char *mode, int ndim,
3840                                  size_t sizeof_dtype, int contig_flag,
3841                                  int dtype_is_object);
3842 
3843 /* CIntFromPy.proto */
3844 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
3845 
3846 /* CIntFromPy.proto */
3847 static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *);
3848 
3849 /* PrintOne.proto */
3850 static int __Pyx_PrintOne(PyObject* stream, PyObject *o);
3851 
3852 /* CIntFromPy.proto */
3853 static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *);
3854 
3855 /* CIntFromPy.proto */
3856 static CYTHON_INLINE npy_uint32 __Pyx_PyInt_As_npy_uint32(PyObject *);
3857 
3858 /* CIntFromPy.proto */
3859 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
3860 
3861 /* CIntFromPy.proto */
3862 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
3863 
3864 /* ObjectToMemviewSlice.proto */
3865 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(PyObject *, int writable_flag);
3866 
3867 /* CheckBinaryVersion.proto */
3868 static int __Pyx_check_binary_version(void);
3869 
3870 /* VoidPtrImport.proto */
3871 static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig);
3872 
3873 /* FunctionImport.proto */
3874 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig);
3875 
3876 /* InitStrings.proto */
3877 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
3878 
3879 static int __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_search(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_octree, __pyx_t_5numpy_int64_t **__pyx_v_nind, int *__pyx_v_nsize, __pyx_t_5numpy_int64_t __pyx_v_nneighbors, __pyx_t_5numpy_int64_t __pyx_v_domain_id, struct __pyx_opt_args_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_search *__pyx_optional_args); /* proto*/
3880 static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_process(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_offset, CYTHON_UNUSED int __pyx_v_i, CYTHON_UNUSED int __pyx_v_j, CYTHON_UNUSED int __pyx_v_k, CYTHON_UNUSED int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_ifields, CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq); /* proto*/
3881 static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_find(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_nneighbors, __pyx_t_5numpy_int64_t *__pyx_v_nind, __Pyx_memviewslice __pyx_v_doffs, __Pyx_memviewslice __pyx_v_pcounts, __Pyx_memviewslice __pyx_v_pinds, __Pyx_memviewslice __pyx_v_ppos, __pyx_t_5numpy_float64_t *__pyx_v_cpos, __Pyx_memviewslice __pyx_v_oct_left_edges, __Pyx_memviewslice __pyx_v_oct_dds, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq); /* proto*/
3882 static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __Pyx_memviewslice __pyx_v_ppos, __pyx_t_5numpy_float64_t **__pyx_v_fields, __Pyx_memviewslice __pyx_v_doffs, __pyx_t_5numpy_int64_t **__pyx_v_nind, __Pyx_memviewslice __pyx_v_pinds, __Pyx_memviewslice __pyx_v_pcounts, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_octree, __pyx_t_5numpy_int64_t __pyx_v_domain_id, int *__pyx_v_nsize, __Pyx_memviewslice __pyx_v_oct_left_edges, __Pyx_memviewslice __pyx_v_oct_dds, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq); /* proto*/
3883 static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_process_particle(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_cpos, __Pyx_memviewslice __pyx_v_ppos, __pyx_t_5numpy_float64_t **__pyx_v_fields, __Pyx_memviewslice __pyx_v_doffs, __pyx_t_5numpy_int64_t **__pyx_v_nind, __Pyx_memviewslice __pyx_v_pinds, __Pyx_memviewslice __pyx_v_pcounts, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_octree, __pyx_t_5numpy_int64_t __pyx_v_domain_id, int *__pyx_v_nsize, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq); /* proto*/
3884 static void __pyx_f_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k, int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq); /* proto*/
3885 static void __pyx_f_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k, int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq); /* proto*/
3886 static void __pyx_f_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k, int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq); /* proto*/
3887 static void __pyx_f_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_process(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, CYTHON_UNUSED int __pyx_v_i, CYTHON_UNUSED int __pyx_v_j, CYTHON_UNUSED int __pyx_v_k, CYTHON_UNUSED int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq); /* proto*/
3888 static void __pyx_f_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, CYTHON_UNUSED int __pyx_v_i, CYTHON_UNUSED int __pyx_v_j, CYTHON_UNUSED int __pyx_v_k, CYTHON_UNUSED int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq); /* proto*/
3889 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto*/
3890 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto*/
3891 static CYTHON_INLINE __pyx_t_5numpy_uint8_t __pyx_f_2yt_8geometry_12oct_visitors_20BaseNeighbourVisitor_neighbour_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor *__pyx_v_self); /* proto*/
3892 static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i); /* proto*/
3893 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
3894 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
3895 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
3896 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
3897 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*/
3898 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
3899 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3900 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3901 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3902 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3903 
3904 /* Module declarations from 'cpython.buffer' */
3905 
3906 /* Module declarations from 'libc.string' */
3907 
3908 /* Module declarations from 'libc.stdio' */
3909 
3910 /* Module declarations from '__builtin__' */
3911 
3912 /* Module declarations from 'cpython.type' */
3913 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
3914 
3915 /* Module declarations from 'cpython' */
3916 
3917 /* Module declarations from 'cpython.object' */
3918 
3919 /* Module declarations from 'cpython.ref' */
3920 
3921 /* Module declarations from 'cpython.mem' */
3922 
3923 /* Module declarations from 'numpy' */
3924 
3925 /* Module declarations from 'numpy' */
3926 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
3927 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
3928 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
3929 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
3930 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
3931 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
3932 
3933 /* Module declarations from 'cython.view' */
3934 
3935 /* Module declarations from 'cython' */
3936 
3937 /* Module declarations from 'libc.math' */
3938 
3939 /* Module declarations from 'libc.stdlib' */
3940 
3941 /* Module declarations from 'yt.geometry.oct_visitors' */
3942 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor = 0;
3943 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts = 0;
3944 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalCells = 0;
3945 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_MarkOcts = 0;
3946 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_MaskOcts = 0;
3947 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_IndexOcts = 0;
3948 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_MaskedIndexOcts = 0;
3949 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_IndexMaskMapOcts = 0;
3950 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_ICoordsOcts = 0;
3951 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_IResOcts = 0;
3952 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_FCoordsOcts = 0;
3953 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_FWidthOcts = 0;
3954 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayI64 = 0;
3955 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayF64 = 0;
3956 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8 = 0;
3957 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_IdentifyOcts = 0;
3958 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_AssignDomainInd = 0;
3959 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesO = 0;
3960 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesR = 0;
3961 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_CountByDomain = 0;
3962 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree = 0;
3963 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree = 0;
3964 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_MortonIndexOcts = 0;
3965 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_StoreIndex = 0;
3966 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor = 0;
3967 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor = 0;
3968 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellVisitor = 0;
3969 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_cind(int, int, int); /*proto*/
3970 
3971 /* Module declarations from 'yt.geometry.grid_visitors' */
3972 static __pyx_t_5numpy_uint8_t (*__pyx_f_2yt_8geometry_13grid_visitors_check_child_masked)(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *); /*proto*/
3973 
3974 /* Module declarations from 'yt.utilities.lib.fp_utils' */
3975 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
3976 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
3977 static CYTHON_INLINE PyObject *__pyx_f_2yt_9utilities_3lib_8fp_utils__ensure_code(PyObject *); /*proto*/
3978 
3979 /* Module declarations from 'libc.float' */
3980 
3981 /* Module declarations from 'yt.utilities.lib.geometry_utils' */
3982 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_ifrexp(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_int64_t *); /*proto*/
3983 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_msdb(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/
3984 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_xor_msb(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
3985 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by2(__pyx_t_5numpy_uint64_t); /*proto*/
3986 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_64bits_by2(__pyx_t_5numpy_uint64_t); /*proto*/
3987 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit(__pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t); /*proto*/
3988 static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_14geometry_utils_decode_morton_64bit(__pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t *); /*proto*/
3989 
3990 /* Module declarations from 'yt.geometry.selection_routines' */
3991 static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = 0;
3992 static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = 0;
3993 static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = 0;
3994 static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = 0;
3995 
3996 /* Module declarations from 'yt.utilities.lib.allocation_container' */
3997 static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = 0;
3998 
3999 /* Module declarations from 'yt.geometry.oct_container' */
4000 static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool = 0;
4001 static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = 0;
4002 static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = 0;
4003 static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = 0;
4004 static int *__pyx_vp_2yt_8geometry_13oct_container_ORDER_MAX = 0;
4005 #define __pyx_v_2yt_8geometry_13oct_container_ORDER_MAX (*__pyx_vp_2yt_8geometry_13oct_container_ORDER_MAX)
4006 
4007 /* Module declarations from 'yt.utilities.lib.distance_queue' */
4008 static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_14distance_queue_PriorityQueue = 0;
4009 static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_14distance_queue_DistanceQueue = 0;
4010 static int (*__pyx_f_2yt_9utilities_3lib_14distance_queue_Neighbor_compare)(void *, void *); /*proto*/
4011 static __pyx_t_5numpy_float64_t (*__pyx_f_2yt_9utilities_3lib_14distance_queue_r2dist)(__pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, int *, __pyx_t_5numpy_float64_t); /*proto*/
4012 
4013 /* Module declarations from 'numpy.math' */
4014 
4015 /* Module declarations from 'yt.geometry.particle_deposit' */
4016 static PyTypeObject *__pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation = 0;
4017 static CYTHON_INLINE int __pyx_f_2yt_8geometry_16particle_deposit_gind(int, int, int, int *); /*proto*/
4018 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_cubic(__pyx_t_5numpy_float64_t); /*proto*/
4019 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quartic(__pyx_t_5numpy_float64_t); /*proto*/
4020 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quintic(__pyx_t_5numpy_float64_t); /*proto*/
4021 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland2(__pyx_t_5numpy_float64_t); /*proto*/
4022 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland4(__pyx_t_5numpy_float64_t); /*proto*/
4023 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland6(__pyx_t_5numpy_float64_t); /*proto*/
4024 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_dummy(__pyx_t_5numpy_float64_t); /*proto*/
4025 static CYTHON_INLINE __pyx_t_2yt_8geometry_16particle_deposit_kernel_func __pyx_f_2yt_8geometry_16particle_deposit_get_kernel_func(PyObject *); /*proto*/
4026 
4027 /* Module declarations from 'cpython.exc' */
4028 
4029 /* Module declarations from 'yt.geometry.particle_smooth' */
4030 static PyTypeObject *__pyx_ptype_2yt_8geometry_15particle_smooth_ParticleSmoothOperation = 0;
4031 static PyTypeObject *__pyx_ptype_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth = 0;
4032 static PyTypeObject *__pyx_ptype_2yt_8geometry_15particle_smooth_NearestNeighborSmooth = 0;
4033 static PyTypeObject *__pyx_ptype_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth = 0;
4034 static PyTypeObject *__pyx_ptype_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth = 0;
4035 static PyTypeObject *__pyx_ptype_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate = 0;
4036 static PyTypeObject *__pyx_array_type = 0;
4037 static PyTypeObject *__pyx_MemviewEnum_type = 0;
4038 static PyTypeObject *__pyx_memoryview_type = 0;
4039 static PyTypeObject *__pyx_memoryviewslice_type = 0;
4040 static PyObject *generic = 0;
4041 static PyObject *strided = 0;
4042 static PyObject *indirect = 0;
4043 static PyObject *contiguous = 0;
4044 static PyObject *indirect_contiguous = 0;
4045 static int __pyx_memoryview_thread_locks_used;
4046 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
4047 static void __pyx_f_2yt_8geometry_15particle_smooth_spherical_coord_setup(__pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *); /*proto*/
4048 static void __pyx_f_2yt_8geometry_15particle_smooth_cart_coord_setup(__pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *); /*proto*/
4049 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
4050 static void *__pyx_align_pointer(void *, size_t); /*proto*/
4051 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
4052 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
4053 static PyObject *_unellipsify(PyObject *, int); /*proto*/
4054 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
4055 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
4056 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*/
4057 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
4058 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
4059 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
4060 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
4061 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
4062 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
4063 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
4064 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
4065 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
4066 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
4067 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
4068 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
4069 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
4070 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
4071 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
4072 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
4073 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
4074 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
4075 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
4076 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
4077 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
4078 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
4079 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
4080 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
4081 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
4082 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 };
4083 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 };
4084 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 };
4085 #define __Pyx_MODULE_NAME "yt.geometry.particle_smooth"
4086 extern int __pyx_module_is_main_yt__geometry__particle_smooth;
4087 int __pyx_module_is_main_yt__geometry__particle_smooth = 0;
4088 
4089 /* Implementation of 'yt.geometry.particle_smooth' */
4090 static PyObject *__pyx_builtin_NotImplementedError;
4091 static PyObject *__pyx_builtin_range;
4092 static PyObject *__pyx_builtin_TypeError;
4093 static PyObject *__pyx_builtin_RuntimeError;
4094 static PyObject *__pyx_builtin_ValueError;
4095 static PyObject *__pyx_builtin_ImportError;
4096 static PyObject *__pyx_builtin_MemoryError;
4097 static PyObject *__pyx_builtin_enumerate;
4098 static PyObject *__pyx_builtin_Ellipsis;
4099 static PyObject *__pyx_builtin_id;
4100 static PyObject *__pyx_builtin_IndexError;
4101 static const char __pyx_k_C[] = "C";
4102 static const char __pyx_k_F[] = "F";
4103 static const char __pyx_k_O[] = "O";
4104 static const char __pyx_k_c[] = "c";
4105 static const char __pyx_k_id[] = "id";
4106 static const char __pyx_k_np[] = "np";
4107 static const char __pyx_k_cos[] = "cos";
4108 static const char __pyx_k_end[] = "end";
4109 static const char __pyx_k_new[] = "__new__";
4110 static const char __pyx_k_obj[] = "obj";
4111 static const char __pyx_k_sin[] = "sin";
4112 static const char __pyx_k_base[] = "base";
4113 static const char __pyx_k_dict[] = "__dict__";
4114 static const char __pyx_k_file[] = "file";
4115 static const char __pyx_k_gobj[] = "gobj";
4116 static const char __pyx_k_main[] = "__main__";
4117 static const char __pyx_k_mode[] = "mode";
4118 static const char __pyx_k_name[] = "name";
4119 static const char __pyx_k_ndim[] = "ndim";
4120 static const char __pyx_k_none[] = "none";
4121 static const char __pyx_k_pack[] = "pack";
4122 static const char __pyx_k_size[] = "size";
4123 static const char __pyx_k_step[] = "step";
4124 static const char __pyx_k_stop[] = "stop";
4125 static const char __pyx_k_test[] = "__test__";
4126 static const char __pyx_k_ASCII[] = "ASCII";
4127 static const char __pyx_k_class[] = "__class__";
4128 static const char __pyx_k_cubic[] = "cubic";
4129 static const char __pyx_k_dtype[] = "dtype";
4130 static const char __pyx_k_empty[] = "empty";
4131 static const char __pyx_k_error[] = "error";
4132 static const char __pyx_k_flags[] = "flags";
4133 static const char __pyx_k_int64[] = "int64";
4134 static const char __pyx_k_numpy[] = "numpy";
4135 static const char __pyx_k_nvals[] = "nvals";
4136 static const char __pyx_k_order[] = "order";
4137 static const char __pyx_k_print[] = "print";
4138 static const char __pyx_k_range[] = "range";
4139 static const char __pyx_k_shape[] = "shape";
4140 static const char __pyx_k_start[] = "start";
4141 static const char __pyx_k_uint8[] = "uint8";
4142 static const char __pyx_k_units[] = "units";
4143 static const char __pyx_k_zeros[] = "zeros";
4144 static const char __pyx_k_append[] = "append";
4145 static const char __pyx_k_encode[] = "encode";
4146 static const char __pyx_k_fields[] = "fields";
4147 static const char __pyx_k_format[] = "format";
4148 static const char __pyx_k_import[] = "__import__";
4149 static const char __pyx_k_name_2[] = "__name__";
4150 static const char __pyx_k_pickle[] = "pickle";
4151 static const char __pyx_k_reduce[] = "__reduce__";
4152 static const char __pyx_k_struct[] = "struct";
4153 static const char __pyx_k_unpack[] = "unpack";
4154 static const char __pyx_k_update[] = "update";
4155 static const char __pyx_k_argsort[] = "argsort";
4156 static const char __pyx_k_asarray[] = "asarray";
4157 static const char __pyx_k_float64[] = "float64";
4158 static const char __pyx_k_fortran[] = "fortran";
4159 static const char __pyx_k_memview[] = "memview";
4160 static const char __pyx_k_nfields[] = "nfields";
4161 static const char __pyx_k_quartic[] = "quartic";
4162 static const char __pyx_k_quintic[] = "quintic";
4163 static const char __pyx_k_Ellipsis[] = "Ellipsis";
4164 static const char __pyx_k_geometry[] = "geometry";
4165 static const char __pyx_k_getstate[] = "__getstate__";
4166 static const char __pyx_k_itemsize[] = "itemsize";
4167 static const char __pyx_k_mdom_ind[] = "mdom_ind";
4168 static const char __pyx_k_pdom_ind[] = "pdom_ind";
4169 static const char __pyx_k_pyx_type[] = "__pyx_type";
4170 static const char __pyx_k_setstate[] = "__setstate__";
4171 static const char __pyx_k_TypeError[] = "TypeError";
4172 static const char __pyx_k_cartesian[] = "cartesian";
4173 static const char __pyx_k_domain_id[] = "domain_id";
4174 static const char __pyx_k_enumerate[] = "enumerate";
4175 static const char __pyx_k_positions[] = "positions";
4176 static const char __pyx_k_pyx_state[] = "__pyx_state";
4177 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
4178 static const char __pyx_k_spherical[] = "spherical";
4179 static const char __pyx_k_wendland2[] = "wendland2";
4180 static const char __pyx_k_wendland4[] = "wendland4";
4181 static const char __pyx_k_wendland6[] = "wendland6";
4182 static const char __pyx_k_IndexError[] = "IndexError";
4183 static const char __pyx_k_ValueError[] = "ValueError";
4184 static const char __pyx_k_idw_smooth[] = "idw_smooth";
4185 static const char __pyx_k_pyx_result[] = "__pyx_result";
4186 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
4187 static const char __pyx_k_zeros_like[] = "zeros_like";
4188 static const char __pyx_k_ImportError[] = "ImportError";
4189 static const char __pyx_k_MemoryError[] = "MemoryError";
4190 static const char __pyx_k_PickleError[] = "PickleError";
4191 static const char __pyx_k_code_length[] = "code_length";
4192 static const char __pyx_k_kernel_name[] = "kernel_name";
4193 static const char __pyx_k_mesh_octree[] = "mesh_octree";
4194 static const char __pyx_k_periodicity[] = "periodicity";
4195 static const char __pyx_k_RuntimeError[] = "RuntimeError";
4196 static const char __pyx_k_index_fields[] = "index_fields";
4197 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
4198 static const char __pyx_k_stringsource[] = "stringsource";
4199 static const char __pyx_k_domain_offset[] = "domain_offset";
4200 static const char __pyx_k_max_neighbors[] = "max_neighbors";
4201 static const char __pyx_k_oct_positions[] = "oct_positions";
4202 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
4203 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
4204 static const char __pyx_k_density_smooth[] = "density_smooth";
4205 static const char __pyx_k_nearest_smooth[] = "nearest_smooth";
4206 static const char __pyx_k_SOMETHING_WRONG[] = "SOMETHING WRONG";
4207 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
4208 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
4209 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
4210 static const char __pyx_k_particle_octree[] = "particle_octree";
4211 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
4212 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
4213 static const char __pyx_k_convert_to_units[] = "convert_to_units";
4214 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
4215 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
4216 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
4217 static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
4218 static const char __pyx_k_nth_neighbor_smooth[] = "nth_neighbor_smooth";
4219 static const char __pyx_k_VolumeWeightedSmooth[] = "VolumeWeightedSmooth";
4220 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
4221 static const char __pyx_k_NearestNeighborSmooth[] = "NearestNeighborSmooth";
4222 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
4223 static const char __pyx_k_IDWInterpolationSmooth[] = "IDWInterpolationSmooth";
4224 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
4225 static const char __pyx_k_volume_weighted_smooth[] = "volume_weighted_smooth";
4226 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
4227 static const char __pyx_k_ParticleSmoothOperation[] = "ParticleSmoothOperation";
4228 static const char __pyx_k_SmoothedDensityEstimate[] = "SmoothedDensityEstimate";
4229 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
4230 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
4231 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
4232 static const char __pyx_k_NthNeighborDistanceSmooth[] = "NthNeighborDistanceSmooth";
4233 static const char __pyx_k_Particle_smoothing_in_cells[] = "\nParticle smoothing in cells\n\n\n\n\n";
4234 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
4235 static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
4236 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
4237 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
4238 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
4239 static const char __pyx_k_self_fp_self_pos_setup_self_sph[] = "self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling";
4240 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
4241 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
4242 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
4243 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
4244 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
4245 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
4246 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
4247 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
4248 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
4249 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
4250 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
4251 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
4252 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
4253 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
4254 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
4255 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
4256 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
4257 static const char __pyx_k_self_pos_setup_self_sph_kernel_c[] = "self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling";
4258 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
4259 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
4260 static PyObject *__pyx_n_s_ASCII;
4261 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
4262 static PyObject *__pyx_n_s_C;
4263 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
4264 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
4265 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
4266 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
4267 static PyObject *__pyx_n_s_Ellipsis;
4268 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
4269 static PyObject *__pyx_n_s_F;
4270 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
4271 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
4272 static PyObject *__pyx_n_s_IDWInterpolationSmooth;
4273 static PyObject *__pyx_n_s_ImportError;
4274 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
4275 static PyObject *__pyx_n_s_IndexError;
4276 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
4277 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
4278 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
4279 static PyObject *__pyx_n_s_MemoryError;
4280 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
4281 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
4282 static PyObject *__pyx_n_s_NearestNeighborSmooth;
4283 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
4284 static PyObject *__pyx_n_s_NotImplementedError;
4285 static PyObject *__pyx_n_s_NthNeighborDistanceSmooth;
4286 static PyObject *__pyx_n_b_O;
4287 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
4288 static PyObject *__pyx_n_s_ParticleSmoothOperation;
4289 static PyObject *__pyx_n_s_PickleError;
4290 static PyObject *__pyx_n_s_RuntimeError;
4291 static PyObject *__pyx_kp_s_SOMETHING_WRONG;
4292 static PyObject *__pyx_n_s_SmoothedDensityEstimate;
4293 static PyObject *__pyx_n_s_TypeError;
4294 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
4295 static PyObject *__pyx_n_s_ValueError;
4296 static PyObject *__pyx_n_s_View_MemoryView;
4297 static PyObject *__pyx_n_s_VolumeWeightedSmooth;
4298 static PyObject *__pyx_n_s_allocate_buffer;
4299 static PyObject *__pyx_n_s_append;
4300 static PyObject *__pyx_n_s_argsort;
4301 static PyObject *__pyx_n_s_asarray;
4302 static PyObject *__pyx_n_s_base;
4303 static PyObject *__pyx_n_s_c;
4304 static PyObject *__pyx_n_u_c;
4305 static PyObject *__pyx_n_s_cartesian;
4306 static PyObject *__pyx_n_s_class;
4307 static PyObject *__pyx_n_s_cline_in_traceback;
4308 static PyObject *__pyx_n_s_code_length;
4309 static PyObject *__pyx_kp_s_contiguous_and_direct;
4310 static PyObject *__pyx_kp_s_contiguous_and_indirect;
4311 static PyObject *__pyx_n_s_convert_to_units;
4312 static PyObject *__pyx_n_s_cos;
4313 static PyObject *__pyx_n_s_cubic;
4314 static PyObject *__pyx_n_s_density_smooth;
4315 static PyObject *__pyx_n_s_dict;
4316 static PyObject *__pyx_n_s_domain_id;
4317 static PyObject *__pyx_n_s_domain_offset;
4318 static PyObject *__pyx_n_s_dtype;
4319 static PyObject *__pyx_n_s_dtype_is_object;
4320 static PyObject *__pyx_n_s_empty;
4321 static PyObject *__pyx_n_s_encode;
4322 static PyObject *__pyx_n_s_end;
4323 static PyObject *__pyx_n_s_enumerate;
4324 static PyObject *__pyx_n_s_error;
4325 static PyObject *__pyx_n_s_fields;
4326 static PyObject *__pyx_n_s_file;
4327 static PyObject *__pyx_n_s_flags;
4328 static PyObject *__pyx_n_s_float64;
4329 static PyObject *__pyx_n_s_format;
4330 static PyObject *__pyx_n_s_fortran;
4331 static PyObject *__pyx_n_u_fortran;
4332 static PyObject *__pyx_n_s_geometry;
4333 static PyObject *__pyx_n_s_getstate;
4334 static PyObject *__pyx_n_s_gobj;
4335 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
4336 static PyObject *__pyx_n_s_id;
4337 static PyObject *__pyx_n_s_idw_smooth;
4338 static PyObject *__pyx_n_s_import;
4339 static PyObject *__pyx_n_s_index_fields;
4340 static PyObject *__pyx_n_s_int64;
4341 static PyObject *__pyx_n_s_itemsize;
4342 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
4343 static PyObject *__pyx_n_s_kernel_name;
4344 static PyObject *__pyx_n_s_main;
4345 static PyObject *__pyx_n_s_max_neighbors;
4346 static PyObject *__pyx_n_s_mdom_ind;
4347 static PyObject *__pyx_n_s_memview;
4348 static PyObject *__pyx_n_s_mesh_octree;
4349 static PyObject *__pyx_n_s_mode;
4350 static PyObject *__pyx_n_s_name;
4351 static PyObject *__pyx_n_s_name_2;
4352 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
4353 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
4354 static PyObject *__pyx_n_s_ndim;
4355 static PyObject *__pyx_n_s_nearest_smooth;
4356 static PyObject *__pyx_n_s_new;
4357 static PyObject *__pyx_n_s_nfields;
4358 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
4359 static PyObject *__pyx_n_s_none;
4360 static PyObject *__pyx_n_s_np;
4361 static PyObject *__pyx_n_s_nth_neighbor_smooth;
4362 static PyObject *__pyx_n_s_numpy;
4363 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
4364 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
4365 static PyObject *__pyx_n_s_nvals;
4366 static PyObject *__pyx_n_s_obj;
4367 static PyObject *__pyx_n_s_oct_positions;
4368 static PyObject *__pyx_n_s_order;
4369 static PyObject *__pyx_n_s_pack;
4370 static PyObject *__pyx_n_s_particle_octree;
4371 static PyObject *__pyx_n_s_pdom_ind;
4372 static PyObject *__pyx_n_s_periodicity;
4373 static PyObject *__pyx_n_s_pickle;
4374 static PyObject *__pyx_n_s_positions;
4375 static PyObject *__pyx_n_s_print;
4376 static PyObject *__pyx_n_s_pyx_PickleError;
4377 static PyObject *__pyx_n_s_pyx_checksum;
4378 static PyObject *__pyx_n_s_pyx_getbuffer;
4379 static PyObject *__pyx_n_s_pyx_result;
4380 static PyObject *__pyx_n_s_pyx_state;
4381 static PyObject *__pyx_n_s_pyx_type;
4382 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
4383 static PyObject *__pyx_n_s_pyx_vtable;
4384 static PyObject *__pyx_n_s_quartic;
4385 static PyObject *__pyx_n_s_quintic;
4386 static PyObject *__pyx_n_s_range;
4387 static PyObject *__pyx_n_s_reduce;
4388 static PyObject *__pyx_n_s_reduce_cython;
4389 static PyObject *__pyx_n_s_reduce_ex;
4390 static PyObject *__pyx_kp_s_self_fp_self_pos_setup_self_sph;
4391 static PyObject *__pyx_kp_s_self_pos_setup_self_sph_kernel_c;
4392 static PyObject *__pyx_n_s_setstate;
4393 static PyObject *__pyx_n_s_setstate_cython;
4394 static PyObject *__pyx_n_s_shape;
4395 static PyObject *__pyx_n_s_sin;
4396 static PyObject *__pyx_n_s_size;
4397 static PyObject *__pyx_n_s_spherical;
4398 static PyObject *__pyx_n_s_start;
4399 static PyObject *__pyx_n_s_step;
4400 static PyObject *__pyx_n_s_stop;
4401 static PyObject *__pyx_kp_s_strided_and_direct;
4402 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
4403 static PyObject *__pyx_kp_s_strided_and_indirect;
4404 static PyObject *__pyx_kp_s_stringsource;
4405 static PyObject *__pyx_n_s_struct;
4406 static PyObject *__pyx_n_s_test;
4407 static PyObject *__pyx_n_s_uint8;
4408 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
4409 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
4410 static PyObject *__pyx_n_s_units;
4411 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
4412 static PyObject *__pyx_n_s_unpack;
4413 static PyObject *__pyx_n_s_update;
4414 static PyObject *__pyx_n_s_volume_weighted_smooth;
4415 static PyObject *__pyx_n_s_wendland2;
4416 static PyObject *__pyx_n_s_wendland4;
4417 static PyObject *__pyx_n_s_wendland6;
4418 static PyObject *__pyx_n_s_zeros;
4419 static PyObject *__pyx_n_s_zeros_like;
4420 static int __pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation___init__(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, PyObject *__pyx_v_nvals, PyObject *__pyx_v_nfields, PyObject *__pyx_v_max_neighbors, PyObject *__pyx_v_kernel_name); /* proto */
4421 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_2initialize(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args); /* proto */
4422 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_4finalize(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args); /* proto */
4423 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_6process_octree(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_mesh_octree, __Pyx_memviewslice __pyx_v_mdom_ind, __Pyx_memviewslice __pyx_v_positions, __Pyx_memviewslice __pyx_v_oct_positions, PyObject *__pyx_v_fields, int __pyx_v_domain_id, int __pyx_v_domain_offset, PyObject *__pyx_v_periodicity, PyObject *__pyx_v_index_fields, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_particle_octree, __Pyx_memviewslice __pyx_v_pdom_ind, PyObject *__pyx_v_geometry); /* proto */
4424 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_8process_particles(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_particle_octree, PyArrayObject *__pyx_v_pdom_ind, PyArrayObject *__pyx_v_positions, PyObject *__pyx_v_fields, int __pyx_v_domain_id, int __pyx_v_domain_offset, PyObject *__pyx_v_periodicity, PyObject *__pyx_v_geometry); /* proto */
4425 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_10process_grid(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_gobj, CYTHON_UNUSED PyArrayObject *__pyx_v_positions, CYTHON_UNUSED PyObject *__pyx_v_fields); /* proto */
4426 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals___get__(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self); /* proto */
4427 static int __pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals_2__set__(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
4428 static int __pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals_4__del__(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self); /* proto */
4429 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self); /* proto */
4430 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4431 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_initialize(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self); /* proto */
4432 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_2finalize(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self); /* proto */
4433 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals___get__(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self); /* proto */
4434 static int __pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals_2__set__(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
4435 static int __pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals_4__del__(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self); /* proto */
4436 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self); /* proto */
4437 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4438 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_initialize(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self); /* proto */
4439 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_2finalize(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self); /* proto */
4440 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals___get__(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self); /* proto */
4441 static int __pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals_2__set__(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
4442 static int __pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals_4__del__(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self); /* proto */
4443 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self); /* proto */
4444 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4445 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_initialize(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self); /* proto */
4446 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_2finalize(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self); /* proto */
4447 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_2p2___get__(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self); /* proto */
4448 static int __pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_2p2_2__set__(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
4449 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals___get__(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self); /* proto */
4450 static int __pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals_2__set__(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
4451 static int __pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals_4__del__(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self); /* proto */
4452 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self); /* proto */
4453 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4454 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_initialize(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *__pyx_v_self); /* proto */
4455 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_2finalize(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *__pyx_v_self); /* proto */
4456 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *__pyx_v_self); /* proto */
4457 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4458 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_initialize(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *__pyx_v_self); /* proto */
4459 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_2finalize(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *__pyx_v_self); /* proto */
4460 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *__pyx_v_self); /* proto */
4461 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4462 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
4463 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
4464 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 */
4465 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 */
4466 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
4467 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
4468 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
4469 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
4470 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
4471 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 */
4472 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
4473 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 */
4474 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
4475 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
4476 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
4477 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
4478 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 */
4479 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4480 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
4481 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 */
4482 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 */
4483 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4484 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4485 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4486 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4487 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4488 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4489 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4490 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4491 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4492 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4493 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4494 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4495 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4496 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4497 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4498 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4499 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4500 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 */
4501 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
4502 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
4503 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
4504 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 */
4505 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 */
4506 static PyObject *__pyx_tp_new_2yt_8geometry_15particle_smooth_ParticleSmoothOperation(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4507 static PyObject *__pyx_tp_new_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4508 static PyObject *__pyx_tp_new_2yt_8geometry_15particle_smooth_NearestNeighborSmooth(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4509 static PyObject *__pyx_tp_new_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4510 static PyObject *__pyx_tp_new_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4511 static PyObject *__pyx_tp_new_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4512 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4513 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4514 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4515 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4516 static PyObject *__pyx_int_0;
4517 static PyObject *__pyx_int_1;
4518 static PyObject *__pyx_int_2;
4519 static PyObject *__pyx_int_3;
4520 static PyObject *__pyx_int_184977713;
4521 static PyObject *__pyx_int_neg_1;
4522 static __Pyx_memviewslice __pyx_k__2;
4523 static PyObject *__pyx_tuple_;
4524 static PyObject *__pyx_slice__4;
4525 static PyObject *__pyx_tuple__3;
4526 static PyObject *__pyx_tuple__5;
4527 static PyObject *__pyx_tuple__6;
4528 static PyObject *__pyx_tuple__7;
4529 static PyObject *__pyx_tuple__8;
4530 static PyObject *__pyx_tuple__9;
4531 static PyObject *__pyx_tuple__10;
4532 static PyObject *__pyx_tuple__11;
4533 static PyObject *__pyx_tuple__12;
4534 static PyObject *__pyx_tuple__13;
4535 static PyObject *__pyx_tuple__14;
4536 static PyObject *__pyx_tuple__15;
4537 static PyObject *__pyx_tuple__16;
4538 static PyObject *__pyx_tuple__17;
4539 static PyObject *__pyx_tuple__18;
4540 static PyObject *__pyx_tuple__19;
4541 static PyObject *__pyx_tuple__20;
4542 static PyObject *__pyx_tuple__21;
4543 static PyObject *__pyx_tuple__22;
4544 static PyObject *__pyx_tuple__23;
4545 static PyObject *__pyx_tuple__24;
4546 static PyObject *__pyx_tuple__25;
4547 static PyObject *__pyx_tuple__26;
4548 static PyObject *__pyx_tuple__27;
4549 static PyObject *__pyx_tuple__28;
4550 static PyObject *__pyx_tuple__29;
4551 static PyObject *__pyx_tuple__30;
4552 static PyObject *__pyx_tuple__31;
4553 static PyObject *__pyx_tuple__32;
4554 static PyObject *__pyx_tuple__33;
4555 static PyObject *__pyx_tuple__34;
4556 static PyObject *__pyx_tuple__35;
4557 static PyObject *__pyx_tuple__36;
4558 static PyObject *__pyx_tuple__37;
4559 static PyObject *__pyx_tuple__38;
4560 static PyObject *__pyx_tuple__39;
4561 static PyObject *__pyx_tuple__40;
4562 static PyObject *__pyx_tuple__41;
4563 static PyObject *__pyx_tuple__42;
4564 static PyObject *__pyx_tuple__43;
4565 static PyObject *__pyx_tuple__44;
4566 static PyObject *__pyx_tuple__45;
4567 static PyObject *__pyx_tuple__46;
4568 static PyObject *__pyx_tuple__47;
4569 static PyObject *__pyx_tuple__48;
4570 static PyObject *__pyx_tuple__49;
4571 static PyObject *__pyx_codeobj__50;
4572 /* Late includes */
4573 
4574 /* "yt/geometry/particle_smooth.pyx":24
4575  *
4576  *
4577  * cdef void spherical_coord_setup(np.float64_t ipos[3], np.float64_t opos[3]):             # <<<<<<<<<<<<<<
4578  *     opos[0] = ipos[0] * sin(ipos[1]) * cos(ipos[2])
4579  *     opos[1] = ipos[0] * sin(ipos[1]) * sin(ipos[2])
4580  */
4581 
__pyx_f_2yt_8geometry_15particle_smooth_spherical_coord_setup(__pyx_t_5numpy_float64_t * __pyx_v_ipos,__pyx_t_5numpy_float64_t * __pyx_v_opos)4582 static void __pyx_f_2yt_8geometry_15particle_smooth_spherical_coord_setup(__pyx_t_5numpy_float64_t *__pyx_v_ipos, __pyx_t_5numpy_float64_t *__pyx_v_opos) {
4583   __Pyx_RefNannyDeclarations
4584   __Pyx_RefNannySetupContext("spherical_coord_setup", 0);
4585 
4586   /* "yt/geometry/particle_smooth.pyx":25
4587  *
4588  * cdef void spherical_coord_setup(np.float64_t ipos[3], np.float64_t opos[3]):
4589  *     opos[0] = ipos[0] * sin(ipos[1]) * cos(ipos[2])             # <<<<<<<<<<<<<<
4590  *     opos[1] = ipos[0] * sin(ipos[1]) * sin(ipos[2])
4591  *     opos[2] = ipos[0] * cos(ipos[1])
4592  */
4593   (__pyx_v_opos[0]) = (((__pyx_v_ipos[0]) * sin((__pyx_v_ipos[1]))) * cos((__pyx_v_ipos[2])));
4594 
4595   /* "yt/geometry/particle_smooth.pyx":26
4596  * cdef void spherical_coord_setup(np.float64_t ipos[3], np.float64_t opos[3]):
4597  *     opos[0] = ipos[0] * sin(ipos[1]) * cos(ipos[2])
4598  *     opos[1] = ipos[0] * sin(ipos[1]) * sin(ipos[2])             # <<<<<<<<<<<<<<
4599  *     opos[2] = ipos[0] * cos(ipos[1])
4600  *
4601  */
4602   (__pyx_v_opos[1]) = (((__pyx_v_ipos[0]) * sin((__pyx_v_ipos[1]))) * sin((__pyx_v_ipos[2])));
4603 
4604   /* "yt/geometry/particle_smooth.pyx":27
4605  *     opos[0] = ipos[0] * sin(ipos[1]) * cos(ipos[2])
4606  *     opos[1] = ipos[0] * sin(ipos[1]) * sin(ipos[2])
4607  *     opos[2] = ipos[0] * cos(ipos[1])             # <<<<<<<<<<<<<<
4608  *
4609  * cdef void cart_coord_setup(np.float64_t ipos[3], np.float64_t opos[3]):
4610  */
4611   (__pyx_v_opos[2]) = ((__pyx_v_ipos[0]) * cos((__pyx_v_ipos[1])));
4612 
4613   /* "yt/geometry/particle_smooth.pyx":24
4614  *
4615  *
4616  * cdef void spherical_coord_setup(np.float64_t ipos[3], np.float64_t opos[3]):             # <<<<<<<<<<<<<<
4617  *     opos[0] = ipos[0] * sin(ipos[1]) * cos(ipos[2])
4618  *     opos[1] = ipos[0] * sin(ipos[1]) * sin(ipos[2])
4619  */
4620 
4621   /* function exit code */
4622   __Pyx_RefNannyFinishContext();
4623 }
4624 
4625 /* "yt/geometry/particle_smooth.pyx":29
4626  *     opos[2] = ipos[0] * cos(ipos[1])
4627  *
4628  * cdef void cart_coord_setup(np.float64_t ipos[3], np.float64_t opos[3]):             # <<<<<<<<<<<<<<
4629  *     opos[0] = ipos[0]
4630  *     opos[1] = ipos[1]
4631  */
4632 
__pyx_f_2yt_8geometry_15particle_smooth_cart_coord_setup(__pyx_t_5numpy_float64_t * __pyx_v_ipos,__pyx_t_5numpy_float64_t * __pyx_v_opos)4633 static void __pyx_f_2yt_8geometry_15particle_smooth_cart_coord_setup(__pyx_t_5numpy_float64_t *__pyx_v_ipos, __pyx_t_5numpy_float64_t *__pyx_v_opos) {
4634   __Pyx_RefNannyDeclarations
4635   __Pyx_RefNannySetupContext("cart_coord_setup", 0);
4636 
4637   /* "yt/geometry/particle_smooth.pyx":30
4638  *
4639  * cdef void cart_coord_setup(np.float64_t ipos[3], np.float64_t opos[3]):
4640  *     opos[0] = ipos[0]             # <<<<<<<<<<<<<<
4641  *     opos[1] = ipos[1]
4642  *     opos[2] = ipos[2]
4643  */
4644   (__pyx_v_opos[0]) = (__pyx_v_ipos[0]);
4645 
4646   /* "yt/geometry/particle_smooth.pyx":31
4647  * cdef void cart_coord_setup(np.float64_t ipos[3], np.float64_t opos[3]):
4648  *     opos[0] = ipos[0]
4649  *     opos[1] = ipos[1]             # <<<<<<<<<<<<<<
4650  *     opos[2] = ipos[2]
4651  *
4652  */
4653   (__pyx_v_opos[1]) = (__pyx_v_ipos[1]);
4654 
4655   /* "yt/geometry/particle_smooth.pyx":32
4656  *     opos[0] = ipos[0]
4657  *     opos[1] = ipos[1]
4658  *     opos[2] = ipos[2]             # <<<<<<<<<<<<<<
4659  *
4660  * cdef class ParticleSmoothOperation:
4661  */
4662   (__pyx_v_opos[2]) = (__pyx_v_ipos[2]);
4663 
4664   /* "yt/geometry/particle_smooth.pyx":29
4665  *     opos[2] = ipos[0] * cos(ipos[1])
4666  *
4667  * cdef void cart_coord_setup(np.float64_t ipos[3], np.float64_t opos[3]):             # <<<<<<<<<<<<<<
4668  *     opos[0] = ipos[0]
4669  *     opos[1] = ipos[1]
4670  */
4671 
4672   /* function exit code */
4673   __Pyx_RefNannyFinishContext();
4674 }
4675 
4676 /* "yt/geometry/particle_smooth.pyx":35
4677  *
4678  * cdef class ParticleSmoothOperation:
4679  *     def __init__(self, nvals, nfields, max_neighbors, kernel_name):             # <<<<<<<<<<<<<<
4680  *         # This is the set of cells, in grids, blocks or octs, we are handling.
4681  *         cdef int i
4682  */
4683 
4684 /* Python wrapper */
4685 static int __pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4686 static int __pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4687   PyObject *__pyx_v_nvals = 0;
4688   PyObject *__pyx_v_nfields = 0;
4689   PyObject *__pyx_v_max_neighbors = 0;
4690   PyObject *__pyx_v_kernel_name = 0;
4691   int __pyx_r;
4692   __Pyx_RefNannyDeclarations
4693   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
4694   {
4695     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nvals,&__pyx_n_s_nfields,&__pyx_n_s_max_neighbors,&__pyx_n_s_kernel_name,0};
4696     PyObject* values[4] = {0,0,0,0};
4697     if (unlikely(__pyx_kwds)) {
4698       Py_ssize_t kw_args;
4699       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4700       switch (pos_args) {
4701         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4702         CYTHON_FALLTHROUGH;
4703         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4704         CYTHON_FALLTHROUGH;
4705         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4706         CYTHON_FALLTHROUGH;
4707         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4708         CYTHON_FALLTHROUGH;
4709         case  0: break;
4710         default: goto __pyx_L5_argtuple_error;
4711       }
4712       kw_args = PyDict_Size(__pyx_kwds);
4713       switch (pos_args) {
4714         case  0:
4715         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nvals)) != 0)) kw_args--;
4716         else goto __pyx_L5_argtuple_error;
4717         CYTHON_FALLTHROUGH;
4718         case  1:
4719         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nfields)) != 0)) kw_args--;
4720         else {
4721           __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 35, __pyx_L3_error)
4722         }
4723         CYTHON_FALLTHROUGH;
4724         case  2:
4725         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_neighbors)) != 0)) kw_args--;
4726         else {
4727           __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 35, __pyx_L3_error)
4728         }
4729         CYTHON_FALLTHROUGH;
4730         case  3:
4731         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kernel_name)) != 0)) kw_args--;
4732         else {
4733           __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 35, __pyx_L3_error)
4734         }
4735       }
4736       if (unlikely(kw_args > 0)) {
4737         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 35, __pyx_L3_error)
4738       }
4739     } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
4740       goto __pyx_L5_argtuple_error;
4741     } else {
4742       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4743       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4744       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4745       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4746     }
4747     __pyx_v_nvals = values[0];
4748     __pyx_v_nfields = values[1];
4749     __pyx_v_max_neighbors = values[2];
4750     __pyx_v_kernel_name = values[3];
4751   }
4752   goto __pyx_L4_argument_unpacking_done;
4753   __pyx_L5_argtuple_error:;
4754   __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 35, __pyx_L3_error)
4755   __pyx_L3_error:;
4756   __Pyx_AddTraceback("yt.geometry.particle_smooth.ParticleSmoothOperation.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4757   __Pyx_RefNannyFinishContext();
4758   return -1;
4759   __pyx_L4_argument_unpacking_done:;
4760   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation___init__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self), __pyx_v_nvals, __pyx_v_nfields, __pyx_v_max_neighbors, __pyx_v_kernel_name);
4761 
4762   /* function exit code */
4763   __Pyx_RefNannyFinishContext();
4764   return __pyx_r;
4765 }
4766 
__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation___init__(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation * __pyx_v_self,PyObject * __pyx_v_nvals,PyObject * __pyx_v_nfields,PyObject * __pyx_v_max_neighbors,PyObject * __pyx_v_kernel_name)4767 static int __pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation___init__(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, PyObject *__pyx_v_nvals, PyObject *__pyx_v_nfields, PyObject *__pyx_v_max_neighbors, PyObject *__pyx_v_kernel_name) {
4768   int __pyx_r;
4769   __Pyx_RefNannyDeclarations
4770   int __pyx_t_1;
4771   __Pyx_RefNannySetupContext("__init__", 0);
4772 
4773   /* "yt/geometry/particle_smooth.pyx":38
4774  *         # This is the set of cells, in grids, blocks or octs, we are handling.
4775  *         cdef int i
4776  *         self.nvals = nvals             # <<<<<<<<<<<<<<
4777  *         self.nfields = nfields
4778  *         self.maxn = max_neighbors
4779  */
4780   __Pyx_INCREF(__pyx_v_nvals);
4781   __Pyx_GIVEREF(__pyx_v_nvals);
4782   __Pyx_GOTREF(__pyx_v_self->nvals);
4783   __Pyx_DECREF(__pyx_v_self->nvals);
4784   __pyx_v_self->nvals = __pyx_v_nvals;
4785 
4786   /* "yt/geometry/particle_smooth.pyx":39
4787  *         cdef int i
4788  *         self.nvals = nvals
4789  *         self.nfields = nfields             # <<<<<<<<<<<<<<
4790  *         self.maxn = max_neighbors
4791  *         self.sph_kernel = get_kernel_func(kernel_name)
4792  */
4793   __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_nfields); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error)
4794   __pyx_v_self->nfields = __pyx_t_1;
4795 
4796   /* "yt/geometry/particle_smooth.pyx":40
4797  *         self.nvals = nvals
4798  *         self.nfields = nfields
4799  *         self.maxn = max_neighbors             # <<<<<<<<<<<<<<
4800  *         self.sph_kernel = get_kernel_func(kernel_name)
4801  *
4802  */
4803   __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_max_neighbors); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 40, __pyx_L1_error)
4804   __pyx_v_self->maxn = __pyx_t_1;
4805 
4806   /* "yt/geometry/particle_smooth.pyx":41
4807  *         self.nfields = nfields
4808  *         self.maxn = max_neighbors
4809  *         self.sph_kernel = get_kernel_func(kernel_name)             # <<<<<<<<<<<<<<
4810  *
4811  *     def initialize(self, *args):
4812  */
4813   if (!(likely(PyString_CheckExact(__pyx_v_kernel_name))||((__pyx_v_kernel_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_kernel_name)->tp_name), 0))) __PYX_ERR(0, 41, __pyx_L1_error)
4814   __pyx_v_self->sph_kernel = __pyx_f_2yt_8geometry_16particle_deposit_get_kernel_func(((PyObject*)__pyx_v_kernel_name));
4815 
4816   /* "yt/geometry/particle_smooth.pyx":35
4817  *
4818  * cdef class ParticleSmoothOperation:
4819  *     def __init__(self, nvals, nfields, max_neighbors, kernel_name):             # <<<<<<<<<<<<<<
4820  *         # This is the set of cells, in grids, blocks or octs, we are handling.
4821  *         cdef int i
4822  */
4823 
4824   /* function exit code */
4825   __pyx_r = 0;
4826   goto __pyx_L0;
4827   __pyx_L1_error:;
4828   __Pyx_AddTraceback("yt.geometry.particle_smooth.ParticleSmoothOperation.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4829   __pyx_r = -1;
4830   __pyx_L0:;
4831   __Pyx_RefNannyFinishContext();
4832   return __pyx_r;
4833 }
4834 
4835 /* "yt/geometry/particle_smooth.pyx":43
4836  *         self.sph_kernel = get_kernel_func(kernel_name)
4837  *
4838  *     def initialize(self, *args):             # <<<<<<<<<<<<<<
4839  *         raise NotImplementedError
4840  *
4841  */
4842 
4843 /* Python wrapper */
4844 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_3initialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_3initialize(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4845 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_3initialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4846   CYTHON_UNUSED PyObject *__pyx_v_args = 0;
4847   PyObject *__pyx_r = 0;
4848   __Pyx_RefNannyDeclarations
4849   __Pyx_RefNannySetupContext("initialize (wrapper)", 0);
4850   if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "initialize", 0))) return NULL;
4851   __Pyx_INCREF(__pyx_args);
4852   __pyx_v_args = __pyx_args;
4853   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_2initialize(((struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self), __pyx_v_args);
4854 
4855   /* function exit code */
4856   __Pyx_XDECREF(__pyx_v_args);
4857   __Pyx_RefNannyFinishContext();
4858   return __pyx_r;
4859 }
4860 
__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_2initialize(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v_args)4861 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_2initialize(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args) {
4862   PyObject *__pyx_r = NULL;
4863   __Pyx_RefNannyDeclarations
4864   __Pyx_RefNannySetupContext("initialize", 0);
4865 
4866   /* "yt/geometry/particle_smooth.pyx":44
4867  *
4868  *     def initialize(self, *args):
4869  *         raise NotImplementedError             # <<<<<<<<<<<<<<
4870  *
4871  *     def finalize(self, *args):
4872  */
4873   __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
4874   __PYX_ERR(0, 44, __pyx_L1_error)
4875 
4876   /* "yt/geometry/particle_smooth.pyx":43
4877  *         self.sph_kernel = get_kernel_func(kernel_name)
4878  *
4879  *     def initialize(self, *args):             # <<<<<<<<<<<<<<
4880  *         raise NotImplementedError
4881  *
4882  */
4883 
4884   /* function exit code */
4885   __pyx_L1_error:;
4886   __Pyx_AddTraceback("yt.geometry.particle_smooth.ParticleSmoothOperation.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
4887   __pyx_r = NULL;
4888   __Pyx_XGIVEREF(__pyx_r);
4889   __Pyx_RefNannyFinishContext();
4890   return __pyx_r;
4891 }
4892 
4893 /* "yt/geometry/particle_smooth.pyx":46
4894  *         raise NotImplementedError
4895  *
4896  *     def finalize(self, *args):             # <<<<<<<<<<<<<<
4897  *         raise NotImplementedError
4898  *
4899  */
4900 
4901 /* Python wrapper */
4902 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5finalize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5finalize(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4903 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5finalize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4904   CYTHON_UNUSED PyObject *__pyx_v_args = 0;
4905   PyObject *__pyx_r = 0;
4906   __Pyx_RefNannyDeclarations
4907   __Pyx_RefNannySetupContext("finalize (wrapper)", 0);
4908   if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "finalize", 0))) return NULL;
4909   __Pyx_INCREF(__pyx_args);
4910   __pyx_v_args = __pyx_args;
4911   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_4finalize(((struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self), __pyx_v_args);
4912 
4913   /* function exit code */
4914   __Pyx_XDECREF(__pyx_v_args);
4915   __Pyx_RefNannyFinishContext();
4916   return __pyx_r;
4917 }
4918 
__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_4finalize(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v_args)4919 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_4finalize(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args) {
4920   PyObject *__pyx_r = NULL;
4921   __Pyx_RefNannyDeclarations
4922   __Pyx_RefNannySetupContext("finalize", 0);
4923 
4924   /* "yt/geometry/particle_smooth.pyx":47
4925  *
4926  *     def finalize(self, *args):
4927  *         raise NotImplementedError             # <<<<<<<<<<<<<<
4928  *
4929  *     @cython.cdivision(True)
4930  */
4931   __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
4932   __PYX_ERR(0, 47, __pyx_L1_error)
4933 
4934   /* "yt/geometry/particle_smooth.pyx":46
4935  *         raise NotImplementedError
4936  *
4937  *     def finalize(self, *args):             # <<<<<<<<<<<<<<
4938  *         raise NotImplementedError
4939  *
4940  */
4941 
4942   /* function exit code */
4943   __pyx_L1_error:;
4944   __Pyx_AddTraceback("yt.geometry.particle_smooth.ParticleSmoothOperation.finalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
4945   __pyx_r = NULL;
4946   __Pyx_XGIVEREF(__pyx_r);
4947   __Pyx_RefNannyFinishContext();
4948   return __pyx_r;
4949 }
4950 
4951 /* "yt/geometry/particle_smooth.pyx":53
4952  *     @cython.wraparound(False)
4953  *     @cython.initializedcheck(False)
4954  *     def process_octree(self, OctreeContainer mesh_octree,             # <<<<<<<<<<<<<<
4955  *                      np.int64_t [:] mdom_ind,
4956  *                      np.float64_t[:,:] positions,
4957  */
4958 
4959 /* Python wrapper */
4960 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_7process_octree(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_7process_octree(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4961 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_7process_octree(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4962   struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_mesh_octree = 0;
4963   __Pyx_memviewslice __pyx_v_mdom_ind = { 0, 0, { 0 }, { 0 }, { 0 } };
4964   __Pyx_memviewslice __pyx_v_positions = { 0, 0, { 0 }, { 0 }, { 0 } };
4965   __Pyx_memviewslice __pyx_v_oct_positions = { 0, 0, { 0 }, { 0 }, { 0 } };
4966   PyObject *__pyx_v_fields = 0;
4967   int __pyx_v_domain_id;
4968   int __pyx_v_domain_offset;
4969   PyObject *__pyx_v_periodicity = 0;
4970   PyObject *__pyx_v_index_fields = 0;
4971   struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_particle_octree = 0;
4972   __Pyx_memviewslice __pyx_v_pdom_ind = { 0, 0, { 0 }, { 0 }, { 0 } };
4973   PyObject *__pyx_v_geometry = 0;
4974   PyObject *__pyx_r = 0;
4975   __Pyx_RefNannyDeclarations
4976   __Pyx_RefNannySetupContext("process_octree (wrapper)", 0);
4977   {
4978     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mesh_octree,&__pyx_n_s_mdom_ind,&__pyx_n_s_positions,&__pyx_n_s_oct_positions,&__pyx_n_s_fields,&__pyx_n_s_domain_id,&__pyx_n_s_domain_offset,&__pyx_n_s_periodicity,&__pyx_n_s_index_fields,&__pyx_n_s_particle_octree,&__pyx_n_s_pdom_ind,&__pyx_n_s_geometry,0};
4979     PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
4980 
4981     /* "yt/geometry/particle_smooth.pyx":57
4982  *                      np.float64_t[:,:] positions,
4983  *                      np.float64_t[:,:] oct_positions,
4984  *                      fields = None, int domain_id = -1,             # <<<<<<<<<<<<<<
4985  *                      int domain_offset = 0,
4986  *                      periodicity = (True, True, True),
4987  */
4988     values[4] = ((PyObject *)Py_None);
4989 
4990     /* "yt/geometry/particle_smooth.pyx":59
4991  *                      fields = None, int domain_id = -1,
4992  *                      int domain_offset = 0,
4993  *                      periodicity = (True, True, True),             # <<<<<<<<<<<<<<
4994  *                      index_fields = None,
4995  *                      OctreeContainer particle_octree = None,
4996  */
4997     values[7] = ((PyObject *)__pyx_tuple_);
4998 
4999     /* "yt/geometry/particle_smooth.pyx":60
5000  *                      int domain_offset = 0,
5001  *                      periodicity = (True, True, True),
5002  *                      index_fields = None,             # <<<<<<<<<<<<<<
5003  *                      OctreeContainer particle_octree = None,
5004  *                      np.int64_t [:] pdom_ind = None,
5005  */
5006     values[8] = ((PyObject *)Py_None);
5007 
5008     /* "yt/geometry/particle_smooth.pyx":61
5009  *                      periodicity = (True, True, True),
5010  *                      index_fields = None,
5011  *                      OctreeContainer particle_octree = None,             # <<<<<<<<<<<<<<
5012  *                      np.int64_t [:] pdom_ind = None,
5013  *                      geometry = "cartesian"):
5014  */
5015     values[9] = (PyObject *)((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)Py_None);
5016     values[11] = ((PyObject *)__pyx_n_s_cartesian);
5017     if (unlikely(__pyx_kwds)) {
5018       Py_ssize_t kw_args;
5019       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5020       switch (pos_args) {
5021         case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
5022         CYTHON_FALLTHROUGH;
5023         case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
5024         CYTHON_FALLTHROUGH;
5025         case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
5026         CYTHON_FALLTHROUGH;
5027         case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5028         CYTHON_FALLTHROUGH;
5029         case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5030         CYTHON_FALLTHROUGH;
5031         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5032         CYTHON_FALLTHROUGH;
5033         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5034         CYTHON_FALLTHROUGH;
5035         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5036         CYTHON_FALLTHROUGH;
5037         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5038         CYTHON_FALLTHROUGH;
5039         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5040         CYTHON_FALLTHROUGH;
5041         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5042         CYTHON_FALLTHROUGH;
5043         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5044         CYTHON_FALLTHROUGH;
5045         case  0: break;
5046         default: goto __pyx_L5_argtuple_error;
5047       }
5048       kw_args = PyDict_Size(__pyx_kwds);
5049       switch (pos_args) {
5050         case  0:
5051         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mesh_octree)) != 0)) kw_args--;
5052         else goto __pyx_L5_argtuple_error;
5053         CYTHON_FALLTHROUGH;
5054         case  1:
5055         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mdom_ind)) != 0)) kw_args--;
5056         else {
5057           __Pyx_RaiseArgtupleInvalid("process_octree", 0, 4, 12, 1); __PYX_ERR(0, 53, __pyx_L3_error)
5058         }
5059         CYTHON_FALLTHROUGH;
5060         case  2:
5061         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_positions)) != 0)) kw_args--;
5062         else {
5063           __Pyx_RaiseArgtupleInvalid("process_octree", 0, 4, 12, 2); __PYX_ERR(0, 53, __pyx_L3_error)
5064         }
5065         CYTHON_FALLTHROUGH;
5066         case  3:
5067         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_oct_positions)) != 0)) kw_args--;
5068         else {
5069           __Pyx_RaiseArgtupleInvalid("process_octree", 0, 4, 12, 3); __PYX_ERR(0, 53, __pyx_L3_error)
5070         }
5071         CYTHON_FALLTHROUGH;
5072         case  4:
5073         if (kw_args > 0) {
5074           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fields);
5075           if (value) { values[4] = value; kw_args--; }
5076         }
5077         CYTHON_FALLTHROUGH;
5078         case  5:
5079         if (kw_args > 0) {
5080           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain_id);
5081           if (value) { values[5] = value; kw_args--; }
5082         }
5083         CYTHON_FALLTHROUGH;
5084         case  6:
5085         if (kw_args > 0) {
5086           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain_offset);
5087           if (value) { values[6] = value; kw_args--; }
5088         }
5089         CYTHON_FALLTHROUGH;
5090         case  7:
5091         if (kw_args > 0) {
5092           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_periodicity);
5093           if (value) { values[7] = value; kw_args--; }
5094         }
5095         CYTHON_FALLTHROUGH;
5096         case  8:
5097         if (kw_args > 0) {
5098           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index_fields);
5099           if (value) { values[8] = value; kw_args--; }
5100         }
5101         CYTHON_FALLTHROUGH;
5102         case  9:
5103         if (kw_args > 0) {
5104           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_particle_octree);
5105           if (value) { values[9] = value; kw_args--; }
5106         }
5107         CYTHON_FALLTHROUGH;
5108         case 10:
5109         if (kw_args > 0) {
5110           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdom_ind);
5111           if (value) { values[10] = value; kw_args--; }
5112         }
5113         CYTHON_FALLTHROUGH;
5114         case 11:
5115         if (kw_args > 0) {
5116           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_geometry);
5117           if (value) { values[11] = value; kw_args--; }
5118         }
5119       }
5120       if (unlikely(kw_args > 0)) {
5121         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "process_octree") < 0)) __PYX_ERR(0, 53, __pyx_L3_error)
5122       }
5123     } else {
5124       switch (PyTuple_GET_SIZE(__pyx_args)) {
5125         case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
5126         CYTHON_FALLTHROUGH;
5127         case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
5128         CYTHON_FALLTHROUGH;
5129         case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
5130         CYTHON_FALLTHROUGH;
5131         case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5132         CYTHON_FALLTHROUGH;
5133         case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5134         CYTHON_FALLTHROUGH;
5135         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5136         CYTHON_FALLTHROUGH;
5137         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5138         CYTHON_FALLTHROUGH;
5139         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5140         CYTHON_FALLTHROUGH;
5141         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5142         values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5143         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5144         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5145         break;
5146         default: goto __pyx_L5_argtuple_error;
5147       }
5148     }
5149     __pyx_v_mesh_octree = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)values[0]);
5150     __pyx_v_mdom_ind = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_mdom_ind.memview)) __PYX_ERR(0, 54, __pyx_L3_error)
5151     __pyx_v_positions = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_positions.memview)) __PYX_ERR(0, 55, __pyx_L3_error)
5152     __pyx_v_oct_positions = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_oct_positions.memview)) __PYX_ERR(0, 56, __pyx_L3_error)
5153     __pyx_v_fields = values[4];
5154     if (values[5]) {
5155       __pyx_v_domain_id = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L3_error)
5156     } else {
5157       __pyx_v_domain_id = ((int)-1);
5158     }
5159     if (values[6]) {
5160       __pyx_v_domain_offset = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_domain_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L3_error)
5161     } else {
5162       __pyx_v_domain_offset = ((int)0);
5163     }
5164     __pyx_v_periodicity = values[7];
5165     __pyx_v_index_fields = values[8];
5166     __pyx_v_particle_octree = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)values[9]);
5167     if (values[10]) {
5168       __pyx_v_pdom_ind = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[10], PyBUF_WRITABLE); if (unlikely(!__pyx_v_pdom_ind.memview)) __PYX_ERR(0, 62, __pyx_L3_error)
5169     } else {
5170       __pyx_v_pdom_ind = __pyx_k__2;
5171       __PYX_INC_MEMVIEW(&__pyx_v_pdom_ind, 1);
5172     }
5173     __pyx_v_geometry = values[11];
5174   }
5175   goto __pyx_L4_argument_unpacking_done;
5176   __pyx_L5_argtuple_error:;
5177   __Pyx_RaiseArgtupleInvalid("process_octree", 0, 4, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 53, __pyx_L3_error)
5178   __pyx_L3_error:;
5179   __Pyx_AddTraceback("yt.geometry.particle_smooth.ParticleSmoothOperation.process_octree", __pyx_clineno, __pyx_lineno, __pyx_filename);
5180   __Pyx_RefNannyFinishContext();
5181   return NULL;
5182   __pyx_L4_argument_unpacking_done:;
5183   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mesh_octree), __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer, 1, "mesh_octree", 0))) __PYX_ERR(0, 53, __pyx_L1_error)
5184   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_particle_octree), __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer, 1, "particle_octree", 0))) __PYX_ERR(0, 61, __pyx_L1_error)
5185   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_6process_octree(((struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self), __pyx_v_mesh_octree, __pyx_v_mdom_ind, __pyx_v_positions, __pyx_v_oct_positions, __pyx_v_fields, __pyx_v_domain_id, __pyx_v_domain_offset, __pyx_v_periodicity, __pyx_v_index_fields, __pyx_v_particle_octree, __pyx_v_pdom_ind, __pyx_v_geometry);
5186 
5187   /* "yt/geometry/particle_smooth.pyx":53
5188  *     @cython.wraparound(False)
5189  *     @cython.initializedcheck(False)
5190  *     def process_octree(self, OctreeContainer mesh_octree,             # <<<<<<<<<<<<<<
5191  *                      np.int64_t [:] mdom_ind,
5192  *                      np.float64_t[:,:] positions,
5193  */
5194 
5195   /* function exit code */
5196   goto __pyx_L0;
5197   __pyx_L1_error:;
5198   __pyx_r = NULL;
5199   __pyx_L0:;
5200   __Pyx_RefNannyFinishContext();
5201   return __pyx_r;
5202 }
5203 
__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_6process_octree(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation * __pyx_v_self,struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_mesh_octree,__Pyx_memviewslice __pyx_v_mdom_ind,__Pyx_memviewslice __pyx_v_positions,__Pyx_memviewslice __pyx_v_oct_positions,PyObject * __pyx_v_fields,int __pyx_v_domain_id,int __pyx_v_domain_offset,PyObject * __pyx_v_periodicity,PyObject * __pyx_v_index_fields,struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_particle_octree,__Pyx_memviewslice __pyx_v_pdom_ind,PyObject * __pyx_v_geometry)5204 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_6process_octree(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_mesh_octree, __Pyx_memviewslice __pyx_v_mdom_ind, __Pyx_memviewslice __pyx_v_positions, __Pyx_memviewslice __pyx_v_oct_positions, PyObject *__pyx_v_fields, int __pyx_v_domain_id, int __pyx_v_domain_offset, PyObject *__pyx_v_periodicity, PyObject *__pyx_v_index_fields, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_particle_octree, __Pyx_memviewslice __pyx_v_pdom_ind, PyObject *__pyx_v_geometry) {
5205   int __pyx_v_nf;
5206   int __pyx_v_i;
5207   int __pyx_v_j;
5208   int __pyx_v_dims[3];
5209   __pyx_t_5numpy_float64_t **__pyx_v_field_pointers;
5210   __pyx_t_5numpy_float64_t __pyx_v_pos[3];
5211   int __pyx_v_nsize;
5212   __pyx_t_5numpy_int64_t *__pyx_v_nind;
5213   struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo __pyx_v_moi;
5214   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_oct;
5215   CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_numpart;
5216   __pyx_t_5numpy_int64_t __pyx_v_offset;
5217   __pyx_t_5numpy_int64_t __pyx_v_poff;
5218   __pyx_t_5numpy_int64_t __pyx_v_moff_p;
5219   __pyx_t_5numpy_int64_t __pyx_v_moff_m;
5220   __Pyx_memviewslice __pyx_v_pind = { 0, 0, { 0 }, { 0 }, { 0 } };
5221   __Pyx_memviewslice __pyx_v_doff = { 0, 0, { 0 }, { 0 }, { 0 } };
5222   __Pyx_memviewslice __pyx_v_pdoms = { 0, 0, { 0 }, { 0 }, { 0 } };
5223   __Pyx_memviewslice __pyx_v_pcount = { 0, 0, { 0 }, { 0 }, { 0 } };
5224   CYTHON_UNUSED __Pyx_memviewslice __pyx_v_doff_m = { 0, 0, { 0 }, { 0 }, { 0 } };
5225   PyArrayObject *__pyx_v_tarr = 0;
5226   PyArrayObject *__pyx_v_iarr = 0;
5227   __Pyx_memviewslice __pyx_v_cart_positions = { 0, 0, { 0 }, { 0 }, { 0 } };
5228   __Pyx_memviewslice __pyx_v_oct_left_edges = { 0, 0, { 0 }, { 0 }, { 0 } };
5229   __Pyx_memviewslice __pyx_v_oct_dds = { 0, 0, { 0 }, { 0 }, { 0 } };
5230   struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo __pyx_v_oinfo;
5231   int __pyx_v_nz;
5232   __pyx_t_5numpy_float64_t **__pyx_v_index_field_pointers;
5233   __pyx_t_5numpy_float64_t __pyx_v_factor;
5234   PyArrayObject *__pyx_v_visited = 0;
5235   int __pyx_v_nproc;
5236   struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dist_queue = 0;
5237   __Pyx_LocalBuf_ND __pyx_pybuffernd_iarr;
5238   __Pyx_Buffer __pyx_pybuffer_iarr;
5239   __Pyx_LocalBuf_ND __pyx_pybuffernd_tarr;
5240   __Pyx_Buffer __pyx_pybuffer_tarr;
5241   __Pyx_LocalBuf_ND __pyx_pybuffernd_visited;
5242   __Pyx_Buffer __pyx_pybuffer_visited;
5243   PyObject *__pyx_r = NULL;
5244   __Pyx_RefNannyDeclarations
5245   int __pyx_t_1;
5246   int __pyx_t_2;
5247   PyObject *__pyx_t_3 = NULL;
5248   PyObject *__pyx_t_4 = NULL;
5249   PyObject *__pyx_t_5 = NULL;
5250   PyObject *__pyx_t_6 = NULL;
5251   __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
5252   __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
5253   PyObject *__pyx_t_9 = NULL;
5254   __pyx_t_5numpy_float64_t __pyx_t_10;
5255   __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
5256   __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
5257   long __pyx_t_13;
5258   __Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } };
5259   __Pyx_memviewslice __pyx_t_15 = { 0, 0, { 0 }, { 0 }, { 0 } };
5260   Py_ssize_t __pyx_t_16;
5261   int __pyx_t_17;
5262   int __pyx_t_18;
5263   int __pyx_t_19;
5264   PyArrayObject *__pyx_t_20 = NULL;
5265   int __pyx_t_21;
5266   PyObject *__pyx_t_22 = NULL;
5267   PyObject *__pyx_t_23 = NULL;
5268   PyObject *__pyx_t_24 = NULL;
5269   PyArrayObject *__pyx_t_25 = NULL;
5270   Py_ssize_t __pyx_t_26;
5271   Py_ssize_t __pyx_t_27;
5272   Py_ssize_t __pyx_t_28;
5273   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_t_29;
5274   struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get __pyx_t_30;
5275   __pyx_t_5numpy_int64_t __pyx_t_31;
5276   Py_ssize_t __pyx_t_32;
5277   __pyx_t_5numpy_int64_t __pyx_t_33;
5278   Py_ssize_t __pyx_t_34;
5279   __pyx_t_5numpy_int64_t __pyx_t_35;
5280   Py_ssize_t __pyx_t_36;
5281   Py_ssize_t __pyx_t_37;
5282   __pyx_t_5numpy_int64_t __pyx_t_38;
5283   __pyx_t_5numpy_int64_t __pyx_t_39;
5284   __pyx_t_5numpy_int64_t __pyx_t_40;
5285   PyArrayObject *__pyx_t_41 = NULL;
5286   Py_ssize_t __pyx_t_42;
5287   Py_ssize_t __pyx_t_43;
5288   __pyx_t_5numpy_int64_t __pyx_t_44;
5289   __pyx_t_5numpy_int64_t __pyx_t_45;
5290   __pyx_t_5numpy_int64_t __pyx_t_46;
5291   __Pyx_RefNannySetupContext("process_octree", 0);
5292   __Pyx_INCREF(__pyx_v_fields);
5293   __Pyx_INCREF(__pyx_v_periodicity);
5294   __Pyx_INCREF(__pyx_v_index_fields);
5295   __Pyx_INCREF((PyObject *)__pyx_v_particle_octree);
5296   __pyx_pybuffer_tarr.pybuffer.buf = NULL;
5297   __pyx_pybuffer_tarr.refcount = 0;
5298   __pyx_pybuffernd_tarr.data = NULL;
5299   __pyx_pybuffernd_tarr.rcbuffer = &__pyx_pybuffer_tarr;
5300   __pyx_pybuffer_iarr.pybuffer.buf = NULL;
5301   __pyx_pybuffer_iarr.refcount = 0;
5302   __pyx_pybuffernd_iarr.data = NULL;
5303   __pyx_pybuffernd_iarr.rcbuffer = &__pyx_pybuffer_iarr;
5304   __pyx_pybuffer_visited.pybuffer.buf = NULL;
5305   __pyx_pybuffer_visited.refcount = 0;
5306   __pyx_pybuffernd_visited.data = NULL;
5307   __pyx_pybuffernd_visited.rcbuffer = &__pyx_pybuffer_visited;
5308 
5309   /* "yt/geometry/particle_smooth.pyx":88
5310  *         # mechanism of an expandable array for holding pointers to Octs, so
5311  *         # that we can deal with >27 neighbors.
5312  *         if particle_octree is None:             # <<<<<<<<<<<<<<
5313  *             particle_octree = mesh_octree
5314  *             pdom_ind = mdom_ind
5315  */
5316   __pyx_t_1 = (((PyObject *)__pyx_v_particle_octree) == Py_None);
5317   __pyx_t_2 = (__pyx_t_1 != 0);
5318   if (__pyx_t_2) {
5319 
5320     /* "yt/geometry/particle_smooth.pyx":89
5321  *         # that we can deal with >27 neighbors.
5322  *         if particle_octree is None:
5323  *             particle_octree = mesh_octree             # <<<<<<<<<<<<<<
5324  *             pdom_ind = mdom_ind
5325  *         cdef int nf, i, j, n
5326  */
5327     __Pyx_INCREF(((PyObject *)__pyx_v_mesh_octree));
5328     __Pyx_DECREF_SET(__pyx_v_particle_octree, __pyx_v_mesh_octree);
5329 
5330     /* "yt/geometry/particle_smooth.pyx":90
5331  *         if particle_octree is None:
5332  *             particle_octree = mesh_octree
5333  *             pdom_ind = mdom_ind             # <<<<<<<<<<<<<<
5334  *         cdef int nf, i, j, n
5335  *         cdef int dims[3]
5336  */
5337     __PYX_XDEC_MEMVIEW(&__pyx_v_pdom_ind, 1);
5338     __PYX_INC_MEMVIEW(&__pyx_v_mdom_ind, 0);
5339     __pyx_v_pdom_ind = __pyx_v_mdom_ind;
5340 
5341     /* "yt/geometry/particle_smooth.pyx":88
5342  *         # mechanism of an expandable array for holding pointers to Octs, so
5343  *         # that we can deal with >27 neighbors.
5344  *         if particle_octree is None:             # <<<<<<<<<<<<<<
5345  *             particle_octree = mesh_octree
5346  *             pdom_ind = mdom_ind
5347  */
5348   }
5349 
5350   /* "yt/geometry/particle_smooth.pyx":99
5351  *         cdef np.float64_t dds[3]
5352  *         cdef np.float64_t **octree_field_pointers
5353  *         cdef int nsize = 0             # <<<<<<<<<<<<<<
5354  *         cdef np.int64_t *nind = NULL
5355  *         cdef OctInfo moi, poi
5356  */
5357   __pyx_v_nsize = 0;
5358 
5359   /* "yt/geometry/particle_smooth.pyx":100
5360  *         cdef np.float64_t **octree_field_pointers
5361  *         cdef int nsize = 0
5362  *         cdef np.int64_t *nind = NULL             # <<<<<<<<<<<<<<
5363  *         cdef OctInfo moi, poi
5364  *         cdef Oct *oct
5365  */
5366   __pyx_v_nind = NULL;
5367 
5368   /* "yt/geometry/particle_smooth.pyx":112
5369  *         cdef np.float64_t[:,:] oct_left_edges, oct_dds
5370  *         cdef OctInfo oinfo
5371  *         if geometry == "cartesian":             # <<<<<<<<<<<<<<
5372  *             self.pos_setup = cart_coord_setup
5373  *             cart_positions = positions
5374  */
5375   __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_geometry, __pyx_n_s_cartesian, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 112, __pyx_L1_error)
5376   if (__pyx_t_2) {
5377 
5378     /* "yt/geometry/particle_smooth.pyx":113
5379  *         cdef OctInfo oinfo
5380  *         if geometry == "cartesian":
5381  *             self.pos_setup = cart_coord_setup             # <<<<<<<<<<<<<<
5382  *             cart_positions = positions
5383  *         elif geometry == "spherical":
5384  */
5385     __pyx_v_self->pos_setup = __pyx_f_2yt_8geometry_15particle_smooth_cart_coord_setup;
5386 
5387     /* "yt/geometry/particle_smooth.pyx":114
5388  *         if geometry == "cartesian":
5389  *             self.pos_setup = cart_coord_setup
5390  *             cart_positions = positions             # <<<<<<<<<<<<<<
5391  *         elif geometry == "spherical":
5392  *             self.pos_setup = spherical_coord_setup
5393  */
5394     __PYX_INC_MEMVIEW(&__pyx_v_positions, 0);
5395     __pyx_v_cart_positions = __pyx_v_positions;
5396 
5397     /* "yt/geometry/particle_smooth.pyx":112
5398  *         cdef np.float64_t[:,:] oct_left_edges, oct_dds
5399  *         cdef OctInfo oinfo
5400  *         if geometry == "cartesian":             # <<<<<<<<<<<<<<
5401  *             self.pos_setup = cart_coord_setup
5402  *             cart_positions = positions
5403  */
5404     goto __pyx_L4;
5405   }
5406 
5407   /* "yt/geometry/particle_smooth.pyx":115
5408  *             self.pos_setup = cart_coord_setup
5409  *             cart_positions = positions
5410  *         elif geometry == "spherical":             # <<<<<<<<<<<<<<
5411  *             self.pos_setup = spherical_coord_setup
5412  *             cart_positions = np.empty((positions.shape[0], 3), dtype="float64")
5413  */
5414   __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_geometry, __pyx_n_s_spherical, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 115, __pyx_L1_error)
5415   if (likely(__pyx_t_2)) {
5416 
5417     /* "yt/geometry/particle_smooth.pyx":116
5418  *             cart_positions = positions
5419  *         elif geometry == "spherical":
5420  *             self.pos_setup = spherical_coord_setup             # <<<<<<<<<<<<<<
5421  *             cart_positions = np.empty((positions.shape[0], 3), dtype="float64")
5422  *
5423  */
5424     __pyx_v_self->pos_setup = __pyx_f_2yt_8geometry_15particle_smooth_spherical_coord_setup;
5425 
5426     /* "yt/geometry/particle_smooth.pyx":117
5427  *         elif geometry == "spherical":
5428  *             self.pos_setup = spherical_coord_setup
5429  *             cart_positions = np.empty((positions.shape[0], 3), dtype="float64")             # <<<<<<<<<<<<<<
5430  *
5431  *             cart_positions[:,0] = positions[:,0] * \
5432  */
5433     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __pyx_L1_error)
5434     __Pyx_GOTREF(__pyx_t_3);
5435     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 117, __pyx_L1_error)
5436     __Pyx_GOTREF(__pyx_t_4);
5437     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5438     __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_positions.shape[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __pyx_L1_error)
5439     __Pyx_GOTREF(__pyx_t_3);
5440     __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 117, __pyx_L1_error)
5441     __Pyx_GOTREF(__pyx_t_5);
5442     __Pyx_GIVEREF(__pyx_t_3);
5443     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
5444     __Pyx_INCREF(__pyx_int_3);
5445     __Pyx_GIVEREF(__pyx_int_3);
5446     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_3);
5447     __pyx_t_3 = 0;
5448     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __pyx_L1_error)
5449     __Pyx_GOTREF(__pyx_t_3);
5450     __Pyx_GIVEREF(__pyx_t_5);
5451     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
5452     __pyx_t_5 = 0;
5453     __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 117, __pyx_L1_error)
5454     __Pyx_GOTREF(__pyx_t_5);
5455     if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 117, __pyx_L1_error)
5456     __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 117, __pyx_L1_error)
5457     __Pyx_GOTREF(__pyx_t_6);
5458     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5459     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5460     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5461     __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 117, __pyx_L1_error)
5462     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5463     __pyx_v_cart_positions = __pyx_t_7;
5464     __pyx_t_7.memview = NULL;
5465     __pyx_t_7.data = NULL;
5466 
5467     /* "yt/geometry/particle_smooth.pyx":119
5468  *             cart_positions = np.empty((positions.shape[0], 3), dtype="float64")
5469  *
5470  *             cart_positions[:,0] = positions[:,0] * \             # <<<<<<<<<<<<<<
5471  *                                   np.sin(positions[:,1]) * \
5472  *                                   np.cos(positions[:,2])
5473  */
5474     __pyx_t_8.data = __pyx_v_positions.data;
5475     __pyx_t_8.memview = __pyx_v_positions.memview;
5476     __PYX_INC_MEMVIEW(&__pyx_t_8, 0);
5477     __pyx_t_8.shape[0] = __pyx_v_positions.shape[0];
5478 __pyx_t_8.strides[0] = __pyx_v_positions.strides[0];
5479     __pyx_t_8.suboffsets[0] = -1;
5480 
5481 {
5482     Py_ssize_t __pyx_tmp_idx = 0;
5483     Py_ssize_t __pyx_tmp_stride = __pyx_v_positions.strides[1];
5484         if ((0)) __PYX_ERR(0, 119, __pyx_L1_error)
5485         __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride;
5486 }
5487 
5488 __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_t_8, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 119, __pyx_L1_error)
5489     __Pyx_GOTREF(__pyx_t_6);
5490     __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
5491     __pyx_t_8.memview = NULL;
5492     __pyx_t_8.data = NULL;
5493 
5494     /* "yt/geometry/particle_smooth.pyx":120
5495  *
5496  *             cart_positions[:,0] = positions[:,0] * \
5497  *                                   np.sin(positions[:,1]) * \             # <<<<<<<<<<<<<<
5498  *                                   np.cos(positions[:,2])
5499  *             cart_positions[:,1] = positions[:,0] * \
5500  */
5501     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error)
5502     __Pyx_GOTREF(__pyx_t_3);
5503     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sin); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 120, __pyx_L1_error)
5504     __Pyx_GOTREF(__pyx_t_4);
5505     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5506     __pyx_t_8.data = __pyx_v_positions.data;
5507     __pyx_t_8.memview = __pyx_v_positions.memview;
5508     __PYX_INC_MEMVIEW(&__pyx_t_8, 0);
5509     __pyx_t_8.shape[0] = __pyx_v_positions.shape[0];
5510 __pyx_t_8.strides[0] = __pyx_v_positions.strides[0];
5511     __pyx_t_8.suboffsets[0] = -1;
5512 
5513 {
5514     Py_ssize_t __pyx_tmp_idx = 1;
5515     Py_ssize_t __pyx_tmp_stride = __pyx_v_positions.strides[1];
5516         if ((0)) __PYX_ERR(0, 120, __pyx_L1_error)
5517         __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride;
5518 }
5519 
5520 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_t_8, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error)
5521     __Pyx_GOTREF(__pyx_t_3);
5522     __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
5523     __pyx_t_8.memview = NULL;
5524     __pyx_t_8.data = NULL;
5525     __pyx_t_9 = NULL;
5526     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5527       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
5528       if (likely(__pyx_t_9)) {
5529         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5530         __Pyx_INCREF(__pyx_t_9);
5531         __Pyx_INCREF(function);
5532         __Pyx_DECREF_SET(__pyx_t_4, function);
5533       }
5534     }
5535     __pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_9, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
5536     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5537     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5538     if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 120, __pyx_L1_error)
5539     __Pyx_GOTREF(__pyx_t_5);
5540     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5541 
5542     /* "yt/geometry/particle_smooth.pyx":119
5543  *             cart_positions = np.empty((positions.shape[0], 3), dtype="float64")
5544  *
5545  *             cart_positions[:,0] = positions[:,0] * \             # <<<<<<<<<<<<<<
5546  *                                   np.sin(positions[:,1]) * \
5547  *                                   np.cos(positions[:,2])
5548  */
5549     __pyx_t_4 = PyNumber_Multiply(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error)
5550     __Pyx_GOTREF(__pyx_t_4);
5551     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5552     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5553 
5554     /* "yt/geometry/particle_smooth.pyx":121
5555  *             cart_positions[:,0] = positions[:,0] * \
5556  *                                   np.sin(positions[:,1]) * \
5557  *                                   np.cos(positions[:,2])             # <<<<<<<<<<<<<<
5558  *             cart_positions[:,1] = positions[:,0] * \
5559  *                                   np.sin(positions[:,1]) * \
5560  */
5561     __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 121, __pyx_L1_error)
5562     __Pyx_GOTREF(__pyx_t_6);
5563     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_cos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error)
5564     __Pyx_GOTREF(__pyx_t_3);
5565     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5566     __pyx_t_8.data = __pyx_v_positions.data;
5567     __pyx_t_8.memview = __pyx_v_positions.memview;
5568     __PYX_INC_MEMVIEW(&__pyx_t_8, 0);
5569     __pyx_t_8.shape[0] = __pyx_v_positions.shape[0];
5570 __pyx_t_8.strides[0] = __pyx_v_positions.strides[0];
5571     __pyx_t_8.suboffsets[0] = -1;
5572 
5573 {
5574     Py_ssize_t __pyx_tmp_idx = 2;
5575     Py_ssize_t __pyx_tmp_stride = __pyx_v_positions.strides[1];
5576         if ((0)) __PYX_ERR(0, 121, __pyx_L1_error)
5577         __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride;
5578 }
5579 
5580 __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_t_8, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 121, __pyx_L1_error)
5581     __Pyx_GOTREF(__pyx_t_6);
5582     __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
5583     __pyx_t_8.memview = NULL;
5584     __pyx_t_8.data = NULL;
5585     __pyx_t_9 = NULL;
5586     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
5587       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
5588       if (likely(__pyx_t_9)) {
5589         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
5590         __Pyx_INCREF(__pyx_t_9);
5591         __Pyx_INCREF(function);
5592         __Pyx_DECREF_SET(__pyx_t_3, function);
5593       }
5594     }
5595     __pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
5596     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5597     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5598     if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 121, __pyx_L1_error)
5599     __Pyx_GOTREF(__pyx_t_5);
5600     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5601 
5602     /* "yt/geometry/particle_smooth.pyx":120
5603  *
5604  *             cart_positions[:,0] = positions[:,0] * \
5605  *                                   np.sin(positions[:,1]) * \             # <<<<<<<<<<<<<<
5606  *                                   np.cos(positions[:,2])
5607  *             cart_positions[:,1] = positions[:,0] * \
5608  */
5609     __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error)
5610     __Pyx_GOTREF(__pyx_t_3);
5611     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5612     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5613     __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_10 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error)
5614     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5615 
5616     /* "yt/geometry/particle_smooth.pyx":119
5617  *             cart_positions = np.empty((positions.shape[0], 3), dtype="float64")
5618  *
5619  *             cart_positions[:,0] = positions[:,0] * \             # <<<<<<<<<<<<<<
5620  *                                   np.sin(positions[:,1]) * \
5621  *                                   np.cos(positions[:,2])
5622  */
5623     __pyx_t_8.data = __pyx_v_cart_positions.data;
5624     __pyx_t_8.memview = __pyx_v_cart_positions.memview;
5625     __PYX_INC_MEMVIEW(&__pyx_t_8, 0);
5626     __pyx_t_8.shape[0] = __pyx_v_cart_positions.shape[0];
5627 __pyx_t_8.strides[0] = __pyx_v_cart_positions.strides[0];
5628     __pyx_t_8.suboffsets[0] = -1;
5629 
5630 {
5631     Py_ssize_t __pyx_tmp_idx = 0;
5632     Py_ssize_t __pyx_tmp_stride = __pyx_v_cart_positions.strides[1];
5633         if ((0)) __PYX_ERR(0, 119, __pyx_L1_error)
5634         __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride;
5635 }
5636 
5637 {
5638         __pyx_t_5numpy_float64_t __pyx_temp_scalar = __pyx_t_10;
5639         {
5640             Py_ssize_t __pyx_temp_extent_0 = __pyx_t_8.shape[0];
5641             Py_ssize_t __pyx_temp_stride_0 = __pyx_t_8.strides[0];
5642             char *__pyx_temp_pointer_0;
5643             Py_ssize_t __pyx_temp_idx_0;
5644             __pyx_temp_pointer_0 = __pyx_t_8.data;
5645             for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
5646               *((__pyx_t_5numpy_float64_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
5647               __pyx_temp_pointer_0 += __pyx_temp_stride_0;
5648             }
5649         }
5650     }
5651     __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
5652     __pyx_t_8.memview = NULL;
5653     __pyx_t_8.data = NULL;
5654 
5655     /* "yt/geometry/particle_smooth.pyx":122
5656  *                                   np.sin(positions[:,1]) * \
5657  *                                   np.cos(positions[:,2])
5658  *             cart_positions[:,1] = positions[:,0] * \             # <<<<<<<<<<<<<<
5659  *                                   np.sin(positions[:,1]) * \
5660  *                                   np.sin(positions[:,2])
5661  */
5662     __pyx_t_11.data = __pyx_v_positions.data;
5663     __pyx_t_11.memview = __pyx_v_positions.memview;
5664     __PYX_INC_MEMVIEW(&__pyx_t_11, 0);
5665     __pyx_t_11.shape[0] = __pyx_v_positions.shape[0];
5666 __pyx_t_11.strides[0] = __pyx_v_positions.strides[0];
5667     __pyx_t_11.suboffsets[0] = -1;
5668 
5669 {
5670     Py_ssize_t __pyx_tmp_idx = 0;
5671     Py_ssize_t __pyx_tmp_stride = __pyx_v_positions.strides[1];
5672         if ((0)) __PYX_ERR(0, 122, __pyx_L1_error)
5673         __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride;
5674 }
5675 
5676 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_t_11, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error)
5677     __Pyx_GOTREF(__pyx_t_3);
5678     __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
5679     __pyx_t_11.memview = NULL;
5680     __pyx_t_11.data = NULL;
5681 
5682     /* "yt/geometry/particle_smooth.pyx":123
5683  *                                   np.cos(positions[:,2])
5684  *             cart_positions[:,1] = positions[:,0] * \
5685  *                                   np.sin(positions[:,1]) * \             # <<<<<<<<<<<<<<
5686  *                                   np.sin(positions[:,2])
5687  *             cart_positions[:,2] = positions[:,0] * \
5688  */
5689     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
5690     __Pyx_GOTREF(__pyx_t_4);
5691     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sin); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 123, __pyx_L1_error)
5692     __Pyx_GOTREF(__pyx_t_6);
5693     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5694     __pyx_t_11.data = __pyx_v_positions.data;
5695     __pyx_t_11.memview = __pyx_v_positions.memview;
5696     __PYX_INC_MEMVIEW(&__pyx_t_11, 0);
5697     __pyx_t_11.shape[0] = __pyx_v_positions.shape[0];
5698 __pyx_t_11.strides[0] = __pyx_v_positions.strides[0];
5699     __pyx_t_11.suboffsets[0] = -1;
5700 
5701 {
5702     Py_ssize_t __pyx_tmp_idx = 1;
5703     Py_ssize_t __pyx_tmp_stride = __pyx_v_positions.strides[1];
5704         if ((0)) __PYX_ERR(0, 123, __pyx_L1_error)
5705         __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride;
5706 }
5707 
5708 __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_t_11, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
5709     __Pyx_GOTREF(__pyx_t_4);
5710     __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
5711     __pyx_t_11.memview = NULL;
5712     __pyx_t_11.data = NULL;
5713     __pyx_t_9 = NULL;
5714     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
5715       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
5716       if (likely(__pyx_t_9)) {
5717         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
5718         __Pyx_INCREF(__pyx_t_9);
5719         __Pyx_INCREF(function);
5720         __Pyx_DECREF_SET(__pyx_t_6, function);
5721       }
5722     }
5723     __pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_9, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4);
5724     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5725     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5726     if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error)
5727     __Pyx_GOTREF(__pyx_t_5);
5728     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5729 
5730     /* "yt/geometry/particle_smooth.pyx":122
5731  *                                   np.sin(positions[:,1]) * \
5732  *                                   np.cos(positions[:,2])
5733  *             cart_positions[:,1] = positions[:,0] * \             # <<<<<<<<<<<<<<
5734  *                                   np.sin(positions[:,1]) * \
5735  *                                   np.sin(positions[:,2])
5736  */
5737     __pyx_t_6 = PyNumber_Multiply(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 122, __pyx_L1_error)
5738     __Pyx_GOTREF(__pyx_t_6);
5739     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5740     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5741 
5742     /* "yt/geometry/particle_smooth.pyx":124
5743  *             cart_positions[:,1] = positions[:,0] * \
5744  *                                   np.sin(positions[:,1]) * \
5745  *                                   np.sin(positions[:,2])             # <<<<<<<<<<<<<<
5746  *             cart_positions[:,2] = positions[:,0] * \
5747  *                                   np.cos(positions[:,1])
5748  */
5749     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error)
5750     __Pyx_GOTREF(__pyx_t_3);
5751     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sin); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error)
5752     __Pyx_GOTREF(__pyx_t_4);
5753     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5754     __pyx_t_11.data = __pyx_v_positions.data;
5755     __pyx_t_11.memview = __pyx_v_positions.memview;
5756     __PYX_INC_MEMVIEW(&__pyx_t_11, 0);
5757     __pyx_t_11.shape[0] = __pyx_v_positions.shape[0];
5758 __pyx_t_11.strides[0] = __pyx_v_positions.strides[0];
5759     __pyx_t_11.suboffsets[0] = -1;
5760 
5761 {
5762     Py_ssize_t __pyx_tmp_idx = 2;
5763     Py_ssize_t __pyx_tmp_stride = __pyx_v_positions.strides[1];
5764         if ((0)) __PYX_ERR(0, 124, __pyx_L1_error)
5765         __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride;
5766 }
5767 
5768 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_t_11, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error)
5769     __Pyx_GOTREF(__pyx_t_3);
5770     __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
5771     __pyx_t_11.memview = NULL;
5772     __pyx_t_11.data = NULL;
5773     __pyx_t_9 = NULL;
5774     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5775       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
5776       if (likely(__pyx_t_9)) {
5777         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5778         __Pyx_INCREF(__pyx_t_9);
5779         __Pyx_INCREF(function);
5780         __Pyx_DECREF_SET(__pyx_t_4, function);
5781       }
5782     }
5783     __pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_9, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
5784     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5785     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5786     if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error)
5787     __Pyx_GOTREF(__pyx_t_5);
5788     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5789 
5790     /* "yt/geometry/particle_smooth.pyx":123
5791  *                                   np.cos(positions[:,2])
5792  *             cart_positions[:,1] = positions[:,0] * \
5793  *                                   np.sin(positions[:,1]) * \             # <<<<<<<<<<<<<<
5794  *                                   np.sin(positions[:,2])
5795  *             cart_positions[:,2] = positions[:,0] * \
5796  */
5797     __pyx_t_4 = PyNumber_Multiply(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
5798     __Pyx_GOTREF(__pyx_t_4);
5799     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5800     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5801     __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_10 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 123, __pyx_L1_error)
5802     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5803 
5804     /* "yt/geometry/particle_smooth.pyx":122
5805  *                                   np.sin(positions[:,1]) * \
5806  *                                   np.cos(positions[:,2])
5807  *             cart_positions[:,1] = positions[:,0] * \             # <<<<<<<<<<<<<<
5808  *                                   np.sin(positions[:,1]) * \
5809  *                                   np.sin(positions[:,2])
5810  */
5811     __pyx_t_11.data = __pyx_v_cart_positions.data;
5812     __pyx_t_11.memview = __pyx_v_cart_positions.memview;
5813     __PYX_INC_MEMVIEW(&__pyx_t_11, 0);
5814     __pyx_t_11.shape[0] = __pyx_v_cart_positions.shape[0];
5815 __pyx_t_11.strides[0] = __pyx_v_cart_positions.strides[0];
5816     __pyx_t_11.suboffsets[0] = -1;
5817 
5818 {
5819     Py_ssize_t __pyx_tmp_idx = 1;
5820     Py_ssize_t __pyx_tmp_stride = __pyx_v_cart_positions.strides[1];
5821         if ((0)) __PYX_ERR(0, 122, __pyx_L1_error)
5822         __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride;
5823 }
5824 
5825 {
5826         __pyx_t_5numpy_float64_t __pyx_temp_scalar = __pyx_t_10;
5827         {
5828             Py_ssize_t __pyx_temp_extent_0 = __pyx_t_11.shape[0];
5829             Py_ssize_t __pyx_temp_stride_0 = __pyx_t_11.strides[0];
5830             char *__pyx_temp_pointer_0;
5831             Py_ssize_t __pyx_temp_idx_0;
5832             __pyx_temp_pointer_0 = __pyx_t_11.data;
5833             for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
5834               *((__pyx_t_5numpy_float64_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
5835               __pyx_temp_pointer_0 += __pyx_temp_stride_0;
5836             }
5837         }
5838     }
5839     __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
5840     __pyx_t_11.memview = NULL;
5841     __pyx_t_11.data = NULL;
5842 
5843     /* "yt/geometry/particle_smooth.pyx":125
5844  *                                   np.sin(positions[:,1]) * \
5845  *                                   np.sin(positions[:,2])
5846  *             cart_positions[:,2] = positions[:,0] * \             # <<<<<<<<<<<<<<
5847  *                                   np.cos(positions[:,1])
5848  *             periodicity = (False, False, False)
5849  */
5850     __pyx_t_12.data = __pyx_v_positions.data;
5851     __pyx_t_12.memview = __pyx_v_positions.memview;
5852     __PYX_INC_MEMVIEW(&__pyx_t_12, 0);
5853     __pyx_t_12.shape[0] = __pyx_v_positions.shape[0];
5854 __pyx_t_12.strides[0] = __pyx_v_positions.strides[0];
5855     __pyx_t_12.suboffsets[0] = -1;
5856 
5857 {
5858     Py_ssize_t __pyx_tmp_idx = 0;
5859     Py_ssize_t __pyx_tmp_stride = __pyx_v_positions.strides[1];
5860         if ((0)) __PYX_ERR(0, 125, __pyx_L1_error)
5861         __pyx_t_12.data += __pyx_tmp_idx * __pyx_tmp_stride;
5862 }
5863 
5864 __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_t_12, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error)
5865     __Pyx_GOTREF(__pyx_t_4);
5866     __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
5867     __pyx_t_12.memview = NULL;
5868     __pyx_t_12.data = NULL;
5869 
5870     /* "yt/geometry/particle_smooth.pyx":126
5871  *                                   np.sin(positions[:,2])
5872  *             cart_positions[:,2] = positions[:,0] * \
5873  *                                   np.cos(positions[:,1])             # <<<<<<<<<<<<<<
5874  *             periodicity = (False, False, False)
5875  *         else:
5876  */
5877     __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 126, __pyx_L1_error)
5878     __Pyx_GOTREF(__pyx_t_6);
5879     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_cos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
5880     __Pyx_GOTREF(__pyx_t_3);
5881     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5882     __pyx_t_12.data = __pyx_v_positions.data;
5883     __pyx_t_12.memview = __pyx_v_positions.memview;
5884     __PYX_INC_MEMVIEW(&__pyx_t_12, 0);
5885     __pyx_t_12.shape[0] = __pyx_v_positions.shape[0];
5886 __pyx_t_12.strides[0] = __pyx_v_positions.strides[0];
5887     __pyx_t_12.suboffsets[0] = -1;
5888 
5889 {
5890     Py_ssize_t __pyx_tmp_idx = 1;
5891     Py_ssize_t __pyx_tmp_stride = __pyx_v_positions.strides[1];
5892         if ((0)) __PYX_ERR(0, 126, __pyx_L1_error)
5893         __pyx_t_12.data += __pyx_tmp_idx * __pyx_tmp_stride;
5894 }
5895 
5896 __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_t_12, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 126, __pyx_L1_error)
5897     __Pyx_GOTREF(__pyx_t_6);
5898     __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
5899     __pyx_t_12.memview = NULL;
5900     __pyx_t_12.data = NULL;
5901     __pyx_t_9 = NULL;
5902     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
5903       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
5904       if (likely(__pyx_t_9)) {
5905         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
5906         __Pyx_INCREF(__pyx_t_9);
5907         __Pyx_INCREF(function);
5908         __Pyx_DECREF_SET(__pyx_t_3, function);
5909       }
5910     }
5911     __pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
5912     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5913     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5914     if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error)
5915     __Pyx_GOTREF(__pyx_t_5);
5916     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5917 
5918     /* "yt/geometry/particle_smooth.pyx":125
5919  *                                   np.sin(positions[:,1]) * \
5920  *                                   np.sin(positions[:,2])
5921  *             cart_positions[:,2] = positions[:,0] * \             # <<<<<<<<<<<<<<
5922  *                                   np.cos(positions[:,1])
5923  *             periodicity = (False, False, False)
5924  */
5925     __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
5926     __Pyx_GOTREF(__pyx_t_3);
5927     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5928     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5929     __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_10 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L1_error)
5930     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5931     __pyx_t_12.data = __pyx_v_cart_positions.data;
5932     __pyx_t_12.memview = __pyx_v_cart_positions.memview;
5933     __PYX_INC_MEMVIEW(&__pyx_t_12, 0);
5934     __pyx_t_12.shape[0] = __pyx_v_cart_positions.shape[0];
5935 __pyx_t_12.strides[0] = __pyx_v_cart_positions.strides[0];
5936     __pyx_t_12.suboffsets[0] = -1;
5937 
5938 {
5939     Py_ssize_t __pyx_tmp_idx = 2;
5940     Py_ssize_t __pyx_tmp_stride = __pyx_v_cart_positions.strides[1];
5941         if ((0)) __PYX_ERR(0, 125, __pyx_L1_error)
5942         __pyx_t_12.data += __pyx_tmp_idx * __pyx_tmp_stride;
5943 }
5944 
5945 {
5946         __pyx_t_5numpy_float64_t __pyx_temp_scalar = __pyx_t_10;
5947         {
5948             Py_ssize_t __pyx_temp_extent_0 = __pyx_t_12.shape[0];
5949             Py_ssize_t __pyx_temp_stride_0 = __pyx_t_12.strides[0];
5950             char *__pyx_temp_pointer_0;
5951             Py_ssize_t __pyx_temp_idx_0;
5952             __pyx_temp_pointer_0 = __pyx_t_12.data;
5953             for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
5954               *((__pyx_t_5numpy_float64_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
5955               __pyx_temp_pointer_0 += __pyx_temp_stride_0;
5956             }
5957         }
5958     }
5959     __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
5960     __pyx_t_12.memview = NULL;
5961     __pyx_t_12.data = NULL;
5962 
5963     /* "yt/geometry/particle_smooth.pyx":127
5964  *             cart_positions[:,2] = positions[:,0] * \
5965  *                                   np.cos(positions[:,1])
5966  *             periodicity = (False, False, False)             # <<<<<<<<<<<<<<
5967  *         else:
5968  *             raise NotImplementedError
5969  */
5970     __Pyx_INCREF(__pyx_tuple__3);
5971     __Pyx_DECREF_SET(__pyx_v_periodicity, __pyx_tuple__3);
5972 
5973     /* "yt/geometry/particle_smooth.pyx":115
5974  *             self.pos_setup = cart_coord_setup
5975  *             cart_positions = positions
5976  *         elif geometry == "spherical":             # <<<<<<<<<<<<<<
5977  *             self.pos_setup = spherical_coord_setup
5978  *             cart_positions = np.empty((positions.shape[0], 3), dtype="float64")
5979  */
5980     goto __pyx_L4;
5981   }
5982 
5983   /* "yt/geometry/particle_smooth.pyx":129
5984  *             periodicity = (False, False, False)
5985  *         else:
5986  *             raise NotImplementedError             # <<<<<<<<<<<<<<
5987  *         dims[0] = dims[1] = dims[2] = (1 << mesh_octree.oref)
5988  *         cdef int nz = dims[0] * dims[1] * dims[2]
5989  */
5990   /*else*/ {
5991     __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
5992     __PYX_ERR(0, 129, __pyx_L1_error)
5993   }
5994   __pyx_L4:;
5995 
5996   /* "yt/geometry/particle_smooth.pyx":130
5997  *         else:
5998  *             raise NotImplementedError
5999  *         dims[0] = dims[1] = dims[2] = (1 << mesh_octree.oref)             # <<<<<<<<<<<<<<
6000  *         cdef int nz = dims[0] * dims[1] * dims[2]
6001  *         numpart = positions.shape[0]
6002  */
6003   __pyx_t_13 = (1 << __pyx_v_mesh_octree->oref);
6004   (__pyx_v_dims[0]) = __pyx_t_13;
6005   (__pyx_v_dims[1]) = __pyx_t_13;
6006   (__pyx_v_dims[2]) = __pyx_t_13;
6007 
6008   /* "yt/geometry/particle_smooth.pyx":131
6009  *             raise NotImplementedError
6010  *         dims[0] = dims[1] = dims[2] = (1 << mesh_octree.oref)
6011  *         cdef int nz = dims[0] * dims[1] * dims[2]             # <<<<<<<<<<<<<<
6012  *         numpart = positions.shape[0]
6013  *         # pcount is the number of particles per oct.
6014  */
6015   __pyx_v_nz = (((__pyx_v_dims[0]) * (__pyx_v_dims[1])) * (__pyx_v_dims[2]));
6016 
6017   /* "yt/geometry/particle_smooth.pyx":132
6018  *         dims[0] = dims[1] = dims[2] = (1 << mesh_octree.oref)
6019  *         cdef int nz = dims[0] * dims[1] * dims[2]
6020  *         numpart = positions.shape[0]             # <<<<<<<<<<<<<<
6021  *         # pcount is the number of particles per oct.
6022  *         pcount = np.zeros_like(pdom_ind)
6023  */
6024   __pyx_v_numpart = (__pyx_v_positions.shape[0]);
6025 
6026   /* "yt/geometry/particle_smooth.pyx":134
6027  *         numpart = positions.shape[0]
6028  *         # pcount is the number of particles per oct.
6029  *         pcount = np.zeros_like(pdom_ind)             # <<<<<<<<<<<<<<
6030  *         oct_left_edges = np.zeros((pdom_ind.shape[0], 3), dtype='float64')
6031  *         oct_dds = np.zeros_like(oct_left_edges)
6032  */
6033   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 134, __pyx_L1_error)
6034   __Pyx_GOTREF(__pyx_t_5);
6035   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error)
6036   __Pyx_GOTREF(__pyx_t_4);
6037   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6038   __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_pdom_ind, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 134, __pyx_L1_error)
6039   __Pyx_GOTREF(__pyx_t_5);
6040   __pyx_t_6 = NULL;
6041   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
6042     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
6043     if (likely(__pyx_t_6)) {
6044       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
6045       __Pyx_INCREF(__pyx_t_6);
6046       __Pyx_INCREF(function);
6047       __Pyx_DECREF_SET(__pyx_t_4, function);
6048     }
6049   }
6050   __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
6051   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6052   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6053   if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error)
6054   __Pyx_GOTREF(__pyx_t_3);
6055   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6056   __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 134, __pyx_L1_error)
6057   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6058   __pyx_v_pcount = __pyx_t_14;
6059   __pyx_t_14.memview = NULL;
6060   __pyx_t_14.data = NULL;
6061 
6062   /* "yt/geometry/particle_smooth.pyx":135
6063  *         # pcount is the number of particles per oct.
6064  *         pcount = np.zeros_like(pdom_ind)
6065  *         oct_left_edges = np.zeros((pdom_ind.shape[0], 3), dtype='float64')             # <<<<<<<<<<<<<<
6066  *         oct_dds = np.zeros_like(oct_left_edges)
6067  *         # doff is the offset to a given oct in the sorted particles.
6068  */
6069   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error)
6070   __Pyx_GOTREF(__pyx_t_3);
6071   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error)
6072   __Pyx_GOTREF(__pyx_t_4);
6073   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6074   __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_pdom_ind.shape[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error)
6075   __Pyx_GOTREF(__pyx_t_3);
6076   __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 135, __pyx_L1_error)
6077   __Pyx_GOTREF(__pyx_t_5);
6078   __Pyx_GIVEREF(__pyx_t_3);
6079   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
6080   __Pyx_INCREF(__pyx_int_3);
6081   __Pyx_GIVEREF(__pyx_int_3);
6082   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_3);
6083   __pyx_t_3 = 0;
6084   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error)
6085   __Pyx_GOTREF(__pyx_t_3);
6086   __Pyx_GIVEREF(__pyx_t_5);
6087   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
6088   __pyx_t_5 = 0;
6089   __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 135, __pyx_L1_error)
6090   __Pyx_GOTREF(__pyx_t_5);
6091   if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 135, __pyx_L1_error)
6092   __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 135, __pyx_L1_error)
6093   __Pyx_GOTREF(__pyx_t_6);
6094   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6095   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6096   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6097   __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 135, __pyx_L1_error)
6098   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6099   __pyx_v_oct_left_edges = __pyx_t_7;
6100   __pyx_t_7.memview = NULL;
6101   __pyx_t_7.data = NULL;
6102 
6103   /* "yt/geometry/particle_smooth.pyx":136
6104  *         pcount = np.zeros_like(pdom_ind)
6105  *         oct_left_edges = np.zeros((pdom_ind.shape[0], 3), dtype='float64')
6106  *         oct_dds = np.zeros_like(oct_left_edges)             # <<<<<<<<<<<<<<
6107  *         # doff is the offset to a given oct in the sorted particles.
6108  *         doff = np.zeros_like(pdom_ind) - 1
6109  */
6110   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 136, __pyx_L1_error)
6111   __Pyx_GOTREF(__pyx_t_5);
6112   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error)
6113   __Pyx_GOTREF(__pyx_t_3);
6114   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6115   __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_oct_left_edges, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 136, __pyx_L1_error)
6116   __Pyx_GOTREF(__pyx_t_5);
6117   __pyx_t_4 = NULL;
6118   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6119     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
6120     if (likely(__pyx_t_4)) {
6121       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6122       __Pyx_INCREF(__pyx_t_4);
6123       __Pyx_INCREF(function);
6124       __Pyx_DECREF_SET(__pyx_t_3, function);
6125     }
6126   }
6127   __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5);
6128   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6129   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6130   if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 136, __pyx_L1_error)
6131   __Pyx_GOTREF(__pyx_t_6);
6132   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6133   __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 136, __pyx_L1_error)
6134   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6135   __pyx_v_oct_dds = __pyx_t_7;
6136   __pyx_t_7.memview = NULL;
6137   __pyx_t_7.data = NULL;
6138 
6139   /* "yt/geometry/particle_smooth.pyx":138
6140  *         oct_dds = np.zeros_like(oct_left_edges)
6141  *         # doff is the offset to a given oct in the sorted particles.
6142  *         doff = np.zeros_like(pdom_ind) - 1             # <<<<<<<<<<<<<<
6143  *         doff_m = np.zeros((mdom_ind.shape[0], 2), dtype="int64")
6144  *         moff_p = particle_octree.get_domain_offset(domain_id + domain_offset)
6145  */
6146   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error)
6147   __Pyx_GOTREF(__pyx_t_3);
6148   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 138, __pyx_L1_error)
6149   __Pyx_GOTREF(__pyx_t_5);
6150   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6151   __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_pdom_ind, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error)
6152   __Pyx_GOTREF(__pyx_t_3);
6153   __pyx_t_4 = NULL;
6154   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
6155     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
6156     if (likely(__pyx_t_4)) {
6157       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
6158       __Pyx_INCREF(__pyx_t_4);
6159       __Pyx_INCREF(function);
6160       __Pyx_DECREF_SET(__pyx_t_5, function);
6161     }
6162   }
6163   __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3);
6164   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6165   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6166   if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 138, __pyx_L1_error)
6167   __Pyx_GOTREF(__pyx_t_6);
6168   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6169   __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_t_6, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 138, __pyx_L1_error)
6170   __Pyx_GOTREF(__pyx_t_5);
6171   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6172   __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 138, __pyx_L1_error)
6173   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6174   __pyx_v_doff = __pyx_t_14;
6175   __pyx_t_14.memview = NULL;
6176   __pyx_t_14.data = NULL;
6177 
6178   /* "yt/geometry/particle_smooth.pyx":139
6179  *         # doff is the offset to a given oct in the sorted particles.
6180  *         doff = np.zeros_like(pdom_ind) - 1
6181  *         doff_m = np.zeros((mdom_ind.shape[0], 2), dtype="int64")             # <<<<<<<<<<<<<<
6182  *         moff_p = particle_octree.get_domain_offset(domain_id + domain_offset)
6183  *         moff_m = mesh_octree.get_domain_offset(domain_id + domain_offset)
6184  */
6185   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error)
6186   __Pyx_GOTREF(__pyx_t_5);
6187   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __pyx_L1_error)
6188   __Pyx_GOTREF(__pyx_t_6);
6189   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6190   __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_mdom_ind.shape[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error)
6191   __Pyx_GOTREF(__pyx_t_5);
6192   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
6193   __Pyx_GOTREF(__pyx_t_3);
6194   __Pyx_GIVEREF(__pyx_t_5);
6195   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
6196   __Pyx_INCREF(__pyx_int_2);
6197   __Pyx_GIVEREF(__pyx_int_2);
6198   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_2);
6199   __pyx_t_5 = 0;
6200   __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error)
6201   __Pyx_GOTREF(__pyx_t_5);
6202   __Pyx_GIVEREF(__pyx_t_3);
6203   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
6204   __pyx_t_3 = 0;
6205   __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
6206   __Pyx_GOTREF(__pyx_t_3);
6207   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 139, __pyx_L1_error)
6208   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error)
6209   __Pyx_GOTREF(__pyx_t_4);
6210   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6211   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6212   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6213   __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 139, __pyx_L1_error)
6214   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6215   __pyx_v_doff_m = __pyx_t_15;
6216   __pyx_t_15.memview = NULL;
6217   __pyx_t_15.data = NULL;
6218 
6219   /* "yt/geometry/particle_smooth.pyx":140
6220  *         doff = np.zeros_like(pdom_ind) - 1
6221  *         doff_m = np.zeros((mdom_ind.shape[0], 2), dtype="int64")
6222  *         moff_p = particle_octree.get_domain_offset(domain_id + domain_offset)             # <<<<<<<<<<<<<<
6223  *         moff_m = mesh_octree.get_domain_offset(domain_id + domain_offset)
6224  *         # pdoms points particles at their octs.  So the value in this array, for
6225  */
6226   __pyx_v_moff_p = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_particle_octree->__pyx_vtab)->get_domain_offset(__pyx_v_particle_octree, (__pyx_v_domain_id + __pyx_v_domain_offset));
6227 
6228   /* "yt/geometry/particle_smooth.pyx":141
6229  *         doff_m = np.zeros((mdom_ind.shape[0], 2), dtype="int64")
6230  *         moff_p = particle_octree.get_domain_offset(domain_id + domain_offset)
6231  *         moff_m = mesh_octree.get_domain_offset(domain_id + domain_offset)             # <<<<<<<<<<<<<<
6232  *         # pdoms points particles at their octs.  So the value in this array, for
6233  *         # a given index, is the local oct index.
6234  */
6235   __pyx_v_moff_m = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_mesh_octree->__pyx_vtab)->get_domain_offset(__pyx_v_mesh_octree, (__pyx_v_domain_id + __pyx_v_domain_offset));
6236 
6237   /* "yt/geometry/particle_smooth.pyx":144
6238  *         # pdoms points particles at their octs.  So the value in this array, for
6239  *         # a given index, is the local oct index.
6240  *         pdoms = np.zeros(positions.shape[0], dtype="int64") - 1             # <<<<<<<<<<<<<<
6241  *         nf = len(fields)
6242  *         if fields is None:
6243  */
6244   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error)
6245   __Pyx_GOTREF(__pyx_t_4);
6246   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error)
6247   __Pyx_GOTREF(__pyx_t_3);
6248   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6249   __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_positions.shape[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error)
6250   __Pyx_GOTREF(__pyx_t_4);
6251   __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error)
6252   __Pyx_GOTREF(__pyx_t_5);
6253   __Pyx_GIVEREF(__pyx_t_4);
6254   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
6255   __pyx_t_4 = 0;
6256   __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error)
6257   __Pyx_GOTREF(__pyx_t_4);
6258   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 144, __pyx_L1_error)
6259   __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 144, __pyx_L1_error)
6260   __Pyx_GOTREF(__pyx_t_6);
6261   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6262   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6263   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6264   __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_t_6, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error)
6265   __Pyx_GOTREF(__pyx_t_4);
6266   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6267   __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 144, __pyx_L1_error)
6268   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6269   __pyx_v_pdoms = __pyx_t_14;
6270   __pyx_t_14.memview = NULL;
6271   __pyx_t_14.data = NULL;
6272 
6273   /* "yt/geometry/particle_smooth.pyx":145
6274  *         # a given index, is the local oct index.
6275  *         pdoms = np.zeros(positions.shape[0], dtype="int64") - 1
6276  *         nf = len(fields)             # <<<<<<<<<<<<<<
6277  *         if fields is None:
6278  *             fields = []
6279  */
6280   __pyx_t_16 = PyObject_Length(__pyx_v_fields); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 145, __pyx_L1_error)
6281   __pyx_v_nf = __pyx_t_16;
6282 
6283   /* "yt/geometry/particle_smooth.pyx":146
6284  *         pdoms = np.zeros(positions.shape[0], dtype="int64") - 1
6285  *         nf = len(fields)
6286  *         if fields is None:             # <<<<<<<<<<<<<<
6287  *             fields = []
6288  *         field_pointers = <np.float64_t**> alloca(sizeof(np.float64_t *) * nf)
6289  */
6290   __pyx_t_2 = (__pyx_v_fields == Py_None);
6291   __pyx_t_1 = (__pyx_t_2 != 0);
6292   if (__pyx_t_1) {
6293 
6294     /* "yt/geometry/particle_smooth.pyx":147
6295  *         nf = len(fields)
6296  *         if fields is None:
6297  *             fields = []             # <<<<<<<<<<<<<<
6298  *         field_pointers = <np.float64_t**> alloca(sizeof(np.float64_t *) * nf)
6299  *         for i in range(nf):
6300  */
6301     __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error)
6302     __Pyx_GOTREF(__pyx_t_4);
6303     __Pyx_DECREF_SET(__pyx_v_fields, __pyx_t_4);
6304     __pyx_t_4 = 0;
6305 
6306     /* "yt/geometry/particle_smooth.pyx":146
6307  *         pdoms = np.zeros(positions.shape[0], dtype="int64") - 1
6308  *         nf = len(fields)
6309  *         if fields is None:             # <<<<<<<<<<<<<<
6310  *             fields = []
6311  *         field_pointers = <np.float64_t**> alloca(sizeof(np.float64_t *) * nf)
6312  */
6313   }
6314 
6315   /* "yt/geometry/particle_smooth.pyx":148
6316  *         if fields is None:
6317  *             fields = []
6318  *         field_pointers = <np.float64_t**> alloca(sizeof(np.float64_t *) * nf)             # <<<<<<<<<<<<<<
6319  *         for i in range(nf):
6320  *             tarr = fields[i]
6321  */
6322   __pyx_v_field_pointers = ((__pyx_t_5numpy_float64_t **)alloca(((sizeof(__pyx_t_5numpy_float64_t *)) * __pyx_v_nf)));
6323 
6324   /* "yt/geometry/particle_smooth.pyx":149
6325  *             fields = []
6326  *         field_pointers = <np.float64_t**> alloca(sizeof(np.float64_t *) * nf)
6327  *         for i in range(nf):             # <<<<<<<<<<<<<<
6328  *             tarr = fields[i]
6329  *             field_pointers[i] = <np.float64_t *> tarr.data
6330  */
6331   __pyx_t_17 = __pyx_v_nf;
6332   __pyx_t_18 = __pyx_t_17;
6333   for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
6334     __pyx_v_i = __pyx_t_19;
6335 
6336     /* "yt/geometry/particle_smooth.pyx":150
6337  *         field_pointers = <np.float64_t**> alloca(sizeof(np.float64_t *) * nf)
6338  *         for i in range(nf):
6339  *             tarr = fields[i]             # <<<<<<<<<<<<<<
6340  *             field_pointers[i] = <np.float64_t *> tarr.data
6341  *         if index_fields is None:
6342  */
6343     __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_fields, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error)
6344     __Pyx_GOTREF(__pyx_t_4);
6345     if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 150, __pyx_L1_error)
6346     __pyx_t_20 = ((PyArrayObject *)__pyx_t_4);
6347     {
6348       __Pyx_BufFmt_StackElem __pyx_stack[1];
6349       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tarr.rcbuffer->pybuffer);
6350       __pyx_t_21 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tarr.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
6351       if (unlikely(__pyx_t_21 < 0)) {
6352         PyErr_Fetch(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
6353         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tarr.rcbuffer->pybuffer, (PyObject*)__pyx_v_tarr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
6354           Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_24);
6355           __Pyx_RaiseBufferFallbackError();
6356         } else {
6357           PyErr_Restore(__pyx_t_22, __pyx_t_23, __pyx_t_24);
6358         }
6359         __pyx_t_22 = __pyx_t_23 = __pyx_t_24 = 0;
6360       }
6361       __pyx_pybuffernd_tarr.diminfo[0].strides = __pyx_pybuffernd_tarr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tarr.diminfo[0].shape = __pyx_pybuffernd_tarr.rcbuffer->pybuffer.shape[0];
6362       if (unlikely(__pyx_t_21 < 0)) __PYX_ERR(0, 150, __pyx_L1_error)
6363     }
6364     __pyx_t_20 = 0;
6365     __Pyx_XDECREF_SET(__pyx_v_tarr, ((PyArrayObject *)__pyx_t_4));
6366     __pyx_t_4 = 0;
6367 
6368     /* "yt/geometry/particle_smooth.pyx":151
6369  *         for i in range(nf):
6370  *             tarr = fields[i]
6371  *             field_pointers[i] = <np.float64_t *> tarr.data             # <<<<<<<<<<<<<<
6372  *         if index_fields is None:
6373  *             index_fields = []
6374  */
6375     (__pyx_v_field_pointers[__pyx_v_i]) = ((__pyx_t_5numpy_float64_t *)__pyx_v_tarr->data);
6376   }
6377 
6378   /* "yt/geometry/particle_smooth.pyx":152
6379  *             tarr = fields[i]
6380  *             field_pointers[i] = <np.float64_t *> tarr.data
6381  *         if index_fields is None:             # <<<<<<<<<<<<<<
6382  *             index_fields = []
6383  *         nf = len(index_fields)
6384  */
6385   __pyx_t_1 = (__pyx_v_index_fields == Py_None);
6386   __pyx_t_2 = (__pyx_t_1 != 0);
6387   if (__pyx_t_2) {
6388 
6389     /* "yt/geometry/particle_smooth.pyx":153
6390  *             field_pointers[i] = <np.float64_t *> tarr.data
6391  *         if index_fields is None:
6392  *             index_fields = []             # <<<<<<<<<<<<<<
6393  *         nf = len(index_fields)
6394  *         index_field_pointers = <np.float64_t**> alloca(sizeof(np.float64_t *) * nf)
6395  */
6396     __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error)
6397     __Pyx_GOTREF(__pyx_t_4);
6398     __Pyx_DECREF_SET(__pyx_v_index_fields, __pyx_t_4);
6399     __pyx_t_4 = 0;
6400 
6401     /* "yt/geometry/particle_smooth.pyx":152
6402  *             tarr = fields[i]
6403  *             field_pointers[i] = <np.float64_t *> tarr.data
6404  *         if index_fields is None:             # <<<<<<<<<<<<<<
6405  *             index_fields = []
6406  *         nf = len(index_fields)
6407  */
6408   }
6409 
6410   /* "yt/geometry/particle_smooth.pyx":154
6411  *         if index_fields is None:
6412  *             index_fields = []
6413  *         nf = len(index_fields)             # <<<<<<<<<<<<<<
6414  *         index_field_pointers = <np.float64_t**> alloca(sizeof(np.float64_t *) * nf)
6415  *         for i in range(nf):
6416  */
6417   __pyx_t_16 = PyObject_Length(__pyx_v_index_fields); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 154, __pyx_L1_error)
6418   __pyx_v_nf = __pyx_t_16;
6419 
6420   /* "yt/geometry/particle_smooth.pyx":155
6421  *             index_fields = []
6422  *         nf = len(index_fields)
6423  *         index_field_pointers = <np.float64_t**> alloca(sizeof(np.float64_t *) * nf)             # <<<<<<<<<<<<<<
6424  *         for i in range(nf):
6425  *             iarr = index_fields[i]
6426  */
6427   __pyx_v_index_field_pointers = ((__pyx_t_5numpy_float64_t **)alloca(((sizeof(__pyx_t_5numpy_float64_t *)) * __pyx_v_nf)));
6428 
6429   /* "yt/geometry/particle_smooth.pyx":156
6430  *         nf = len(index_fields)
6431  *         index_field_pointers = <np.float64_t**> alloca(sizeof(np.float64_t *) * nf)
6432  *         for i in range(nf):             # <<<<<<<<<<<<<<
6433  *             iarr = index_fields[i]
6434  *             index_field_pointers[i] = <np.float64_t *> iarr.data
6435  */
6436   __pyx_t_17 = __pyx_v_nf;
6437   __pyx_t_18 = __pyx_t_17;
6438   for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
6439     __pyx_v_i = __pyx_t_19;
6440 
6441     /* "yt/geometry/particle_smooth.pyx":157
6442  *         index_field_pointers = <np.float64_t**> alloca(sizeof(np.float64_t *) * nf)
6443  *         for i in range(nf):
6444  *             iarr = index_fields[i]             # <<<<<<<<<<<<<<
6445  *             index_field_pointers[i] = <np.float64_t *> iarr.data
6446  *         for i in range(3):
6447  */
6448     __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_index_fields, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
6449     __Pyx_GOTREF(__pyx_t_4);
6450     if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 157, __pyx_L1_error)
6451     __pyx_t_25 = ((PyArrayObject *)__pyx_t_4);
6452     {
6453       __Pyx_BufFmt_StackElem __pyx_stack[1];
6454       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iarr.rcbuffer->pybuffer);
6455       __pyx_t_21 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_iarr.rcbuffer->pybuffer, (PyObject*)__pyx_t_25, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack);
6456       if (unlikely(__pyx_t_21 < 0)) {
6457         PyErr_Fetch(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22);
6458         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_iarr.rcbuffer->pybuffer, (PyObject*)__pyx_v_iarr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) {
6459           Py_XDECREF(__pyx_t_24); Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_22);
6460           __Pyx_RaiseBufferFallbackError();
6461         } else {
6462           PyErr_Restore(__pyx_t_24, __pyx_t_23, __pyx_t_22);
6463         }
6464         __pyx_t_24 = __pyx_t_23 = __pyx_t_22 = 0;
6465       }
6466       __pyx_pybuffernd_iarr.diminfo[0].strides = __pyx_pybuffernd_iarr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_iarr.diminfo[0].shape = __pyx_pybuffernd_iarr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_iarr.diminfo[1].strides = __pyx_pybuffernd_iarr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_iarr.diminfo[1].shape = __pyx_pybuffernd_iarr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_iarr.diminfo[2].strides = __pyx_pybuffernd_iarr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_iarr.diminfo[2].shape = __pyx_pybuffernd_iarr.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_iarr.diminfo[3].strides = __pyx_pybuffernd_iarr.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_iarr.diminfo[3].shape = __pyx_pybuffernd_iarr.rcbuffer->pybuffer.shape[3];
6467       if (unlikely(__pyx_t_21 < 0)) __PYX_ERR(0, 157, __pyx_L1_error)
6468     }
6469     __pyx_t_25 = 0;
6470     __Pyx_XDECREF_SET(__pyx_v_iarr, ((PyArrayObject *)__pyx_t_4));
6471     __pyx_t_4 = 0;
6472 
6473     /* "yt/geometry/particle_smooth.pyx":158
6474  *         for i in range(nf):
6475  *             iarr = index_fields[i]
6476  *             index_field_pointers[i] = <np.float64_t *> iarr.data             # <<<<<<<<<<<<<<
6477  *         for i in range(3):
6478  *             self.DW[i] = (mesh_octree.DRE[i] - mesh_octree.DLE[i])
6479  */
6480     (__pyx_v_index_field_pointers[__pyx_v_i]) = ((__pyx_t_5numpy_float64_t *)__pyx_v_iarr->data);
6481   }
6482 
6483   /* "yt/geometry/particle_smooth.pyx":159
6484  *             iarr = index_fields[i]
6485  *             index_field_pointers[i] = <np.float64_t *> iarr.data
6486  *         for i in range(3):             # <<<<<<<<<<<<<<
6487  *             self.DW[i] = (mesh_octree.DRE[i] - mesh_octree.DLE[i])
6488  *             self.periodicity[i] = periodicity[i]
6489  */
6490   for (__pyx_t_17 = 0; __pyx_t_17 < 3; __pyx_t_17+=1) {
6491     __pyx_v_i = __pyx_t_17;
6492 
6493     /* "yt/geometry/particle_smooth.pyx":160
6494  *             index_field_pointers[i] = <np.float64_t *> iarr.data
6495  *         for i in range(3):
6496  *             self.DW[i] = (mesh_octree.DRE[i] - mesh_octree.DLE[i])             # <<<<<<<<<<<<<<
6497  *             self.periodicity[i] = periodicity[i]
6498  *         cdef np.float64_t factor = (1 << (particle_octree.oref))
6499  */
6500     (__pyx_v_self->DW[__pyx_v_i]) = ((__pyx_v_mesh_octree->DRE[__pyx_v_i]) - (__pyx_v_mesh_octree->DLE[__pyx_v_i]));
6501 
6502     /* "yt/geometry/particle_smooth.pyx":161
6503  *         for i in range(3):
6504  *             self.DW[i] = (mesh_octree.DRE[i] - mesh_octree.DLE[i])
6505  *             self.periodicity[i] = periodicity[i]             # <<<<<<<<<<<<<<
6506  *         cdef np.float64_t factor = (1 << (particle_octree.oref))
6507  *         for i in range(positions.shape[0]):
6508  */
6509     __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_periodicity, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error)
6510     __Pyx_GOTREF(__pyx_t_4);
6511     __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
6512     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6513     (__pyx_v_self->periodicity[__pyx_v_i]) = __pyx_t_2;
6514   }
6515 
6516   /* "yt/geometry/particle_smooth.pyx":162
6517  *             self.DW[i] = (mesh_octree.DRE[i] - mesh_octree.DLE[i])
6518  *             self.periodicity[i] = periodicity[i]
6519  *         cdef np.float64_t factor = (1 << (particle_octree.oref))             # <<<<<<<<<<<<<<
6520  *         for i in range(positions.shape[0]):
6521  *             for j in range(3):
6522  */
6523   __pyx_v_factor = (1 << __pyx_v_particle_octree->oref);
6524 
6525   /* "yt/geometry/particle_smooth.pyx":163
6526  *             self.periodicity[i] = periodicity[i]
6527  *         cdef np.float64_t factor = (1 << (particle_octree.oref))
6528  *         for i in range(positions.shape[0]):             # <<<<<<<<<<<<<<
6529  *             for j in range(3):
6530  *                 pos[j] = positions[i, j]
6531  */
6532   __pyx_t_16 = (__pyx_v_positions.shape[0]);
6533   __pyx_t_26 = __pyx_t_16;
6534   for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_26; __pyx_t_17+=1) {
6535     __pyx_v_i = __pyx_t_17;
6536 
6537     /* "yt/geometry/particle_smooth.pyx":164
6538  *         cdef np.float64_t factor = (1 << (particle_octree.oref))
6539  *         for i in range(positions.shape[0]):
6540  *             for j in range(3):             # <<<<<<<<<<<<<<
6541  *                 pos[j] = positions[i, j]
6542  *             oct = particle_octree.get(pos, &oinfo)
6543  */
6544     for (__pyx_t_18 = 0; __pyx_t_18 < 3; __pyx_t_18+=1) {
6545       __pyx_v_j = __pyx_t_18;
6546 
6547       /* "yt/geometry/particle_smooth.pyx":165
6548  *         for i in range(positions.shape[0]):
6549  *             for j in range(3):
6550  *                 pos[j] = positions[i, j]             # <<<<<<<<<<<<<<
6551  *             oct = particle_octree.get(pos, &oinfo)
6552  *             if oct == NULL or (domain_id > 0 and oct.domain != domain_id):
6553  */
6554       __pyx_t_27 = __pyx_v_i;
6555       __pyx_t_28 = __pyx_v_j;
6556       (__pyx_v_pos[__pyx_v_j]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_positions.data + __pyx_t_27 * __pyx_v_positions.strides[0]) ) + __pyx_t_28 * __pyx_v_positions.strides[1]) )));
6557     }
6558 
6559     /* "yt/geometry/particle_smooth.pyx":166
6560  *             for j in range(3):
6561  *                 pos[j] = positions[i, j]
6562  *             oct = particle_octree.get(pos, &oinfo)             # <<<<<<<<<<<<<<
6563  *             if oct == NULL or (domain_id > 0 and oct.domain != domain_id):
6564  *                 continue
6565  */
6566     __pyx_t_30.__pyx_n = 1;
6567     __pyx_t_30.oinfo = (&__pyx_v_oinfo);
6568     __pyx_t_29 = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_particle_octree->__pyx_vtab)->get(__pyx_v_particle_octree, __pyx_v_pos, &__pyx_t_30);
6569     __pyx_v_oct = __pyx_t_29;
6570 
6571     /* "yt/geometry/particle_smooth.pyx":167
6572  *                 pos[j] = positions[i, j]
6573  *             oct = particle_octree.get(pos, &oinfo)
6574  *             if oct == NULL or (domain_id > 0 and oct.domain != domain_id):             # <<<<<<<<<<<<<<
6575  *                 continue
6576  *             # Note that this has to be our local index, not our in-file index.
6577  */
6578     __pyx_t_1 = ((__pyx_v_oct == NULL) != 0);
6579     if (!__pyx_t_1) {
6580     } else {
6581       __pyx_t_2 = __pyx_t_1;
6582       goto __pyx_L18_bool_binop_done;
6583     }
6584     __pyx_t_1 = ((__pyx_v_domain_id > 0) != 0);
6585     if (__pyx_t_1) {
6586     } else {
6587       __pyx_t_2 = __pyx_t_1;
6588       goto __pyx_L18_bool_binop_done;
6589     }
6590     __pyx_t_1 = ((__pyx_v_oct->domain != __pyx_v_domain_id) != 0);
6591     __pyx_t_2 = __pyx_t_1;
6592     __pyx_L18_bool_binop_done:;
6593     if (__pyx_t_2) {
6594 
6595       /* "yt/geometry/particle_smooth.pyx":168
6596  *             oct = particle_octree.get(pos, &oinfo)
6597  *             if oct == NULL or (domain_id > 0 and oct.domain != domain_id):
6598  *                 continue             # <<<<<<<<<<<<<<
6599  *             # Note that this has to be our local index, not our in-file index.
6600  *             # This is the particle count, which we'll use once we have sorted
6601  */
6602       goto __pyx_L13_continue;
6603 
6604       /* "yt/geometry/particle_smooth.pyx":167
6605  *                 pos[j] = positions[i, j]
6606  *             oct = particle_octree.get(pos, &oinfo)
6607  *             if oct == NULL or (domain_id > 0 and oct.domain != domain_id):             # <<<<<<<<<<<<<<
6608  *                 continue
6609  *             # Note that this has to be our local index, not our in-file index.
6610  */
6611     }
6612 
6613     /* "yt/geometry/particle_smooth.pyx":172
6614  *             # This is the particle count, which we'll use once we have sorted
6615  *             # the particles to calculate the offsets into each oct's particles.
6616  *             offset = oct.domain_ind - moff_p             # <<<<<<<<<<<<<<
6617  *             pcount[offset] += 1
6618  *             pdoms[i] = offset # We store the *actual* offset.
6619  */
6620     __pyx_v_offset = (__pyx_v_oct->domain_ind - __pyx_v_moff_p);
6621 
6622     /* "yt/geometry/particle_smooth.pyx":173
6623  *             # the particles to calculate the offsets into each oct's particles.
6624  *             offset = oct.domain_ind - moff_p
6625  *             pcount[offset] += 1             # <<<<<<<<<<<<<<
6626  *             pdoms[i] = offset # We store the *actual* offset.
6627  *             # store oct positions and dds to avoid searching for neighbors
6628  */
6629     __pyx_t_31 = __pyx_v_offset;
6630     *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_pcount.data + __pyx_t_31 * __pyx_v_pcount.strides[0]) )) += 1;
6631 
6632     /* "yt/geometry/particle_smooth.pyx":174
6633  *             offset = oct.domain_ind - moff_p
6634  *             pcount[offset] += 1
6635  *             pdoms[i] = offset # We store the *actual* offset.             # <<<<<<<<<<<<<<
6636  *             # store oct positions and dds to avoid searching for neighbors
6637  *             # in octs that we know are too far away
6638  */
6639     __pyx_t_32 = __pyx_v_i;
6640     *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_pdoms.data + __pyx_t_32 * __pyx_v_pdoms.strides[0]) )) = __pyx_v_offset;
6641 
6642     /* "yt/geometry/particle_smooth.pyx":177
6643  *             # store oct positions and dds to avoid searching for neighbors
6644  *             # in octs that we know are too far away
6645  *             for j in range(3):             # <<<<<<<<<<<<<<
6646  *                 oct_left_edges[offset, j] = oinfo.left_edge[j]
6647  *                 oct_dds[offset, j] = oinfo.dds[j] * factor
6648  */
6649     for (__pyx_t_18 = 0; __pyx_t_18 < 3; __pyx_t_18+=1) {
6650       __pyx_v_j = __pyx_t_18;
6651 
6652       /* "yt/geometry/particle_smooth.pyx":178
6653  *             # in octs that we know are too far away
6654  *             for j in range(3):
6655  *                 oct_left_edges[offset, j] = oinfo.left_edge[j]             # <<<<<<<<<<<<<<
6656  *                 oct_dds[offset, j] = oinfo.dds[j] * factor
6657  *         # Now we have oct assignments.  Let's sort them.
6658  */
6659       __pyx_t_33 = __pyx_v_offset;
6660       __pyx_t_34 = __pyx_v_j;
6661       *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_oct_left_edges.data + __pyx_t_33 * __pyx_v_oct_left_edges.strides[0]) ) + __pyx_t_34 * __pyx_v_oct_left_edges.strides[1]) )) = (__pyx_v_oinfo.left_edge[__pyx_v_j]);
6662 
6663       /* "yt/geometry/particle_smooth.pyx":179
6664  *             for j in range(3):
6665  *                 oct_left_edges[offset, j] = oinfo.left_edge[j]
6666  *                 oct_dds[offset, j] = oinfo.dds[j] * factor             # <<<<<<<<<<<<<<
6667  *         # Now we have oct assignments.  Let's sort them.
6668  *         # Note that what we will be providing to our processing functions will
6669  */
6670       __pyx_t_35 = __pyx_v_offset;
6671       __pyx_t_36 = __pyx_v_j;
6672       *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_oct_dds.data + __pyx_t_35 * __pyx_v_oct_dds.strides[0]) ) + __pyx_t_36 * __pyx_v_oct_dds.strides[1]) )) = ((__pyx_v_oinfo.dds[__pyx_v_j]) * __pyx_v_factor);
6673     }
6674     __pyx_L13_continue:;
6675   }
6676 
6677   /* "yt/geometry/particle_smooth.pyx":184
6678  *         # actually be indirectly-sorted fields.  This preserves memory at the
6679  *         # expense of additional pointer lookups.
6680  *         pind = np.asarray(np.argsort(pdoms), dtype='int64', order='C')             # <<<<<<<<<<<<<<
6681  *         # So what this means is that we now have all the oct-0 particle indices
6682  *         # in order, then the oct-1, etc etc.
6683  */
6684   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
6685   __Pyx_GOTREF(__pyx_t_4);
6686   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 184, __pyx_L1_error)
6687   __Pyx_GOTREF(__pyx_t_6);
6688   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6689   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 184, __pyx_L1_error)
6690   __Pyx_GOTREF(__pyx_t_5);
6691   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_argsort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
6692   __Pyx_GOTREF(__pyx_t_3);
6693   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6694   __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_pdoms, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 184, __pyx_L1_error)
6695   __Pyx_GOTREF(__pyx_t_5);
6696   __pyx_t_9 = NULL;
6697   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6698     __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
6699     if (likely(__pyx_t_9)) {
6700       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6701       __Pyx_INCREF(__pyx_t_9);
6702       __Pyx_INCREF(function);
6703       __Pyx_DECREF_SET(__pyx_t_3, function);
6704     }
6705   }
6706   __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5);
6707   __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
6708   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6709   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
6710   __Pyx_GOTREF(__pyx_t_4);
6711   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6712   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
6713   __Pyx_GOTREF(__pyx_t_3);
6714   __Pyx_GIVEREF(__pyx_t_4);
6715   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
6716   __pyx_t_4 = 0;
6717   __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
6718   __Pyx_GOTREF(__pyx_t_4);
6719   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 184, __pyx_L1_error)
6720   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 184, __pyx_L1_error)
6721   __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 184, __pyx_L1_error)
6722   __Pyx_GOTREF(__pyx_t_5);
6723   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6724   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6725   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6726   __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 184, __pyx_L1_error)
6727   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6728   __pyx_v_pind = __pyx_t_14;
6729   __pyx_t_14.memview = NULL;
6730   __pyx_t_14.data = NULL;
6731 
6732   /* "yt/geometry/particle_smooth.pyx":188
6733  *         # in order, then the oct-1, etc etc.
6734  *         # This now gives us the indices to the particles for each domain.
6735  *         for i in range(positions.shape[0]):             # <<<<<<<<<<<<<<
6736  *             # This value, poff, is the index of the particle in the *unsorted*
6737  *             # arrays.
6738  */
6739   __pyx_t_16 = (__pyx_v_positions.shape[0]);
6740   __pyx_t_26 = __pyx_t_16;
6741   for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_26; __pyx_t_17+=1) {
6742     __pyx_v_i = __pyx_t_17;
6743 
6744     /* "yt/geometry/particle_smooth.pyx":191
6745  *             # This value, poff, is the index of the particle in the *unsorted*
6746  *             # arrays.
6747  *             poff = pind[i]             # <<<<<<<<<<<<<<
6748  *             offset = pdoms[poff]
6749  *             # If we have yet to assign the starting index to this oct, we do so
6750  */
6751     __pyx_t_37 = __pyx_v_i;
6752     __pyx_v_poff = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_pind.data + __pyx_t_37 * __pyx_v_pind.strides[0]) )));
6753 
6754     /* "yt/geometry/particle_smooth.pyx":192
6755  *             # arrays.
6756  *             poff = pind[i]
6757  *             offset = pdoms[poff]             # <<<<<<<<<<<<<<
6758  *             # If we have yet to assign the starting index to this oct, we do so
6759  *             # now.
6760  */
6761     __pyx_t_38 = __pyx_v_poff;
6762     __pyx_v_offset = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_pdoms.data + __pyx_t_38 * __pyx_v_pdoms.strides[0]) )));
6763 
6764     /* "yt/geometry/particle_smooth.pyx":195
6765  *             # If we have yet to assign the starting index to this oct, we do so
6766  *             # now.
6767  *             if doff[offset] < 0: doff[offset] = i             # <<<<<<<<<<<<<<
6768  *         #print(domain_id, domain_offset, moff_p, moff_m)
6769  *         #raise RuntimeError
6770  */
6771     __pyx_t_39 = __pyx_v_offset;
6772     __pyx_t_2 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_doff.data + __pyx_t_39 * __pyx_v_doff.strides[0]) ))) < 0) != 0);
6773     if (__pyx_t_2) {
6774       __pyx_t_40 = __pyx_v_offset;
6775       *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_doff.data + __pyx_t_40 * __pyx_v_doff.strides[0]) )) = __pyx_v_i;
6776     }
6777   }
6778 
6779   /* "yt/geometry/particle_smooth.pyx":201
6780  *         # refers to that oct's particles.
6781  *         cdef np.ndarray[np.uint8_t, ndim=1] visited
6782  *         visited = np.zeros(mdom_ind.shape[0], dtype="uint8")             # <<<<<<<<<<<<<<
6783  *         cdef int nproc = 0
6784  *         # This should be thread-private if we ever go to OpenMP
6785  */
6786   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 201, __pyx_L1_error)
6787   __Pyx_GOTREF(__pyx_t_5);
6788   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error)
6789   __Pyx_GOTREF(__pyx_t_4);
6790   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6791   __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_mdom_ind.shape[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 201, __pyx_L1_error)
6792   __Pyx_GOTREF(__pyx_t_5);
6793   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error)
6794   __Pyx_GOTREF(__pyx_t_3);
6795   __Pyx_GIVEREF(__pyx_t_5);
6796   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
6797   __pyx_t_5 = 0;
6798   __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 201, __pyx_L1_error)
6799   __Pyx_GOTREF(__pyx_t_5);
6800   if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 201, __pyx_L1_error)
6801   __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error)
6802   __Pyx_GOTREF(__pyx_t_6);
6803   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6804   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6805   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6806   if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 201, __pyx_L1_error)
6807   __pyx_t_41 = ((PyArrayObject *)__pyx_t_6);
6808   {
6809     __Pyx_BufFmt_StackElem __pyx_stack[1];
6810     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_visited.rcbuffer->pybuffer);
6811     __pyx_t_17 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_visited.rcbuffer->pybuffer, (PyObject*)__pyx_t_41, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
6812     if (unlikely(__pyx_t_17 < 0)) {
6813       PyErr_Fetch(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
6814       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_visited.rcbuffer->pybuffer, (PyObject*)__pyx_v_visited, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
6815         Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_24);
6816         __Pyx_RaiseBufferFallbackError();
6817       } else {
6818         PyErr_Restore(__pyx_t_22, __pyx_t_23, __pyx_t_24);
6819       }
6820       __pyx_t_22 = __pyx_t_23 = __pyx_t_24 = 0;
6821     }
6822     __pyx_pybuffernd_visited.diminfo[0].strides = __pyx_pybuffernd_visited.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_visited.diminfo[0].shape = __pyx_pybuffernd_visited.rcbuffer->pybuffer.shape[0];
6823     if (unlikely(__pyx_t_17 < 0)) __PYX_ERR(0, 201, __pyx_L1_error)
6824   }
6825   __pyx_t_41 = 0;
6826   __pyx_v_visited = ((PyArrayObject *)__pyx_t_6);
6827   __pyx_t_6 = 0;
6828 
6829   /* "yt/geometry/particle_smooth.pyx":202
6830  *         cdef np.ndarray[np.uint8_t, ndim=1] visited
6831  *         visited = np.zeros(mdom_ind.shape[0], dtype="uint8")
6832  *         cdef int nproc = 0             # <<<<<<<<<<<<<<
6833  *         # This should be thread-private if we ever go to OpenMP
6834  *         cdef DistanceQueue dist_queue = DistanceQueue(self.maxn)
6835  */
6836   __pyx_v_nproc = 0;
6837 
6838   /* "yt/geometry/particle_smooth.pyx":204
6839  *         cdef int nproc = 0
6840  *         # This should be thread-private if we ever go to OpenMP
6841  *         cdef DistanceQueue dist_queue = DistanceQueue(self.maxn)             # <<<<<<<<<<<<<<
6842  *         dist_queue._setup(self.DW, self.periodicity)
6843  *         for i in range(oct_positions.shape[0]):
6844  */
6845   __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->maxn); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 204, __pyx_L1_error)
6846   __Pyx_GOTREF(__pyx_t_6);
6847   __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_14distance_queue_DistanceQueue), __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error)
6848   __Pyx_GOTREF(__pyx_t_5);
6849   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6850   __pyx_v_dist_queue = ((struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *)__pyx_t_5);
6851   __pyx_t_5 = 0;
6852 
6853   /* "yt/geometry/particle_smooth.pyx":205
6854  *         # This should be thread-private if we ever go to OpenMP
6855  *         cdef DistanceQueue dist_queue = DistanceQueue(self.maxn)
6856  *         dist_queue._setup(self.DW, self.periodicity)             # <<<<<<<<<<<<<<
6857  *         for i in range(oct_positions.shape[0]):
6858  *             if (i % 10000) == 0:
6859  */
6860   ((struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_DistanceQueue *)__pyx_v_dist_queue->__pyx_base.__pyx_vtab)->_setup(__pyx_v_dist_queue, __pyx_v_self->DW, __pyx_v_self->periodicity);
6861 
6862   /* "yt/geometry/particle_smooth.pyx":206
6863  *         cdef DistanceQueue dist_queue = DistanceQueue(self.maxn)
6864  *         dist_queue._setup(self.DW, self.periodicity)
6865  *         for i in range(oct_positions.shape[0]):             # <<<<<<<<<<<<<<
6866  *             if (i % 10000) == 0:
6867  *                 PyErr_CheckSignals()
6868  */
6869   __pyx_t_16 = (__pyx_v_oct_positions.shape[0]);
6870   __pyx_t_26 = __pyx_t_16;
6871   for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_26; __pyx_t_17+=1) {
6872     __pyx_v_i = __pyx_t_17;
6873 
6874     /* "yt/geometry/particle_smooth.pyx":207
6875  *         dist_queue._setup(self.DW, self.periodicity)
6876  *         for i in range(oct_positions.shape[0]):
6877  *             if (i % 10000) == 0:             # <<<<<<<<<<<<<<
6878  *                 PyErr_CheckSignals()
6879  *             for j in range(3):
6880  */
6881     __pyx_t_2 = (((__pyx_v_i % 0x2710) == 0) != 0);
6882     if (__pyx_t_2) {
6883 
6884       /* "yt/geometry/particle_smooth.pyx":208
6885  *         for i in range(oct_positions.shape[0]):
6886  *             if (i % 10000) == 0:
6887  *                 PyErr_CheckSignals()             # <<<<<<<<<<<<<<
6888  *             for j in range(3):
6889  *                 pos[j] = oct_positions[i, j]
6890  */
6891       __pyx_t_18 = PyErr_CheckSignals(); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 208, __pyx_L1_error)
6892 
6893       /* "yt/geometry/particle_smooth.pyx":207
6894  *         dist_queue._setup(self.DW, self.periodicity)
6895  *         for i in range(oct_positions.shape[0]):
6896  *             if (i % 10000) == 0:             # <<<<<<<<<<<<<<
6897  *                 PyErr_CheckSignals()
6898  *             for j in range(3):
6899  */
6900     }
6901 
6902     /* "yt/geometry/particle_smooth.pyx":209
6903  *             if (i % 10000) == 0:
6904  *                 PyErr_CheckSignals()
6905  *             for j in range(3):             # <<<<<<<<<<<<<<
6906  *                 pos[j] = oct_positions[i, j]
6907  *             oct = mesh_octree.get(pos, &moi)
6908  */
6909     for (__pyx_t_18 = 0; __pyx_t_18 < 3; __pyx_t_18+=1) {
6910       __pyx_v_j = __pyx_t_18;
6911 
6912       /* "yt/geometry/particle_smooth.pyx":210
6913  *                 PyErr_CheckSignals()
6914  *             for j in range(3):
6915  *                 pos[j] = oct_positions[i, j]             # <<<<<<<<<<<<<<
6916  *             oct = mesh_octree.get(pos, &moi)
6917  *             offset = mdom_ind[oct.domain_ind - moff_m] * nz
6918  */
6919       __pyx_t_42 = __pyx_v_i;
6920       __pyx_t_43 = __pyx_v_j;
6921       (__pyx_v_pos[__pyx_v_j]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_oct_positions.data + __pyx_t_42 * __pyx_v_oct_positions.strides[0]) ) + __pyx_t_43 * __pyx_v_oct_positions.strides[1]) )));
6922     }
6923 
6924     /* "yt/geometry/particle_smooth.pyx":211
6925  *             for j in range(3):
6926  *                 pos[j] = oct_positions[i, j]
6927  *             oct = mesh_octree.get(pos, &moi)             # <<<<<<<<<<<<<<
6928  *             offset = mdom_ind[oct.domain_ind - moff_m] * nz
6929  *             if visited[oct.domain_ind - moff_m] == 1: continue
6930  */
6931     __pyx_t_30.__pyx_n = 1;
6932     __pyx_t_30.oinfo = (&__pyx_v_moi);
6933     __pyx_t_29 = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_mesh_octree->__pyx_vtab)->get(__pyx_v_mesh_octree, __pyx_v_pos, &__pyx_t_30);
6934     __pyx_v_oct = __pyx_t_29;
6935 
6936     /* "yt/geometry/particle_smooth.pyx":212
6937  *                 pos[j] = oct_positions[i, j]
6938  *             oct = mesh_octree.get(pos, &moi)
6939  *             offset = mdom_ind[oct.domain_ind - moff_m] * nz             # <<<<<<<<<<<<<<
6940  *             if visited[oct.domain_ind - moff_m] == 1: continue
6941  *             visited[oct.domain_ind - moff_m] = 1
6942  */
6943     __pyx_t_44 = (__pyx_v_oct->domain_ind - __pyx_v_moff_m);
6944     __pyx_v_offset = ((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_mdom_ind.data + __pyx_t_44 * __pyx_v_mdom_ind.strides[0]) ))) * __pyx_v_nz);
6945 
6946     /* "yt/geometry/particle_smooth.pyx":213
6947  *             oct = mesh_octree.get(pos, &moi)
6948  *             offset = mdom_ind[oct.domain_ind - moff_m] * nz
6949  *             if visited[oct.domain_ind - moff_m] == 1: continue             # <<<<<<<<<<<<<<
6950  *             visited[oct.domain_ind - moff_m] = 1
6951  *             if offset < 0: continue
6952  */
6953     __pyx_t_45 = (__pyx_v_oct->domain_ind - __pyx_v_moff_m);
6954     __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_visited.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_visited.diminfo[0].strides)) == 1) != 0);
6955     if (__pyx_t_2) {
6956       goto __pyx_L26_continue;
6957     }
6958 
6959     /* "yt/geometry/particle_smooth.pyx":214
6960  *             offset = mdom_ind[oct.domain_ind - moff_m] * nz
6961  *             if visited[oct.domain_ind - moff_m] == 1: continue
6962  *             visited[oct.domain_ind - moff_m] = 1             # <<<<<<<<<<<<<<
6963  *             if offset < 0: continue
6964  *             nproc += 1
6965  */
6966     __pyx_t_46 = (__pyx_v_oct->domain_ind - __pyx_v_moff_m);
6967     *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_visited.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_visited.diminfo[0].strides) = 1;
6968 
6969     /* "yt/geometry/particle_smooth.pyx":215
6970  *             if visited[oct.domain_ind - moff_m] == 1: continue
6971  *             visited[oct.domain_ind - moff_m] = 1
6972  *             if offset < 0: continue             # <<<<<<<<<<<<<<
6973  *             nproc += 1
6974  *             self.neighbor_process(
6975  */
6976     __pyx_t_2 = ((__pyx_v_offset < 0) != 0);
6977     if (__pyx_t_2) {
6978       goto __pyx_L26_continue;
6979     }
6980 
6981     /* "yt/geometry/particle_smooth.pyx":216
6982  *             visited[oct.domain_ind - moff_m] = 1
6983  *             if offset < 0: continue
6984  *             nproc += 1             # <<<<<<<<<<<<<<
6985  *             self.neighbor_process(
6986  *                 dims, moi.left_edge, moi.dds, cart_positions, field_pointers, doff,
6987  */
6988     __pyx_v_nproc = (__pyx_v_nproc + 1);
6989 
6990     /* "yt/geometry/particle_smooth.pyx":217
6991  *             if offset < 0: continue
6992  *             nproc += 1
6993  *             self.neighbor_process(             # <<<<<<<<<<<<<<
6994  *                 dims, moi.left_edge, moi.dds, cart_positions, field_pointers, doff,
6995  *                 &nind, pind, pcount, offset, index_field_pointers,
6996  */
6997     ((struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self->__pyx_vtab)->neighbor_process(__pyx_v_self, __pyx_v_dims, __pyx_v_moi.left_edge, __pyx_v_moi.dds, __pyx_v_cart_positions, __pyx_v_field_pointers, __pyx_v_doff, (&__pyx_v_nind), __pyx_v_pind, __pyx_v_pcount, __pyx_v_offset, __pyx_v_index_field_pointers, __pyx_v_particle_octree, __pyx_v_domain_id, (&__pyx_v_nsize), __pyx_v_oct_left_edges, __pyx_v_oct_dds, __pyx_v_dist_queue);
6998     __pyx_L26_continue:;
6999   }
7000 
7001   /* "yt/geometry/particle_smooth.pyx":224
7002  *         #print("VISITED", visited.sum(), visited.size,)
7003  *         #print(100.0*float(visited.sum())/visited.size)
7004  *         if nind != NULL:             # <<<<<<<<<<<<<<
7005  *             free(nind)
7006  *
7007  */
7008   __pyx_t_2 = ((__pyx_v_nind != NULL) != 0);
7009   if (__pyx_t_2) {
7010 
7011     /* "yt/geometry/particle_smooth.pyx":225
7012  *         #print(100.0*float(visited.sum())/visited.size)
7013  *         if nind != NULL:
7014  *             free(nind)             # <<<<<<<<<<<<<<
7015  *
7016  *     @cython.cdivision(True)
7017  */
7018     free(__pyx_v_nind);
7019 
7020     /* "yt/geometry/particle_smooth.pyx":224
7021  *         #print("VISITED", visited.sum(), visited.size,)
7022  *         #print(100.0*float(visited.sum())/visited.size)
7023  *         if nind != NULL:             # <<<<<<<<<<<<<<
7024  *             free(nind)
7025  *
7026  */
7027   }
7028 
7029   /* "yt/geometry/particle_smooth.pyx":53
7030  *     @cython.wraparound(False)
7031  *     @cython.initializedcheck(False)
7032  *     def process_octree(self, OctreeContainer mesh_octree,             # <<<<<<<<<<<<<<
7033  *                      np.int64_t [:] mdom_ind,
7034  *                      np.float64_t[:,:] positions,
7035  */
7036 
7037   /* function exit code */
7038   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7039   goto __pyx_L0;
7040   __pyx_L1_error:;
7041   __Pyx_XDECREF(__pyx_t_3);
7042   __Pyx_XDECREF(__pyx_t_4);
7043   __Pyx_XDECREF(__pyx_t_5);
7044   __Pyx_XDECREF(__pyx_t_6);
7045   __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
7046   __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
7047   __Pyx_XDECREF(__pyx_t_9);
7048   __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
7049   __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
7050   __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
7051   __PYX_XDEC_MEMVIEW(&__pyx_t_15, 1);
7052   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7053     __Pyx_PyThreadState_declare
7054     __Pyx_PyThreadState_assign
7055     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7056     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iarr.rcbuffer->pybuffer);
7057     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tarr.rcbuffer->pybuffer);
7058     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_visited.rcbuffer->pybuffer);
7059   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7060   __Pyx_AddTraceback("yt.geometry.particle_smooth.ParticleSmoothOperation.process_octree", __pyx_clineno, __pyx_lineno, __pyx_filename);
7061   __pyx_r = NULL;
7062   goto __pyx_L2;
7063   __pyx_L0:;
7064   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iarr.rcbuffer->pybuffer);
7065   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tarr.rcbuffer->pybuffer);
7066   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_visited.rcbuffer->pybuffer);
7067   __pyx_L2:;
7068   __PYX_XDEC_MEMVIEW(&__pyx_v_pind, 1);
7069   __PYX_XDEC_MEMVIEW(&__pyx_v_doff, 1);
7070   __PYX_XDEC_MEMVIEW(&__pyx_v_pdoms, 1);
7071   __PYX_XDEC_MEMVIEW(&__pyx_v_pcount, 1);
7072   __PYX_XDEC_MEMVIEW(&__pyx_v_doff_m, 1);
7073   __Pyx_XDECREF((PyObject *)__pyx_v_tarr);
7074   __Pyx_XDECREF((PyObject *)__pyx_v_iarr);
7075   __PYX_XDEC_MEMVIEW(&__pyx_v_cart_positions, 1);
7076   __PYX_XDEC_MEMVIEW(&__pyx_v_oct_left_edges, 1);
7077   __PYX_XDEC_MEMVIEW(&__pyx_v_oct_dds, 1);
7078   __Pyx_XDECREF((PyObject *)__pyx_v_visited);
7079   __Pyx_XDECREF((PyObject *)__pyx_v_dist_queue);
7080   __PYX_XDEC_MEMVIEW(&__pyx_v_mdom_ind, 1);
7081   __PYX_XDEC_MEMVIEW(&__pyx_v_positions, 1);
7082   __PYX_XDEC_MEMVIEW(&__pyx_v_oct_positions, 1);
7083   __Pyx_XDECREF(__pyx_v_fields);
7084   __Pyx_XDECREF(__pyx_v_periodicity);
7085   __Pyx_XDECREF(__pyx_v_index_fields);
7086   __Pyx_XDECREF((PyObject *)__pyx_v_particle_octree);
7087   __PYX_XDEC_MEMVIEW(&__pyx_v_pdom_ind, 1);
7088   __Pyx_XGIVEREF(__pyx_r);
7089   __Pyx_RefNannyFinishContext();
7090   return __pyx_r;
7091 }
7092 
7093 /* "yt/geometry/particle_smooth.pyx":231
7094  *     @cython.wraparound(False)
7095  *     @cython.initializedcheck(False)
7096  *     def process_particles(self, OctreeContainer particle_octree,             # <<<<<<<<<<<<<<
7097  *                      np.ndarray[np.int64_t, ndim=1] pdom_ind,
7098  *                      np.ndarray[np.float64_t, ndim=2] positions,
7099  */
7100 
7101 /* Python wrapper */
7102 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_9process_particles(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_9process_particles(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)7103 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_9process_particles(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7104   struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_particle_octree = 0;
7105   PyArrayObject *__pyx_v_pdom_ind = 0;
7106   PyArrayObject *__pyx_v_positions = 0;
7107   PyObject *__pyx_v_fields = 0;
7108   int __pyx_v_domain_id;
7109   int __pyx_v_domain_offset;
7110   PyObject *__pyx_v_periodicity = 0;
7111   PyObject *__pyx_v_geometry = 0;
7112   PyObject *__pyx_r = 0;
7113   __Pyx_RefNannyDeclarations
7114   __Pyx_RefNannySetupContext("process_particles (wrapper)", 0);
7115   {
7116     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_particle_octree,&__pyx_n_s_pdom_ind,&__pyx_n_s_positions,&__pyx_n_s_fields,&__pyx_n_s_domain_id,&__pyx_n_s_domain_offset,&__pyx_n_s_periodicity,&__pyx_n_s_geometry,0};
7117     PyObject* values[8] = {0,0,0,0,0,0,0,0};
7118 
7119     /* "yt/geometry/particle_smooth.pyx":234
7120  *                      np.ndarray[np.int64_t, ndim=1] pdom_ind,
7121  *                      np.ndarray[np.float64_t, ndim=2] positions,
7122  *                      fields = None, int domain_id = -1,             # <<<<<<<<<<<<<<
7123  *                      int domain_offset = 0,
7124  *                      periodicity = (True, True, True),
7125  */
7126     values[3] = ((PyObject *)Py_None);
7127 
7128     /* "yt/geometry/particle_smooth.pyx":236
7129  *                      fields = None, int domain_id = -1,
7130  *                      int domain_offset = 0,
7131  *                      periodicity = (True, True, True),             # <<<<<<<<<<<<<<
7132  *                      geometry = "cartesian"):
7133  *         # The other functions in this base class process particles in a way
7134  */
7135     values[6] = ((PyObject *)__pyx_tuple_);
7136     values[7] = ((PyObject *)__pyx_n_s_cartesian);
7137     if (unlikely(__pyx_kwds)) {
7138       Py_ssize_t kw_args;
7139       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7140       switch (pos_args) {
7141         case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
7142         CYTHON_FALLTHROUGH;
7143         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7144         CYTHON_FALLTHROUGH;
7145         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7146         CYTHON_FALLTHROUGH;
7147         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7148         CYTHON_FALLTHROUGH;
7149         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7150         CYTHON_FALLTHROUGH;
7151         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7152         CYTHON_FALLTHROUGH;
7153         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7154         CYTHON_FALLTHROUGH;
7155         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7156         CYTHON_FALLTHROUGH;
7157         case  0: break;
7158         default: goto __pyx_L5_argtuple_error;
7159       }
7160       kw_args = PyDict_Size(__pyx_kwds);
7161       switch (pos_args) {
7162         case  0:
7163         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_particle_octree)) != 0)) kw_args--;
7164         else goto __pyx_L5_argtuple_error;
7165         CYTHON_FALLTHROUGH;
7166         case  1:
7167         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdom_ind)) != 0)) kw_args--;
7168         else {
7169           __Pyx_RaiseArgtupleInvalid("process_particles", 0, 3, 8, 1); __PYX_ERR(0, 231, __pyx_L3_error)
7170         }
7171         CYTHON_FALLTHROUGH;
7172         case  2:
7173         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_positions)) != 0)) kw_args--;
7174         else {
7175           __Pyx_RaiseArgtupleInvalid("process_particles", 0, 3, 8, 2); __PYX_ERR(0, 231, __pyx_L3_error)
7176         }
7177         CYTHON_FALLTHROUGH;
7178         case  3:
7179         if (kw_args > 0) {
7180           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fields);
7181           if (value) { values[3] = value; kw_args--; }
7182         }
7183         CYTHON_FALLTHROUGH;
7184         case  4:
7185         if (kw_args > 0) {
7186           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain_id);
7187           if (value) { values[4] = value; kw_args--; }
7188         }
7189         CYTHON_FALLTHROUGH;
7190         case  5:
7191         if (kw_args > 0) {
7192           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain_offset);
7193           if (value) { values[5] = value; kw_args--; }
7194         }
7195         CYTHON_FALLTHROUGH;
7196         case  6:
7197         if (kw_args > 0) {
7198           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_periodicity);
7199           if (value) { values[6] = value; kw_args--; }
7200         }
7201         CYTHON_FALLTHROUGH;
7202         case  7:
7203         if (kw_args > 0) {
7204           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_geometry);
7205           if (value) { values[7] = value; kw_args--; }
7206         }
7207       }
7208       if (unlikely(kw_args > 0)) {
7209         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "process_particles") < 0)) __PYX_ERR(0, 231, __pyx_L3_error)
7210       }
7211     } else {
7212       switch (PyTuple_GET_SIZE(__pyx_args)) {
7213         case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
7214         CYTHON_FALLTHROUGH;
7215         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7216         CYTHON_FALLTHROUGH;
7217         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7218         CYTHON_FALLTHROUGH;
7219         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7220         CYTHON_FALLTHROUGH;
7221         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7222         CYTHON_FALLTHROUGH;
7223         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7224         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7225         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7226         break;
7227         default: goto __pyx_L5_argtuple_error;
7228       }
7229     }
7230     __pyx_v_particle_octree = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)values[0]);
7231     __pyx_v_pdom_ind = ((PyArrayObject *)values[1]);
7232     __pyx_v_positions = ((PyArrayObject *)values[2]);
7233     __pyx_v_fields = values[3];
7234     if (values[4]) {
7235       __pyx_v_domain_id = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 234, __pyx_L3_error)
7236     } else {
7237       __pyx_v_domain_id = ((int)-1);
7238     }
7239     if (values[5]) {
7240       __pyx_v_domain_offset = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_domain_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 235, __pyx_L3_error)
7241     } else {
7242       __pyx_v_domain_offset = ((int)0);
7243     }
7244     __pyx_v_periodicity = values[6];
7245     __pyx_v_geometry = values[7];
7246   }
7247   goto __pyx_L4_argument_unpacking_done;
7248   __pyx_L5_argtuple_error:;
7249   __Pyx_RaiseArgtupleInvalid("process_particles", 0, 3, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 231, __pyx_L3_error)
7250   __pyx_L3_error:;
7251   __Pyx_AddTraceback("yt.geometry.particle_smooth.ParticleSmoothOperation.process_particles", __pyx_clineno, __pyx_lineno, __pyx_filename);
7252   __Pyx_RefNannyFinishContext();
7253   return NULL;
7254   __pyx_L4_argument_unpacking_done:;
7255   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_particle_octree), __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer, 1, "particle_octree", 0))) __PYX_ERR(0, 231, __pyx_L1_error)
7256   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdom_ind), __pyx_ptype_5numpy_ndarray, 1, "pdom_ind", 0))) __PYX_ERR(0, 232, __pyx_L1_error)
7257   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_positions), __pyx_ptype_5numpy_ndarray, 1, "positions", 0))) __PYX_ERR(0, 233, __pyx_L1_error)
7258   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_8process_particles(((struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self), __pyx_v_particle_octree, __pyx_v_pdom_ind, __pyx_v_positions, __pyx_v_fields, __pyx_v_domain_id, __pyx_v_domain_offset, __pyx_v_periodicity, __pyx_v_geometry);
7259 
7260   /* "yt/geometry/particle_smooth.pyx":231
7261  *     @cython.wraparound(False)
7262  *     @cython.initializedcheck(False)
7263  *     def process_particles(self, OctreeContainer particle_octree,             # <<<<<<<<<<<<<<
7264  *                      np.ndarray[np.int64_t, ndim=1] pdom_ind,
7265  *                      np.ndarray[np.float64_t, ndim=2] positions,
7266  */
7267 
7268   /* function exit code */
7269   goto __pyx_L0;
7270   __pyx_L1_error:;
7271   __pyx_r = NULL;
7272   __pyx_L0:;
7273   __Pyx_RefNannyFinishContext();
7274   return __pyx_r;
7275 }
7276 
__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_8process_particles(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation * __pyx_v_self,struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_particle_octree,PyArrayObject * __pyx_v_pdom_ind,PyArrayObject * __pyx_v_positions,PyObject * __pyx_v_fields,int __pyx_v_domain_id,int __pyx_v_domain_offset,PyObject * __pyx_v_periodicity,PyObject * __pyx_v_geometry)7277 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_8process_particles(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_particle_octree, PyArrayObject *__pyx_v_pdom_ind, PyArrayObject *__pyx_v_positions, PyObject *__pyx_v_fields, int __pyx_v_domain_id, int __pyx_v_domain_offset, PyObject *__pyx_v_periodicity, PyObject *__pyx_v_geometry) {
7278   int __pyx_v_nf;
7279   int __pyx_v_i;
7280   int __pyx_v_j;
7281   int __pyx_v_k;
7282   __pyx_t_5numpy_float64_t **__pyx_v_field_pointers;
7283   __pyx_t_5numpy_float64_t __pyx_v_pos[3];
7284   int __pyx_v_nsize;
7285   __pyx_t_5numpy_int64_t *__pyx_v_nind;
7286   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_oct;
7287   CYTHON_UNUSED struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **__pyx_v_neighbors;
7288   CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_numpart;
7289   __pyx_t_5numpy_int64_t __pyx_v_offset;
7290   __pyx_t_5numpy_int64_t __pyx_v_moff_p;
7291   __pyx_t_5numpy_int64_t __pyx_v_pind0;
7292   __pyx_t_5numpy_int64_t __pyx_v_poff;
7293   __Pyx_memviewslice __pyx_v_pind = { 0, 0, { 0 }, { 0 }, { 0 } };
7294   __Pyx_memviewslice __pyx_v_doff = { 0, 0, { 0 }, { 0 }, { 0 } };
7295   __Pyx_memviewslice __pyx_v_pdoms = { 0, 0, { 0 }, { 0 }, { 0 } };
7296   __Pyx_memviewslice __pyx_v_pcount = { 0, 0, { 0 }, { 0 }, { 0 } };
7297   PyArrayObject *__pyx_v_tarr = 0;
7298   PyArrayObject *__pyx_v_cart_positions = 0;
7299   CYTHON_UNUSED int __pyx_v_maxnei;
7300   CYTHON_UNUSED int __pyx_v_nproc;
7301   struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dist_queue = 0;
7302   __Pyx_LocalBuf_ND __pyx_pybuffernd_cart_positions;
7303   __Pyx_Buffer __pyx_pybuffer_cart_positions;
7304   __Pyx_LocalBuf_ND __pyx_pybuffernd_pdom_ind;
7305   __Pyx_Buffer __pyx_pybuffer_pdom_ind;
7306   __Pyx_LocalBuf_ND __pyx_pybuffernd_positions;
7307   __Pyx_Buffer __pyx_pybuffer_positions;
7308   __Pyx_LocalBuf_ND __pyx_pybuffernd_tarr;
7309   __Pyx_Buffer __pyx_pybuffer_tarr;
7310   PyObject *__pyx_r = NULL;
7311   __Pyx_RefNannyDeclarations
7312   int __pyx_t_1;
7313   int __pyx_t_2;
7314   PyObject *__pyx_t_3 = NULL;
7315   PyObject *__pyx_t_4 = NULL;
7316   PyObject *__pyx_t_5 = NULL;
7317   PyObject *__pyx_t_6 = NULL;
7318   PyObject *__pyx_t_7 = NULL;
7319   PyObject *__pyx_t_8 = NULL;
7320   PyObject *__pyx_t_9 = NULL;
7321   PyArrayObject *__pyx_t_10 = NULL;
7322   PyObject *__pyx_t_11 = NULL;
7323   __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
7324   Py_ssize_t __pyx_t_13;
7325   int __pyx_t_14;
7326   int __pyx_t_15;
7327   int __pyx_t_16;
7328   PyArrayObject *__pyx_t_17 = NULL;
7329   int __pyx_t_18;
7330   npy_intp __pyx_t_19;
7331   npy_intp __pyx_t_20;
7332   Py_ssize_t __pyx_t_21;
7333   Py_ssize_t __pyx_t_22;
7334   __pyx_t_5numpy_int64_t __pyx_t_23;
7335   Py_ssize_t __pyx_t_24;
7336   Py_ssize_t __pyx_t_25;
7337   __pyx_t_5numpy_int64_t __pyx_t_26;
7338   __pyx_t_5numpy_int64_t __pyx_t_27;
7339   __pyx_t_5numpy_int64_t __pyx_t_28;
7340   Py_ssize_t __pyx_t_29;
7341   Py_ssize_t __pyx_t_30;
7342   Py_ssize_t __pyx_t_31;
7343   __pyx_t_5numpy_int64_t __pyx_t_32;
7344   __pyx_t_5numpy_int64_t __pyx_t_33;
7345   Py_ssize_t __pyx_t_34;
7346   Py_ssize_t __pyx_t_35;
7347   __pyx_t_5numpy_int64_t __pyx_t_36;
7348   __pyx_t_5numpy_int64_t __pyx_t_37;
7349   Py_ssize_t __pyx_t_38;
7350   __pyx_t_5numpy_int64_t __pyx_t_39;
7351   __pyx_t_5numpy_int64_t __pyx_t_40;
7352   Py_ssize_t __pyx_t_41;
7353   __Pyx_memviewslice __pyx_t_42 = { 0, 0, { 0 }, { 0 }, { 0 } };
7354   __Pyx_RefNannySetupContext("process_particles", 0);
7355   __Pyx_INCREF(__pyx_v_fields);
7356   __Pyx_INCREF(__pyx_v_periodicity);
7357   __pyx_pybuffer_tarr.pybuffer.buf = NULL;
7358   __pyx_pybuffer_tarr.refcount = 0;
7359   __pyx_pybuffernd_tarr.data = NULL;
7360   __pyx_pybuffernd_tarr.rcbuffer = &__pyx_pybuffer_tarr;
7361   __pyx_pybuffer_cart_positions.pybuffer.buf = NULL;
7362   __pyx_pybuffer_cart_positions.refcount = 0;
7363   __pyx_pybuffernd_cart_positions.data = NULL;
7364   __pyx_pybuffernd_cart_positions.rcbuffer = &__pyx_pybuffer_cart_positions;
7365   __pyx_pybuffer_pdom_ind.pybuffer.buf = NULL;
7366   __pyx_pybuffer_pdom_ind.refcount = 0;
7367   __pyx_pybuffernd_pdom_ind.data = NULL;
7368   __pyx_pybuffernd_pdom_ind.rcbuffer = &__pyx_pybuffer_pdom_ind;
7369   __pyx_pybuffer_positions.pybuffer.buf = NULL;
7370   __pyx_pybuffer_positions.refcount = 0;
7371   __pyx_pybuffernd_positions.data = NULL;
7372   __pyx_pybuffernd_positions.rcbuffer = &__pyx_pybuffer_positions;
7373   {
7374     __Pyx_BufFmt_StackElem __pyx_stack[1];
7375     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pdom_ind.rcbuffer->pybuffer, (PyObject*)__pyx_v_pdom_ind, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 231, __pyx_L1_error)
7376   }
7377   __pyx_pybuffernd_pdom_ind.diminfo[0].strides = __pyx_pybuffernd_pdom_ind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pdom_ind.diminfo[0].shape = __pyx_pybuffernd_pdom_ind.rcbuffer->pybuffer.shape[0];
7378   {
7379     __Pyx_BufFmt_StackElem __pyx_stack[1];
7380     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_positions.rcbuffer->pybuffer, (PyObject*)__pyx_v_positions, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 231, __pyx_L1_error)
7381   }
7382   __pyx_pybuffernd_positions.diminfo[0].strides = __pyx_pybuffernd_positions.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_positions.diminfo[0].shape = __pyx_pybuffernd_positions.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_positions.diminfo[1].strides = __pyx_pybuffernd_positions.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_positions.diminfo[1].shape = __pyx_pybuffernd_positions.rcbuffer->pybuffer.shape[1];
7383 
7384   /* "yt/geometry/particle_smooth.pyx":252
7385  *         cdef np.float64_t pos[3]
7386  *         cdef np.float64_t **octree_field_pointers
7387  *         cdef int nsize = 0             # <<<<<<<<<<<<<<
7388  *         cdef np.int64_t *nind = NULL
7389  *         cdef OctInfo moi, poi
7390  */
7391   __pyx_v_nsize = 0;
7392 
7393   /* "yt/geometry/particle_smooth.pyx":253
7394  *         cdef np.float64_t **octree_field_pointers
7395  *         cdef int nsize = 0
7396  *         cdef np.int64_t *nind = NULL             # <<<<<<<<<<<<<<
7397  *         cdef OctInfo moi, poi
7398  *         cdef Oct *oct
7399  */
7400   __pyx_v_nind = NULL;
7401 
7402   /* "yt/geometry/particle_smooth.pyx":256
7403  *         cdef OctInfo moi, poi
7404  *         cdef Oct *oct
7405  *         cdef Oct **neighbors = NULL             # <<<<<<<<<<<<<<
7406  *         cdef np.int64_t nneighbors, numpart, offset, local_ind
7407  *         cdef np.int64_t moff_p, moff_m, pind0, poff
7408  */
7409   __pyx_v_neighbors = NULL;
7410 
7411   /* "yt/geometry/particle_smooth.pyx":262
7412  *         cdef np.ndarray[np.float64_t, ndim=1] tarr
7413  *         cdef np.ndarray[np.float64_t, ndim=2] cart_positions
7414  *         if geometry == "cartesian":             # <<<<<<<<<<<<<<
7415  *             self.pos_setup = cart_coord_setup
7416  *             cart_positions = positions
7417  */
7418   __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_geometry, __pyx_n_s_cartesian, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 262, __pyx_L1_error)
7419   if (__pyx_t_1) {
7420 
7421     /* "yt/geometry/particle_smooth.pyx":263
7422  *         cdef np.ndarray[np.float64_t, ndim=2] cart_positions
7423  *         if geometry == "cartesian":
7424  *             self.pos_setup = cart_coord_setup             # <<<<<<<<<<<<<<
7425  *             cart_positions = positions
7426  *         elif geometry == "spherical":
7427  */
7428     __pyx_v_self->pos_setup = __pyx_f_2yt_8geometry_15particle_smooth_cart_coord_setup;
7429 
7430     /* "yt/geometry/particle_smooth.pyx":264
7431  *         if geometry == "cartesian":
7432  *             self.pos_setup = cart_coord_setup
7433  *             cart_positions = positions             # <<<<<<<<<<<<<<
7434  *         elif geometry == "spherical":
7435  *             self.pos_setup = spherical_coord_setup
7436  */
7437     {
7438       __Pyx_BufFmt_StackElem __pyx_stack[1];
7439       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cart_positions.rcbuffer->pybuffer);
7440       __pyx_t_2 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cart_positions.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_positions), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
7441       if (unlikely(__pyx_t_2 < 0)) {
7442         PyErr_Fetch(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
7443         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cart_positions.rcbuffer->pybuffer, (PyObject*)__pyx_v_cart_positions, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
7444           Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5);
7445           __Pyx_RaiseBufferFallbackError();
7446         } else {
7447           PyErr_Restore(__pyx_t_3, __pyx_t_4, __pyx_t_5);
7448         }
7449         __pyx_t_3 = __pyx_t_4 = __pyx_t_5 = 0;
7450       }
7451       __pyx_pybuffernd_cart_positions.diminfo[0].strides = __pyx_pybuffernd_cart_positions.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cart_positions.diminfo[0].shape = __pyx_pybuffernd_cart_positions.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_cart_positions.diminfo[1].strides = __pyx_pybuffernd_cart_positions.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_cart_positions.diminfo[1].shape = __pyx_pybuffernd_cart_positions.rcbuffer->pybuffer.shape[1];
7452       if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 264, __pyx_L1_error)
7453     }
7454     __Pyx_INCREF(((PyObject *)__pyx_v_positions));
7455     __pyx_v_cart_positions = ((PyArrayObject *)__pyx_v_positions);
7456 
7457     /* "yt/geometry/particle_smooth.pyx":262
7458  *         cdef np.ndarray[np.float64_t, ndim=1] tarr
7459  *         cdef np.ndarray[np.float64_t, ndim=2] cart_positions
7460  *         if geometry == "cartesian":             # <<<<<<<<<<<<<<
7461  *             self.pos_setup = cart_coord_setup
7462  *             cart_positions = positions
7463  */
7464     goto __pyx_L3;
7465   }
7466 
7467   /* "yt/geometry/particle_smooth.pyx":265
7468  *             self.pos_setup = cart_coord_setup
7469  *             cart_positions = positions
7470  *         elif geometry == "spherical":             # <<<<<<<<<<<<<<
7471  *             self.pos_setup = spherical_coord_setup
7472  *             cart_positions = np.empty((positions.shape[0], 3), dtype="float64")
7473  */
7474   __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_geometry, __pyx_n_s_spherical, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 265, __pyx_L1_error)
7475   if (likely(__pyx_t_1)) {
7476 
7477     /* "yt/geometry/particle_smooth.pyx":266
7478  *             cart_positions = positions
7479  *         elif geometry == "spherical":
7480  *             self.pos_setup = spherical_coord_setup             # <<<<<<<<<<<<<<
7481  *             cart_positions = np.empty((positions.shape[0], 3), dtype="float64")
7482  *
7483  */
7484     __pyx_v_self->pos_setup = __pyx_f_2yt_8geometry_15particle_smooth_spherical_coord_setup;
7485 
7486     /* "yt/geometry/particle_smooth.pyx":267
7487  *         elif geometry == "spherical":
7488  *             self.pos_setup = spherical_coord_setup
7489  *             cart_positions = np.empty((positions.shape[0], 3), dtype="float64")             # <<<<<<<<<<<<<<
7490  *
7491  *             cart_positions[:,0] = positions[:,0] * \
7492  */
7493     __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 267, __pyx_L1_error)
7494     __Pyx_GOTREF(__pyx_t_6);
7495     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 267, __pyx_L1_error)
7496     __Pyx_GOTREF(__pyx_t_7);
7497     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7498     __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_positions->dimensions[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 267, __pyx_L1_error)
7499     __Pyx_GOTREF(__pyx_t_6);
7500     __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 267, __pyx_L1_error)
7501     __Pyx_GOTREF(__pyx_t_8);
7502     __Pyx_GIVEREF(__pyx_t_6);
7503     PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
7504     __Pyx_INCREF(__pyx_int_3);
7505     __Pyx_GIVEREF(__pyx_int_3);
7506     PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_int_3);
7507     __pyx_t_6 = 0;
7508     __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 267, __pyx_L1_error)
7509     __Pyx_GOTREF(__pyx_t_6);
7510     __Pyx_GIVEREF(__pyx_t_8);
7511     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8);
7512     __pyx_t_8 = 0;
7513     __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 267, __pyx_L1_error)
7514     __Pyx_GOTREF(__pyx_t_8);
7515     if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 267, __pyx_L1_error)
7516     __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 267, __pyx_L1_error)
7517     __Pyx_GOTREF(__pyx_t_9);
7518     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7519     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7520     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7521     if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 267, __pyx_L1_error)
7522     __pyx_t_10 = ((PyArrayObject *)__pyx_t_9);
7523     {
7524       __Pyx_BufFmt_StackElem __pyx_stack[1];
7525       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cart_positions.rcbuffer->pybuffer);
7526       __pyx_t_2 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cart_positions.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
7527       if (unlikely(__pyx_t_2 < 0)) {
7528         PyErr_Fetch(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
7529         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cart_positions.rcbuffer->pybuffer, (PyObject*)__pyx_v_cart_positions, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
7530           Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3);
7531           __Pyx_RaiseBufferFallbackError();
7532         } else {
7533           PyErr_Restore(__pyx_t_5, __pyx_t_4, __pyx_t_3);
7534         }
7535         __pyx_t_5 = __pyx_t_4 = __pyx_t_3 = 0;
7536       }
7537       __pyx_pybuffernd_cart_positions.diminfo[0].strides = __pyx_pybuffernd_cart_positions.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cart_positions.diminfo[0].shape = __pyx_pybuffernd_cart_positions.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_cart_positions.diminfo[1].strides = __pyx_pybuffernd_cart_positions.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_cart_positions.diminfo[1].shape = __pyx_pybuffernd_cart_positions.rcbuffer->pybuffer.shape[1];
7538       if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 267, __pyx_L1_error)
7539     }
7540     __pyx_t_10 = 0;
7541     __pyx_v_cart_positions = ((PyArrayObject *)__pyx_t_9);
7542     __pyx_t_9 = 0;
7543 
7544     /* "yt/geometry/particle_smooth.pyx":269
7545  *             cart_positions = np.empty((positions.shape[0], 3), dtype="float64")
7546  *
7547  *             cart_positions[:,0] = positions[:,0] * \             # <<<<<<<<<<<<<<
7548  *                                   np.sin(positions[:,1]) * \
7549  *                                   np.cos(positions[:,2])
7550  */
7551     __pyx_t_9 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_positions), __pyx_tuple__5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 269, __pyx_L1_error)
7552     __Pyx_GOTREF(__pyx_t_9);
7553 
7554     /* "yt/geometry/particle_smooth.pyx":270
7555  *
7556  *             cart_positions[:,0] = positions[:,0] * \
7557  *                                   np.sin(positions[:,1]) * \             # <<<<<<<<<<<<<<
7558  *                                   np.cos(positions[:,2])
7559  *             cart_positions[:,1] = positions[:,0] * \
7560  */
7561     __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 270, __pyx_L1_error)
7562     __Pyx_GOTREF(__pyx_t_6);
7563     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sin); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 270, __pyx_L1_error)
7564     __Pyx_GOTREF(__pyx_t_7);
7565     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7566     __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_positions), __pyx_tuple__6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 270, __pyx_L1_error)
7567     __Pyx_GOTREF(__pyx_t_6);
7568     __pyx_t_11 = NULL;
7569     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
7570       __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7);
7571       if (likely(__pyx_t_11)) {
7572         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
7573         __Pyx_INCREF(__pyx_t_11);
7574         __Pyx_INCREF(function);
7575         __Pyx_DECREF_SET(__pyx_t_7, function);
7576       }
7577     }
7578     __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_11, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
7579     __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
7580     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7581     if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 270, __pyx_L1_error)
7582     __Pyx_GOTREF(__pyx_t_8);
7583     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7584 
7585     /* "yt/geometry/particle_smooth.pyx":269
7586  *             cart_positions = np.empty((positions.shape[0], 3), dtype="float64")
7587  *
7588  *             cart_positions[:,0] = positions[:,0] * \             # <<<<<<<<<<<<<<
7589  *                                   np.sin(positions[:,1]) * \
7590  *                                   np.cos(positions[:,2])
7591  */
7592     __pyx_t_7 = PyNumber_Multiply(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 269, __pyx_L1_error)
7593     __Pyx_GOTREF(__pyx_t_7);
7594     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7595     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7596 
7597     /* "yt/geometry/particle_smooth.pyx":271
7598  *             cart_positions[:,0] = positions[:,0] * \
7599  *                                   np.sin(positions[:,1]) * \
7600  *                                   np.cos(positions[:,2])             # <<<<<<<<<<<<<<
7601  *             cart_positions[:,1] = positions[:,0] * \
7602  *                                   np.sin(positions[:,1]) * \
7603  */
7604     __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 271, __pyx_L1_error)
7605     __Pyx_GOTREF(__pyx_t_9);
7606     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_cos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 271, __pyx_L1_error)
7607     __Pyx_GOTREF(__pyx_t_6);
7608     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7609     __pyx_t_9 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_positions), __pyx_tuple__7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 271, __pyx_L1_error)
7610     __Pyx_GOTREF(__pyx_t_9);
7611     __pyx_t_11 = NULL;
7612     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
7613       __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6);
7614       if (likely(__pyx_t_11)) {
7615         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
7616         __Pyx_INCREF(__pyx_t_11);
7617         __Pyx_INCREF(function);
7618         __Pyx_DECREF_SET(__pyx_t_6, function);
7619       }
7620     }
7621     __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_11, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_9);
7622     __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
7623     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7624     if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 271, __pyx_L1_error)
7625     __Pyx_GOTREF(__pyx_t_8);
7626     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7627 
7628     /* "yt/geometry/particle_smooth.pyx":270
7629  *
7630  *             cart_positions[:,0] = positions[:,0] * \
7631  *                                   np.sin(positions[:,1]) * \             # <<<<<<<<<<<<<<
7632  *                                   np.cos(positions[:,2])
7633  *             cart_positions[:,1] = positions[:,0] * \
7634  */
7635     __pyx_t_6 = PyNumber_Multiply(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 270, __pyx_L1_error)
7636     __Pyx_GOTREF(__pyx_t_6);
7637     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7638     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7639 
7640     /* "yt/geometry/particle_smooth.pyx":269
7641  *             cart_positions = np.empty((positions.shape[0], 3), dtype="float64")
7642  *
7643  *             cart_positions[:,0] = positions[:,0] * \             # <<<<<<<<<<<<<<
7644  *                                   np.sin(positions[:,1]) * \
7645  *                                   np.cos(positions[:,2])
7646  */
7647     if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_cart_positions), __pyx_tuple__5, __pyx_t_6) < 0)) __PYX_ERR(0, 269, __pyx_L1_error)
7648     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7649 
7650     /* "yt/geometry/particle_smooth.pyx":272
7651  *                                   np.sin(positions[:,1]) * \
7652  *                                   np.cos(positions[:,2])
7653  *             cart_positions[:,1] = positions[:,0] * \             # <<<<<<<<<<<<<<
7654  *                                   np.sin(positions[:,1]) * \
7655  *                                   np.sin(positions[:,2])
7656  */
7657     __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_positions), __pyx_tuple__5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 272, __pyx_L1_error)
7658     __Pyx_GOTREF(__pyx_t_6);
7659 
7660     /* "yt/geometry/particle_smooth.pyx":273
7661  *                                   np.cos(positions[:,2])
7662  *             cart_positions[:,1] = positions[:,0] * \
7663  *                                   np.sin(positions[:,1]) * \             # <<<<<<<<<<<<<<
7664  *                                   np.sin(positions[:,2])
7665  *             cart_positions[:,2] = positions[:,0] * \
7666  */
7667     __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 273, __pyx_L1_error)
7668     __Pyx_GOTREF(__pyx_t_7);
7669     __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_sin); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 273, __pyx_L1_error)
7670     __Pyx_GOTREF(__pyx_t_9);
7671     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7672     __pyx_t_7 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_positions), __pyx_tuple__6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 273, __pyx_L1_error)
7673     __Pyx_GOTREF(__pyx_t_7);
7674     __pyx_t_11 = NULL;
7675     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
7676       __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
7677       if (likely(__pyx_t_11)) {
7678         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
7679         __Pyx_INCREF(__pyx_t_11);
7680         __Pyx_INCREF(function);
7681         __Pyx_DECREF_SET(__pyx_t_9, function);
7682       }
7683     }
7684     __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_11, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_7);
7685     __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
7686     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7687     if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 273, __pyx_L1_error)
7688     __Pyx_GOTREF(__pyx_t_8);
7689     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7690 
7691     /* "yt/geometry/particle_smooth.pyx":272
7692  *                                   np.sin(positions[:,1]) * \
7693  *                                   np.cos(positions[:,2])
7694  *             cart_positions[:,1] = positions[:,0] * \             # <<<<<<<<<<<<<<
7695  *                                   np.sin(positions[:,1]) * \
7696  *                                   np.sin(positions[:,2])
7697  */
7698     __pyx_t_9 = PyNumber_Multiply(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 272, __pyx_L1_error)
7699     __Pyx_GOTREF(__pyx_t_9);
7700     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7701     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7702 
7703     /* "yt/geometry/particle_smooth.pyx":274
7704  *             cart_positions[:,1] = positions[:,0] * \
7705  *                                   np.sin(positions[:,1]) * \
7706  *                                   np.sin(positions[:,2])             # <<<<<<<<<<<<<<
7707  *             cart_positions[:,2] = positions[:,0] * \
7708  *                                   np.cos(positions[:,1])
7709  */
7710     __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 274, __pyx_L1_error)
7711     __Pyx_GOTREF(__pyx_t_6);
7712     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sin); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 274, __pyx_L1_error)
7713     __Pyx_GOTREF(__pyx_t_7);
7714     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7715     __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_positions), __pyx_tuple__7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 274, __pyx_L1_error)
7716     __Pyx_GOTREF(__pyx_t_6);
7717     __pyx_t_11 = NULL;
7718     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
7719       __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7);
7720       if (likely(__pyx_t_11)) {
7721         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
7722         __Pyx_INCREF(__pyx_t_11);
7723         __Pyx_INCREF(function);
7724         __Pyx_DECREF_SET(__pyx_t_7, function);
7725       }
7726     }
7727     __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_11, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
7728     __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
7729     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7730     if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 274, __pyx_L1_error)
7731     __Pyx_GOTREF(__pyx_t_8);
7732     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7733 
7734     /* "yt/geometry/particle_smooth.pyx":273
7735  *                                   np.cos(positions[:,2])
7736  *             cart_positions[:,1] = positions[:,0] * \
7737  *                                   np.sin(positions[:,1]) * \             # <<<<<<<<<<<<<<
7738  *                                   np.sin(positions[:,2])
7739  *             cart_positions[:,2] = positions[:,0] * \
7740  */
7741     __pyx_t_7 = PyNumber_Multiply(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 273, __pyx_L1_error)
7742     __Pyx_GOTREF(__pyx_t_7);
7743     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7744     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7745 
7746     /* "yt/geometry/particle_smooth.pyx":272
7747  *                                   np.sin(positions[:,1]) * \
7748  *                                   np.cos(positions[:,2])
7749  *             cart_positions[:,1] = positions[:,0] * \             # <<<<<<<<<<<<<<
7750  *                                   np.sin(positions[:,1]) * \
7751  *                                   np.sin(positions[:,2])
7752  */
7753     if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_cart_positions), __pyx_tuple__6, __pyx_t_7) < 0)) __PYX_ERR(0, 272, __pyx_L1_error)
7754     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7755 
7756     /* "yt/geometry/particle_smooth.pyx":275
7757  *                                   np.sin(positions[:,1]) * \
7758  *                                   np.sin(positions[:,2])
7759  *             cart_positions[:,2] = positions[:,0] * \             # <<<<<<<<<<<<<<
7760  *                                   np.cos(positions[:,1])
7761  *             periodicity = (False, False, False)
7762  */
7763     __pyx_t_7 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_positions), __pyx_tuple__5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 275, __pyx_L1_error)
7764     __Pyx_GOTREF(__pyx_t_7);
7765 
7766     /* "yt/geometry/particle_smooth.pyx":276
7767  *                                   np.sin(positions[:,2])
7768  *             cart_positions[:,2] = positions[:,0] * \
7769  *                                   np.cos(positions[:,1])             # <<<<<<<<<<<<<<
7770  *             periodicity = (False, False, False)
7771  *         else:
7772  */
7773     __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 276, __pyx_L1_error)
7774     __Pyx_GOTREF(__pyx_t_9);
7775     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_cos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 276, __pyx_L1_error)
7776     __Pyx_GOTREF(__pyx_t_6);
7777     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7778     __pyx_t_9 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_positions), __pyx_tuple__6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 276, __pyx_L1_error)
7779     __Pyx_GOTREF(__pyx_t_9);
7780     __pyx_t_11 = NULL;
7781     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
7782       __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6);
7783       if (likely(__pyx_t_11)) {
7784         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
7785         __Pyx_INCREF(__pyx_t_11);
7786         __Pyx_INCREF(function);
7787         __Pyx_DECREF_SET(__pyx_t_6, function);
7788       }
7789     }
7790     __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_11, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_9);
7791     __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
7792     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7793     if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 276, __pyx_L1_error)
7794     __Pyx_GOTREF(__pyx_t_8);
7795     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7796 
7797     /* "yt/geometry/particle_smooth.pyx":275
7798  *                                   np.sin(positions[:,1]) * \
7799  *                                   np.sin(positions[:,2])
7800  *             cart_positions[:,2] = positions[:,0] * \             # <<<<<<<<<<<<<<
7801  *                                   np.cos(positions[:,1])
7802  *             periodicity = (False, False, False)
7803  */
7804     __pyx_t_6 = PyNumber_Multiply(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 275, __pyx_L1_error)
7805     __Pyx_GOTREF(__pyx_t_6);
7806     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7807     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7808     if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_cart_positions), __pyx_tuple__7, __pyx_t_6) < 0)) __PYX_ERR(0, 275, __pyx_L1_error)
7809     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7810 
7811     /* "yt/geometry/particle_smooth.pyx":277
7812  *             cart_positions[:,2] = positions[:,0] * \
7813  *                                   np.cos(positions[:,1])
7814  *             periodicity = (False, False, False)             # <<<<<<<<<<<<<<
7815  *         else:
7816  *             raise NotImplementedError
7817  */
7818     __Pyx_INCREF(__pyx_tuple__3);
7819     __Pyx_DECREF_SET(__pyx_v_periodicity, __pyx_tuple__3);
7820 
7821     /* "yt/geometry/particle_smooth.pyx":265
7822  *             self.pos_setup = cart_coord_setup
7823  *             cart_positions = positions
7824  *         elif geometry == "spherical":             # <<<<<<<<<<<<<<
7825  *             self.pos_setup = spherical_coord_setup
7826  *             cart_positions = np.empty((positions.shape[0], 3), dtype="float64")
7827  */
7828     goto __pyx_L3;
7829   }
7830 
7831   /* "yt/geometry/particle_smooth.pyx":279
7832  *             periodicity = (False, False, False)
7833  *         else:
7834  *             raise NotImplementedError             # <<<<<<<<<<<<<<
7835  *         numpart = positions.shape[0]
7836  *         pcount = np.zeros_like(pdom_ind)
7837  */
7838   /*else*/ {
7839     __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
7840     __PYX_ERR(0, 279, __pyx_L1_error)
7841   }
7842   __pyx_L3:;
7843 
7844   /* "yt/geometry/particle_smooth.pyx":280
7845  *         else:
7846  *             raise NotImplementedError
7847  *         numpart = positions.shape[0]             # <<<<<<<<<<<<<<
7848  *         pcount = np.zeros_like(pdom_ind)
7849  *         doff = np.zeros_like(pdom_ind) - 1
7850  */
7851   __pyx_v_numpart = (__pyx_v_positions->dimensions[0]);
7852 
7853   /* "yt/geometry/particle_smooth.pyx":281
7854  *             raise NotImplementedError
7855  *         numpart = positions.shape[0]
7856  *         pcount = np.zeros_like(pdom_ind)             # <<<<<<<<<<<<<<
7857  *         doff = np.zeros_like(pdom_ind) - 1
7858  *         moff_p = particle_octree.get_domain_offset(domain_id + domain_offset)
7859  */
7860   __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 281, __pyx_L1_error)
7861   __Pyx_GOTREF(__pyx_t_8);
7862   __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 281, __pyx_L1_error)
7863   __Pyx_GOTREF(__pyx_t_7);
7864   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7865   __pyx_t_8 = NULL;
7866   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
7867     __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
7868     if (likely(__pyx_t_8)) {
7869       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
7870       __Pyx_INCREF(__pyx_t_8);
7871       __Pyx_INCREF(function);
7872       __Pyx_DECREF_SET(__pyx_t_7, function);
7873     }
7874   }
7875   __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, ((PyObject *)__pyx_v_pdom_ind)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_pdom_ind));
7876   __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7877   if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 281, __pyx_L1_error)
7878   __Pyx_GOTREF(__pyx_t_6);
7879   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7880   __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 281, __pyx_L1_error)
7881   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7882   __pyx_v_pcount = __pyx_t_12;
7883   __pyx_t_12.memview = NULL;
7884   __pyx_t_12.data = NULL;
7885 
7886   /* "yt/geometry/particle_smooth.pyx":282
7887  *         numpart = positions.shape[0]
7888  *         pcount = np.zeros_like(pdom_ind)
7889  *         doff = np.zeros_like(pdom_ind) - 1             # <<<<<<<<<<<<<<
7890  *         moff_p = particle_octree.get_domain_offset(domain_id + domain_offset)
7891  *         pdoms = np.zeros(positions.shape[0], dtype="int64") - 1
7892  */
7893   __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 282, __pyx_L1_error)
7894   __Pyx_GOTREF(__pyx_t_7);
7895   __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 282, __pyx_L1_error)
7896   __Pyx_GOTREF(__pyx_t_8);
7897   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7898   __pyx_t_7 = NULL;
7899   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
7900     __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
7901     if (likely(__pyx_t_7)) {
7902       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
7903       __Pyx_INCREF(__pyx_t_7);
7904       __Pyx_INCREF(function);
7905       __Pyx_DECREF_SET(__pyx_t_8, function);
7906     }
7907   }
7908   __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, ((PyObject *)__pyx_v_pdom_ind)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_v_pdom_ind));
7909   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7910   if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 282, __pyx_L1_error)
7911   __Pyx_GOTREF(__pyx_t_6);
7912   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7913   __pyx_t_8 = __Pyx_PyInt_SubtractObjC(__pyx_t_6, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 282, __pyx_L1_error)
7914   __Pyx_GOTREF(__pyx_t_8);
7915   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7916   __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 282, __pyx_L1_error)
7917   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7918   __pyx_v_doff = __pyx_t_12;
7919   __pyx_t_12.memview = NULL;
7920   __pyx_t_12.data = NULL;
7921 
7922   /* "yt/geometry/particle_smooth.pyx":283
7923  *         pcount = np.zeros_like(pdom_ind)
7924  *         doff = np.zeros_like(pdom_ind) - 1
7925  *         moff_p = particle_octree.get_domain_offset(domain_id + domain_offset)             # <<<<<<<<<<<<<<
7926  *         pdoms = np.zeros(positions.shape[0], dtype="int64") - 1
7927  *         nf = len(fields)
7928  */
7929   __pyx_v_moff_p = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_particle_octree->__pyx_vtab)->get_domain_offset(__pyx_v_particle_octree, (__pyx_v_domain_id + __pyx_v_domain_offset));
7930 
7931   /* "yt/geometry/particle_smooth.pyx":284
7932  *         doff = np.zeros_like(pdom_ind) - 1
7933  *         moff_p = particle_octree.get_domain_offset(domain_id + domain_offset)
7934  *         pdoms = np.zeros(positions.shape[0], dtype="int64") - 1             # <<<<<<<<<<<<<<
7935  *         nf = len(fields)
7936  *         if fields is None:
7937  */
7938   __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 284, __pyx_L1_error)
7939   __Pyx_GOTREF(__pyx_t_8);
7940   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L1_error)
7941   __Pyx_GOTREF(__pyx_t_6);
7942   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7943   __pyx_t_8 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_positions->dimensions[0])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 284, __pyx_L1_error)
7944   __Pyx_GOTREF(__pyx_t_8);
7945   __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 284, __pyx_L1_error)
7946   __Pyx_GOTREF(__pyx_t_7);
7947   __Pyx_GIVEREF(__pyx_t_8);
7948   PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
7949   __pyx_t_8 = 0;
7950   __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 284, __pyx_L1_error)
7951   __Pyx_GOTREF(__pyx_t_8);
7952   if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 284, __pyx_L1_error)
7953   __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 284, __pyx_L1_error)
7954   __Pyx_GOTREF(__pyx_t_9);
7955   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7956   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7957   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7958   __pyx_t_8 = __Pyx_PyInt_SubtractObjC(__pyx_t_9, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 284, __pyx_L1_error)
7959   __Pyx_GOTREF(__pyx_t_8);
7960   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7961   __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 284, __pyx_L1_error)
7962   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7963   __pyx_v_pdoms = __pyx_t_12;
7964   __pyx_t_12.memview = NULL;
7965   __pyx_t_12.data = NULL;
7966 
7967   /* "yt/geometry/particle_smooth.pyx":285
7968  *         moff_p = particle_octree.get_domain_offset(domain_id + domain_offset)
7969  *         pdoms = np.zeros(positions.shape[0], dtype="int64") - 1
7970  *         nf = len(fields)             # <<<<<<<<<<<<<<
7971  *         if fields is None:
7972  *             fields = []
7973  */
7974   __pyx_t_13 = PyObject_Length(__pyx_v_fields); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 285, __pyx_L1_error)
7975   __pyx_v_nf = __pyx_t_13;
7976 
7977   /* "yt/geometry/particle_smooth.pyx":286
7978  *         pdoms = np.zeros(positions.shape[0], dtype="int64") - 1
7979  *         nf = len(fields)
7980  *         if fields is None:             # <<<<<<<<<<<<<<
7981  *             fields = []
7982  *         field_pointers = <np.float64_t**> alloca(sizeof(np.float64_t *) * nf)
7983  */
7984   __pyx_t_1 = (__pyx_v_fields == Py_None);
7985   __pyx_t_14 = (__pyx_t_1 != 0);
7986   if (__pyx_t_14) {
7987 
7988     /* "yt/geometry/particle_smooth.pyx":287
7989  *         nf = len(fields)
7990  *         if fields is None:
7991  *             fields = []             # <<<<<<<<<<<<<<
7992  *         field_pointers = <np.float64_t**> alloca(sizeof(np.float64_t *) * nf)
7993  *         for i in range(nf):
7994  */
7995     __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
7996     __Pyx_GOTREF(__pyx_t_8);
7997     __Pyx_DECREF_SET(__pyx_v_fields, __pyx_t_8);
7998     __pyx_t_8 = 0;
7999 
8000     /* "yt/geometry/particle_smooth.pyx":286
8001  *         pdoms = np.zeros(positions.shape[0], dtype="int64") - 1
8002  *         nf = len(fields)
8003  *         if fields is None:             # <<<<<<<<<<<<<<
8004  *             fields = []
8005  *         field_pointers = <np.float64_t**> alloca(sizeof(np.float64_t *) * nf)
8006  */
8007   }
8008 
8009   /* "yt/geometry/particle_smooth.pyx":288
8010  *         if fields is None:
8011  *             fields = []
8012  *         field_pointers = <np.float64_t**> alloca(sizeof(np.float64_t *) * nf)             # <<<<<<<<<<<<<<
8013  *         for i in range(nf):
8014  *             tarr = fields[i]
8015  */
8016   __pyx_v_field_pointers = ((__pyx_t_5numpy_float64_t **)alloca(((sizeof(__pyx_t_5numpy_float64_t *)) * __pyx_v_nf)));
8017 
8018   /* "yt/geometry/particle_smooth.pyx":289
8019  *             fields = []
8020  *         field_pointers = <np.float64_t**> alloca(sizeof(np.float64_t *) * nf)
8021  *         for i in range(nf):             # <<<<<<<<<<<<<<
8022  *             tarr = fields[i]
8023  *             field_pointers[i] = <np.float64_t *> tarr.data
8024  */
8025   __pyx_t_2 = __pyx_v_nf;
8026   __pyx_t_15 = __pyx_t_2;
8027   for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
8028     __pyx_v_i = __pyx_t_16;
8029 
8030     /* "yt/geometry/particle_smooth.pyx":290
8031  *         field_pointers = <np.float64_t**> alloca(sizeof(np.float64_t *) * nf)
8032  *         for i in range(nf):
8033  *             tarr = fields[i]             # <<<<<<<<<<<<<<
8034  *             field_pointers[i] = <np.float64_t *> tarr.data
8035  *         for i in range(3):
8036  */
8037     __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_fields, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 290, __pyx_L1_error)
8038     __Pyx_GOTREF(__pyx_t_8);
8039     if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 290, __pyx_L1_error)
8040     __pyx_t_17 = ((PyArrayObject *)__pyx_t_8);
8041     {
8042       __Pyx_BufFmt_StackElem __pyx_stack[1];
8043       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tarr.rcbuffer->pybuffer);
8044       __pyx_t_18 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tarr.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
8045       if (unlikely(__pyx_t_18 < 0)) {
8046         PyErr_Fetch(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
8047         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tarr.rcbuffer->pybuffer, (PyObject*)__pyx_v_tarr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
8048           Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5);
8049           __Pyx_RaiseBufferFallbackError();
8050         } else {
8051           PyErr_Restore(__pyx_t_3, __pyx_t_4, __pyx_t_5);
8052         }
8053         __pyx_t_3 = __pyx_t_4 = __pyx_t_5 = 0;
8054       }
8055       __pyx_pybuffernd_tarr.diminfo[0].strides = __pyx_pybuffernd_tarr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tarr.diminfo[0].shape = __pyx_pybuffernd_tarr.rcbuffer->pybuffer.shape[0];
8056       if (unlikely(__pyx_t_18 < 0)) __PYX_ERR(0, 290, __pyx_L1_error)
8057     }
8058     __pyx_t_17 = 0;
8059     __Pyx_XDECREF_SET(__pyx_v_tarr, ((PyArrayObject *)__pyx_t_8));
8060     __pyx_t_8 = 0;
8061 
8062     /* "yt/geometry/particle_smooth.pyx":291
8063  *         for i in range(nf):
8064  *             tarr = fields[i]
8065  *             field_pointers[i] = <np.float64_t *> tarr.data             # <<<<<<<<<<<<<<
8066  *         for i in range(3):
8067  *             self.DW[i] = (particle_octree.DRE[i] - particle_octree.DLE[i])
8068  */
8069     (__pyx_v_field_pointers[__pyx_v_i]) = ((__pyx_t_5numpy_float64_t *)__pyx_v_tarr->data);
8070   }
8071 
8072   /* "yt/geometry/particle_smooth.pyx":292
8073  *             tarr = fields[i]
8074  *             field_pointers[i] = <np.float64_t *> tarr.data
8075  *         for i in range(3):             # <<<<<<<<<<<<<<
8076  *             self.DW[i] = (particle_octree.DRE[i] - particle_octree.DLE[i])
8077  *             self.periodicity[i] = periodicity[i]
8078  */
8079   for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) {
8080     __pyx_v_i = __pyx_t_2;
8081 
8082     /* "yt/geometry/particle_smooth.pyx":293
8083  *             field_pointers[i] = <np.float64_t *> tarr.data
8084  *         for i in range(3):
8085  *             self.DW[i] = (particle_octree.DRE[i] - particle_octree.DLE[i])             # <<<<<<<<<<<<<<
8086  *             self.periodicity[i] = periodicity[i]
8087  *         for i in range(positions.shape[0]):
8088  */
8089     (__pyx_v_self->DW[__pyx_v_i]) = ((__pyx_v_particle_octree->DRE[__pyx_v_i]) - (__pyx_v_particle_octree->DLE[__pyx_v_i]));
8090 
8091     /* "yt/geometry/particle_smooth.pyx":294
8092  *         for i in range(3):
8093  *             self.DW[i] = (particle_octree.DRE[i] - particle_octree.DLE[i])
8094  *             self.periodicity[i] = periodicity[i]             # <<<<<<<<<<<<<<
8095  *         for i in range(positions.shape[0]):
8096  *             for j in range(3):
8097  */
8098     __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_periodicity, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 294, __pyx_L1_error)
8099     __Pyx_GOTREF(__pyx_t_8);
8100     __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 294, __pyx_L1_error)
8101     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8102     (__pyx_v_self->periodicity[__pyx_v_i]) = __pyx_t_14;
8103   }
8104 
8105   /* "yt/geometry/particle_smooth.pyx":295
8106  *             self.DW[i] = (particle_octree.DRE[i] - particle_octree.DLE[i])
8107  *             self.periodicity[i] = periodicity[i]
8108  *         for i in range(positions.shape[0]):             # <<<<<<<<<<<<<<
8109  *             for j in range(3):
8110  *                 pos[j] = positions[i, j]
8111  */
8112   __pyx_t_19 = (__pyx_v_positions->dimensions[0]);
8113   __pyx_t_20 = __pyx_t_19;
8114   for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_20; __pyx_t_2+=1) {
8115     __pyx_v_i = __pyx_t_2;
8116 
8117     /* "yt/geometry/particle_smooth.pyx":296
8118  *             self.periodicity[i] = periodicity[i]
8119  *         for i in range(positions.shape[0]):
8120  *             for j in range(3):             # <<<<<<<<<<<<<<
8121  *                 pos[j] = positions[i, j]
8122  *             oct = particle_octree.get(pos)
8123  */
8124     for (__pyx_t_15 = 0; __pyx_t_15 < 3; __pyx_t_15+=1) {
8125       __pyx_v_j = __pyx_t_15;
8126 
8127       /* "yt/geometry/particle_smooth.pyx":297
8128  *         for i in range(positions.shape[0]):
8129  *             for j in range(3):
8130  *                 pos[j] = positions[i, j]             # <<<<<<<<<<<<<<
8131  *             oct = particle_octree.get(pos)
8132  *             if oct == NULL or (domain_id > 0 and oct.domain != domain_id):
8133  */
8134       __pyx_t_21 = __pyx_v_i;
8135       __pyx_t_22 = __pyx_v_j;
8136       (__pyx_v_pos[__pyx_v_j]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_positions.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_positions.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_positions.diminfo[1].strides));
8137     }
8138 
8139     /* "yt/geometry/particle_smooth.pyx":298
8140  *             for j in range(3):
8141  *                 pos[j] = positions[i, j]
8142  *             oct = particle_octree.get(pos)             # <<<<<<<<<<<<<<
8143  *             if oct == NULL or (domain_id > 0 and oct.domain != domain_id):
8144  *                 continue
8145  */
8146     __pyx_v_oct = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_particle_octree->__pyx_vtab)->get(__pyx_v_particle_octree, __pyx_v_pos, NULL);
8147 
8148     /* "yt/geometry/particle_smooth.pyx":299
8149  *                 pos[j] = positions[i, j]
8150  *             oct = particle_octree.get(pos)
8151  *             if oct == NULL or (domain_id > 0 and oct.domain != domain_id):             # <<<<<<<<<<<<<<
8152  *                 continue
8153  *             # Note that this has to be our local index, not our in-file index.
8154  */
8155     __pyx_t_1 = ((__pyx_v_oct == NULL) != 0);
8156     if (!__pyx_t_1) {
8157     } else {
8158       __pyx_t_14 = __pyx_t_1;
8159       goto __pyx_L14_bool_binop_done;
8160     }
8161     __pyx_t_1 = ((__pyx_v_domain_id > 0) != 0);
8162     if (__pyx_t_1) {
8163     } else {
8164       __pyx_t_14 = __pyx_t_1;
8165       goto __pyx_L14_bool_binop_done;
8166     }
8167     __pyx_t_1 = ((__pyx_v_oct->domain != __pyx_v_domain_id) != 0);
8168     __pyx_t_14 = __pyx_t_1;
8169     __pyx_L14_bool_binop_done:;
8170     if (__pyx_t_14) {
8171 
8172       /* "yt/geometry/particle_smooth.pyx":300
8173  *             oct = particle_octree.get(pos)
8174  *             if oct == NULL or (domain_id > 0 and oct.domain != domain_id):
8175  *                 continue             # <<<<<<<<<<<<<<
8176  *             # Note that this has to be our local index, not our in-file index.
8177  *             # This is the particle count, which we'll use once we have sorted
8178  */
8179       goto __pyx_L9_continue;
8180 
8181       /* "yt/geometry/particle_smooth.pyx":299
8182  *                 pos[j] = positions[i, j]
8183  *             oct = particle_octree.get(pos)
8184  *             if oct == NULL or (domain_id > 0 and oct.domain != domain_id):             # <<<<<<<<<<<<<<
8185  *                 continue
8186  *             # Note that this has to be our local index, not our in-file index.
8187  */
8188     }
8189 
8190     /* "yt/geometry/particle_smooth.pyx":304
8191  *             # This is the particle count, which we'll use once we have sorted
8192  *             # the particles to calculate the offsets into each oct's particles.
8193  *             offset = oct.domain_ind - moff_p             # <<<<<<<<<<<<<<
8194  *             pcount[offset] += 1
8195  *             pdoms[i] = offset # We store the *actual* offset.
8196  */
8197     __pyx_v_offset = (__pyx_v_oct->domain_ind - __pyx_v_moff_p);
8198 
8199     /* "yt/geometry/particle_smooth.pyx":305
8200  *             # the particles to calculate the offsets into each oct's particles.
8201  *             offset = oct.domain_ind - moff_p
8202  *             pcount[offset] += 1             # <<<<<<<<<<<<<<
8203  *             pdoms[i] = offset # We store the *actual* offset.
8204  *         # Now we have oct assignments.  Let's sort them.
8205  */
8206     __pyx_t_23 = __pyx_v_offset;
8207     *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_pcount.data + __pyx_t_23 * __pyx_v_pcount.strides[0]) )) += 1;
8208 
8209     /* "yt/geometry/particle_smooth.pyx":306
8210  *             offset = oct.domain_ind - moff_p
8211  *             pcount[offset] += 1
8212  *             pdoms[i] = offset # We store the *actual* offset.             # <<<<<<<<<<<<<<
8213  *         # Now we have oct assignments.  Let's sort them.
8214  *         # Note that what we will be providing to our processing functions will
8215  */
8216     __pyx_t_24 = __pyx_v_i;
8217     *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_pdoms.data + __pyx_t_24 * __pyx_v_pdoms.strides[0]) )) = __pyx_v_offset;
8218     __pyx_L9_continue:;
8219   }
8220 
8221   /* "yt/geometry/particle_smooth.pyx":311
8222  *         # actually be indirectly-sorted fields.  This preserves memory at the
8223  *         # expense of additional pointer lookups.
8224  *         pind = np.asarray(np.argsort(pdoms), dtype='int64', order='C')             # <<<<<<<<<<<<<<
8225  *         # So what this means is that we now have all the oct-0 particle indices
8226  *         # in order, then the oct-1, etc etc.
8227  */
8228   __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 311, __pyx_L1_error)
8229   __Pyx_GOTREF(__pyx_t_8);
8230   __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 311, __pyx_L1_error)
8231   __Pyx_GOTREF(__pyx_t_9);
8232   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8233   __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 311, __pyx_L1_error)
8234   __Pyx_GOTREF(__pyx_t_7);
8235   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_argsort); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
8236   __Pyx_GOTREF(__pyx_t_6);
8237   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8238   __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_pdoms, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 311, __pyx_L1_error)
8239   __Pyx_GOTREF(__pyx_t_7);
8240   __pyx_t_11 = NULL;
8241   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
8242     __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6);
8243     if (likely(__pyx_t_11)) {
8244       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
8245       __Pyx_INCREF(__pyx_t_11);
8246       __Pyx_INCREF(function);
8247       __Pyx_DECREF_SET(__pyx_t_6, function);
8248     }
8249   }
8250   __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_11, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7);
8251   __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
8252   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8253   if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 311, __pyx_L1_error)
8254   __Pyx_GOTREF(__pyx_t_8);
8255   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8256   __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
8257   __Pyx_GOTREF(__pyx_t_6);
8258   __Pyx_GIVEREF(__pyx_t_8);
8259   PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8);
8260   __pyx_t_8 = 0;
8261   __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 311, __pyx_L1_error)
8262   __Pyx_GOTREF(__pyx_t_8);
8263   if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 311, __pyx_L1_error)
8264   if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 311, __pyx_L1_error)
8265   __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 311, __pyx_L1_error)
8266   __Pyx_GOTREF(__pyx_t_7);
8267   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8268   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8269   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8270   __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_7, PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 311, __pyx_L1_error)
8271   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8272   __pyx_v_pind = __pyx_t_12;
8273   __pyx_t_12.memview = NULL;
8274   __pyx_t_12.data = NULL;
8275 
8276   /* "yt/geometry/particle_smooth.pyx":315
8277  *         # in order, then the oct-1, etc etc.
8278  *         # This now gives us the indices to the particles for each domain.
8279  *         for i in range(positions.shape[0]):             # <<<<<<<<<<<<<<
8280  *             # This value, poff, is the index of the particle in the *unsorted*
8281  *             # arrays.
8282  */
8283   __pyx_t_19 = (__pyx_v_positions->dimensions[0]);
8284   __pyx_t_20 = __pyx_t_19;
8285   for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_20; __pyx_t_2+=1) {
8286     __pyx_v_i = __pyx_t_2;
8287 
8288     /* "yt/geometry/particle_smooth.pyx":318
8289  *             # This value, poff, is the index of the particle in the *unsorted*
8290  *             # arrays.
8291  *             poff = pind[i]             # <<<<<<<<<<<<<<
8292  *             offset = pdoms[poff]
8293  *             # If we have yet to assign the starting index to this oct, we do so
8294  */
8295     __pyx_t_25 = __pyx_v_i;
8296     __pyx_v_poff = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_pind.data + __pyx_t_25 * __pyx_v_pind.strides[0]) )));
8297 
8298     /* "yt/geometry/particle_smooth.pyx":319
8299  *             # arrays.
8300  *             poff = pind[i]
8301  *             offset = pdoms[poff]             # <<<<<<<<<<<<<<
8302  *             # If we have yet to assign the starting index to this oct, we do so
8303  *             # now.
8304  */
8305     __pyx_t_26 = __pyx_v_poff;
8306     __pyx_v_offset = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_pdoms.data + __pyx_t_26 * __pyx_v_pdoms.strides[0]) )));
8307 
8308     /* "yt/geometry/particle_smooth.pyx":322
8309  *             # If we have yet to assign the starting index to this oct, we do so
8310  *             # now.
8311  *             if doff[offset] < 0: doff[offset] = i             # <<<<<<<<<<<<<<
8312  *         #print(domain_id, domain_offset, moff_p, moff_m)
8313  *         #raise RuntimeError
8314  */
8315     __pyx_t_27 = __pyx_v_offset;
8316     __pyx_t_14 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_doff.data + __pyx_t_27 * __pyx_v_doff.strides[0]) ))) < 0) != 0);
8317     if (__pyx_t_14) {
8318       __pyx_t_28 = __pyx_v_offset;
8319       *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_doff.data + __pyx_t_28 * __pyx_v_doff.strides[0]) )) = __pyx_v_i;
8320     }
8321   }
8322 
8323   /* "yt/geometry/particle_smooth.pyx":327
8324  *         # Now doff is full of offsets to the first entry in the pind that
8325  *         # refers to that oct's particles.
8326  *         cdef int maxnei = 0             # <<<<<<<<<<<<<<
8327  *         cdef int nproc = 0
8328  *         # This should be thread-private if we ever go to OpenMP
8329  */
8330   __pyx_v_maxnei = 0;
8331 
8332   /* "yt/geometry/particle_smooth.pyx":328
8333  *         # refers to that oct's particles.
8334  *         cdef int maxnei = 0
8335  *         cdef int nproc = 0             # <<<<<<<<<<<<<<
8336  *         # This should be thread-private if we ever go to OpenMP
8337  *         cdef DistanceQueue dist_queue = DistanceQueue(self.maxn)
8338  */
8339   __pyx_v_nproc = 0;
8340 
8341   /* "yt/geometry/particle_smooth.pyx":330
8342  *         cdef int nproc = 0
8343  *         # This should be thread-private if we ever go to OpenMP
8344  *         cdef DistanceQueue dist_queue = DistanceQueue(self.maxn)             # <<<<<<<<<<<<<<
8345  *         dist_queue._setup(self.DW, self.periodicity)
8346  *         for i in range(doff.shape[0]):
8347  */
8348   __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->maxn); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 330, __pyx_L1_error)
8349   __Pyx_GOTREF(__pyx_t_7);
8350   __pyx_t_8 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_14distance_queue_DistanceQueue), __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 330, __pyx_L1_error)
8351   __Pyx_GOTREF(__pyx_t_8);
8352   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8353   __pyx_v_dist_queue = ((struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *)__pyx_t_8);
8354   __pyx_t_8 = 0;
8355 
8356   /* "yt/geometry/particle_smooth.pyx":331
8357  *         # This should be thread-private if we ever go to OpenMP
8358  *         cdef DistanceQueue dist_queue = DistanceQueue(self.maxn)
8359  *         dist_queue._setup(self.DW, self.periodicity)             # <<<<<<<<<<<<<<
8360  *         for i in range(doff.shape[0]):
8361  *             if doff[i] < 0: continue
8362  */
8363   ((struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_DistanceQueue *)__pyx_v_dist_queue->__pyx_base.__pyx_vtab)->_setup(__pyx_v_dist_queue, __pyx_v_self->DW, __pyx_v_self->periodicity);
8364 
8365   /* "yt/geometry/particle_smooth.pyx":332
8366  *         cdef DistanceQueue dist_queue = DistanceQueue(self.maxn)
8367  *         dist_queue._setup(self.DW, self.periodicity)
8368  *         for i in range(doff.shape[0]):             # <<<<<<<<<<<<<<
8369  *             if doff[i] < 0: continue
8370  *             offset = pind[doff[i]]
8371  */
8372   __pyx_t_13 = (__pyx_v_doff.shape[0]);
8373   __pyx_t_29 = __pyx_t_13;
8374   for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_29; __pyx_t_2+=1) {
8375     __pyx_v_i = __pyx_t_2;
8376 
8377     /* "yt/geometry/particle_smooth.pyx":333
8378  *         dist_queue._setup(self.DW, self.periodicity)
8379  *         for i in range(doff.shape[0]):
8380  *             if doff[i] < 0: continue             # <<<<<<<<<<<<<<
8381  *             offset = pind[doff[i]]
8382  *             for j in range(3):
8383  */
8384     __pyx_t_30 = __pyx_v_i;
8385     __pyx_t_14 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_doff.data + __pyx_t_30 * __pyx_v_doff.strides[0]) ))) < 0) != 0);
8386     if (__pyx_t_14) {
8387       goto __pyx_L20_continue;
8388     }
8389 
8390     /* "yt/geometry/particle_smooth.pyx":334
8391  *         for i in range(doff.shape[0]):
8392  *             if doff[i] < 0: continue
8393  *             offset = pind[doff[i]]             # <<<<<<<<<<<<<<
8394  *             for j in range(3):
8395  *                 pos[j] = positions[offset, j]
8396  */
8397     __pyx_t_31 = __pyx_v_i;
8398     __pyx_t_32 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_doff.data + __pyx_t_31 * __pyx_v_doff.strides[0]) )));
8399     __pyx_v_offset = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_pind.data + __pyx_t_32 * __pyx_v_pind.strides[0]) )));
8400 
8401     /* "yt/geometry/particle_smooth.pyx":335
8402  *             if doff[i] < 0: continue
8403  *             offset = pind[doff[i]]
8404  *             for j in range(3):             # <<<<<<<<<<<<<<
8405  *                 pos[j] = positions[offset, j]
8406  *             for j in range(pcount[i]):
8407  */
8408     for (__pyx_t_15 = 0; __pyx_t_15 < 3; __pyx_t_15+=1) {
8409       __pyx_v_j = __pyx_t_15;
8410 
8411       /* "yt/geometry/particle_smooth.pyx":336
8412  *             offset = pind[doff[i]]
8413  *             for j in range(3):
8414  *                 pos[j] = positions[offset, j]             # <<<<<<<<<<<<<<
8415  *             for j in range(pcount[i]):
8416  *                 pind0 = pind[doff[i] + j]
8417  */
8418       __pyx_t_33 = __pyx_v_offset;
8419       __pyx_t_34 = __pyx_v_j;
8420       (__pyx_v_pos[__pyx_v_j]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_positions.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_positions.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_positions.diminfo[1].strides));
8421     }
8422 
8423     /* "yt/geometry/particle_smooth.pyx":337
8424  *             for j in range(3):
8425  *                 pos[j] = positions[offset, j]
8426  *             for j in range(pcount[i]):             # <<<<<<<<<<<<<<
8427  *                 pind0 = pind[doff[i] + j]
8428  *                 for k in range(3):
8429  */
8430     __pyx_t_35 = __pyx_v_i;
8431     __pyx_t_36 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_pcount.data + __pyx_t_35 * __pyx_v_pcount.strides[0]) )));
8432     __pyx_t_37 = __pyx_t_36;
8433     for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_37; __pyx_t_15+=1) {
8434       __pyx_v_j = __pyx_t_15;
8435 
8436       /* "yt/geometry/particle_smooth.pyx":338
8437  *                 pos[j] = positions[offset, j]
8438  *             for j in range(pcount[i]):
8439  *                 pind0 = pind[doff[i] + j]             # <<<<<<<<<<<<<<
8440  *                 for k in range(3):
8441  *                     pos[k] = positions[pind0, k]
8442  */
8443       __pyx_t_38 = __pyx_v_i;
8444       __pyx_t_39 = ((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_doff.data + __pyx_t_38 * __pyx_v_doff.strides[0]) ))) + __pyx_v_j);
8445       __pyx_v_pind0 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_pind.data + __pyx_t_39 * __pyx_v_pind.strides[0]) )));
8446 
8447       /* "yt/geometry/particle_smooth.pyx":339
8448  *             for j in range(pcount[i]):
8449  *                 pind0 = pind[doff[i] + j]
8450  *                 for k in range(3):             # <<<<<<<<<<<<<<
8451  *                     pos[k] = positions[pind0, k]
8452  *                 self.neighbor_process_particle(pos, cart_positions, field_pointers,
8453  */
8454       for (__pyx_t_16 = 0; __pyx_t_16 < 3; __pyx_t_16+=1) {
8455         __pyx_v_k = __pyx_t_16;
8456 
8457         /* "yt/geometry/particle_smooth.pyx":340
8458  *                 pind0 = pind[doff[i] + j]
8459  *                 for k in range(3):
8460  *                     pos[k] = positions[pind0, k]             # <<<<<<<<<<<<<<
8461  *                 self.neighbor_process_particle(pos, cart_positions, field_pointers,
8462  *                             doff, &nind, pind, pcount, pind0,
8463  */
8464         __pyx_t_40 = __pyx_v_pind0;
8465         __pyx_t_41 = __pyx_v_k;
8466         (__pyx_v_pos[__pyx_v_k]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_positions.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_positions.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_positions.diminfo[1].strides));
8467       }
8468 
8469       /* "yt/geometry/particle_smooth.pyx":341
8470  *                 for k in range(3):
8471  *                     pos[k] = positions[pind0, k]
8472  *                 self.neighbor_process_particle(pos, cart_positions, field_pointers,             # <<<<<<<<<<<<<<
8473  *                             doff, &nind, pind, pcount, pind0,
8474  *                             NULL, particle_octree, domain_id, &nsize,
8475  */
8476       __pyx_t_42 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(((PyObject *)__pyx_v_cart_positions), PyBUF_WRITABLE); if (unlikely(!__pyx_t_42.memview)) __PYX_ERR(0, 341, __pyx_L1_error)
8477 
8478       /* "yt/geometry/particle_smooth.pyx":344
8479  *                             doff, &nind, pind, pcount, pind0,
8480  *                             NULL, particle_octree, domain_id, &nsize,
8481  *                             dist_queue)             # <<<<<<<<<<<<<<
8482  *         #print("VISITED", visited.sum(), visited.size,)
8483  *         #print(100.0*float(visited.sum())/visited.size)
8484  */
8485       ((struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self->__pyx_vtab)->neighbor_process_particle(__pyx_v_self, __pyx_v_pos, __pyx_t_42, __pyx_v_field_pointers, __pyx_v_doff, (&__pyx_v_nind), __pyx_v_pind, __pyx_v_pcount, __pyx_v_pind0, NULL, __pyx_v_particle_octree, __pyx_v_domain_id, (&__pyx_v_nsize), __pyx_v_dist_queue);
8486       __PYX_XDEC_MEMVIEW(&__pyx_t_42, 1);
8487       __pyx_t_42.memview = NULL;
8488       __pyx_t_42.data = NULL;
8489     }
8490     __pyx_L20_continue:;
8491   }
8492 
8493   /* "yt/geometry/particle_smooth.pyx":347
8494  *         #print("VISITED", visited.sum(), visited.size,)
8495  *         #print(100.0*float(visited.sum())/visited.size)
8496  *         if nind != NULL:             # <<<<<<<<<<<<<<
8497  *             free(nind)
8498  *
8499  */
8500   __pyx_t_14 = ((__pyx_v_nind != NULL) != 0);
8501   if (__pyx_t_14) {
8502 
8503     /* "yt/geometry/particle_smooth.pyx":348
8504  *         #print(100.0*float(visited.sum())/visited.size)
8505  *         if nind != NULL:
8506  *             free(nind)             # <<<<<<<<<<<<<<
8507  *
8508  *     cdef int neighbor_search(self, np.float64_t pos[3], OctreeContainer octree,
8509  */
8510     free(__pyx_v_nind);
8511 
8512     /* "yt/geometry/particle_smooth.pyx":347
8513  *         #print("VISITED", visited.sum(), visited.size,)
8514  *         #print(100.0*float(visited.sum())/visited.size)
8515  *         if nind != NULL:             # <<<<<<<<<<<<<<
8516  *             free(nind)
8517  *
8518  */
8519   }
8520 
8521   /* "yt/geometry/particle_smooth.pyx":231
8522  *     @cython.wraparound(False)
8523  *     @cython.initializedcheck(False)
8524  *     def process_particles(self, OctreeContainer particle_octree,             # <<<<<<<<<<<<<<
8525  *                      np.ndarray[np.int64_t, ndim=1] pdom_ind,
8526  *                      np.ndarray[np.float64_t, ndim=2] positions,
8527  */
8528 
8529   /* function exit code */
8530   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8531   goto __pyx_L0;
8532   __pyx_L1_error:;
8533   __Pyx_XDECREF(__pyx_t_6);
8534   __Pyx_XDECREF(__pyx_t_7);
8535   __Pyx_XDECREF(__pyx_t_8);
8536   __Pyx_XDECREF(__pyx_t_9);
8537   __Pyx_XDECREF(__pyx_t_11);
8538   __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
8539   __PYX_XDEC_MEMVIEW(&__pyx_t_42, 1);
8540   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
8541     __Pyx_PyThreadState_declare
8542     __Pyx_PyThreadState_assign
8543     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
8544     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cart_positions.rcbuffer->pybuffer);
8545     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pdom_ind.rcbuffer->pybuffer);
8546     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_positions.rcbuffer->pybuffer);
8547     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tarr.rcbuffer->pybuffer);
8548   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
8549   __Pyx_AddTraceback("yt.geometry.particle_smooth.ParticleSmoothOperation.process_particles", __pyx_clineno, __pyx_lineno, __pyx_filename);
8550   __pyx_r = NULL;
8551   goto __pyx_L2;
8552   __pyx_L0:;
8553   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cart_positions.rcbuffer->pybuffer);
8554   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pdom_ind.rcbuffer->pybuffer);
8555   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_positions.rcbuffer->pybuffer);
8556   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tarr.rcbuffer->pybuffer);
8557   __pyx_L2:;
8558   __PYX_XDEC_MEMVIEW(&__pyx_v_pind, 1);
8559   __PYX_XDEC_MEMVIEW(&__pyx_v_doff, 1);
8560   __PYX_XDEC_MEMVIEW(&__pyx_v_pdoms, 1);
8561   __PYX_XDEC_MEMVIEW(&__pyx_v_pcount, 1);
8562   __Pyx_XDECREF((PyObject *)__pyx_v_tarr);
8563   __Pyx_XDECREF((PyObject *)__pyx_v_cart_positions);
8564   __Pyx_XDECREF((PyObject *)__pyx_v_dist_queue);
8565   __Pyx_XDECREF(__pyx_v_fields);
8566   __Pyx_XDECREF(__pyx_v_periodicity);
8567   __Pyx_XGIVEREF(__pyx_r);
8568   __Pyx_RefNannyFinishContext();
8569   return __pyx_r;
8570 }
8571 
8572 /* "yt/geometry/particle_smooth.pyx":350
8573  *             free(nind)
8574  *
8575  *     cdef int neighbor_search(self, np.float64_t pos[3], OctreeContainer octree,             # <<<<<<<<<<<<<<
8576  *                              np.int64_t **nind, int *nsize,
8577  *                              np.int64_t nneighbors, np.int64_t domain_id,
8578  */
8579 
__pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_search(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation * __pyx_v_self,__pyx_t_5numpy_float64_t * __pyx_v_pos,struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_octree,__pyx_t_5numpy_int64_t ** __pyx_v_nind,int * __pyx_v_nsize,__pyx_t_5numpy_int64_t __pyx_v_nneighbors,__pyx_t_5numpy_int64_t __pyx_v_domain_id,struct __pyx_opt_args_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_search * __pyx_optional_args)8580 static int __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_search(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_octree, __pyx_t_5numpy_int64_t **__pyx_v_nind, int *__pyx_v_nsize, __pyx_t_5numpy_int64_t __pyx_v_nneighbors, __pyx_t_5numpy_int64_t __pyx_v_domain_id, struct __pyx_opt_args_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_search *__pyx_optional_args) {
8581 
8582   /* "yt/geometry/particle_smooth.pyx":353
8583  *                              np.int64_t **nind, int *nsize,
8584  *                              np.int64_t nneighbors, np.int64_t domain_id,
8585  *                              Oct **oct = NULL, int extra_layer = 0):             # <<<<<<<<<<<<<<
8586  *         cdef OctInfo oi
8587  *         cdef Oct *ooct
8588  */
8589   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **__pyx_v_oct = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **)NULL);
8590   int __pyx_v_extra_layer = ((int)0);
8591   struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo __pyx_v_oi;
8592   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_ooct;
8593   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **__pyx_v_neighbors;
8594   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **__pyx_v_first_layer;
8595   int __pyx_v_j;
8596   int __pyx_v_total_neighbors;
8597   int __pyx_v_initial_layer;
8598   int __pyx_v_layer_ind;
8599   __pyx_t_5numpy_int64_t __pyx_v_moff;
8600   int __pyx_v_n;
8601   int __pyx_r;
8602   __Pyx_RefNannyDeclarations
8603   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_t_1;
8604   struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get __pyx_t_2;
8605   int __pyx_t_3;
8606   int __pyx_t_4;
8607   __pyx_t_5numpy_int64_t __pyx_t_5;
8608   __pyx_t_5numpy_int64_t __pyx_t_6;
8609   int __pyx_t_7;
8610   int __pyx_t_8;
8611   int __pyx_t_9;
8612   int __pyx_t_10;
8613   int __pyx_t_11;
8614   int __pyx_t_12;
8615   __Pyx_RefNannySetupContext("neighbor_search", 0);
8616   if (__pyx_optional_args) {
8617     if (__pyx_optional_args->__pyx_n > 0) {
8618       __pyx_v_oct = __pyx_optional_args->oct;
8619       if (__pyx_optional_args->__pyx_n > 1) {
8620         __pyx_v_extra_layer = __pyx_optional_args->extra_layer;
8621       }
8622     }
8623   }
8624 
8625   /* "yt/geometry/particle_smooth.pyx":358
8626  *         cdef Oct **neighbors
8627  *         cdef Oct **first_layer
8628  *         cdef int j, total_neighbors = 0, initial_layer = 0             # <<<<<<<<<<<<<<
8629  *         cdef int layer_ind = 0
8630  *         cdef np.int64_t moff = octree.get_domain_offset(domain_id)
8631  */
8632   __pyx_v_total_neighbors = 0;
8633   __pyx_v_initial_layer = 0;
8634 
8635   /* "yt/geometry/particle_smooth.pyx":359
8636  *         cdef Oct **first_layer
8637  *         cdef int j, total_neighbors = 0, initial_layer = 0
8638  *         cdef int layer_ind = 0             # <<<<<<<<<<<<<<
8639  *         cdef np.int64_t moff = octree.get_domain_offset(domain_id)
8640  *         ooct = octree.get(pos, &oi)
8641  */
8642   __pyx_v_layer_ind = 0;
8643 
8644   /* "yt/geometry/particle_smooth.pyx":360
8645  *         cdef int j, total_neighbors = 0, initial_layer = 0
8646  *         cdef int layer_ind = 0
8647  *         cdef np.int64_t moff = octree.get_domain_offset(domain_id)             # <<<<<<<<<<<<<<
8648  *         ooct = octree.get(pos, &oi)
8649  *         if oct != NULL and ooct == oct[0]:
8650  */
8651   __pyx_v_moff = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_octree->__pyx_vtab)->get_domain_offset(__pyx_v_octree, __pyx_v_domain_id);
8652 
8653   /* "yt/geometry/particle_smooth.pyx":361
8654  *         cdef int layer_ind = 0
8655  *         cdef np.int64_t moff = octree.get_domain_offset(domain_id)
8656  *         ooct = octree.get(pos, &oi)             # <<<<<<<<<<<<<<
8657  *         if oct != NULL and ooct == oct[0]:
8658  *             return nneighbors
8659  */
8660   __pyx_t_2.__pyx_n = 1;
8661   __pyx_t_2.oinfo = (&__pyx_v_oi);
8662   __pyx_t_1 = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_octree->__pyx_vtab)->get(__pyx_v_octree, __pyx_v_pos, &__pyx_t_2);
8663   __pyx_v_ooct = __pyx_t_1;
8664 
8665   /* "yt/geometry/particle_smooth.pyx":362
8666  *         cdef np.int64_t moff = octree.get_domain_offset(domain_id)
8667  *         ooct = octree.get(pos, &oi)
8668  *         if oct != NULL and ooct == oct[0]:             # <<<<<<<<<<<<<<
8669  *             return nneighbors
8670  *         oct[0] = ooct
8671  */
8672   __pyx_t_4 = ((__pyx_v_oct != NULL) != 0);
8673   if (__pyx_t_4) {
8674   } else {
8675     __pyx_t_3 = __pyx_t_4;
8676     goto __pyx_L4_bool_binop_done;
8677   }
8678   __pyx_t_4 = ((__pyx_v_ooct == (__pyx_v_oct[0])) != 0);
8679   __pyx_t_3 = __pyx_t_4;
8680   __pyx_L4_bool_binop_done:;
8681   if (__pyx_t_3) {
8682 
8683     /* "yt/geometry/particle_smooth.pyx":363
8684  *         ooct = octree.get(pos, &oi)
8685  *         if oct != NULL and ooct == oct[0]:
8686  *             return nneighbors             # <<<<<<<<<<<<<<
8687  *         oct[0] = ooct
8688  *         if nind[0] == NULL:
8689  */
8690     __pyx_r = __pyx_v_nneighbors;
8691     goto __pyx_L0;
8692 
8693     /* "yt/geometry/particle_smooth.pyx":362
8694  *         cdef np.int64_t moff = octree.get_domain_offset(domain_id)
8695  *         ooct = octree.get(pos, &oi)
8696  *         if oct != NULL and ooct == oct[0]:             # <<<<<<<<<<<<<<
8697  *             return nneighbors
8698  *         oct[0] = ooct
8699  */
8700   }
8701 
8702   /* "yt/geometry/particle_smooth.pyx":364
8703  *         if oct != NULL and ooct == oct[0]:
8704  *             return nneighbors
8705  *         oct[0] = ooct             # <<<<<<<<<<<<<<
8706  *         if nind[0] == NULL:
8707  *             nsize[0] = 27
8708  */
8709   (__pyx_v_oct[0]) = __pyx_v_ooct;
8710 
8711   /* "yt/geometry/particle_smooth.pyx":365
8712  *             return nneighbors
8713  *         oct[0] = ooct
8714  *         if nind[0] == NULL:             # <<<<<<<<<<<<<<
8715  *             nsize[0] = 27
8716  *             nind[0] = <np.int64_t *> malloc(sizeof(np.int64_t)*nsize[0])
8717  */
8718   __pyx_t_3 = (((__pyx_v_nind[0]) == NULL) != 0);
8719   if (__pyx_t_3) {
8720 
8721     /* "yt/geometry/particle_smooth.pyx":366
8722  *         oct[0] = ooct
8723  *         if nind[0] == NULL:
8724  *             nsize[0] = 27             # <<<<<<<<<<<<<<
8725  *             nind[0] = <np.int64_t *> malloc(sizeof(np.int64_t)*nsize[0])
8726  *         # This is our "seed" set of neighbors.  If we are asked to, we will
8727  */
8728     (__pyx_v_nsize[0]) = 27;
8729 
8730     /* "yt/geometry/particle_smooth.pyx":367
8731  *         if nind[0] == NULL:
8732  *             nsize[0] = 27
8733  *             nind[0] = <np.int64_t *> malloc(sizeof(np.int64_t)*nsize[0])             # <<<<<<<<<<<<<<
8734  *         # This is our "seed" set of neighbors.  If we are asked to, we will
8735  *         # create a master list of neighbors that is much bigger and includes
8736  */
8737     (__pyx_v_nind[0]) = ((__pyx_t_5numpy_int64_t *)malloc(((sizeof(__pyx_t_5numpy_int64_t)) * (__pyx_v_nsize[0]))));
8738 
8739     /* "yt/geometry/particle_smooth.pyx":365
8740  *             return nneighbors
8741  *         oct[0] = ooct
8742  *         if nind[0] == NULL:             # <<<<<<<<<<<<<<
8743  *             nsize[0] = 27
8744  *             nind[0] = <np.int64_t *> malloc(sizeof(np.int64_t)*nsize[0])
8745  */
8746   }
8747 
8748   /* "yt/geometry/particle_smooth.pyx":371
8749  *         # create a master list of neighbors that is much bigger and includes
8750  *         # everything.
8751  *         layer_ind = 0             # <<<<<<<<<<<<<<
8752  *         first_layer = NULL
8753  *         while 1:
8754  */
8755   __pyx_v_layer_ind = 0;
8756 
8757   /* "yt/geometry/particle_smooth.pyx":372
8758  *         # everything.
8759  *         layer_ind = 0
8760  *         first_layer = NULL             # <<<<<<<<<<<<<<
8761  *         while 1:
8762  *             neighbors = octree.neighbors(&oi, &nneighbors, ooct, self.periodicity)
8763  */
8764   __pyx_v_first_layer = NULL;
8765 
8766   /* "yt/geometry/particle_smooth.pyx":373
8767  *         layer_ind = 0
8768  *         first_layer = NULL
8769  *         while 1:             # <<<<<<<<<<<<<<
8770  *             neighbors = octree.neighbors(&oi, &nneighbors, ooct, self.periodicity)
8771  *             # Now we have all our neighbors.  And, we should be set for what
8772  */
8773   while (1) {
8774 
8775     /* "yt/geometry/particle_smooth.pyx":374
8776  *         first_layer = NULL
8777  *         while 1:
8778  *             neighbors = octree.neighbors(&oi, &nneighbors, ooct, self.periodicity)             # <<<<<<<<<<<<<<
8779  *             # Now we have all our neighbors.  And, we should be set for what
8780  *             # else we need to do.
8781  */
8782     __pyx_v_neighbors = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_octree->__pyx_vtab)->neighbors(__pyx_v_octree, (&__pyx_v_oi), (&__pyx_v_nneighbors), __pyx_v_ooct, __pyx_v_self->periodicity);
8783 
8784     /* "yt/geometry/particle_smooth.pyx":377
8785  *             # Now we have all our neighbors.  And, we should be set for what
8786  *             # else we need to do.
8787  *             if total_neighbors + nneighbors > nsize[0]:             # <<<<<<<<<<<<<<
8788  *                 nind[0] = <np.int64_t *> realloc(
8789  *                     nind[0], sizeof(np.int64_t)*(nneighbors + total_neighbors))
8790  */
8791     __pyx_t_3 = (((__pyx_v_total_neighbors + __pyx_v_nneighbors) > (__pyx_v_nsize[0])) != 0);
8792     if (__pyx_t_3) {
8793 
8794       /* "yt/geometry/particle_smooth.pyx":378
8795  *             # else we need to do.
8796  *             if total_neighbors + nneighbors > nsize[0]:
8797  *                 nind[0] = <np.int64_t *> realloc(             # <<<<<<<<<<<<<<
8798  *                     nind[0], sizeof(np.int64_t)*(nneighbors + total_neighbors))
8799  *                 nsize[0] = nneighbors + total_neighbors
8800  */
8801       (__pyx_v_nind[0]) = ((__pyx_t_5numpy_int64_t *)realloc((__pyx_v_nind[0]), ((sizeof(__pyx_t_5numpy_int64_t)) * (__pyx_v_nneighbors + __pyx_v_total_neighbors))));
8802 
8803       /* "yt/geometry/particle_smooth.pyx":380
8804  *                 nind[0] = <np.int64_t *> realloc(
8805  *                     nind[0], sizeof(np.int64_t)*(nneighbors + total_neighbors))
8806  *                 nsize[0] = nneighbors + total_neighbors             # <<<<<<<<<<<<<<
8807  *             for j in range(nneighbors):
8808  *                 # Particle octree neighbor indices
8809  */
8810       (__pyx_v_nsize[0]) = (__pyx_v_nneighbors + __pyx_v_total_neighbors);
8811 
8812       /* "yt/geometry/particle_smooth.pyx":377
8813  *             # Now we have all our neighbors.  And, we should be set for what
8814  *             # else we need to do.
8815  *             if total_neighbors + nneighbors > nsize[0]:             # <<<<<<<<<<<<<<
8816  *                 nind[0] = <np.int64_t *> realloc(
8817  *                     nind[0], sizeof(np.int64_t)*(nneighbors + total_neighbors))
8818  */
8819     }
8820 
8821     /* "yt/geometry/particle_smooth.pyx":381
8822  *                     nind[0], sizeof(np.int64_t)*(nneighbors + total_neighbors))
8823  *                 nsize[0] = nneighbors + total_neighbors
8824  *             for j in range(nneighbors):             # <<<<<<<<<<<<<<
8825  *                 # Particle octree neighbor indices
8826  *                 nind[0][j + total_neighbors] = neighbors[j].domain_ind - moff
8827  */
8828     __pyx_t_5 = __pyx_v_nneighbors;
8829     __pyx_t_6 = __pyx_t_5;
8830     for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
8831       __pyx_v_j = __pyx_t_7;
8832 
8833       /* "yt/geometry/particle_smooth.pyx":383
8834  *             for j in range(nneighbors):
8835  *                 # Particle octree neighbor indices
8836  *                 nind[0][j + total_neighbors] = neighbors[j].domain_ind - moff             # <<<<<<<<<<<<<<
8837  *             total_neighbors += nneighbors
8838  *             if extra_layer == 0:
8839  */
8840       ((__pyx_v_nind[0])[(__pyx_v_j + __pyx_v_total_neighbors)]) = ((__pyx_v_neighbors[__pyx_v_j])->domain_ind - __pyx_v_moff);
8841     }
8842 
8843     /* "yt/geometry/particle_smooth.pyx":384
8844  *                 # Particle octree neighbor indices
8845  *                 nind[0][j + total_neighbors] = neighbors[j].domain_ind - moff
8846  *             total_neighbors += nneighbors             # <<<<<<<<<<<<<<
8847  *             if extra_layer == 0:
8848  *                 # Not adding on any additional layers here.
8849  */
8850     __pyx_v_total_neighbors = (__pyx_v_total_neighbors + __pyx_v_nneighbors);
8851 
8852     /* "yt/geometry/particle_smooth.pyx":385
8853  *                 nind[0][j + total_neighbors] = neighbors[j].domain_ind - moff
8854  *             total_neighbors += nneighbors
8855  *             if extra_layer == 0:             # <<<<<<<<<<<<<<
8856  *                 # Not adding on any additional layers here.
8857  *                 free(neighbors)
8858  */
8859     __pyx_t_3 = ((__pyx_v_extra_layer == 0) != 0);
8860     if (__pyx_t_3) {
8861 
8862       /* "yt/geometry/particle_smooth.pyx":387
8863  *             if extra_layer == 0:
8864  *                 # Not adding on any additional layers here.
8865  *                 free(neighbors)             # <<<<<<<<<<<<<<
8866  *                 neighbors = NULL
8867  *                 break
8868  */
8869       free(__pyx_v_neighbors);
8870 
8871       /* "yt/geometry/particle_smooth.pyx":388
8872  *                 # Not adding on any additional layers here.
8873  *                 free(neighbors)
8874  *                 neighbors = NULL             # <<<<<<<<<<<<<<
8875  *                 break
8876  *             if initial_layer == 0:
8877  */
8878       __pyx_v_neighbors = NULL;
8879 
8880       /* "yt/geometry/particle_smooth.pyx":389
8881  *                 free(neighbors)
8882  *                 neighbors = NULL
8883  *                 break             # <<<<<<<<<<<<<<
8884  *             if initial_layer == 0:
8885  *                 initial_layer = nneighbors
8886  */
8887       goto __pyx_L8_break;
8888 
8889       /* "yt/geometry/particle_smooth.pyx":385
8890  *                 nind[0][j + total_neighbors] = neighbors[j].domain_ind - moff
8891  *             total_neighbors += nneighbors
8892  *             if extra_layer == 0:             # <<<<<<<<<<<<<<
8893  *                 # Not adding on any additional layers here.
8894  *                 free(neighbors)
8895  */
8896     }
8897 
8898     /* "yt/geometry/particle_smooth.pyx":390
8899  *                 neighbors = NULL
8900  *                 break
8901  *             if initial_layer == 0:             # <<<<<<<<<<<<<<
8902  *                 initial_layer = nneighbors
8903  *                 first_layer = neighbors
8904  */
8905     __pyx_t_3 = ((__pyx_v_initial_layer == 0) != 0);
8906     if (__pyx_t_3) {
8907 
8908       /* "yt/geometry/particle_smooth.pyx":391
8909  *                 break
8910  *             if initial_layer == 0:
8911  *                 initial_layer = nneighbors             # <<<<<<<<<<<<<<
8912  *                 first_layer = neighbors
8913  *             else:
8914  */
8915       __pyx_v_initial_layer = __pyx_v_nneighbors;
8916 
8917       /* "yt/geometry/particle_smooth.pyx":392
8918  *             if initial_layer == 0:
8919  *                 initial_layer = nneighbors
8920  *                 first_layer = neighbors             # <<<<<<<<<<<<<<
8921  *             else:
8922  *                 # Allocated internally; we free this in the loops if we aren't
8923  */
8924       __pyx_v_first_layer = __pyx_v_neighbors;
8925 
8926       /* "yt/geometry/particle_smooth.pyx":390
8927  *                 neighbors = NULL
8928  *                 break
8929  *             if initial_layer == 0:             # <<<<<<<<<<<<<<
8930  *                 initial_layer = nneighbors
8931  *                 first_layer = neighbors
8932  */
8933       goto __pyx_L13;
8934     }
8935 
8936     /* "yt/geometry/particle_smooth.pyx":396
8937  *                 # Allocated internally; we free this in the loops if we aren't
8938  *                 # tracking it
8939  *                 free(neighbors)             # <<<<<<<<<<<<<<
8940  *                 neighbors = NULL
8941  *             ooct = first_layer[layer_ind]
8942  */
8943     /*else*/ {
8944       free(__pyx_v_neighbors);
8945 
8946       /* "yt/geometry/particle_smooth.pyx":397
8947  *                 # tracking it
8948  *                 free(neighbors)
8949  *                 neighbors = NULL             # <<<<<<<<<<<<<<
8950  *             ooct = first_layer[layer_ind]
8951  *             layer_ind += 1
8952  */
8953       __pyx_v_neighbors = NULL;
8954     }
8955     __pyx_L13:;
8956 
8957     /* "yt/geometry/particle_smooth.pyx":398
8958  *                 free(neighbors)
8959  *                 neighbors = NULL
8960  *             ooct = first_layer[layer_ind]             # <<<<<<<<<<<<<<
8961  *             layer_ind += 1
8962  *             if layer_ind == initial_layer:
8963  */
8964     __pyx_v_ooct = (__pyx_v_first_layer[__pyx_v_layer_ind]);
8965 
8966     /* "yt/geometry/particle_smooth.pyx":399
8967  *                 neighbors = NULL
8968  *             ooct = first_layer[layer_ind]
8969  *             layer_ind += 1             # <<<<<<<<<<<<<<
8970  *             if layer_ind == initial_layer:
8971  *                 neighbors
8972  */
8973     __pyx_v_layer_ind = (__pyx_v_layer_ind + 1);
8974 
8975     /* "yt/geometry/particle_smooth.pyx":400
8976  *             ooct = first_layer[layer_ind]
8977  *             layer_ind += 1
8978  *             if layer_ind == initial_layer:             # <<<<<<<<<<<<<<
8979  *                 neighbors
8980  *                 break
8981  */
8982     __pyx_t_3 = ((__pyx_v_layer_ind == __pyx_v_initial_layer) != 0);
8983     if (__pyx_t_3) {
8984 
8985       /* "yt/geometry/particle_smooth.pyx":402
8986  *             if layer_ind == initial_layer:
8987  *                 neighbors
8988  *                 break             # <<<<<<<<<<<<<<
8989  *
8990  *
8991  */
8992       goto __pyx_L8_break;
8993 
8994       /* "yt/geometry/particle_smooth.pyx":400
8995  *             ooct = first_layer[layer_ind]
8996  *             layer_ind += 1
8997  *             if layer_ind == initial_layer:             # <<<<<<<<<<<<<<
8998  *                 neighbors
8999  *                 break
9000  */
9001     }
9002   }
9003   __pyx_L8_break:;
9004 
9005   /* "yt/geometry/particle_smooth.pyx":405
9006  *
9007  *
9008  *         for j in range(total_neighbors):             # <<<<<<<<<<<<<<
9009  *             # Particle octree neighbor indices
9010  *             if nind[0][j] == -1: continue
9011  */
9012   __pyx_t_7 = __pyx_v_total_neighbors;
9013   __pyx_t_8 = __pyx_t_7;
9014   for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
9015     __pyx_v_j = __pyx_t_9;
9016 
9017     /* "yt/geometry/particle_smooth.pyx":407
9018  *         for j in range(total_neighbors):
9019  *             # Particle octree neighbor indices
9020  *             if nind[0][j] == -1: continue             # <<<<<<<<<<<<<<
9021  *             for n in range(j):
9022  *                 if nind[0][j] == nind[0][n]:
9023  */
9024     __pyx_t_3 = ((((__pyx_v_nind[0])[__pyx_v_j]) == -1LL) != 0);
9025     if (__pyx_t_3) {
9026       goto __pyx_L15_continue;
9027     }
9028 
9029     /* "yt/geometry/particle_smooth.pyx":408
9030  *             # Particle octree neighbor indices
9031  *             if nind[0][j] == -1: continue
9032  *             for n in range(j):             # <<<<<<<<<<<<<<
9033  *                 if nind[0][j] == nind[0][n]:
9034  *                     nind[0][j] = -1
9035  */
9036     __pyx_t_10 = __pyx_v_j;
9037     __pyx_t_11 = __pyx_t_10;
9038     for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
9039       __pyx_v_n = __pyx_t_12;
9040 
9041       /* "yt/geometry/particle_smooth.pyx":409
9042  *             if nind[0][j] == -1: continue
9043  *             for n in range(j):
9044  *                 if nind[0][j] == nind[0][n]:             # <<<<<<<<<<<<<<
9045  *                     nind[0][j] = -1
9046  *         # This is allocated by the neighbors function, so we deallocate it.
9047  */
9048       __pyx_t_3 = ((((__pyx_v_nind[0])[__pyx_v_j]) == ((__pyx_v_nind[0])[__pyx_v_n])) != 0);
9049       if (__pyx_t_3) {
9050 
9051         /* "yt/geometry/particle_smooth.pyx":410
9052  *             for n in range(j):
9053  *                 if nind[0][j] == nind[0][n]:
9054  *                     nind[0][j] = -1             # <<<<<<<<<<<<<<
9055  *         # This is allocated by the neighbors function, so we deallocate it.
9056  *         if first_layer != NULL:
9057  */
9058         ((__pyx_v_nind[0])[__pyx_v_j]) = -1LL;
9059 
9060         /* "yt/geometry/particle_smooth.pyx":409
9061  *             if nind[0][j] == -1: continue
9062  *             for n in range(j):
9063  *                 if nind[0][j] == nind[0][n]:             # <<<<<<<<<<<<<<
9064  *                     nind[0][j] = -1
9065  *         # This is allocated by the neighbors function, so we deallocate it.
9066  */
9067       }
9068     }
9069     __pyx_L15_continue:;
9070   }
9071 
9072   /* "yt/geometry/particle_smooth.pyx":412
9073  *                     nind[0][j] = -1
9074  *         # This is allocated by the neighbors function, so we deallocate it.
9075  *         if first_layer != NULL:             # <<<<<<<<<<<<<<
9076  *             free(first_layer)
9077  *         return total_neighbors
9078  */
9079   __pyx_t_3 = ((__pyx_v_first_layer != NULL) != 0);
9080   if (__pyx_t_3) {
9081 
9082     /* "yt/geometry/particle_smooth.pyx":413
9083  *         # This is allocated by the neighbors function, so we deallocate it.
9084  *         if first_layer != NULL:
9085  *             free(first_layer)             # <<<<<<<<<<<<<<
9086  *         return total_neighbors
9087  *
9088  */
9089     free(__pyx_v_first_layer);
9090 
9091     /* "yt/geometry/particle_smooth.pyx":412
9092  *                     nind[0][j] = -1
9093  *         # This is allocated by the neighbors function, so we deallocate it.
9094  *         if first_layer != NULL:             # <<<<<<<<<<<<<<
9095  *             free(first_layer)
9096  *         return total_neighbors
9097  */
9098   }
9099 
9100   /* "yt/geometry/particle_smooth.pyx":414
9101  *         if first_layer != NULL:
9102  *             free(first_layer)
9103  *         return total_neighbors             # <<<<<<<<<<<<<<
9104  *
9105  *     @cython.cdivision(True)
9106  */
9107   __pyx_r = __pyx_v_total_neighbors;
9108   goto __pyx_L0;
9109 
9110   /* "yt/geometry/particle_smooth.pyx":350
9111  *             free(nind)
9112  *
9113  *     cdef int neighbor_search(self, np.float64_t pos[3], OctreeContainer octree,             # <<<<<<<<<<<<<<
9114  *                              np.int64_t **nind, int *nsize,
9115  *                              np.int64_t nneighbors, np.int64_t domain_id,
9116  */
9117 
9118   /* function exit code */
9119   __pyx_L0:;
9120   __Pyx_RefNannyFinishContext();
9121   return __pyx_r;
9122 }
9123 
9124 /* "yt/geometry/particle_smooth.pyx":420
9125  *     @cython.wraparound(False)
9126  *     @cython.initializedcheck(False)
9127  *     def process_grid(self, gobj,             # <<<<<<<<<<<<<<
9128  *                      np.ndarray[np.float64_t, ndim=2] positions,
9129  *                      fields = None):
9130  */
9131 
9132 /* Python wrapper */
9133 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_11process_grid(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_11process_grid(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)9134 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_11process_grid(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9135   CYTHON_UNUSED PyObject *__pyx_v_gobj = 0;
9136   CYTHON_UNUSED PyArrayObject *__pyx_v_positions = 0;
9137   CYTHON_UNUSED PyObject *__pyx_v_fields = 0;
9138   PyObject *__pyx_r = 0;
9139   __Pyx_RefNannyDeclarations
9140   __Pyx_RefNannySetupContext("process_grid (wrapper)", 0);
9141   {
9142     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gobj,&__pyx_n_s_positions,&__pyx_n_s_fields,0};
9143     PyObject* values[3] = {0,0,0};
9144 
9145     /* "yt/geometry/particle_smooth.pyx":422
9146  *     def process_grid(self, gobj,
9147  *                      np.ndarray[np.float64_t, ndim=2] positions,
9148  *                      fields = None):             # <<<<<<<<<<<<<<
9149  *         raise NotImplementedError
9150  *
9151  */
9152     values[2] = ((PyObject *)Py_None);
9153     if (unlikely(__pyx_kwds)) {
9154       Py_ssize_t kw_args;
9155       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9156       switch (pos_args) {
9157         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9158         CYTHON_FALLTHROUGH;
9159         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9160         CYTHON_FALLTHROUGH;
9161         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9162         CYTHON_FALLTHROUGH;
9163         case  0: break;
9164         default: goto __pyx_L5_argtuple_error;
9165       }
9166       kw_args = PyDict_Size(__pyx_kwds);
9167       switch (pos_args) {
9168         case  0:
9169         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gobj)) != 0)) kw_args--;
9170         else goto __pyx_L5_argtuple_error;
9171         CYTHON_FALLTHROUGH;
9172         case  1:
9173         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_positions)) != 0)) kw_args--;
9174         else {
9175           __Pyx_RaiseArgtupleInvalid("process_grid", 0, 2, 3, 1); __PYX_ERR(0, 420, __pyx_L3_error)
9176         }
9177         CYTHON_FALLTHROUGH;
9178         case  2:
9179         if (kw_args > 0) {
9180           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fields);
9181           if (value) { values[2] = value; kw_args--; }
9182         }
9183       }
9184       if (unlikely(kw_args > 0)) {
9185         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "process_grid") < 0)) __PYX_ERR(0, 420, __pyx_L3_error)
9186       }
9187     } else {
9188       switch (PyTuple_GET_SIZE(__pyx_args)) {
9189         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9190         CYTHON_FALLTHROUGH;
9191         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9192         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9193         break;
9194         default: goto __pyx_L5_argtuple_error;
9195       }
9196     }
9197     __pyx_v_gobj = values[0];
9198     __pyx_v_positions = ((PyArrayObject *)values[1]);
9199     __pyx_v_fields = values[2];
9200   }
9201   goto __pyx_L4_argument_unpacking_done;
9202   __pyx_L5_argtuple_error:;
9203   __Pyx_RaiseArgtupleInvalid("process_grid", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 420, __pyx_L3_error)
9204   __pyx_L3_error:;
9205   __Pyx_AddTraceback("yt.geometry.particle_smooth.ParticleSmoothOperation.process_grid", __pyx_clineno, __pyx_lineno, __pyx_filename);
9206   __Pyx_RefNannyFinishContext();
9207   return NULL;
9208   __pyx_L4_argument_unpacking_done:;
9209   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_positions), __pyx_ptype_5numpy_ndarray, 1, "positions", 0))) __PYX_ERR(0, 421, __pyx_L1_error)
9210   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_10process_grid(((struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self), __pyx_v_gobj, __pyx_v_positions, __pyx_v_fields);
9211 
9212   /* "yt/geometry/particle_smooth.pyx":420
9213  *     @cython.wraparound(False)
9214  *     @cython.initializedcheck(False)
9215  *     def process_grid(self, gobj,             # <<<<<<<<<<<<<<
9216  *                      np.ndarray[np.float64_t, ndim=2] positions,
9217  *                      fields = None):
9218  */
9219 
9220   /* function exit code */
9221   goto __pyx_L0;
9222   __pyx_L1_error:;
9223   __pyx_r = NULL;
9224   __pyx_L0:;
9225   __Pyx_RefNannyFinishContext();
9226   return __pyx_r;
9227 }
9228 
__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_10process_grid(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v_gobj,CYTHON_UNUSED PyArrayObject * __pyx_v_positions,CYTHON_UNUSED PyObject * __pyx_v_fields)9229 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_10process_grid(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_gobj, CYTHON_UNUSED PyArrayObject *__pyx_v_positions, CYTHON_UNUSED PyObject *__pyx_v_fields) {
9230   __Pyx_LocalBuf_ND __pyx_pybuffernd_positions;
9231   __Pyx_Buffer __pyx_pybuffer_positions;
9232   PyObject *__pyx_r = NULL;
9233   __Pyx_RefNannyDeclarations
9234   __Pyx_RefNannySetupContext("process_grid", 0);
9235   __pyx_pybuffer_positions.pybuffer.buf = NULL;
9236   __pyx_pybuffer_positions.refcount = 0;
9237   __pyx_pybuffernd_positions.data = NULL;
9238   __pyx_pybuffernd_positions.rcbuffer = &__pyx_pybuffer_positions;
9239   {
9240     __Pyx_BufFmt_StackElem __pyx_stack[1];
9241     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_positions.rcbuffer->pybuffer, (PyObject*)__pyx_v_positions, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 420, __pyx_L1_error)
9242   }
9243   __pyx_pybuffernd_positions.diminfo[0].strides = __pyx_pybuffernd_positions.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_positions.diminfo[0].shape = __pyx_pybuffernd_positions.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_positions.diminfo[1].strides = __pyx_pybuffernd_positions.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_positions.diminfo[1].shape = __pyx_pybuffernd_positions.rcbuffer->pybuffer.shape[1];
9244 
9245   /* "yt/geometry/particle_smooth.pyx":423
9246  *                      np.ndarray[np.float64_t, ndim=2] positions,
9247  *                      fields = None):
9248  *         raise NotImplementedError             # <<<<<<<<<<<<<<
9249  *
9250  *     cdef void process(self, np.int64_t offset, int i, int j, int k,
9251  */
9252   __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
9253   __PYX_ERR(0, 423, __pyx_L1_error)
9254 
9255   /* "yt/geometry/particle_smooth.pyx":420
9256  *     @cython.wraparound(False)
9257  *     @cython.initializedcheck(False)
9258  *     def process_grid(self, gobj,             # <<<<<<<<<<<<<<
9259  *                      np.ndarray[np.float64_t, ndim=2] positions,
9260  *                      fields = None):
9261  */
9262 
9263   /* function exit code */
9264   __pyx_L1_error:;
9265   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
9266     __Pyx_PyThreadState_declare
9267     __Pyx_PyThreadState_assign
9268     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
9269     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_positions.rcbuffer->pybuffer);
9270   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
9271   __Pyx_AddTraceback("yt.geometry.particle_smooth.ParticleSmoothOperation.process_grid", __pyx_clineno, __pyx_lineno, __pyx_filename);
9272   __pyx_r = NULL;
9273   goto __pyx_L2;
9274   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_positions.rcbuffer->pybuffer);
9275   __pyx_L2:;
9276   __Pyx_XGIVEREF(__pyx_r);
9277   __Pyx_RefNannyFinishContext();
9278   return __pyx_r;
9279 }
9280 
9281 /* "yt/geometry/particle_smooth.pyx":425
9282  *         raise NotImplementedError
9283  *
9284  *     cdef void process(self, np.int64_t offset, int i, int j, int k,             # <<<<<<<<<<<<<<
9285  *                       int dim[3], np.float64_t cpos[3], np.float64_t **fields,
9286  *                       np.float64_t **ifields, DistanceQueue dq):
9287  */
9288 
__pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_process(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation * __pyx_v_self,CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_offset,CYTHON_UNUSED int __pyx_v_i,CYTHON_UNUSED int __pyx_v_j,CYTHON_UNUSED int __pyx_v_k,CYTHON_UNUSED int * __pyx_v_dim,CYTHON_UNUSED __pyx_t_5numpy_float64_t * __pyx_v_cpos,CYTHON_UNUSED __pyx_t_5numpy_float64_t ** __pyx_v_fields,CYTHON_UNUSED __pyx_t_5numpy_float64_t ** __pyx_v_ifields,CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue * __pyx_v_dq)9289 static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_process(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_offset, CYTHON_UNUSED int __pyx_v_i, CYTHON_UNUSED int __pyx_v_j, CYTHON_UNUSED int __pyx_v_k, CYTHON_UNUSED int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_ifields, CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq) {
9290   __Pyx_RefNannyDeclarations
9291   __Pyx_RefNannySetupContext("process", 0);
9292 
9293   /* "yt/geometry/particle_smooth.pyx":428
9294  *                       int dim[3], np.float64_t cpos[3], np.float64_t **fields,
9295  *                       np.float64_t **ifields, DistanceQueue dq):
9296  *         raise NotImplementedError             # <<<<<<<<<<<<<<
9297  *
9298  *     @cython.cdivision(True)
9299  */
9300   __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
9301   __PYX_ERR(0, 428, __pyx_L1_error)
9302 
9303   /* "yt/geometry/particle_smooth.pyx":425
9304  *         raise NotImplementedError
9305  *
9306  *     cdef void process(self, np.int64_t offset, int i, int j, int k,             # <<<<<<<<<<<<<<
9307  *                       int dim[3], np.float64_t cpos[3], np.float64_t **fields,
9308  *                       np.float64_t **ifields, DistanceQueue dq):
9309  */
9310 
9311   /* function exit code */
9312   __pyx_L1_error:;
9313   __Pyx_WriteUnraisable("yt.geometry.particle_smooth.ParticleSmoothOperation.process", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
9314   __Pyx_RefNannyFinishContext();
9315 }
9316 
9317 /* "yt/geometry/particle_smooth.pyx":434
9318  *     @cython.wraparound(False)
9319  *     @cython.initializedcheck(False)
9320  *     cdef void neighbor_find(self,             # <<<<<<<<<<<<<<
9321  *                             np.int64_t nneighbors,
9322  *                             np.int64_t *nind,
9323  */
9324 
__pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_find(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation * __pyx_v_self,__pyx_t_5numpy_int64_t __pyx_v_nneighbors,__pyx_t_5numpy_int64_t * __pyx_v_nind,__Pyx_memviewslice __pyx_v_doffs,__Pyx_memviewslice __pyx_v_pcounts,__Pyx_memviewslice __pyx_v_pinds,__Pyx_memviewslice __pyx_v_ppos,__pyx_t_5numpy_float64_t * __pyx_v_cpos,__Pyx_memviewslice __pyx_v_oct_left_edges,__Pyx_memviewslice __pyx_v_oct_dds,struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue * __pyx_v_dq)9325 static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_find(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_nneighbors, __pyx_t_5numpy_int64_t *__pyx_v_nind, __Pyx_memviewslice __pyx_v_doffs, __Pyx_memviewslice __pyx_v_pcounts, __Pyx_memviewslice __pyx_v_pinds, __Pyx_memviewslice __pyx_v_ppos, __pyx_t_5numpy_float64_t *__pyx_v_cpos, __Pyx_memviewslice __pyx_v_oct_left_edges, __Pyx_memviewslice __pyx_v_oct_dds, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq) {
9326   int __pyx_v_ni;
9327   int __pyx_v_i;
9328   int __pyx_v_j;
9329   int __pyx_v_k;
9330   __pyx_t_5numpy_int64_t __pyx_v_offset;
9331   __pyx_t_5numpy_int64_t __pyx_v_pn;
9332   __pyx_t_5numpy_int64_t __pyx_v_pc;
9333   __pyx_t_5numpy_float64_t __pyx_v_pos[3];
9334   __pyx_t_5numpy_float64_t __pyx_v_ex[2];
9335   __pyx_t_5numpy_float64_t __pyx_v_DR[2];
9336   __pyx_t_5numpy_float64_t __pyx_v_r2_trunc;
9337   __pyx_t_5numpy_float64_t __pyx_v_r2;
9338   __pyx_t_5numpy_float64_t __pyx_v_dist;
9339   __Pyx_RefNannyDeclarations
9340   __pyx_t_5numpy_int64_t __pyx_t_1;
9341   __pyx_t_5numpy_int64_t __pyx_t_2;
9342   int __pyx_t_3;
9343   int __pyx_t_4;
9344   int __pyx_t_5;
9345   __pyx_t_5numpy_float64_t __pyx_t_6;
9346   int __pyx_t_7;
9347   __pyx_t_5numpy_int64_t __pyx_t_8;
9348   Py_ssize_t __pyx_t_9;
9349   __pyx_t_5numpy_int64_t __pyx_t_10;
9350   Py_ssize_t __pyx_t_11;
9351   int __pyx_t_12;
9352   int __pyx_t_13;
9353   __pyx_t_5numpy_int64_t __pyx_t_14;
9354   __pyx_t_5numpy_int64_t __pyx_t_15;
9355   __pyx_t_5numpy_int64_t __pyx_t_16;
9356   __pyx_t_5numpy_int64_t __pyx_t_17;
9357   __pyx_t_5numpy_int64_t __pyx_t_18;
9358   __pyx_t_5numpy_int64_t __pyx_t_19;
9359   Py_ssize_t __pyx_t_20;
9360   __Pyx_RefNannySetupContext("neighbor_find", 0);
9361 
9362   /* "yt/geometry/particle_smooth.pyx":454
9363  *         cdef np.float64_t DR[2]
9364  *         cdef np.float64_t cp, r2_trunc, r2, dist
9365  *         dq.neighbor_reset()             # <<<<<<<<<<<<<<
9366  *         for ni in range(nneighbors):
9367  *             if nind[ni] == -1: continue
9368  */
9369   ((struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_DistanceQueue *)__pyx_v_dq->__pyx_base.__pyx_vtab)->neighbor_reset(__pyx_v_dq);
9370 
9371   /* "yt/geometry/particle_smooth.pyx":455
9372  *         cdef np.float64_t cp, r2_trunc, r2, dist
9373  *         dq.neighbor_reset()
9374  *         for ni in range(nneighbors):             # <<<<<<<<<<<<<<
9375  *             if nind[ni] == -1: continue
9376  *             # terminate early if all 8 corners of oct are farther away than
9377  */
9378   __pyx_t_1 = __pyx_v_nneighbors;
9379   __pyx_t_2 = __pyx_t_1;
9380   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
9381     __pyx_v_ni = __pyx_t_3;
9382 
9383     /* "yt/geometry/particle_smooth.pyx":456
9384  *         dq.neighbor_reset()
9385  *         for ni in range(nneighbors):
9386  *             if nind[ni] == -1: continue             # <<<<<<<<<<<<<<
9387  *             # terminate early if all 8 corners of oct are farther away than
9388  *             # most distant currently known neighbor
9389  */
9390     __pyx_t_4 = (((__pyx_v_nind[__pyx_v_ni]) == -1LL) != 0);
9391     if (__pyx_t_4) {
9392       goto __pyx_L3_continue;
9393     }
9394 
9395     /* "yt/geometry/particle_smooth.pyx":459
9396  *             # terminate early if all 8 corners of oct are farther away than
9397  *             # most distant currently known neighbor
9398  *             if oct_left_edges != None and dq.curn == dq.maxn:             # <<<<<<<<<<<<<<
9399  *                 r2_trunc = dq.neighbors[dq.curn - 1].r2
9400  *                 # iterate over each dimension in the outer loop so we can
9401  */
9402     __pyx_t_5 = ((((PyObject *) __pyx_v_oct_left_edges.memview) != Py_None) != 0);
9403     if (__pyx_t_5) {
9404     } else {
9405       __pyx_t_4 = __pyx_t_5;
9406       goto __pyx_L7_bool_binop_done;
9407     }
9408     __pyx_t_5 = ((__pyx_v_dq->__pyx_base.curn == __pyx_v_dq->__pyx_base.maxn) != 0);
9409     __pyx_t_4 = __pyx_t_5;
9410     __pyx_L7_bool_binop_done:;
9411     if (__pyx_t_4) {
9412 
9413       /* "yt/geometry/particle_smooth.pyx":460
9414  *             # most distant currently known neighbor
9415  *             if oct_left_edges != None and dq.curn == dq.maxn:
9416  *                 r2_trunc = dq.neighbors[dq.curn - 1].r2             # <<<<<<<<<<<<<<
9417  *                 # iterate over each dimension in the outer loop so we can
9418  *                 # consolidate temporary storage
9419  */
9420       __pyx_t_6 = (__pyx_v_dq->neighbors[(__pyx_v_dq->__pyx_base.curn - 1)]).r2;
9421       __pyx_v_r2_trunc = __pyx_t_6;
9422 
9423       /* "yt/geometry/particle_smooth.pyx":466
9424  *                 # closest, of each possible permutation.
9425  *                 # k here is the dimension
9426  *                 r2 = 0.0             # <<<<<<<<<<<<<<
9427  *                 for k in range(3):
9428  *                     # We start at left edge, then do halfway, then right edge.
9429  */
9430       __pyx_v_r2 = 0.0;
9431 
9432       /* "yt/geometry/particle_smooth.pyx":467
9433  *                 # k here is the dimension
9434  *                 r2 = 0.0
9435  *                 for k in range(3):             # <<<<<<<<<<<<<<
9436  *                     # We start at left edge, then do halfway, then right edge.
9437  *                     ex[0] = oct_left_edges[nind[ni], k]
9438  */
9439       for (__pyx_t_7 = 0; __pyx_t_7 < 3; __pyx_t_7+=1) {
9440         __pyx_v_k = __pyx_t_7;
9441 
9442         /* "yt/geometry/particle_smooth.pyx":469
9443  *                 for k in range(3):
9444  *                     # We start at left edge, then do halfway, then right edge.
9445  *                     ex[0] = oct_left_edges[nind[ni], k]             # <<<<<<<<<<<<<<
9446  *                     ex[1] = ex[0] + oct_dds[nind[ni], k]
9447  *                     # There are three possibilities; we are between, left-of,
9448  */
9449         __pyx_t_8 = (__pyx_v_nind[__pyx_v_ni]);
9450         __pyx_t_9 = __pyx_v_k;
9451         (__pyx_v_ex[0]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_oct_left_edges.data + __pyx_t_8 * __pyx_v_oct_left_edges.strides[0]) ) + __pyx_t_9 * __pyx_v_oct_left_edges.strides[1]) )));
9452 
9453         /* "yt/geometry/particle_smooth.pyx":470
9454  *                     # We start at left edge, then do halfway, then right edge.
9455  *                     ex[0] = oct_left_edges[nind[ni], k]
9456  *                     ex[1] = ex[0] + oct_dds[nind[ni], k]             # <<<<<<<<<<<<<<
9457  *                     # There are three possibilities; we are between, left-of,
9458  *                     # or right-of the extrema.  Thanks to
9459  */
9460         __pyx_t_10 = (__pyx_v_nind[__pyx_v_ni]);
9461         __pyx_t_11 = __pyx_v_k;
9462         (__pyx_v_ex[1]) = ((__pyx_v_ex[0]) + (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_oct_dds.data + __pyx_t_10 * __pyx_v_oct_dds.strides[0]) ) + __pyx_t_11 * __pyx_v_oct_dds.strides[1]) ))));
9463 
9464         /* "yt/geometry/particle_smooth.pyx":476
9465  *                     # for some help.  This has been modified to account for
9466  *                     # periodicity.
9467  *                     dist = 0.0             # <<<<<<<<<<<<<<
9468  *                     DR[0] = (ex[0] - cpos[k])
9469  *                     DR[1] = (cpos[k] - ex[1])
9470  */
9471         __pyx_v_dist = 0.0;
9472 
9473         /* "yt/geometry/particle_smooth.pyx":477
9474  *                     # periodicity.
9475  *                     dist = 0.0
9476  *                     DR[0] = (ex[0] - cpos[k])             # <<<<<<<<<<<<<<
9477  *                     DR[1] = (cpos[k] - ex[1])
9478  *                     for j in range(2):
9479  */
9480         (__pyx_v_DR[0]) = ((__pyx_v_ex[0]) - (__pyx_v_cpos[__pyx_v_k]));
9481 
9482         /* "yt/geometry/particle_smooth.pyx":478
9483  *                     dist = 0.0
9484  *                     DR[0] = (ex[0] - cpos[k])
9485  *                     DR[1] = (cpos[k] - ex[1])             # <<<<<<<<<<<<<<
9486  *                     for j in range(2):
9487  *                         if not self.periodicity[k]:
9488  */
9489         (__pyx_v_DR[1]) = ((__pyx_v_cpos[__pyx_v_k]) - (__pyx_v_ex[1]));
9490 
9491         /* "yt/geometry/particle_smooth.pyx":479
9492  *                     DR[0] = (ex[0] - cpos[k])
9493  *                     DR[1] = (cpos[k] - ex[1])
9494  *                     for j in range(2):             # <<<<<<<<<<<<<<
9495  *                         if not self.periodicity[k]:
9496  *                             pass
9497  */
9498         for (__pyx_t_12 = 0; __pyx_t_12 < 2; __pyx_t_12+=1) {
9499           __pyx_v_j = __pyx_t_12;
9500 
9501           /* "yt/geometry/particle_smooth.pyx":480
9502  *                     DR[1] = (cpos[k] - ex[1])
9503  *                     for j in range(2):
9504  *                         if not self.periodicity[k]:             # <<<<<<<<<<<<<<
9505  *                             pass
9506  *                         elif (DR[j] > self.DW[k]/2.0):
9507  */
9508           __pyx_t_4 = ((!((__pyx_v_self->periodicity[__pyx_v_k]) != 0)) != 0);
9509           if (__pyx_t_4) {
9510             goto __pyx_L13;
9511           }
9512 
9513           /* "yt/geometry/particle_smooth.pyx":482
9514  *                         if not self.periodicity[k]:
9515  *                             pass
9516  *                         elif (DR[j] > self.DW[k]/2.0):             # <<<<<<<<<<<<<<
9517  *                             DR[j] -= self.DW[k]
9518  *                         elif (DR[j] < -self.DW[k]/2.0):
9519  */
9520           __pyx_t_4 = (((__pyx_v_DR[__pyx_v_j]) > ((__pyx_v_self->DW[__pyx_v_k]) / 2.0)) != 0);
9521           if (__pyx_t_4) {
9522 
9523             /* "yt/geometry/particle_smooth.pyx":483
9524  *                             pass
9525  *                         elif (DR[j] > self.DW[k]/2.0):
9526  *                             DR[j] -= self.DW[k]             # <<<<<<<<<<<<<<
9527  *                         elif (DR[j] < -self.DW[k]/2.0):
9528  *                             DR[j] += self.DW[k]
9529  */
9530             __pyx_t_13 = __pyx_v_j;
9531             (__pyx_v_DR[__pyx_t_13]) = ((__pyx_v_DR[__pyx_t_13]) - (__pyx_v_self->DW[__pyx_v_k]));
9532 
9533             /* "yt/geometry/particle_smooth.pyx":482
9534  *                         if not self.periodicity[k]:
9535  *                             pass
9536  *                         elif (DR[j] > self.DW[k]/2.0):             # <<<<<<<<<<<<<<
9537  *                             DR[j] -= self.DW[k]
9538  *                         elif (DR[j] < -self.DW[k]/2.0):
9539  */
9540             goto __pyx_L13;
9541           }
9542 
9543           /* "yt/geometry/particle_smooth.pyx":484
9544  *                         elif (DR[j] > self.DW[k]/2.0):
9545  *                             DR[j] -= self.DW[k]
9546  *                         elif (DR[j] < -self.DW[k]/2.0):             # <<<<<<<<<<<<<<
9547  *                             DR[j] += self.DW[k]
9548  *                         dist = fmax(dist, DR[j])
9549  */
9550           __pyx_t_4 = (((__pyx_v_DR[__pyx_v_j]) < ((-(__pyx_v_self->DW[__pyx_v_k])) / 2.0)) != 0);
9551           if (__pyx_t_4) {
9552 
9553             /* "yt/geometry/particle_smooth.pyx":485
9554  *                             DR[j] -= self.DW[k]
9555  *                         elif (DR[j] < -self.DW[k]/2.0):
9556  *                             DR[j] += self.DW[k]             # <<<<<<<<<<<<<<
9557  *                         dist = fmax(dist, DR[j])
9558  *                     r2 += dist*dist
9559  */
9560             __pyx_t_13 = __pyx_v_j;
9561             (__pyx_v_DR[__pyx_t_13]) = ((__pyx_v_DR[__pyx_t_13]) + (__pyx_v_self->DW[__pyx_v_k]));
9562 
9563             /* "yt/geometry/particle_smooth.pyx":484
9564  *                         elif (DR[j] > self.DW[k]/2.0):
9565  *                             DR[j] -= self.DW[k]
9566  *                         elif (DR[j] < -self.DW[k]/2.0):             # <<<<<<<<<<<<<<
9567  *                             DR[j] += self.DW[k]
9568  *                         dist = fmax(dist, DR[j])
9569  */
9570           }
9571           __pyx_L13:;
9572 
9573           /* "yt/geometry/particle_smooth.pyx":486
9574  *                         elif (DR[j] < -self.DW[k]/2.0):
9575  *                             DR[j] += self.DW[k]
9576  *                         dist = fmax(dist, DR[j])             # <<<<<<<<<<<<<<
9577  *                     r2 += dist*dist
9578  *                 if r2 > r2_trunc:
9579  */
9580           __pyx_v_dist = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_dist, (__pyx_v_DR[__pyx_v_j]));
9581         }
9582 
9583         /* "yt/geometry/particle_smooth.pyx":487
9584  *                             DR[j] += self.DW[k]
9585  *                         dist = fmax(dist, DR[j])
9586  *                     r2 += dist*dist             # <<<<<<<<<<<<<<
9587  *                 if r2 > r2_trunc:
9588  *                     continue
9589  */
9590         __pyx_v_r2 = (__pyx_v_r2 + (__pyx_v_dist * __pyx_v_dist));
9591       }
9592 
9593       /* "yt/geometry/particle_smooth.pyx":488
9594  *                         dist = fmax(dist, DR[j])
9595  *                     r2 += dist*dist
9596  *                 if r2 > r2_trunc:             # <<<<<<<<<<<<<<
9597  *                     continue
9598  *             offset = doffs[nind[ni]]
9599  */
9600       __pyx_t_4 = ((__pyx_v_r2 > __pyx_v_r2_trunc) != 0);
9601       if (__pyx_t_4) {
9602 
9603         /* "yt/geometry/particle_smooth.pyx":489
9604  *                     r2 += dist*dist
9605  *                 if r2 > r2_trunc:
9606  *                     continue             # <<<<<<<<<<<<<<
9607  *             offset = doffs[nind[ni]]
9608  *             pc = pcounts[nind[ni]]
9609  */
9610         goto __pyx_L3_continue;
9611 
9612         /* "yt/geometry/particle_smooth.pyx":488
9613  *                         dist = fmax(dist, DR[j])
9614  *                     r2 += dist*dist
9615  *                 if r2 > r2_trunc:             # <<<<<<<<<<<<<<
9616  *                     continue
9617  *             offset = doffs[nind[ni]]
9618  */
9619       }
9620 
9621       /* "yt/geometry/particle_smooth.pyx":459
9622  *             # terminate early if all 8 corners of oct are farther away than
9623  *             # most distant currently known neighbor
9624  *             if oct_left_edges != None and dq.curn == dq.maxn:             # <<<<<<<<<<<<<<
9625  *                 r2_trunc = dq.neighbors[dq.curn - 1].r2
9626  *                 # iterate over each dimension in the outer loop so we can
9627  */
9628     }
9629 
9630     /* "yt/geometry/particle_smooth.pyx":490
9631  *                 if r2 > r2_trunc:
9632  *                     continue
9633  *             offset = doffs[nind[ni]]             # <<<<<<<<<<<<<<
9634  *             pc = pcounts[nind[ni]]
9635  *             for i in range(pc):
9636  */
9637     __pyx_t_14 = (__pyx_v_nind[__pyx_v_ni]);
9638     __pyx_v_offset = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_doffs.data + __pyx_t_14 * __pyx_v_doffs.strides[0]) )));
9639 
9640     /* "yt/geometry/particle_smooth.pyx":491
9641  *                     continue
9642  *             offset = doffs[nind[ni]]
9643  *             pc = pcounts[nind[ni]]             # <<<<<<<<<<<<<<
9644  *             for i in range(pc):
9645  *                 pn = pinds[offset + i]
9646  */
9647     __pyx_t_15 = (__pyx_v_nind[__pyx_v_ni]);
9648     __pyx_v_pc = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_pcounts.data + __pyx_t_15 * __pyx_v_pcounts.strides[0]) )));
9649 
9650     /* "yt/geometry/particle_smooth.pyx":492
9651  *             offset = doffs[nind[ni]]
9652  *             pc = pcounts[nind[ni]]
9653  *             for i in range(pc):             # <<<<<<<<<<<<<<
9654  *                 pn = pinds[offset + i]
9655  *                 for j in range(3):
9656  */
9657     __pyx_t_16 = __pyx_v_pc;
9658     __pyx_t_17 = __pyx_t_16;
9659     for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_17; __pyx_t_7+=1) {
9660       __pyx_v_i = __pyx_t_7;
9661 
9662       /* "yt/geometry/particle_smooth.pyx":493
9663  *             pc = pcounts[nind[ni]]
9664  *             for i in range(pc):
9665  *                 pn = pinds[offset + i]             # <<<<<<<<<<<<<<
9666  *                 for j in range(3):
9667  *                     pos[j] = ppos[pn, j]
9668  */
9669       __pyx_t_18 = (__pyx_v_offset + __pyx_v_i);
9670       __pyx_v_pn = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_pinds.data + __pyx_t_18 * __pyx_v_pinds.strides[0]) )));
9671 
9672       /* "yt/geometry/particle_smooth.pyx":494
9673  *             for i in range(pc):
9674  *                 pn = pinds[offset + i]
9675  *                 for j in range(3):             # <<<<<<<<<<<<<<
9676  *                     pos[j] = ppos[pn, j]
9677  *                 dq.neighbor_eval(pn, pos, cpos)
9678  */
9679       for (__pyx_t_12 = 0; __pyx_t_12 < 3; __pyx_t_12+=1) {
9680         __pyx_v_j = __pyx_t_12;
9681 
9682         /* "yt/geometry/particle_smooth.pyx":495
9683  *                 pn = pinds[offset + i]
9684  *                 for j in range(3):
9685  *                     pos[j] = ppos[pn, j]             # <<<<<<<<<<<<<<
9686  *                 dq.neighbor_eval(pn, pos, cpos)
9687  *
9688  */
9689         __pyx_t_19 = __pyx_v_pn;
9690         __pyx_t_20 = __pyx_v_j;
9691         (__pyx_v_pos[__pyx_v_j]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_ppos.data + __pyx_t_19 * __pyx_v_ppos.strides[0]) ) + __pyx_t_20 * __pyx_v_ppos.strides[1]) )));
9692       }
9693 
9694       /* "yt/geometry/particle_smooth.pyx":496
9695  *                 for j in range(3):
9696  *                     pos[j] = ppos[pn, j]
9697  *                 dq.neighbor_eval(pn, pos, cpos)             # <<<<<<<<<<<<<<
9698  *
9699  *     @cython.cdivision(True)
9700  */
9701       ((struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_DistanceQueue *)__pyx_v_dq->__pyx_base.__pyx_vtab)->neighbor_eval(__pyx_v_dq, __pyx_v_pn, __pyx_v_pos, __pyx_v_cpos);
9702     }
9703     __pyx_L3_continue:;
9704   }
9705 
9706   /* "yt/geometry/particle_smooth.pyx":434
9707  *     @cython.wraparound(False)
9708  *     @cython.initializedcheck(False)
9709  *     cdef void neighbor_find(self,             # <<<<<<<<<<<<<<
9710  *                             np.int64_t nneighbors,
9711  *                             np.int64_t *nind,
9712  */
9713 
9714   /* function exit code */
9715   __Pyx_RefNannyFinishContext();
9716 }
9717 
9718 /* "yt/geometry/particle_smooth.pyx":502
9719  *     @cython.wraparound(False)
9720  *     @cython.initializedcheck(False)
9721  *     cdef void neighbor_process(self, int dim[3], np.float64_t left_edge[3],             # <<<<<<<<<<<<<<
9722  *                                np.float64_t dds[3], np.float64_t[:,:] ppos,
9723  *                                np.float64_t **fields,
9724  */
9725 
__pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation * __pyx_v_self,int * __pyx_v_dim,__pyx_t_5numpy_float64_t * __pyx_v_left_edge,__pyx_t_5numpy_float64_t * __pyx_v_dds,__Pyx_memviewslice __pyx_v_ppos,__pyx_t_5numpy_float64_t ** __pyx_v_fields,__Pyx_memviewslice __pyx_v_doffs,__pyx_t_5numpy_int64_t ** __pyx_v_nind,__Pyx_memviewslice __pyx_v_pinds,__Pyx_memviewslice __pyx_v_pcounts,__pyx_t_5numpy_int64_t __pyx_v_offset,__pyx_t_5numpy_float64_t ** __pyx_v_index_fields,struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_octree,__pyx_t_5numpy_int64_t __pyx_v_domain_id,int * __pyx_v_nsize,__Pyx_memviewslice __pyx_v_oct_left_edges,__Pyx_memviewslice __pyx_v_oct_dds,struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue * __pyx_v_dq)9726 static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __Pyx_memviewslice __pyx_v_ppos, __pyx_t_5numpy_float64_t **__pyx_v_fields, __Pyx_memviewslice __pyx_v_doffs, __pyx_t_5numpy_int64_t **__pyx_v_nind, __Pyx_memviewslice __pyx_v_pinds, __Pyx_memviewslice __pyx_v_pcounts, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_octree, __pyx_t_5numpy_int64_t __pyx_v_domain_id, int *__pyx_v_nsize, __Pyx_memviewslice __pyx_v_oct_left_edges, __Pyx_memviewslice __pyx_v_oct_dds, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq) {
9727   int __pyx_v_i;
9728   int __pyx_v_j;
9729   int __pyx_v_k;
9730   int __pyx_v_ntot;
9731   int __pyx_v_nntot;
9732   int __pyx_v_m;
9733   int __pyx_v_nneighbors;
9734   __pyx_t_5numpy_float64_t __pyx_v_cpos[3];
9735   __pyx_t_5numpy_float64_t __pyx_v_opos[3];
9736   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_oct;
9737   __Pyx_RefNannyDeclarations
9738   int __pyx_t_1;
9739   int __pyx_t_2;
9740   int __pyx_t_3;
9741   int __pyx_t_4;
9742   int __pyx_t_5;
9743   int __pyx_t_6;
9744   int __pyx_t_7;
9745   int __pyx_t_8;
9746   int __pyx_t_9;
9747   int __pyx_t_10;
9748   struct __pyx_opt_args_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_search __pyx_t_11;
9749   int __pyx_t_12;
9750   int __pyx_t_13;
9751   int __pyx_t_14;
9752   __pyx_t_5numpy_int64_t __pyx_t_15;
9753   PyObject *__pyx_t_16 = NULL;
9754   PyObject *__pyx_t_17 = NULL;
9755   PyObject *__pyx_t_18 = NULL;
9756   PyObject *__pyx_t_19 = NULL;
9757   PyObject *__pyx_t_20 = NULL;
9758   long __pyx_t_21;
9759   __Pyx_RefNannySetupContext("neighbor_process", 0);
9760 
9761   /* "yt/geometry/particle_smooth.pyx":519
9762  *         cdef np.float64_t cpos[3]
9763  *         cdef np.float64_t opos[3]
9764  *         cdef Oct* oct = NULL             # <<<<<<<<<<<<<<
9765  *         cpos[0] = left_edge[0] + 0.5*dds[0]
9766  *         for i in range(dim[0]):
9767  */
9768   __pyx_v_oct = NULL;
9769 
9770   /* "yt/geometry/particle_smooth.pyx":520
9771  *         cdef np.float64_t opos[3]
9772  *         cdef Oct* oct = NULL
9773  *         cpos[0] = left_edge[0] + 0.5*dds[0]             # <<<<<<<<<<<<<<
9774  *         for i in range(dim[0]):
9775  *             cpos[1] = left_edge[1] + 0.5*dds[1]
9776  */
9777   (__pyx_v_cpos[0]) = ((__pyx_v_left_edge[0]) + (0.5 * (__pyx_v_dds[0])));
9778 
9779   /* "yt/geometry/particle_smooth.pyx":521
9780  *         cdef Oct* oct = NULL
9781  *         cpos[0] = left_edge[0] + 0.5*dds[0]
9782  *         for i in range(dim[0]):             # <<<<<<<<<<<<<<
9783  *             cpos[1] = left_edge[1] + 0.5*dds[1]
9784  *             for j in range(dim[1]):
9785  */
9786   __pyx_t_1 = (__pyx_v_dim[0]);
9787   __pyx_t_2 = __pyx_t_1;
9788   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
9789     __pyx_v_i = __pyx_t_3;
9790 
9791     /* "yt/geometry/particle_smooth.pyx":522
9792  *         cpos[0] = left_edge[0] + 0.5*dds[0]
9793  *         for i in range(dim[0]):
9794  *             cpos[1] = left_edge[1] + 0.5*dds[1]             # <<<<<<<<<<<<<<
9795  *             for j in range(dim[1]):
9796  *                 cpos[2] = left_edge[2] + 0.5*dds[2]
9797  */
9798     (__pyx_v_cpos[1]) = ((__pyx_v_left_edge[1]) + (0.5 * (__pyx_v_dds[1])));
9799 
9800     /* "yt/geometry/particle_smooth.pyx":523
9801  *         for i in range(dim[0]):
9802  *             cpos[1] = left_edge[1] + 0.5*dds[1]
9803  *             for j in range(dim[1]):             # <<<<<<<<<<<<<<
9804  *                 cpos[2] = left_edge[2] + 0.5*dds[2]
9805  *                 for k in range(dim[2]):
9806  */
9807     __pyx_t_4 = (__pyx_v_dim[1]);
9808     __pyx_t_5 = __pyx_t_4;
9809     for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
9810       __pyx_v_j = __pyx_t_6;
9811 
9812       /* "yt/geometry/particle_smooth.pyx":524
9813  *             cpos[1] = left_edge[1] + 0.5*dds[1]
9814  *             for j in range(dim[1]):
9815  *                 cpos[2] = left_edge[2] + 0.5*dds[2]             # <<<<<<<<<<<<<<
9816  *                 for k in range(dim[2]):
9817  *                     self.pos_setup(cpos, opos)
9818  */
9819       (__pyx_v_cpos[2]) = ((__pyx_v_left_edge[2]) + (0.5 * (__pyx_v_dds[2])));
9820 
9821       /* "yt/geometry/particle_smooth.pyx":525
9822  *             for j in range(dim[1]):
9823  *                 cpos[2] = left_edge[2] + 0.5*dds[2]
9824  *                 for k in range(dim[2]):             # <<<<<<<<<<<<<<
9825  *                     self.pos_setup(cpos, opos)
9826  *                     nneighbors = self.neighbor_search(opos, octree,
9827  */
9828       __pyx_t_7 = (__pyx_v_dim[2]);
9829       __pyx_t_8 = __pyx_t_7;
9830       for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
9831         __pyx_v_k = __pyx_t_9;
9832 
9833         /* "yt/geometry/particle_smooth.pyx":526
9834  *                 cpos[2] = left_edge[2] + 0.5*dds[2]
9835  *                 for k in range(dim[2]):
9836  *                     self.pos_setup(cpos, opos)             # <<<<<<<<<<<<<<
9837  *                     nneighbors = self.neighbor_search(opos, octree,
9838  *                                     nind, nsize, nneighbors, domain_id, &oct, 0)
9839  */
9840         __pyx_v_self->pos_setup(__pyx_v_cpos, __pyx_v_opos);
9841 
9842         /* "yt/geometry/particle_smooth.pyx":527
9843  *                 for k in range(dim[2]):
9844  *                     self.pos_setup(cpos, opos)
9845  *                     nneighbors = self.neighbor_search(opos, octree,             # <<<<<<<<<<<<<<
9846  *                                     nind, nsize, nneighbors, domain_id, &oct, 0)
9847  *                     self.neighbor_find(nneighbors, nind[0], doffs, pcounts,
9848  */
9849         __pyx_t_11.__pyx_n = 2;
9850         __pyx_t_11.oct = (&__pyx_v_oct);
9851         __pyx_t_11.extra_layer = 0;
9852         __pyx_t_10 = ((struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self->__pyx_vtab)->neighbor_search(__pyx_v_self, __pyx_v_opos, __pyx_v_octree, __pyx_v_nind, __pyx_v_nsize, __pyx_v_nneighbors, __pyx_v_domain_id, &__pyx_t_11);
9853         __pyx_v_nneighbors = __pyx_t_10;
9854 
9855         /* "yt/geometry/particle_smooth.pyx":529
9856  *                     nneighbors = self.neighbor_search(opos, octree,
9857  *                                     nind, nsize, nneighbors, domain_id, &oct, 0)
9858  *                     self.neighbor_find(nneighbors, nind[0], doffs, pcounts,             # <<<<<<<<<<<<<<
9859  *                                        pinds, ppos, opos, oct_left_edges,
9860  *                                        oct_dds, dq)
9861  */
9862         ((struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self->__pyx_vtab)->neighbor_find(__pyx_v_self, __pyx_v_nneighbors, (__pyx_v_nind[0]), __pyx_v_doffs, __pyx_v_pcounts, __pyx_v_pinds, __pyx_v_ppos, __pyx_v_opos, __pyx_v_oct_left_edges, __pyx_v_oct_dds, __pyx_v_dq);
9863 
9864         /* "yt/geometry/particle_smooth.pyx":533
9865  *                                        oct_dds, dq)
9866  *                     # Now we have all our neighbors in our neighbor list.
9867  *                     if dq.curn <-1*dq.maxn:             # <<<<<<<<<<<<<<
9868  *                         ntot = nntot = 0
9869  *                         for m in range(nneighbors):
9870  */
9871         __pyx_t_12 = ((__pyx_v_dq->__pyx_base.curn < (-1L * __pyx_v_dq->__pyx_base.maxn)) != 0);
9872         if (__pyx_t_12) {
9873 
9874           /* "yt/geometry/particle_smooth.pyx":534
9875  *                     # Now we have all our neighbors in our neighbor list.
9876  *                     if dq.curn <-1*dq.maxn:
9877  *                         ntot = nntot = 0             # <<<<<<<<<<<<<<
9878  *                         for m in range(nneighbors):
9879  *                             if nind[0][m] < 0: continue
9880  */
9881           __pyx_v_ntot = 0;
9882           __pyx_v_nntot = 0;
9883 
9884           /* "yt/geometry/particle_smooth.pyx":535
9885  *                     if dq.curn <-1*dq.maxn:
9886  *                         ntot = nntot = 0
9887  *                         for m in range(nneighbors):             # <<<<<<<<<<<<<<
9888  *                             if nind[0][m] < 0: continue
9889  *                             nntot += 1
9890  */
9891           __pyx_t_10 = __pyx_v_nneighbors;
9892           __pyx_t_13 = __pyx_t_10;
9893           for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
9894             __pyx_v_m = __pyx_t_14;
9895 
9896             /* "yt/geometry/particle_smooth.pyx":536
9897  *                         ntot = nntot = 0
9898  *                         for m in range(nneighbors):
9899  *                             if nind[0][m] < 0: continue             # <<<<<<<<<<<<<<
9900  *                             nntot += 1
9901  *                             ntot += pcounts[nind[0][m]]
9902  */
9903             __pyx_t_12 = ((((__pyx_v_nind[0])[__pyx_v_m]) < 0) != 0);
9904             if (__pyx_t_12) {
9905               goto __pyx_L10_continue;
9906             }
9907 
9908             /* "yt/geometry/particle_smooth.pyx":537
9909  *                         for m in range(nneighbors):
9910  *                             if nind[0][m] < 0: continue
9911  *                             nntot += 1             # <<<<<<<<<<<<<<
9912  *                             ntot += pcounts[nind[0][m]]
9913  *                         print("SOMETHING WRONG", dq.curn, nneighbors, ntot, nntot)
9914  */
9915             __pyx_v_nntot = (__pyx_v_nntot + 1);
9916 
9917             /* "yt/geometry/particle_smooth.pyx":538
9918  *                             if nind[0][m] < 0: continue
9919  *                             nntot += 1
9920  *                             ntot += pcounts[nind[0][m]]             # <<<<<<<<<<<<<<
9921  *                         print("SOMETHING WRONG", dq.curn, nneighbors, ntot, nntot)
9922  *                     self.process(offset, i, j, k, dim, opos, fields,
9923  */
9924             __pyx_t_15 = ((__pyx_v_nind[0])[__pyx_v_m]);
9925             __pyx_v_ntot = (__pyx_v_ntot + (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_pcounts.data + __pyx_t_15 * __pyx_v_pcounts.strides[0]) ))));
9926             __pyx_L10_continue:;
9927           }
9928 
9929           /* "yt/geometry/particle_smooth.pyx":539
9930  *                             nntot += 1
9931  *                             ntot += pcounts[nind[0][m]]
9932  *                         print("SOMETHING WRONG", dq.curn, nneighbors, ntot, nntot)             # <<<<<<<<<<<<<<
9933  *                     self.process(offset, i, j, k, dim, opos, fields,
9934  *                                  index_fields, dq)
9935  */
9936           __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_dq->__pyx_base.curn); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 539, __pyx_L1_error)
9937           __Pyx_GOTREF(__pyx_t_16);
9938           __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_nneighbors); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 539, __pyx_L1_error)
9939           __Pyx_GOTREF(__pyx_t_17);
9940           __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_ntot); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 539, __pyx_L1_error)
9941           __Pyx_GOTREF(__pyx_t_18);
9942           __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_nntot); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 539, __pyx_L1_error)
9943           __Pyx_GOTREF(__pyx_t_19);
9944           __pyx_t_20 = PyTuple_New(5); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 539, __pyx_L1_error)
9945           __Pyx_GOTREF(__pyx_t_20);
9946           __Pyx_INCREF(__pyx_kp_s_SOMETHING_WRONG);
9947           __Pyx_GIVEREF(__pyx_kp_s_SOMETHING_WRONG);
9948           PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_kp_s_SOMETHING_WRONG);
9949           __Pyx_GIVEREF(__pyx_t_16);
9950           PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_16);
9951           __Pyx_GIVEREF(__pyx_t_17);
9952           PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_t_17);
9953           __Pyx_GIVEREF(__pyx_t_18);
9954           PyTuple_SET_ITEM(__pyx_t_20, 3, __pyx_t_18);
9955           __Pyx_GIVEREF(__pyx_t_19);
9956           PyTuple_SET_ITEM(__pyx_t_20, 4, __pyx_t_19);
9957           __pyx_t_16 = 0;
9958           __pyx_t_17 = 0;
9959           __pyx_t_18 = 0;
9960           __pyx_t_19 = 0;
9961           if (__Pyx_PrintOne(0, __pyx_t_20) < 0) __PYX_ERR(0, 539, __pyx_L1_error)
9962           __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
9963 
9964           /* "yt/geometry/particle_smooth.pyx":533
9965  *                                        oct_dds, dq)
9966  *                     # Now we have all our neighbors in our neighbor list.
9967  *                     if dq.curn <-1*dq.maxn:             # <<<<<<<<<<<<<<
9968  *                         ntot = nntot = 0
9969  *                         for m in range(nneighbors):
9970  */
9971         }
9972 
9973         /* "yt/geometry/particle_smooth.pyx":540
9974  *                             ntot += pcounts[nind[0][m]]
9975  *                         print("SOMETHING WRONG", dq.curn, nneighbors, ntot, nntot)
9976  *                     self.process(offset, i, j, k, dim, opos, fields,             # <<<<<<<<<<<<<<
9977  *                                  index_fields, dq)
9978  *                     cpos[2] += dds[2]
9979  */
9980         ((struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self->__pyx_vtab)->process(__pyx_v_self, __pyx_v_offset, __pyx_v_i, __pyx_v_j, __pyx_v_k, __pyx_v_dim, __pyx_v_opos, __pyx_v_fields, __pyx_v_index_fields, __pyx_v_dq);
9981 
9982         /* "yt/geometry/particle_smooth.pyx":542
9983  *                     self.process(offset, i, j, k, dim, opos, fields,
9984  *                                  index_fields, dq)
9985  *                     cpos[2] += dds[2]             # <<<<<<<<<<<<<<
9986  *                 cpos[1] += dds[1]
9987  *             cpos[0] += dds[0]
9988  */
9989         __pyx_t_21 = 2;
9990         (__pyx_v_cpos[__pyx_t_21]) = ((__pyx_v_cpos[__pyx_t_21]) + (__pyx_v_dds[2]));
9991       }
9992 
9993       /* "yt/geometry/particle_smooth.pyx":543
9994  *                                  index_fields, dq)
9995  *                     cpos[2] += dds[2]
9996  *                 cpos[1] += dds[1]             # <<<<<<<<<<<<<<
9997  *             cpos[0] += dds[0]
9998  *
9999  */
10000       __pyx_t_21 = 1;
10001       (__pyx_v_cpos[__pyx_t_21]) = ((__pyx_v_cpos[__pyx_t_21]) + (__pyx_v_dds[1]));
10002     }
10003 
10004     /* "yt/geometry/particle_smooth.pyx":544
10005  *                     cpos[2] += dds[2]
10006  *                 cpos[1] += dds[1]
10007  *             cpos[0] += dds[0]             # <<<<<<<<<<<<<<
10008  *
10009  *     @cython.cdivision(True)
10010  */
10011     __pyx_t_21 = 0;
10012     (__pyx_v_cpos[__pyx_t_21]) = ((__pyx_v_cpos[__pyx_t_21]) + (__pyx_v_dds[0]));
10013   }
10014 
10015   /* "yt/geometry/particle_smooth.pyx":502
10016  *     @cython.wraparound(False)
10017  *     @cython.initializedcheck(False)
10018  *     cdef void neighbor_process(self, int dim[3], np.float64_t left_edge[3],             # <<<<<<<<<<<<<<
10019  *                                np.float64_t dds[3], np.float64_t[:,:] ppos,
10020  *                                np.float64_t **fields,
10021  */
10022 
10023   /* function exit code */
10024   goto __pyx_L0;
10025   __pyx_L1_error:;
10026   __Pyx_XDECREF(__pyx_t_16);
10027   __Pyx_XDECREF(__pyx_t_17);
10028   __Pyx_XDECREF(__pyx_t_18);
10029   __Pyx_XDECREF(__pyx_t_19);
10030   __Pyx_XDECREF(__pyx_t_20);
10031   __Pyx_WriteUnraisable("yt.geometry.particle_smooth.ParticleSmoothOperation.neighbor_process", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
10032   __pyx_L0:;
10033   __Pyx_RefNannyFinishContext();
10034 }
10035 
10036 /* "yt/geometry/particle_smooth.pyx":550
10037  *     @cython.wraparound(False)
10038  *     @cython.initializedcheck(False)
10039  *     cdef void neighbor_process_particle(self, np.float64_t cpos[3],             # <<<<<<<<<<<<<<
10040  *                                np.float64_t[:,:] ppos,
10041  *                                np.float64_t **fields,
10042  */
10043 
__pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_process_particle(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation * __pyx_v_self,__pyx_t_5numpy_float64_t * __pyx_v_cpos,__Pyx_memviewslice __pyx_v_ppos,__pyx_t_5numpy_float64_t ** __pyx_v_fields,__Pyx_memviewslice __pyx_v_doffs,__pyx_t_5numpy_int64_t ** __pyx_v_nind,__Pyx_memviewslice __pyx_v_pinds,__Pyx_memviewslice __pyx_v_pcounts,__pyx_t_5numpy_int64_t __pyx_v_offset,__pyx_t_5numpy_float64_t ** __pyx_v_index_fields,struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_octree,__pyx_t_5numpy_int64_t __pyx_v_domain_id,int * __pyx_v_nsize,struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue * __pyx_v_dq)10044 static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_process_particle(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_cpos, __Pyx_memviewslice __pyx_v_ppos, __pyx_t_5numpy_float64_t **__pyx_v_fields, __Pyx_memviewslice __pyx_v_doffs, __pyx_t_5numpy_int64_t **__pyx_v_nind, __Pyx_memviewslice __pyx_v_pinds, __Pyx_memviewslice __pyx_v_pcounts, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_octree, __pyx_t_5numpy_int64_t __pyx_v_domain_id, int *__pyx_v_nsize, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq) {
10045   int __pyx_v_i;
10046   int __pyx_v_j;
10047   int __pyx_v_k;
10048   int __pyx_v_dim[3];
10049   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_oct;
10050   __pyx_t_5numpy_int64_t __pyx_v_nneighbors;
10051   __pyx_t_5numpy_float64_t __pyx_v_opos[3];
10052   __Pyx_RefNannyDeclarations
10053   int __pyx_t_1;
10054   struct __pyx_opt_args_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_search __pyx_t_2;
10055   __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
10056   __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
10057   __Pyx_RefNannySetupContext("neighbor_process_particle", 0);
10058 
10059   /* "yt/geometry/particle_smooth.pyx":565
10060  *         cdef int i, j, k, ntot, nntot, m
10061  *         cdef int dim[3]
10062  *         cdef Oct *oct = NULL             # <<<<<<<<<<<<<<
10063  *         cdef np.int64_t nneighbors = 0
10064  *         i = j = k = 0
10065  */
10066   __pyx_v_oct = NULL;
10067 
10068   /* "yt/geometry/particle_smooth.pyx":566
10069  *         cdef int dim[3]
10070  *         cdef Oct *oct = NULL
10071  *         cdef np.int64_t nneighbors = 0             # <<<<<<<<<<<<<<
10072  *         i = j = k = 0
10073  *         dim[0] = dim[1] = dim[2] = 1
10074  */
10075   __pyx_v_nneighbors = 0;
10076 
10077   /* "yt/geometry/particle_smooth.pyx":567
10078  *         cdef Oct *oct = NULL
10079  *         cdef np.int64_t nneighbors = 0
10080  *         i = j = k = 0             # <<<<<<<<<<<<<<
10081  *         dim[0] = dim[1] = dim[2] = 1
10082  *         cdef np.float64_t opos[3]
10083  */
10084   __pyx_v_i = 0;
10085   __pyx_v_j = 0;
10086   __pyx_v_k = 0;
10087 
10088   /* "yt/geometry/particle_smooth.pyx":568
10089  *         cdef np.int64_t nneighbors = 0
10090  *         i = j = k = 0
10091  *         dim[0] = dim[1] = dim[2] = 1             # <<<<<<<<<<<<<<
10092  *         cdef np.float64_t opos[3]
10093  *         self.pos_setup(cpos, opos)
10094  */
10095   (__pyx_v_dim[0]) = 1;
10096   (__pyx_v_dim[1]) = 1;
10097   (__pyx_v_dim[2]) = 1;
10098 
10099   /* "yt/geometry/particle_smooth.pyx":570
10100  *         dim[0] = dim[1] = dim[2] = 1
10101  *         cdef np.float64_t opos[3]
10102  *         self.pos_setup(cpos, opos)             # <<<<<<<<<<<<<<
10103  *         nneighbors = self.neighbor_search(opos, octree,
10104  *                         nind, nsize, nneighbors, domain_id, &oct, 0)
10105  */
10106   __pyx_v_self->pos_setup(__pyx_v_cpos, __pyx_v_opos);
10107 
10108   /* "yt/geometry/particle_smooth.pyx":571
10109  *         cdef np.float64_t opos[3]
10110  *         self.pos_setup(cpos, opos)
10111  *         nneighbors = self.neighbor_search(opos, octree,             # <<<<<<<<<<<<<<
10112  *                         nind, nsize, nneighbors, domain_id, &oct, 0)
10113  *         self.neighbor_find(nneighbors, nind[0], doffs, pcounts, pinds, ppos,
10114  */
10115   __pyx_t_2.__pyx_n = 2;
10116   __pyx_t_2.oct = (&__pyx_v_oct);
10117   __pyx_t_2.extra_layer = 0;
10118   __pyx_t_1 = ((struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self->__pyx_vtab)->neighbor_search(__pyx_v_self, __pyx_v_opos, __pyx_v_octree, __pyx_v_nind, __pyx_v_nsize, __pyx_v_nneighbors, __pyx_v_domain_id, &__pyx_t_2);
10119   __pyx_v_nneighbors = __pyx_t_1;
10120 
10121   /* "yt/geometry/particle_smooth.pyx":574
10122  *                         nind, nsize, nneighbors, domain_id, &oct, 0)
10123  *         self.neighbor_find(nneighbors, nind[0], doffs, pcounts, pinds, ppos,
10124  *                            opos, None, None, dq)             # <<<<<<<<<<<<<<
10125  *         self.process(offset, i, j, k, dim, opos, fields, index_fields, dq)
10126  *
10127  */
10128   __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 574, __pyx_L1_error)
10129   __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 574, __pyx_L1_error)
10130 
10131   /* "yt/geometry/particle_smooth.pyx":573
10132  *         nneighbors = self.neighbor_search(opos, octree,
10133  *                         nind, nsize, nneighbors, domain_id, &oct, 0)
10134  *         self.neighbor_find(nneighbors, nind[0], doffs, pcounts, pinds, ppos,             # <<<<<<<<<<<<<<
10135  *                            opos, None, None, dq)
10136  *         self.process(offset, i, j, k, dim, opos, fields, index_fields, dq)
10137  */
10138   ((struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self->__pyx_vtab)->neighbor_find(__pyx_v_self, __pyx_v_nneighbors, (__pyx_v_nind[0]), __pyx_v_doffs, __pyx_v_pcounts, __pyx_v_pinds, __pyx_v_ppos, __pyx_v_opos, __pyx_t_3, __pyx_t_4, __pyx_v_dq);
10139   __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
10140   __pyx_t_3.memview = NULL;
10141   __pyx_t_3.data = NULL;
10142   __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
10143   __pyx_t_4.memview = NULL;
10144   __pyx_t_4.data = NULL;
10145 
10146   /* "yt/geometry/particle_smooth.pyx":575
10147  *         self.neighbor_find(nneighbors, nind[0], doffs, pcounts, pinds, ppos,
10148  *                            opos, None, None, dq)
10149  *         self.process(offset, i, j, k, dim, opos, fields, index_fields, dq)             # <<<<<<<<<<<<<<
10150  *
10151  * cdef class VolumeWeightedSmooth(ParticleSmoothOperation):
10152  */
10153   ((struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self->__pyx_vtab)->process(__pyx_v_self, __pyx_v_offset, __pyx_v_i, __pyx_v_j, __pyx_v_k, __pyx_v_dim, __pyx_v_opos, __pyx_v_fields, __pyx_v_index_fields, __pyx_v_dq);
10154 
10155   /* "yt/geometry/particle_smooth.pyx":550
10156  *     @cython.wraparound(False)
10157  *     @cython.initializedcheck(False)
10158  *     cdef void neighbor_process_particle(self, np.float64_t cpos[3],             # <<<<<<<<<<<<<<
10159  *                                np.float64_t[:,:] ppos,
10160  *                                np.float64_t **fields,
10161  */
10162 
10163   /* function exit code */
10164   goto __pyx_L0;
10165   __pyx_L1_error:;
10166   __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
10167   __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
10168   __Pyx_WriteUnraisable("yt.geometry.particle_smooth.ParticleSmoothOperation.neighbor_process_particle", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
10169   __pyx_L0:;
10170   __Pyx_RefNannyFinishContext();
10171 }
10172 
10173 /* "yt/geometry/particle_smooth.pxd":36
10174  *     # We assume each will allocate and define their own temporary storage
10175  *     cdef kernel_func sph_kernel
10176  *     cdef public object nvals             # <<<<<<<<<<<<<<
10177  *     cdef np.float64_t DW[3]
10178  *     cdef int nfields
10179  */
10180 
10181 /* Python wrapper */
10182 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals_1__get__(PyObject * __pyx_v_self)10183 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals_1__get__(PyObject *__pyx_v_self) {
10184   PyObject *__pyx_r = 0;
10185   __Pyx_RefNannyDeclarations
10186   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10187   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals___get__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self));
10188 
10189   /* function exit code */
10190   __Pyx_RefNannyFinishContext();
10191   return __pyx_r;
10192 }
10193 
__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals___get__(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation * __pyx_v_self)10194 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals___get__(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self) {
10195   PyObject *__pyx_r = NULL;
10196   __Pyx_RefNannyDeclarations
10197   __Pyx_RefNannySetupContext("__get__", 0);
10198   __Pyx_XDECREF(__pyx_r);
10199   __Pyx_INCREF(__pyx_v_self->nvals);
10200   __pyx_r = __pyx_v_self->nvals;
10201   goto __pyx_L0;
10202 
10203   /* function exit code */
10204   __pyx_L0:;
10205   __Pyx_XGIVEREF(__pyx_r);
10206   __Pyx_RefNannyFinishContext();
10207   return __pyx_r;
10208 }
10209 
10210 /* Python wrapper */
10211 static int __pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)10212 static int __pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
10213   int __pyx_r;
10214   __Pyx_RefNannyDeclarations
10215   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
10216   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals_2__set__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self), ((PyObject *)__pyx_v_value));
10217 
10218   /* function exit code */
10219   __Pyx_RefNannyFinishContext();
10220   return __pyx_r;
10221 }
10222 
__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals_2__set__(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation * __pyx_v_self,PyObject * __pyx_v_value)10223 static int __pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals_2__set__(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, PyObject *__pyx_v_value) {
10224   int __pyx_r;
10225   __Pyx_RefNannyDeclarations
10226   __Pyx_RefNannySetupContext("__set__", 0);
10227   __Pyx_INCREF(__pyx_v_value);
10228   __Pyx_GIVEREF(__pyx_v_value);
10229   __Pyx_GOTREF(__pyx_v_self->nvals);
10230   __Pyx_DECREF(__pyx_v_self->nvals);
10231   __pyx_v_self->nvals = __pyx_v_value;
10232 
10233   /* function exit code */
10234   __pyx_r = 0;
10235   __Pyx_RefNannyFinishContext();
10236   return __pyx_r;
10237 }
10238 
10239 /* Python wrapper */
10240 static int __pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals_5__del__(PyObject * __pyx_v_self)10241 static int __pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals_5__del__(PyObject *__pyx_v_self) {
10242   int __pyx_r;
10243   __Pyx_RefNannyDeclarations
10244   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
10245   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals_4__del__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self));
10246 
10247   /* function exit code */
10248   __Pyx_RefNannyFinishContext();
10249   return __pyx_r;
10250 }
10251 
__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals_4__del__(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation * __pyx_v_self)10252 static int __pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals_4__del__(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self) {
10253   int __pyx_r;
10254   __Pyx_RefNannyDeclarations
10255   __Pyx_RefNannySetupContext("__del__", 0);
10256   __Pyx_INCREF(Py_None);
10257   __Pyx_GIVEREF(Py_None);
10258   __Pyx_GOTREF(__pyx_v_self->nvals);
10259   __Pyx_DECREF(__pyx_v_self->nvals);
10260   __pyx_v_self->nvals = Py_None;
10261 
10262   /* function exit code */
10263   __pyx_r = 0;
10264   __Pyx_RefNannyFinishContext();
10265   return __pyx_r;
10266 }
10267 
10268 /* "(tree fragment)":1
10269  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
10270  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
10271  * def __setstate_cython__(self, __pyx_state):
10272  */
10273 
10274 /* Python wrapper */
10275 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_13__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)10276 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10277   PyObject *__pyx_r = 0;
10278   __Pyx_RefNannyDeclarations
10279   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
10280   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_12__reduce_cython__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self));
10281 
10282   /* function exit code */
10283   __Pyx_RefNannyFinishContext();
10284   return __pyx_r;
10285 }
10286 
__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation * __pyx_v_self)10287 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self) {
10288   PyObject *__pyx_r = NULL;
10289   __Pyx_RefNannyDeclarations
10290   PyObject *__pyx_t_1 = NULL;
10291   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
10292 
10293   /* "(tree fragment)":2
10294  * def __reduce_cython__(self):
10295  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
10296  * def __setstate_cython__(self, __pyx_state):
10297  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
10298  */
10299   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
10300   __Pyx_GOTREF(__pyx_t_1);
10301   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10302   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10303   __PYX_ERR(1, 2, __pyx_L1_error)
10304 
10305   /* "(tree fragment)":1
10306  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
10307  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
10308  * def __setstate_cython__(self, __pyx_state):
10309  */
10310 
10311   /* function exit code */
10312   __pyx_L1_error:;
10313   __Pyx_XDECREF(__pyx_t_1);
10314   __Pyx_AddTraceback("yt.geometry.particle_smooth.ParticleSmoothOperation.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10315   __pyx_r = NULL;
10316   __Pyx_XGIVEREF(__pyx_r);
10317   __Pyx_RefNannyFinishContext();
10318   return __pyx_r;
10319 }
10320 
10321 /* "(tree fragment)":3
10322  * def __reduce_cython__(self):
10323  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
10324  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
10325  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
10326  */
10327 
10328 /* Python wrapper */
10329 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_15__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)10330 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10331   PyObject *__pyx_r = 0;
10332   __Pyx_RefNannyDeclarations
10333   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
10334   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_14__setstate_cython__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10335 
10336   /* function exit code */
10337   __Pyx_RefNannyFinishContext();
10338   return __pyx_r;
10339 }
10340 
__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)10341 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
10342   PyObject *__pyx_r = NULL;
10343   __Pyx_RefNannyDeclarations
10344   PyObject *__pyx_t_1 = NULL;
10345   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10346 
10347   /* "(tree fragment)":4
10348  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
10349  * def __setstate_cython__(self, __pyx_state):
10350  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
10351  */
10352   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
10353   __Pyx_GOTREF(__pyx_t_1);
10354   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10355   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10356   __PYX_ERR(1, 4, __pyx_L1_error)
10357 
10358   /* "(tree fragment)":3
10359  * def __reduce_cython__(self):
10360  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
10361  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
10362  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
10363  */
10364 
10365   /* function exit code */
10366   __pyx_L1_error:;
10367   __Pyx_XDECREF(__pyx_t_1);
10368   __Pyx_AddTraceback("yt.geometry.particle_smooth.ParticleSmoothOperation.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10369   __pyx_r = NULL;
10370   __Pyx_XGIVEREF(__pyx_r);
10371   __Pyx_RefNannyFinishContext();
10372   return __pyx_r;
10373 }
10374 
10375 /* "yt/geometry/particle_smooth.pyx":586
10376  *     cdef np.float64_t **fp
10377  *     cdef public object vals
10378  *     def initialize(self):             # <<<<<<<<<<<<<<
10379  *         cdef int i
10380  *         if self.nfields < 4:
10381  */
10382 
10383 /* Python wrapper */
10384 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_1initialize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_1initialize(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)10385 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_1initialize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10386   PyObject *__pyx_r = 0;
10387   __Pyx_RefNannyDeclarations
10388   __Pyx_RefNannySetupContext("initialize (wrapper)", 0);
10389   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_initialize(((struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *)__pyx_v_self));
10390 
10391   /* function exit code */
10392   __Pyx_RefNannyFinishContext();
10393   return __pyx_r;
10394 }
10395 
__pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_initialize(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth * __pyx_v_self)10396 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_initialize(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self) {
10397   int __pyx_v_i;
10398   PyArrayObject *__pyx_v_tarr = 0;
10399   PyObject *__pyx_r = NULL;
10400   __Pyx_RefNannyDeclarations
10401   int __pyx_t_1;
10402   PyObject *__pyx_t_2 = NULL;
10403   long __pyx_t_3;
10404   long __pyx_t_4;
10405   int __pyx_t_5;
10406   PyObject *__pyx_t_6 = NULL;
10407   PyObject *__pyx_t_7 = NULL;
10408   PyObject *__pyx_t_8 = NULL;
10409   int __pyx_t_9;
10410   __Pyx_RefNannySetupContext("initialize", 0);
10411 
10412   /* "yt/geometry/particle_smooth.pyx":588
10413  *     def initialize(self):
10414  *         cdef int i
10415  *         if self.nfields < 4:             # <<<<<<<<<<<<<<
10416  *             # We need four fields -- the mass should be the first, then the
10417  *             # smoothing length for particles, the normalization factor to
10418  */
10419   __pyx_t_1 = ((__pyx_v_self->__pyx_base.nfields < 4) != 0);
10420   if (unlikely(__pyx_t_1)) {
10421 
10422     /* "yt/geometry/particle_smooth.pyx":592
10423  *             # smoothing length for particles, the normalization factor to
10424  *             # ensure mass conservation, then the field we're smoothing.
10425  *             raise RuntimeError             # <<<<<<<<<<<<<<
10426  *         cdef np.ndarray tarr
10427  *         self.fp = <np.float64_t **> malloc(
10428  */
10429     __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
10430     __PYX_ERR(0, 592, __pyx_L1_error)
10431 
10432     /* "yt/geometry/particle_smooth.pyx":588
10433  *     def initialize(self):
10434  *         cdef int i
10435  *         if self.nfields < 4:             # <<<<<<<<<<<<<<
10436  *             # We need four fields -- the mass should be the first, then the
10437  *             # smoothing length for particles, the normalization factor to
10438  */
10439   }
10440 
10441   /* "yt/geometry/particle_smooth.pyx":594
10442  *             raise RuntimeError
10443  *         cdef np.ndarray tarr
10444  *         self.fp = <np.float64_t **> malloc(             # <<<<<<<<<<<<<<
10445  *             sizeof(np.float64_t *) * (self.nfields - 3))
10446  *         self.vals = []
10447  */
10448   __pyx_v_self->fp = ((__pyx_t_5numpy_float64_t **)malloc(((sizeof(__pyx_t_5numpy_float64_t *)) * (__pyx_v_self->__pyx_base.nfields - 3))));
10449 
10450   /* "yt/geometry/particle_smooth.pyx":596
10451  *         self.fp = <np.float64_t **> malloc(
10452  *             sizeof(np.float64_t *) * (self.nfields - 3))
10453  *         self.vals = []             # <<<<<<<<<<<<<<
10454  *         # We usually only allocate one field; if we are doing multiple field,
10455  *         # single-pass smoothing, then we might have more.
10456  */
10457   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 596, __pyx_L1_error)
10458   __Pyx_GOTREF(__pyx_t_2);
10459   __Pyx_GIVEREF(__pyx_t_2);
10460   __Pyx_GOTREF(__pyx_v_self->vals);
10461   __Pyx_DECREF(__pyx_v_self->vals);
10462   __pyx_v_self->vals = __pyx_t_2;
10463   __pyx_t_2 = 0;
10464 
10465   /* "yt/geometry/particle_smooth.pyx":599
10466  *         # We usually only allocate one field; if we are doing multiple field,
10467  *         # single-pass smoothing, then we might have more.
10468  *         for i in range(self.nfields - 3):             # <<<<<<<<<<<<<<
10469  *             tarr = np.zeros(self.nvals, dtype="float64", order="F")
10470  *             self.vals.append(tarr)
10471  */
10472   __pyx_t_3 = (__pyx_v_self->__pyx_base.nfields - 3);
10473   __pyx_t_4 = __pyx_t_3;
10474   for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
10475     __pyx_v_i = __pyx_t_5;
10476 
10477     /* "yt/geometry/particle_smooth.pyx":600
10478  *         # single-pass smoothing, then we might have more.
10479  *         for i in range(self.nfields - 3):
10480  *             tarr = np.zeros(self.nvals, dtype="float64", order="F")             # <<<<<<<<<<<<<<
10481  *             self.vals.append(tarr)
10482  *             self.fp[i] = <np.float64_t *> tarr.data
10483  */
10484     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 600, __pyx_L1_error)
10485     __Pyx_GOTREF(__pyx_t_2);
10486     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 600, __pyx_L1_error)
10487     __Pyx_GOTREF(__pyx_t_6);
10488     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10489     __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 600, __pyx_L1_error)
10490     __Pyx_GOTREF(__pyx_t_2);
10491     __Pyx_INCREF(__pyx_v_self->__pyx_base.nvals);
10492     __Pyx_GIVEREF(__pyx_v_self->__pyx_base.nvals);
10493     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->__pyx_base.nvals);
10494     __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 600, __pyx_L1_error)
10495     __Pyx_GOTREF(__pyx_t_7);
10496     if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 600, __pyx_L1_error)
10497     if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(0, 600, __pyx_L1_error)
10498     __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 600, __pyx_L1_error)
10499     __Pyx_GOTREF(__pyx_t_8);
10500     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10501     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10502     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10503     if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 600, __pyx_L1_error)
10504     __Pyx_XDECREF_SET(__pyx_v_tarr, ((PyArrayObject *)__pyx_t_8));
10505     __pyx_t_8 = 0;
10506 
10507     /* "yt/geometry/particle_smooth.pyx":601
10508  *         for i in range(self.nfields - 3):
10509  *             tarr = np.zeros(self.nvals, dtype="float64", order="F")
10510  *             self.vals.append(tarr)             # <<<<<<<<<<<<<<
10511  *             self.fp[i] = <np.float64_t *> tarr.data
10512  *
10513  */
10514     __pyx_t_9 = __Pyx_PyObject_Append(__pyx_v_self->vals, ((PyObject *)__pyx_v_tarr)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 601, __pyx_L1_error)
10515 
10516     /* "yt/geometry/particle_smooth.pyx":602
10517  *             tarr = np.zeros(self.nvals, dtype="float64", order="F")
10518  *             self.vals.append(tarr)
10519  *             self.fp[i] = <np.float64_t *> tarr.data             # <<<<<<<<<<<<<<
10520  *
10521  *     def finalize(self):
10522  */
10523     (__pyx_v_self->fp[__pyx_v_i]) = ((__pyx_t_5numpy_float64_t *)__pyx_v_tarr->data);
10524   }
10525 
10526   /* "yt/geometry/particle_smooth.pyx":586
10527  *     cdef np.float64_t **fp
10528  *     cdef public object vals
10529  *     def initialize(self):             # <<<<<<<<<<<<<<
10530  *         cdef int i
10531  *         if self.nfields < 4:
10532  */
10533 
10534   /* function exit code */
10535   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10536   goto __pyx_L0;
10537   __pyx_L1_error:;
10538   __Pyx_XDECREF(__pyx_t_2);
10539   __Pyx_XDECREF(__pyx_t_6);
10540   __Pyx_XDECREF(__pyx_t_7);
10541   __Pyx_XDECREF(__pyx_t_8);
10542   __Pyx_AddTraceback("yt.geometry.particle_smooth.VolumeWeightedSmooth.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
10543   __pyx_r = NULL;
10544   __pyx_L0:;
10545   __Pyx_XDECREF((PyObject *)__pyx_v_tarr);
10546   __Pyx_XGIVEREF(__pyx_r);
10547   __Pyx_RefNannyFinishContext();
10548   return __pyx_r;
10549 }
10550 
10551 /* "yt/geometry/particle_smooth.pyx":604
10552  *             self.fp[i] = <np.float64_t *> tarr.data
10553  *
10554  *     def finalize(self):             # <<<<<<<<<<<<<<
10555  *         free(self.fp)
10556  *         return self.vals
10557  */
10558 
10559 /* Python wrapper */
10560 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_3finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_3finalize(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)10561 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_3finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10562   PyObject *__pyx_r = 0;
10563   __Pyx_RefNannyDeclarations
10564   __Pyx_RefNannySetupContext("finalize (wrapper)", 0);
10565   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_2finalize(((struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *)__pyx_v_self));
10566 
10567   /* function exit code */
10568   __Pyx_RefNannyFinishContext();
10569   return __pyx_r;
10570 }
10571 
__pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_2finalize(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth * __pyx_v_self)10572 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_2finalize(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self) {
10573   PyObject *__pyx_r = NULL;
10574   __Pyx_RefNannyDeclarations
10575   __Pyx_RefNannySetupContext("finalize", 0);
10576 
10577   /* "yt/geometry/particle_smooth.pyx":605
10578  *
10579  *     def finalize(self):
10580  *         free(self.fp)             # <<<<<<<<<<<<<<
10581  *         return self.vals
10582  *
10583  */
10584   free(__pyx_v_self->fp);
10585 
10586   /* "yt/geometry/particle_smooth.pyx":606
10587  *     def finalize(self):
10588  *         free(self.fp)
10589  *         return self.vals             # <<<<<<<<<<<<<<
10590  *
10591  *     @cython.cdivision(True)
10592  */
10593   __Pyx_XDECREF(__pyx_r);
10594   __Pyx_INCREF(__pyx_v_self->vals);
10595   __pyx_r = __pyx_v_self->vals;
10596   goto __pyx_L0;
10597 
10598   /* "yt/geometry/particle_smooth.pyx":604
10599  *             self.fp[i] = <np.float64_t *> tarr.data
10600  *
10601  *     def finalize(self):             # <<<<<<<<<<<<<<
10602  *         free(self.fp)
10603  *         return self.vals
10604  */
10605 
10606   /* function exit code */
10607   __pyx_L0:;
10608   __Pyx_XGIVEREF(__pyx_r);
10609   __Pyx_RefNannyFinishContext();
10610   return __pyx_r;
10611 }
10612 
10613 /* "yt/geometry/particle_smooth.pyx":612
10614  *     @cython.wraparound(False)
10615  *     @cython.initializedcheck(False)
10616  *     cdef void process(self, np.int64_t offset, int i, int j, int k,             # <<<<<<<<<<<<<<
10617  *                       int dim[3], np.float64_t cpos[3], np.float64_t **fields,
10618  *                       np.float64_t **index_fields, DistanceQueue dq):
10619  */
10620 
__pyx_f_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth * __pyx_v_self,__pyx_t_5numpy_int64_t __pyx_v_offset,int __pyx_v_i,int __pyx_v_j,int __pyx_v_k,int * __pyx_v_dim,CYTHON_UNUSED __pyx_t_5numpy_float64_t * __pyx_v_cpos,__pyx_t_5numpy_float64_t ** __pyx_v_fields,__pyx_t_5numpy_float64_t ** __pyx_v_index_fields,struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue * __pyx_v_dq)10621 static void __pyx_f_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k, int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq) {
10622   int __pyx_v_n;
10623   int __pyx_v_fi;
10624   __pyx_t_5numpy_float64_t __pyx_v_weight;
10625   __pyx_t_5numpy_float64_t __pyx_v_r2;
10626   __pyx_t_5numpy_float64_t __pyx_v_val;
10627   __pyx_t_5numpy_float64_t __pyx_v_hsml;
10628   __pyx_t_5numpy_float64_t __pyx_v_dens;
10629   __pyx_t_5numpy_float64_t __pyx_v_mass;
10630   CYTHON_UNUSED __pyx_t_5numpy_float64_t __pyx_v_coeff;
10631   __pyx_t_5numpy_float64_t __pyx_v_max_r;
10632   __pyx_t_5numpy_float64_t __pyx_v_max_hsml;
10633   __pyx_t_5numpy_float64_t __pyx_v_ihsml;
10634   __pyx_t_5numpy_float64_t __pyx_v_ihsml3;
10635   __pyx_t_5numpy_float64_t __pyx_v_kern;
10636   __pyx_t_5numpy_int64_t __pyx_v_pn;
10637   __Pyx_RefNannyDeclarations
10638   int __pyx_t_1;
10639   int __pyx_t_2;
10640   int __pyx_t_3;
10641   __pyx_t_5numpy_float64_t __pyx_t_4;
10642   __pyx_t_5numpy_int64_t __pyx_t_5;
10643   int __pyx_t_6;
10644   long __pyx_t_7;
10645   long __pyx_t_8;
10646   int __pyx_t_9;
10647   int __pyx_t_10;
10648   __Pyx_RefNannySetupContext("process", 0);
10649 
10650   /* "yt/geometry/particle_smooth.pyx":620
10651  *         cdef np.float64_t weight, r2, val, hsml, dens, mass, coeff, max_r
10652  *         cdef np.float64_t max_hsml, ihsml, ihsml3, kern
10653  *         coeff = 0.0             # <<<<<<<<<<<<<<
10654  *         cdef np.int64_t pn
10655  *         # We get back our mass
10656  */
10657   __pyx_v_coeff = 0.0;
10658 
10659   /* "yt/geometry/particle_smooth.pyx":624
10660  *         # We get back our mass
10661  *         # rho_i = sum(j = 1 .. n) m_j * W_ij
10662  *         max_r = sqrt(dq.neighbors[dq.curn-1].r2)             # <<<<<<<<<<<<<<
10663  *         max_hsml = index_fields[0][gind(i,j,k,dim) + offset]
10664  *         for n in range(dq.curn):
10665  */
10666   __pyx_v_max_r = sqrt((__pyx_v_dq->neighbors[(__pyx_v_dq->__pyx_base.curn - 1)]).r2);
10667 
10668   /* "yt/geometry/particle_smooth.pyx":625
10669  *         # rho_i = sum(j = 1 .. n) m_j * W_ij
10670  *         max_r = sqrt(dq.neighbors[dq.curn-1].r2)
10671  *         max_hsml = index_fields[0][gind(i,j,k,dim) + offset]             # <<<<<<<<<<<<<<
10672  *         for n in range(dq.curn):
10673  *             # No normalization for the moment.
10674  */
10675   __pyx_v_max_hsml = ((__pyx_v_index_fields[0])[(__pyx_f_2yt_8geometry_16particle_deposit_gind(__pyx_v_i, __pyx_v_j, __pyx_v_k, __pyx_v_dim) + __pyx_v_offset)]);
10676 
10677   /* "yt/geometry/particle_smooth.pyx":626
10678  *         max_r = sqrt(dq.neighbors[dq.curn-1].r2)
10679  *         max_hsml = index_fields[0][gind(i,j,k,dim) + offset]
10680  *         for n in range(dq.curn):             # <<<<<<<<<<<<<<
10681  *             # No normalization for the moment.
10682  *             # fields[0] is the smoothing length.
10683  */
10684   __pyx_t_1 = __pyx_v_dq->__pyx_base.curn;
10685   __pyx_t_2 = __pyx_t_1;
10686   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
10687     __pyx_v_n = __pyx_t_3;
10688 
10689     /* "yt/geometry/particle_smooth.pyx":629
10690  *             # No normalization for the moment.
10691  *             # fields[0] is the smoothing length.
10692  *             r2 = dq.neighbors[n].r2             # <<<<<<<<<<<<<<
10693  *             pn = dq.neighbors[n].pn
10694  *             # Smoothing kernel weight function
10695  */
10696     __pyx_t_4 = (__pyx_v_dq->neighbors[__pyx_v_n]).r2;
10697     __pyx_v_r2 = __pyx_t_4;
10698 
10699     /* "yt/geometry/particle_smooth.pyx":630
10700  *             # fields[0] is the smoothing length.
10701  *             r2 = dq.neighbors[n].r2
10702  *             pn = dq.neighbors[n].pn             # <<<<<<<<<<<<<<
10703  *             # Smoothing kernel weight function
10704  *             mass = fields[0][pn]
10705  */
10706     __pyx_t_5 = (__pyx_v_dq->neighbors[__pyx_v_n]).pn;
10707     __pyx_v_pn = __pyx_t_5;
10708 
10709     /* "yt/geometry/particle_smooth.pyx":632
10710  *             pn = dq.neighbors[n].pn
10711  *             # Smoothing kernel weight function
10712  *             mass = fields[0][pn]             # <<<<<<<<<<<<<<
10713  *             hsml = fields[1][pn]
10714  *             dens = fields[2][pn]
10715  */
10716     __pyx_v_mass = ((__pyx_v_fields[0])[__pyx_v_pn]);
10717 
10718     /* "yt/geometry/particle_smooth.pyx":633
10719  *             # Smoothing kernel weight function
10720  *             mass = fields[0][pn]
10721  *             hsml = fields[1][pn]             # <<<<<<<<<<<<<<
10722  *             dens = fields[2][pn]
10723  *             if hsml < 0:
10724  */
10725     __pyx_v_hsml = ((__pyx_v_fields[1])[__pyx_v_pn]);
10726 
10727     /* "yt/geometry/particle_smooth.pyx":634
10728  *             mass = fields[0][pn]
10729  *             hsml = fields[1][pn]
10730  *             dens = fields[2][pn]             # <<<<<<<<<<<<<<
10731  *             if hsml < 0:
10732  *                 hsml = max_r
10733  */
10734     __pyx_v_dens = ((__pyx_v_fields[2])[__pyx_v_pn]);
10735 
10736     /* "yt/geometry/particle_smooth.pyx":635
10737  *             hsml = fields[1][pn]
10738  *             dens = fields[2][pn]
10739  *             if hsml < 0:             # <<<<<<<<<<<<<<
10740  *                 hsml = max_r
10741  *             if hsml == 0: continue
10742  */
10743     __pyx_t_6 = ((__pyx_v_hsml < 0.0) != 0);
10744     if (__pyx_t_6) {
10745 
10746       /* "yt/geometry/particle_smooth.pyx":636
10747  *             dens = fields[2][pn]
10748  *             if hsml < 0:
10749  *                 hsml = max_r             # <<<<<<<<<<<<<<
10750  *             if hsml == 0: continue
10751  *             ihsml = 1.0/hsml
10752  */
10753       __pyx_v_hsml = __pyx_v_max_r;
10754 
10755       /* "yt/geometry/particle_smooth.pyx":635
10756  *             hsml = fields[1][pn]
10757  *             dens = fields[2][pn]
10758  *             if hsml < 0:             # <<<<<<<<<<<<<<
10759  *                 hsml = max_r
10760  *             if hsml == 0: continue
10761  */
10762     }
10763 
10764     /* "yt/geometry/particle_smooth.pyx":637
10765  *             if hsml < 0:
10766  *                 hsml = max_r
10767  *             if hsml == 0: continue             # <<<<<<<<<<<<<<
10768  *             ihsml = 1.0/hsml
10769  *             hsml = fmax(max_hsml/2.0, hsml)
10770  */
10771     __pyx_t_6 = ((__pyx_v_hsml == 0.0) != 0);
10772     if (__pyx_t_6) {
10773       goto __pyx_L3_continue;
10774     }
10775 
10776     /* "yt/geometry/particle_smooth.pyx":638
10777  *                 hsml = max_r
10778  *             if hsml == 0: continue
10779  *             ihsml = 1.0/hsml             # <<<<<<<<<<<<<<
10780  *             hsml = fmax(max_hsml/2.0, hsml)
10781  *             ihsml3 = ihsml*ihsml*ihsml
10782  */
10783     __pyx_v_ihsml = (1.0 / __pyx_v_hsml);
10784 
10785     /* "yt/geometry/particle_smooth.pyx":639
10786  *             if hsml == 0: continue
10787  *             ihsml = 1.0/hsml
10788  *             hsml = fmax(max_hsml/2.0, hsml)             # <<<<<<<<<<<<<<
10789  *             ihsml3 = ihsml*ihsml*ihsml
10790  *             # Usually this density has been computed
10791  */
10792     __pyx_v_hsml = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((__pyx_v_max_hsml / 2.0), __pyx_v_hsml);
10793 
10794     /* "yt/geometry/particle_smooth.pyx":640
10795  *             ihsml = 1.0/hsml
10796  *             hsml = fmax(max_hsml/2.0, hsml)
10797  *             ihsml3 = ihsml*ihsml*ihsml             # <<<<<<<<<<<<<<
10798  *             # Usually this density has been computed
10799  *             if dens == 0.0: continue
10800  */
10801     __pyx_v_ihsml3 = ((__pyx_v_ihsml * __pyx_v_ihsml) * __pyx_v_ihsml);
10802 
10803     /* "yt/geometry/particle_smooth.pyx":642
10804  *             ihsml3 = ihsml*ihsml*ihsml
10805  *             # Usually this density has been computed
10806  *             if dens == 0.0: continue             # <<<<<<<<<<<<<<
10807  *             weight = (mass / dens) * ihsml3
10808  *             kern = self.sph_kernel(sqrt(r2) * ihsml)
10809  */
10810     __pyx_t_6 = ((__pyx_v_dens == 0.0) != 0);
10811     if (__pyx_t_6) {
10812       goto __pyx_L3_continue;
10813     }
10814 
10815     /* "yt/geometry/particle_smooth.pyx":643
10816  *             # Usually this density has been computed
10817  *             if dens == 0.0: continue
10818  *             weight = (mass / dens) * ihsml3             # <<<<<<<<<<<<<<
10819  *             kern = self.sph_kernel(sqrt(r2) * ihsml)
10820  *             weight *= kern
10821  */
10822     __pyx_v_weight = ((__pyx_v_mass / __pyx_v_dens) * __pyx_v_ihsml3);
10823 
10824     /* "yt/geometry/particle_smooth.pyx":644
10825  *             if dens == 0.0: continue
10826  *             weight = (mass / dens) * ihsml3
10827  *             kern = self.sph_kernel(sqrt(r2) * ihsml)             # <<<<<<<<<<<<<<
10828  *             weight *= kern
10829  *             # Mass of the particle times the value
10830  */
10831     __pyx_v_kern = __pyx_v_self->__pyx_base.sph_kernel((sqrt(__pyx_v_r2) * __pyx_v_ihsml));
10832 
10833     /* "yt/geometry/particle_smooth.pyx":645
10834  *             weight = (mass / dens) * ihsml3
10835  *             kern = self.sph_kernel(sqrt(r2) * ihsml)
10836  *             weight *= kern             # <<<<<<<<<<<<<<
10837  *             # Mass of the particle times the value
10838  *             for fi in range(self.nfields - 3):
10839  */
10840     __pyx_v_weight = (__pyx_v_weight * __pyx_v_kern);
10841 
10842     /* "yt/geometry/particle_smooth.pyx":647
10843  *             weight *= kern
10844  *             # Mass of the particle times the value
10845  *             for fi in range(self.nfields - 3):             # <<<<<<<<<<<<<<
10846  *                 val = fields[fi + 3][pn]
10847  *                 self.fp[fi][gind(i,j,k,dim) + offset] += val * weight
10848  */
10849     __pyx_t_7 = (__pyx_v_self->__pyx_base.nfields - 3);
10850     __pyx_t_8 = __pyx_t_7;
10851     for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
10852       __pyx_v_fi = __pyx_t_9;
10853 
10854       /* "yt/geometry/particle_smooth.pyx":648
10855  *             # Mass of the particle times the value
10856  *             for fi in range(self.nfields - 3):
10857  *                 val = fields[fi + 3][pn]             # <<<<<<<<<<<<<<
10858  *                 self.fp[fi][gind(i,j,k,dim) + offset] += val * weight
10859  *         return
10860  */
10861       __pyx_v_val = ((__pyx_v_fields[(__pyx_v_fi + 3)])[__pyx_v_pn]);
10862 
10863       /* "yt/geometry/particle_smooth.pyx":649
10864  *             for fi in range(self.nfields - 3):
10865  *                 val = fields[fi + 3][pn]
10866  *                 self.fp[fi][gind(i,j,k,dim) + offset] += val * weight             # <<<<<<<<<<<<<<
10867  *         return
10868  *
10869  */
10870       __pyx_t_10 = __pyx_v_fi;
10871       __pyx_t_5 = (__pyx_f_2yt_8geometry_16particle_deposit_gind(__pyx_v_i, __pyx_v_j, __pyx_v_k, __pyx_v_dim) + __pyx_v_offset);
10872       ((__pyx_v_self->fp[__pyx_t_10])[__pyx_t_5]) = (((__pyx_v_self->fp[__pyx_t_10])[__pyx_t_5]) + (__pyx_v_val * __pyx_v_weight));
10873     }
10874     __pyx_L3_continue:;
10875   }
10876 
10877   /* "yt/geometry/particle_smooth.pyx":650
10878  *                 val = fields[fi + 3][pn]
10879  *                 self.fp[fi][gind(i,j,k,dim) + offset] += val * weight
10880  *         return             # <<<<<<<<<<<<<<
10881  *
10882  * volume_weighted_smooth = VolumeWeightedSmooth
10883  */
10884   goto __pyx_L0;
10885 
10886   /* "yt/geometry/particle_smooth.pyx":612
10887  *     @cython.wraparound(False)
10888  *     @cython.initializedcheck(False)
10889  *     cdef void process(self, np.int64_t offset, int i, int j, int k,             # <<<<<<<<<<<<<<
10890  *                       int dim[3], np.float64_t cpos[3], np.float64_t **fields,
10891  *                       np.float64_t **index_fields, DistanceQueue dq):
10892  */
10893 
10894   /* function exit code */
10895   __pyx_L0:;
10896   __Pyx_RefNannyFinishContext();
10897 }
10898 
10899 /* "yt/geometry/particle_smooth.pyx":585
10900  *     # applying here is equation 6, with variable smoothing lengths (eq 13).
10901  *     cdef np.float64_t **fp
10902  *     cdef public object vals             # <<<<<<<<<<<<<<
10903  *     def initialize(self):
10904  *         cdef int i
10905  */
10906 
10907 /* Python wrapper */
10908 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals_1__get__(PyObject * __pyx_v_self)10909 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals_1__get__(PyObject *__pyx_v_self) {
10910   PyObject *__pyx_r = 0;
10911   __Pyx_RefNannyDeclarations
10912   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10913   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals___get__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *)__pyx_v_self));
10914 
10915   /* function exit code */
10916   __Pyx_RefNannyFinishContext();
10917   return __pyx_r;
10918 }
10919 
__pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals___get__(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth * __pyx_v_self)10920 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals___get__(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self) {
10921   PyObject *__pyx_r = NULL;
10922   __Pyx_RefNannyDeclarations
10923   __Pyx_RefNannySetupContext("__get__", 0);
10924   __Pyx_XDECREF(__pyx_r);
10925   __Pyx_INCREF(__pyx_v_self->vals);
10926   __pyx_r = __pyx_v_self->vals;
10927   goto __pyx_L0;
10928 
10929   /* function exit code */
10930   __pyx_L0:;
10931   __Pyx_XGIVEREF(__pyx_r);
10932   __Pyx_RefNannyFinishContext();
10933   return __pyx_r;
10934 }
10935 
10936 /* Python wrapper */
10937 static int __pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)10938 static int __pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
10939   int __pyx_r;
10940   __Pyx_RefNannyDeclarations
10941   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
10942   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals_2__set__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *)__pyx_v_self), ((PyObject *)__pyx_v_value));
10943 
10944   /* function exit code */
10945   __Pyx_RefNannyFinishContext();
10946   return __pyx_r;
10947 }
10948 
__pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals_2__set__(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth * __pyx_v_self,PyObject * __pyx_v_value)10949 static int __pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals_2__set__(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self, PyObject *__pyx_v_value) {
10950   int __pyx_r;
10951   __Pyx_RefNannyDeclarations
10952   __Pyx_RefNannySetupContext("__set__", 0);
10953   __Pyx_INCREF(__pyx_v_value);
10954   __Pyx_GIVEREF(__pyx_v_value);
10955   __Pyx_GOTREF(__pyx_v_self->vals);
10956   __Pyx_DECREF(__pyx_v_self->vals);
10957   __pyx_v_self->vals = __pyx_v_value;
10958 
10959   /* function exit code */
10960   __pyx_r = 0;
10961   __Pyx_RefNannyFinishContext();
10962   return __pyx_r;
10963 }
10964 
10965 /* Python wrapper */
10966 static int __pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals_5__del__(PyObject * __pyx_v_self)10967 static int __pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals_5__del__(PyObject *__pyx_v_self) {
10968   int __pyx_r;
10969   __Pyx_RefNannyDeclarations
10970   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
10971   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals_4__del__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *)__pyx_v_self));
10972 
10973   /* function exit code */
10974   __Pyx_RefNannyFinishContext();
10975   return __pyx_r;
10976 }
10977 
__pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals_4__del__(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth * __pyx_v_self)10978 static int __pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals_4__del__(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self) {
10979   int __pyx_r;
10980   __Pyx_RefNannyDeclarations
10981   __Pyx_RefNannySetupContext("__del__", 0);
10982   __Pyx_INCREF(Py_None);
10983   __Pyx_GIVEREF(Py_None);
10984   __Pyx_GOTREF(__pyx_v_self->vals);
10985   __Pyx_DECREF(__pyx_v_self->vals);
10986   __pyx_v_self->vals = Py_None;
10987 
10988   /* function exit code */
10989   __pyx_r = 0;
10990   __Pyx_RefNannyFinishContext();
10991   return __pyx_r;
10992 }
10993 
10994 /* "(tree fragment)":1
10995  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
10996  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
10997  * def __setstate_cython__(self, __pyx_state):
10998  */
10999 
11000 /* Python wrapper */
11001 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_5__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)11002 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11003   PyObject *__pyx_r = 0;
11004   __Pyx_RefNannyDeclarations
11005   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
11006   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *)__pyx_v_self));
11007 
11008   /* function exit code */
11009   __Pyx_RefNannyFinishContext();
11010   return __pyx_r;
11011 }
11012 
__pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth * __pyx_v_self)11013 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self) {
11014   PyObject *__pyx_r = NULL;
11015   __Pyx_RefNannyDeclarations
11016   PyObject *__pyx_t_1 = NULL;
11017   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
11018 
11019   /* "(tree fragment)":2
11020  * def __reduce_cython__(self):
11021  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
11022  * def __setstate_cython__(self, __pyx_state):
11023  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
11024  */
11025   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
11026   __Pyx_GOTREF(__pyx_t_1);
11027   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11028   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11029   __PYX_ERR(1, 2, __pyx_L1_error)
11030 
11031   /* "(tree fragment)":1
11032  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
11033  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
11034  * def __setstate_cython__(self, __pyx_state):
11035  */
11036 
11037   /* function exit code */
11038   __pyx_L1_error:;
11039   __Pyx_XDECREF(__pyx_t_1);
11040   __Pyx_AddTraceback("yt.geometry.particle_smooth.VolumeWeightedSmooth.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11041   __pyx_r = NULL;
11042   __Pyx_XGIVEREF(__pyx_r);
11043   __Pyx_RefNannyFinishContext();
11044   return __pyx_r;
11045 }
11046 
11047 /* "(tree fragment)":3
11048  * def __reduce_cython__(self):
11049  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
11050  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
11051  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
11052  */
11053 
11054 /* Python wrapper */
11055 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_7__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)11056 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11057   PyObject *__pyx_r = 0;
11058   __Pyx_RefNannyDeclarations
11059   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
11060   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11061 
11062   /* function exit code */
11063   __Pyx_RefNannyFinishContext();
11064   return __pyx_r;
11065 }
11066 
__pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)11067 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
11068   PyObject *__pyx_r = NULL;
11069   __Pyx_RefNannyDeclarations
11070   PyObject *__pyx_t_1 = NULL;
11071   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
11072 
11073   /* "(tree fragment)":4
11074  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
11075  * def __setstate_cython__(self, __pyx_state):
11076  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
11077  */
11078   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
11079   __Pyx_GOTREF(__pyx_t_1);
11080   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11081   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11082   __PYX_ERR(1, 4, __pyx_L1_error)
11083 
11084   /* "(tree fragment)":3
11085  * def __reduce_cython__(self):
11086  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
11087  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
11088  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
11089  */
11090 
11091   /* function exit code */
11092   __pyx_L1_error:;
11093   __Pyx_XDECREF(__pyx_t_1);
11094   __Pyx_AddTraceback("yt.geometry.particle_smooth.VolumeWeightedSmooth.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11095   __pyx_r = NULL;
11096   __Pyx_XGIVEREF(__pyx_r);
11097   __Pyx_RefNannyFinishContext();
11098   return __pyx_r;
11099 }
11100 
11101 /* "yt/geometry/particle_smooth.pyx":657
11102  *     cdef np.float64_t *fp
11103  *     cdef public object vals
11104  *     def initialize(self):             # <<<<<<<<<<<<<<
11105  *         cdef np.ndarray tarr
11106  *         assert(self.nfields == 1)
11107  */
11108 
11109 /* Python wrapper */
11110 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_1initialize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_1initialize(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)11111 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_1initialize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11112   PyObject *__pyx_r = 0;
11113   __Pyx_RefNannyDeclarations
11114   __Pyx_RefNannySetupContext("initialize (wrapper)", 0);
11115   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_initialize(((struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *)__pyx_v_self));
11116 
11117   /* function exit code */
11118   __Pyx_RefNannyFinishContext();
11119   return __pyx_r;
11120 }
11121 
__pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_initialize(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth * __pyx_v_self)11122 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_initialize(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self) {
11123   PyArrayObject *__pyx_v_tarr = 0;
11124   PyObject *__pyx_r = NULL;
11125   __Pyx_RefNannyDeclarations
11126   PyObject *__pyx_t_1 = NULL;
11127   PyObject *__pyx_t_2 = NULL;
11128   PyObject *__pyx_t_3 = NULL;
11129   PyObject *__pyx_t_4 = NULL;
11130   __Pyx_RefNannySetupContext("initialize", 0);
11131 
11132   /* "yt/geometry/particle_smooth.pyx":659
11133  *     def initialize(self):
11134  *         cdef np.ndarray tarr
11135  *         assert(self.nfields == 1)             # <<<<<<<<<<<<<<
11136  *         tarr = np.zeros(self.nvals, dtype="float64", order="F")
11137  *         self.vals = tarr
11138  */
11139   #ifndef CYTHON_WITHOUT_ASSERTIONS
11140   if (unlikely(!Py_OptimizeFlag)) {
11141     if (unlikely(!((__pyx_v_self->__pyx_base.nfields == 1) != 0))) {
11142       PyErr_SetNone(PyExc_AssertionError);
11143       __PYX_ERR(0, 659, __pyx_L1_error)
11144     }
11145   }
11146   #endif
11147 
11148   /* "yt/geometry/particle_smooth.pyx":660
11149  *         cdef np.ndarray tarr
11150  *         assert(self.nfields == 1)
11151  *         tarr = np.zeros(self.nvals, dtype="float64", order="F")             # <<<<<<<<<<<<<<
11152  *         self.vals = tarr
11153  *         self.fp = <np.float64_t *> tarr.data
11154  */
11155   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 660, __pyx_L1_error)
11156   __Pyx_GOTREF(__pyx_t_1);
11157   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error)
11158   __Pyx_GOTREF(__pyx_t_2);
11159   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11160   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 660, __pyx_L1_error)
11161   __Pyx_GOTREF(__pyx_t_1);
11162   __Pyx_INCREF(__pyx_v_self->__pyx_base.nvals);
11163   __Pyx_GIVEREF(__pyx_v_self->__pyx_base.nvals);
11164   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.nvals);
11165   __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 660, __pyx_L1_error)
11166   __Pyx_GOTREF(__pyx_t_3);
11167   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 660, __pyx_L1_error)
11168   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(0, 660, __pyx_L1_error)
11169   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 660, __pyx_L1_error)
11170   __Pyx_GOTREF(__pyx_t_4);
11171   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11172   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11173   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11174   if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 660, __pyx_L1_error)
11175   __pyx_v_tarr = ((PyArrayObject *)__pyx_t_4);
11176   __pyx_t_4 = 0;
11177 
11178   /* "yt/geometry/particle_smooth.pyx":661
11179  *         assert(self.nfields == 1)
11180  *         tarr = np.zeros(self.nvals, dtype="float64", order="F")
11181  *         self.vals = tarr             # <<<<<<<<<<<<<<
11182  *         self.fp = <np.float64_t *> tarr.data
11183  *
11184  */
11185   __Pyx_INCREF(((PyObject *)__pyx_v_tarr));
11186   __Pyx_GIVEREF(((PyObject *)__pyx_v_tarr));
11187   __Pyx_GOTREF(__pyx_v_self->vals);
11188   __Pyx_DECREF(__pyx_v_self->vals);
11189   __pyx_v_self->vals = ((PyObject *)__pyx_v_tarr);
11190 
11191   /* "yt/geometry/particle_smooth.pyx":662
11192  *         tarr = np.zeros(self.nvals, dtype="float64", order="F")
11193  *         self.vals = tarr
11194  *         self.fp = <np.float64_t *> tarr.data             # <<<<<<<<<<<<<<
11195  *
11196  *     def finalize(self):
11197  */
11198   __pyx_v_self->fp = ((__pyx_t_5numpy_float64_t *)__pyx_v_tarr->data);
11199 
11200   /* "yt/geometry/particle_smooth.pyx":657
11201  *     cdef np.float64_t *fp
11202  *     cdef public object vals
11203  *     def initialize(self):             # <<<<<<<<<<<<<<
11204  *         cdef np.ndarray tarr
11205  *         assert(self.nfields == 1)
11206  */
11207 
11208   /* function exit code */
11209   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11210   goto __pyx_L0;
11211   __pyx_L1_error:;
11212   __Pyx_XDECREF(__pyx_t_1);
11213   __Pyx_XDECREF(__pyx_t_2);
11214   __Pyx_XDECREF(__pyx_t_3);
11215   __Pyx_XDECREF(__pyx_t_4);
11216   __Pyx_AddTraceback("yt.geometry.particle_smooth.NearestNeighborSmooth.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
11217   __pyx_r = NULL;
11218   __pyx_L0:;
11219   __Pyx_XDECREF((PyObject *)__pyx_v_tarr);
11220   __Pyx_XGIVEREF(__pyx_r);
11221   __Pyx_RefNannyFinishContext();
11222   return __pyx_r;
11223 }
11224 
11225 /* "yt/geometry/particle_smooth.pyx":664
11226  *         self.fp = <np.float64_t *> tarr.data
11227  *
11228  *     def finalize(self):             # <<<<<<<<<<<<<<
11229  *         return self.vals
11230  *
11231  */
11232 
11233 /* Python wrapper */
11234 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_3finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_3finalize(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)11235 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_3finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11236   PyObject *__pyx_r = 0;
11237   __Pyx_RefNannyDeclarations
11238   __Pyx_RefNannySetupContext("finalize (wrapper)", 0);
11239   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_2finalize(((struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *)__pyx_v_self));
11240 
11241   /* function exit code */
11242   __Pyx_RefNannyFinishContext();
11243   return __pyx_r;
11244 }
11245 
__pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_2finalize(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth * __pyx_v_self)11246 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_2finalize(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self) {
11247   PyObject *__pyx_r = NULL;
11248   __Pyx_RefNannyDeclarations
11249   __Pyx_RefNannySetupContext("finalize", 0);
11250 
11251   /* "yt/geometry/particle_smooth.pyx":665
11252  *
11253  *     def finalize(self):
11254  *         return self.vals             # <<<<<<<<<<<<<<
11255  *
11256  *     @cython.cdivision(True)
11257  */
11258   __Pyx_XDECREF(__pyx_r);
11259   __Pyx_INCREF(__pyx_v_self->vals);
11260   __pyx_r = __pyx_v_self->vals;
11261   goto __pyx_L0;
11262 
11263   /* "yt/geometry/particle_smooth.pyx":664
11264  *         self.fp = <np.float64_t *> tarr.data
11265  *
11266  *     def finalize(self):             # <<<<<<<<<<<<<<
11267  *         return self.vals
11268  *
11269  */
11270 
11271   /* function exit code */
11272   __pyx_L0:;
11273   __Pyx_XGIVEREF(__pyx_r);
11274   __Pyx_RefNannyFinishContext();
11275   return __pyx_r;
11276 }
11277 
11278 /* "yt/geometry/particle_smooth.pyx":671
11279  *     @cython.wraparound(False)
11280  *     @cython.initializedcheck(False)
11281  *     cdef void process(self, np.int64_t offset, int i, int j, int k,             # <<<<<<<<<<<<<<
11282  *                       int dim[3], np.float64_t cpos[3], np.float64_t **fields,
11283  *                       np.float64_t **index_fields, DistanceQueue dq):
11284  */
11285 
__pyx_f_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth * __pyx_v_self,__pyx_t_5numpy_int64_t __pyx_v_offset,int __pyx_v_i,int __pyx_v_j,int __pyx_v_k,int * __pyx_v_dim,CYTHON_UNUSED __pyx_t_5numpy_float64_t * __pyx_v_cpos,__pyx_t_5numpy_float64_t ** __pyx_v_fields,CYTHON_UNUSED __pyx_t_5numpy_float64_t ** __pyx_v_index_fields,struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue * __pyx_v_dq)11286 static void __pyx_f_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k, int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq) {
11287   __pyx_t_5numpy_int64_t __pyx_v_pn;
11288   __Pyx_RefNannyDeclarations
11289   __pyx_t_5numpy_int64_t __pyx_t_1;
11290   __Pyx_RefNannySetupContext("process", 0);
11291 
11292   /* "yt/geometry/particle_smooth.pyx":679
11293  *         # We get back our mass
11294  *         # rho_i = sum(j = 1 .. n) m_j * W_ij
11295  *         pn = dq.neighbors[0].pn             # <<<<<<<<<<<<<<
11296  *         self.fp[gind(i,j,k,dim) + offset] = fields[0][pn]
11297  *         #self.fp[gind(i,j,k,dim) + offset] = dq.neighbors[0].r2
11298  */
11299   __pyx_t_1 = (__pyx_v_dq->neighbors[0]).pn;
11300   __pyx_v_pn = __pyx_t_1;
11301 
11302   /* "yt/geometry/particle_smooth.pyx":680
11303  *         # rho_i = sum(j = 1 .. n) m_j * W_ij
11304  *         pn = dq.neighbors[0].pn
11305  *         self.fp[gind(i,j,k,dim) + offset] = fields[0][pn]             # <<<<<<<<<<<<<<
11306  *         #self.fp[gind(i,j,k,dim) + offset] = dq.neighbors[0].r2
11307  *         return
11308  */
11309   (__pyx_v_self->fp[(__pyx_f_2yt_8geometry_16particle_deposit_gind(__pyx_v_i, __pyx_v_j, __pyx_v_k, __pyx_v_dim) + __pyx_v_offset)]) = ((__pyx_v_fields[0])[__pyx_v_pn]);
11310 
11311   /* "yt/geometry/particle_smooth.pyx":682
11312  *         self.fp[gind(i,j,k,dim) + offset] = fields[0][pn]
11313  *         #self.fp[gind(i,j,k,dim) + offset] = dq.neighbors[0].r2
11314  *         return             # <<<<<<<<<<<<<<
11315  *
11316  * nearest_smooth = NearestNeighborSmooth
11317  */
11318   goto __pyx_L0;
11319 
11320   /* "yt/geometry/particle_smooth.pyx":671
11321  *     @cython.wraparound(False)
11322  *     @cython.initializedcheck(False)
11323  *     cdef void process(self, np.int64_t offset, int i, int j, int k,             # <<<<<<<<<<<<<<
11324  *                       int dim[3], np.float64_t cpos[3], np.float64_t **fields,
11325  *                       np.float64_t **index_fields, DistanceQueue dq):
11326  */
11327 
11328   /* function exit code */
11329   __pyx_L0:;
11330   __Pyx_RefNannyFinishContext();
11331 }
11332 
11333 /* "yt/geometry/particle_smooth.pyx":656
11334  * cdef class NearestNeighborSmooth(ParticleSmoothOperation):
11335  *     cdef np.float64_t *fp
11336  *     cdef public object vals             # <<<<<<<<<<<<<<
11337  *     def initialize(self):
11338  *         cdef np.ndarray tarr
11339  */
11340 
11341 /* Python wrapper */
11342 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals_1__get__(PyObject * __pyx_v_self)11343 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals_1__get__(PyObject *__pyx_v_self) {
11344   PyObject *__pyx_r = 0;
11345   __Pyx_RefNannyDeclarations
11346   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11347   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals___get__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *)__pyx_v_self));
11348 
11349   /* function exit code */
11350   __Pyx_RefNannyFinishContext();
11351   return __pyx_r;
11352 }
11353 
__pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals___get__(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth * __pyx_v_self)11354 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals___get__(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self) {
11355   PyObject *__pyx_r = NULL;
11356   __Pyx_RefNannyDeclarations
11357   __Pyx_RefNannySetupContext("__get__", 0);
11358   __Pyx_XDECREF(__pyx_r);
11359   __Pyx_INCREF(__pyx_v_self->vals);
11360   __pyx_r = __pyx_v_self->vals;
11361   goto __pyx_L0;
11362 
11363   /* function exit code */
11364   __pyx_L0:;
11365   __Pyx_XGIVEREF(__pyx_r);
11366   __Pyx_RefNannyFinishContext();
11367   return __pyx_r;
11368 }
11369 
11370 /* Python wrapper */
11371 static int __pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)11372 static int __pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
11373   int __pyx_r;
11374   __Pyx_RefNannyDeclarations
11375   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
11376   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals_2__set__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *)__pyx_v_self), ((PyObject *)__pyx_v_value));
11377 
11378   /* function exit code */
11379   __Pyx_RefNannyFinishContext();
11380   return __pyx_r;
11381 }
11382 
__pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals_2__set__(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth * __pyx_v_self,PyObject * __pyx_v_value)11383 static int __pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals_2__set__(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self, PyObject *__pyx_v_value) {
11384   int __pyx_r;
11385   __Pyx_RefNannyDeclarations
11386   __Pyx_RefNannySetupContext("__set__", 0);
11387   __Pyx_INCREF(__pyx_v_value);
11388   __Pyx_GIVEREF(__pyx_v_value);
11389   __Pyx_GOTREF(__pyx_v_self->vals);
11390   __Pyx_DECREF(__pyx_v_self->vals);
11391   __pyx_v_self->vals = __pyx_v_value;
11392 
11393   /* function exit code */
11394   __pyx_r = 0;
11395   __Pyx_RefNannyFinishContext();
11396   return __pyx_r;
11397 }
11398 
11399 /* Python wrapper */
11400 static int __pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals_5__del__(PyObject * __pyx_v_self)11401 static int __pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals_5__del__(PyObject *__pyx_v_self) {
11402   int __pyx_r;
11403   __Pyx_RefNannyDeclarations
11404   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
11405   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals_4__del__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *)__pyx_v_self));
11406 
11407   /* function exit code */
11408   __Pyx_RefNannyFinishContext();
11409   return __pyx_r;
11410 }
11411 
__pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals_4__del__(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth * __pyx_v_self)11412 static int __pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals_4__del__(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self) {
11413   int __pyx_r;
11414   __Pyx_RefNannyDeclarations
11415   __Pyx_RefNannySetupContext("__del__", 0);
11416   __Pyx_INCREF(Py_None);
11417   __Pyx_GIVEREF(Py_None);
11418   __Pyx_GOTREF(__pyx_v_self->vals);
11419   __Pyx_DECREF(__pyx_v_self->vals);
11420   __pyx_v_self->vals = Py_None;
11421 
11422   /* function exit code */
11423   __pyx_r = 0;
11424   __Pyx_RefNannyFinishContext();
11425   return __pyx_r;
11426 }
11427 
11428 /* "(tree fragment)":1
11429  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
11430  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
11431  * def __setstate_cython__(self, __pyx_state):
11432  */
11433 
11434 /* Python wrapper */
11435 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_5__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)11436 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11437   PyObject *__pyx_r = 0;
11438   __Pyx_RefNannyDeclarations
11439   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
11440   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *)__pyx_v_self));
11441 
11442   /* function exit code */
11443   __Pyx_RefNannyFinishContext();
11444   return __pyx_r;
11445 }
11446 
__pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth * __pyx_v_self)11447 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self) {
11448   PyObject *__pyx_r = NULL;
11449   __Pyx_RefNannyDeclarations
11450   PyObject *__pyx_t_1 = NULL;
11451   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
11452 
11453   /* "(tree fragment)":2
11454  * def __reduce_cython__(self):
11455  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
11456  * def __setstate_cython__(self, __pyx_state):
11457  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
11458  */
11459   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
11460   __Pyx_GOTREF(__pyx_t_1);
11461   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11462   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11463   __PYX_ERR(1, 2, __pyx_L1_error)
11464 
11465   /* "(tree fragment)":1
11466  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
11467  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
11468  * def __setstate_cython__(self, __pyx_state):
11469  */
11470 
11471   /* function exit code */
11472   __pyx_L1_error:;
11473   __Pyx_XDECREF(__pyx_t_1);
11474   __Pyx_AddTraceback("yt.geometry.particle_smooth.NearestNeighborSmooth.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11475   __pyx_r = NULL;
11476   __Pyx_XGIVEREF(__pyx_r);
11477   __Pyx_RefNannyFinishContext();
11478   return __pyx_r;
11479 }
11480 
11481 /* "(tree fragment)":3
11482  * def __reduce_cython__(self):
11483  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
11484  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
11485  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
11486  */
11487 
11488 /* Python wrapper */
11489 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_7__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)11490 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11491   PyObject *__pyx_r = 0;
11492   __Pyx_RefNannyDeclarations
11493   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
11494   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11495 
11496   /* function exit code */
11497   __Pyx_RefNannyFinishContext();
11498   return __pyx_r;
11499 }
11500 
__pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)11501 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
11502   PyObject *__pyx_r = NULL;
11503   __Pyx_RefNannyDeclarations
11504   PyObject *__pyx_t_1 = NULL;
11505   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
11506 
11507   /* "(tree fragment)":4
11508  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
11509  * def __setstate_cython__(self, __pyx_state):
11510  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
11511  */
11512   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
11513   __Pyx_GOTREF(__pyx_t_1);
11514   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11515   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11516   __PYX_ERR(1, 4, __pyx_L1_error)
11517 
11518   /* "(tree fragment)":3
11519  * def __reduce_cython__(self):
11520  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
11521  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
11522  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
11523  */
11524 
11525   /* function exit code */
11526   __pyx_L1_error:;
11527   __Pyx_XDECREF(__pyx_t_1);
11528   __Pyx_AddTraceback("yt.geometry.particle_smooth.NearestNeighborSmooth.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11529   __pyx_r = NULL;
11530   __Pyx_XGIVEREF(__pyx_r);
11531   __Pyx_RefNannyFinishContext();
11532   return __pyx_r;
11533 }
11534 
11535 /* "yt/geometry/particle_smooth.pyx":690
11536  *     cdef public int p2
11537  *     cdef public object vals
11538  *     def initialize(self):             # <<<<<<<<<<<<<<
11539  *         cdef np.ndarray tarr
11540  *         assert(self.nfields == 1)
11541  */
11542 
11543 /* Python wrapper */
11544 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_1initialize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_1initialize(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)11545 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_1initialize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11546   PyObject *__pyx_r = 0;
11547   __Pyx_RefNannyDeclarations
11548   __Pyx_RefNannySetupContext("initialize (wrapper)", 0);
11549   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_initialize(((struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *)__pyx_v_self));
11550 
11551   /* function exit code */
11552   __Pyx_RefNannyFinishContext();
11553   return __pyx_r;
11554 }
11555 
__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_initialize(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth * __pyx_v_self)11556 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_initialize(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self) {
11557   PyArrayObject *__pyx_v_tarr = 0;
11558   PyObject *__pyx_r = NULL;
11559   __Pyx_RefNannyDeclarations
11560   PyObject *__pyx_t_1 = NULL;
11561   PyObject *__pyx_t_2 = NULL;
11562   PyObject *__pyx_t_3 = NULL;
11563   PyObject *__pyx_t_4 = NULL;
11564   __Pyx_RefNannySetupContext("initialize", 0);
11565 
11566   /* "yt/geometry/particle_smooth.pyx":692
11567  *     def initialize(self):
11568  *         cdef np.ndarray tarr
11569  *         assert(self.nfields == 1)             # <<<<<<<<<<<<<<
11570  *         tarr = np.zeros(self.nvals, dtype="float64", order="F")
11571  *         self.vals = tarr
11572  */
11573   #ifndef CYTHON_WITHOUT_ASSERTIONS
11574   if (unlikely(!Py_OptimizeFlag)) {
11575     if (unlikely(!((__pyx_v_self->__pyx_base.nfields == 1) != 0))) {
11576       PyErr_SetNone(PyExc_AssertionError);
11577       __PYX_ERR(0, 692, __pyx_L1_error)
11578     }
11579   }
11580   #endif
11581 
11582   /* "yt/geometry/particle_smooth.pyx":693
11583  *         cdef np.ndarray tarr
11584  *         assert(self.nfields == 1)
11585  *         tarr = np.zeros(self.nvals, dtype="float64", order="F")             # <<<<<<<<<<<<<<
11586  *         self.vals = tarr
11587  *         self.fp = <np.float64_t *> tarr.data
11588  */
11589   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error)
11590   __Pyx_GOTREF(__pyx_t_1);
11591   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error)
11592   __Pyx_GOTREF(__pyx_t_2);
11593   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11594   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error)
11595   __Pyx_GOTREF(__pyx_t_1);
11596   __Pyx_INCREF(__pyx_v_self->__pyx_base.nvals);
11597   __Pyx_GIVEREF(__pyx_v_self->__pyx_base.nvals);
11598   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.nvals);
11599   __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L1_error)
11600   __Pyx_GOTREF(__pyx_t_3);
11601   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 693, __pyx_L1_error)
11602   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(0, 693, __pyx_L1_error)
11603   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L1_error)
11604   __Pyx_GOTREF(__pyx_t_4);
11605   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11606   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11607   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11608   if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 693, __pyx_L1_error)
11609   __pyx_v_tarr = ((PyArrayObject *)__pyx_t_4);
11610   __pyx_t_4 = 0;
11611 
11612   /* "yt/geometry/particle_smooth.pyx":694
11613  *         assert(self.nfields == 1)
11614  *         tarr = np.zeros(self.nvals, dtype="float64", order="F")
11615  *         self.vals = tarr             # <<<<<<<<<<<<<<
11616  *         self.fp = <np.float64_t *> tarr.data
11617  *         self.p2 = 2 # Power, for IDW, in units of 2.  So we only do even p's.
11618  */
11619   __Pyx_INCREF(((PyObject *)__pyx_v_tarr));
11620   __Pyx_GIVEREF(((PyObject *)__pyx_v_tarr));
11621   __Pyx_GOTREF(__pyx_v_self->vals);
11622   __Pyx_DECREF(__pyx_v_self->vals);
11623   __pyx_v_self->vals = ((PyObject *)__pyx_v_tarr);
11624 
11625   /* "yt/geometry/particle_smooth.pyx":695
11626  *         tarr = np.zeros(self.nvals, dtype="float64", order="F")
11627  *         self.vals = tarr
11628  *         self.fp = <np.float64_t *> tarr.data             # <<<<<<<<<<<<<<
11629  *         self.p2 = 2 # Power, for IDW, in units of 2.  So we only do even p's.
11630  *
11631  */
11632   __pyx_v_self->fp = ((__pyx_t_5numpy_float64_t *)__pyx_v_tarr->data);
11633 
11634   /* "yt/geometry/particle_smooth.pyx":696
11635  *         self.vals = tarr
11636  *         self.fp = <np.float64_t *> tarr.data
11637  *         self.p2 = 2 # Power, for IDW, in units of 2.  So we only do even p's.             # <<<<<<<<<<<<<<
11638  *
11639  *     def finalize(self):
11640  */
11641   __pyx_v_self->p2 = 2;
11642 
11643   /* "yt/geometry/particle_smooth.pyx":690
11644  *     cdef public int p2
11645  *     cdef public object vals
11646  *     def initialize(self):             # <<<<<<<<<<<<<<
11647  *         cdef np.ndarray tarr
11648  *         assert(self.nfields == 1)
11649  */
11650 
11651   /* function exit code */
11652   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11653   goto __pyx_L0;
11654   __pyx_L1_error:;
11655   __Pyx_XDECREF(__pyx_t_1);
11656   __Pyx_XDECREF(__pyx_t_2);
11657   __Pyx_XDECREF(__pyx_t_3);
11658   __Pyx_XDECREF(__pyx_t_4);
11659   __Pyx_AddTraceback("yt.geometry.particle_smooth.IDWInterpolationSmooth.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
11660   __pyx_r = NULL;
11661   __pyx_L0:;
11662   __Pyx_XDECREF((PyObject *)__pyx_v_tarr);
11663   __Pyx_XGIVEREF(__pyx_r);
11664   __Pyx_RefNannyFinishContext();
11665   return __pyx_r;
11666 }
11667 
11668 /* "yt/geometry/particle_smooth.pyx":698
11669  *         self.p2 = 2 # Power, for IDW, in units of 2.  So we only do even p's.
11670  *
11671  *     def finalize(self):             # <<<<<<<<<<<<<<
11672  *         return self.vals
11673  *
11674  */
11675 
11676 /* Python wrapper */
11677 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_3finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_3finalize(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)11678 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_3finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11679   PyObject *__pyx_r = 0;
11680   __Pyx_RefNannyDeclarations
11681   __Pyx_RefNannySetupContext("finalize (wrapper)", 0);
11682   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_2finalize(((struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *)__pyx_v_self));
11683 
11684   /* function exit code */
11685   __Pyx_RefNannyFinishContext();
11686   return __pyx_r;
11687 }
11688 
__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_2finalize(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth * __pyx_v_self)11689 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_2finalize(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self) {
11690   PyObject *__pyx_r = NULL;
11691   __Pyx_RefNannyDeclarations
11692   __Pyx_RefNannySetupContext("finalize", 0);
11693 
11694   /* "yt/geometry/particle_smooth.pyx":699
11695  *
11696  *     def finalize(self):
11697  *         return self.vals             # <<<<<<<<<<<<<<
11698  *
11699  *     @cython.cdivision(True)
11700  */
11701   __Pyx_XDECREF(__pyx_r);
11702   __Pyx_INCREF(__pyx_v_self->vals);
11703   __pyx_r = __pyx_v_self->vals;
11704   goto __pyx_L0;
11705 
11706   /* "yt/geometry/particle_smooth.pyx":698
11707  *         self.p2 = 2 # Power, for IDW, in units of 2.  So we only do even p's.
11708  *
11709  *     def finalize(self):             # <<<<<<<<<<<<<<
11710  *         return self.vals
11711  *
11712  */
11713 
11714   /* function exit code */
11715   __pyx_L0:;
11716   __Pyx_XGIVEREF(__pyx_r);
11717   __Pyx_RefNannyFinishContext();
11718   return __pyx_r;
11719 }
11720 
11721 /* "yt/geometry/particle_smooth.pyx":705
11722  *     @cython.wraparound(False)
11723  *     @cython.initializedcheck(False)
11724  *     cdef void process(self, np.int64_t offset, int i, int j, int k,             # <<<<<<<<<<<<<<
11725  *                       int dim[3], np.float64_t cpos[3], np.float64_t **fields,
11726  *                       np.float64_t **index_fields, DistanceQueue dq):
11727  */
11728 
__pyx_f_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth * __pyx_v_self,__pyx_t_5numpy_int64_t __pyx_v_offset,int __pyx_v_i,int __pyx_v_j,int __pyx_v_k,int * __pyx_v_dim,CYTHON_UNUSED __pyx_t_5numpy_float64_t * __pyx_v_cpos,__pyx_t_5numpy_float64_t ** __pyx_v_fields,CYTHON_UNUSED __pyx_t_5numpy_float64_t ** __pyx_v_index_fields,struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue * __pyx_v_dq)11729 static void __pyx_f_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k, int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq) {
11730   __pyx_t_5numpy_int64_t __pyx_v_pn;
11731   __pyx_t_5numpy_int64_t __pyx_v_ni;
11732   CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_di;
11733   __pyx_t_5numpy_float64_t __pyx_v_total_weight;
11734   __pyx_t_5numpy_float64_t __pyx_v_total_value;
11735   __pyx_t_5numpy_float64_t __pyx_v_r2;
11736   __pyx_t_5numpy_float64_t __pyx_v_val;
11737   __pyx_t_5numpy_float64_t __pyx_v_w;
11738   __Pyx_RefNannyDeclarations
11739   int __pyx_t_1;
11740   __pyx_t_5numpy_int64_t __pyx_t_2;
11741   int __pyx_t_3;
11742   int __pyx_t_4;
11743   __pyx_t_5numpy_float64_t __pyx_t_5;
11744   long __pyx_t_6;
11745   long __pyx_t_7;
11746   __pyx_t_5numpy_int64_t __pyx_t_8;
11747   __Pyx_RefNannySetupContext("process", 0);
11748 
11749   /* "yt/geometry/particle_smooth.pyx":711
11750  *         # We also have a list of neighboring particles with particle numbers.
11751  *         cdef np.int64_t pn, ni, di
11752  *         cdef np.float64_t total_weight = 0.0, total_value = 0.0, r2, val, w             # <<<<<<<<<<<<<<
11753  *         # We're going to do a very simple IDW average
11754  *         if dq.neighbors[0].r2 == 0.0:
11755  */
11756   __pyx_v_total_weight = 0.0;
11757   __pyx_v_total_value = 0.0;
11758 
11759   /* "yt/geometry/particle_smooth.pyx":713
11760  *         cdef np.float64_t total_weight = 0.0, total_value = 0.0, r2, val, w
11761  *         # We're going to do a very simple IDW average
11762  *         if dq.neighbors[0].r2 == 0.0:             # <<<<<<<<<<<<<<
11763  *             pn = dq.neighbors[0].pn
11764  *             self.fp[gind(i,j,k,dim) + offset] = fields[0][pn]
11765  */
11766   __pyx_t_1 = (((__pyx_v_dq->neighbors[0]).r2 == 0.0) != 0);
11767   if (__pyx_t_1) {
11768 
11769     /* "yt/geometry/particle_smooth.pyx":714
11770  *         # We're going to do a very simple IDW average
11771  *         if dq.neighbors[0].r2 == 0.0:
11772  *             pn = dq.neighbors[0].pn             # <<<<<<<<<<<<<<
11773  *             self.fp[gind(i,j,k,dim) + offset] = fields[0][pn]
11774  *         for ni in range(dq.curn):
11775  */
11776     __pyx_t_2 = (__pyx_v_dq->neighbors[0]).pn;
11777     __pyx_v_pn = __pyx_t_2;
11778 
11779     /* "yt/geometry/particle_smooth.pyx":715
11780  *         if dq.neighbors[0].r2 == 0.0:
11781  *             pn = dq.neighbors[0].pn
11782  *             self.fp[gind(i,j,k,dim) + offset] = fields[0][pn]             # <<<<<<<<<<<<<<
11783  *         for ni in range(dq.curn):
11784  *             r2 = dq.neighbors[ni].r2
11785  */
11786     (__pyx_v_self->fp[(__pyx_f_2yt_8geometry_16particle_deposit_gind(__pyx_v_i, __pyx_v_j, __pyx_v_k, __pyx_v_dim) + __pyx_v_offset)]) = ((__pyx_v_fields[0])[__pyx_v_pn]);
11787 
11788     /* "yt/geometry/particle_smooth.pyx":713
11789  *         cdef np.float64_t total_weight = 0.0, total_value = 0.0, r2, val, w
11790  *         # We're going to do a very simple IDW average
11791  *         if dq.neighbors[0].r2 == 0.0:             # <<<<<<<<<<<<<<
11792  *             pn = dq.neighbors[0].pn
11793  *             self.fp[gind(i,j,k,dim) + offset] = fields[0][pn]
11794  */
11795   }
11796 
11797   /* "yt/geometry/particle_smooth.pyx":716
11798  *             pn = dq.neighbors[0].pn
11799  *             self.fp[gind(i,j,k,dim) + offset] = fields[0][pn]
11800  *         for ni in range(dq.curn):             # <<<<<<<<<<<<<<
11801  *             r2 = dq.neighbors[ni].r2
11802  *             val = fields[0][dq.neighbors[ni].pn]
11803  */
11804   __pyx_t_3 = __pyx_v_dq->__pyx_base.curn;
11805   __pyx_t_4 = __pyx_t_3;
11806   for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_4; __pyx_t_2+=1) {
11807     __pyx_v_ni = __pyx_t_2;
11808 
11809     /* "yt/geometry/particle_smooth.pyx":717
11810  *             self.fp[gind(i,j,k,dim) + offset] = fields[0][pn]
11811  *         for ni in range(dq.curn):
11812  *             r2 = dq.neighbors[ni].r2             # <<<<<<<<<<<<<<
11813  *             val = fields[0][dq.neighbors[ni].pn]
11814  *             w = r2
11815  */
11816     __pyx_t_5 = (__pyx_v_dq->neighbors[__pyx_v_ni]).r2;
11817     __pyx_v_r2 = __pyx_t_5;
11818 
11819     /* "yt/geometry/particle_smooth.pyx":718
11820  *         for ni in range(dq.curn):
11821  *             r2 = dq.neighbors[ni].r2
11822  *             val = fields[0][dq.neighbors[ni].pn]             # <<<<<<<<<<<<<<
11823  *             w = r2
11824  *             for di in range(self.p2 - 1):
11825  */
11826     __pyx_v_val = ((__pyx_v_fields[0])[(__pyx_v_dq->neighbors[__pyx_v_ni]).pn]);
11827 
11828     /* "yt/geometry/particle_smooth.pyx":719
11829  *             r2 = dq.neighbors[ni].r2
11830  *             val = fields[0][dq.neighbors[ni].pn]
11831  *             w = r2             # <<<<<<<<<<<<<<
11832  *             for di in range(self.p2 - 1):
11833  *                 w *= r2
11834  */
11835     __pyx_v_w = __pyx_v_r2;
11836 
11837     /* "yt/geometry/particle_smooth.pyx":720
11838  *             val = fields[0][dq.neighbors[ni].pn]
11839  *             w = r2
11840  *             for di in range(self.p2 - 1):             # <<<<<<<<<<<<<<
11841  *                 w *= r2
11842  *             total_value += w * val
11843  */
11844     __pyx_t_6 = (__pyx_v_self->p2 - 1);
11845     __pyx_t_7 = __pyx_t_6;
11846     for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
11847       __pyx_v_di = __pyx_t_8;
11848 
11849       /* "yt/geometry/particle_smooth.pyx":721
11850  *             w = r2
11851  *             for di in range(self.p2 - 1):
11852  *                 w *= r2             # <<<<<<<<<<<<<<
11853  *             total_value += w * val
11854  *             total_weight += w
11855  */
11856       __pyx_v_w = (__pyx_v_w * __pyx_v_r2);
11857     }
11858 
11859     /* "yt/geometry/particle_smooth.pyx":722
11860  *             for di in range(self.p2 - 1):
11861  *                 w *= r2
11862  *             total_value += w * val             # <<<<<<<<<<<<<<
11863  *             total_weight += w
11864  *         self.fp[gind(i,j,k,dim) + offset] = total_value / total_weight
11865  */
11866     __pyx_v_total_value = (__pyx_v_total_value + (__pyx_v_w * __pyx_v_val));
11867 
11868     /* "yt/geometry/particle_smooth.pyx":723
11869  *                 w *= r2
11870  *             total_value += w * val
11871  *             total_weight += w             # <<<<<<<<<<<<<<
11872  *         self.fp[gind(i,j,k,dim) + offset] = total_value / total_weight
11873  *         return
11874  */
11875     __pyx_v_total_weight = (__pyx_v_total_weight + __pyx_v_w);
11876   }
11877 
11878   /* "yt/geometry/particle_smooth.pyx":724
11879  *             total_value += w * val
11880  *             total_weight += w
11881  *         self.fp[gind(i,j,k,dim) + offset] = total_value / total_weight             # <<<<<<<<<<<<<<
11882  *         return
11883  *
11884  */
11885   (__pyx_v_self->fp[(__pyx_f_2yt_8geometry_16particle_deposit_gind(__pyx_v_i, __pyx_v_j, __pyx_v_k, __pyx_v_dim) + __pyx_v_offset)]) = (__pyx_v_total_value / __pyx_v_total_weight);
11886 
11887   /* "yt/geometry/particle_smooth.pyx":725
11888  *             total_weight += w
11889  *         self.fp[gind(i,j,k,dim) + offset] = total_value / total_weight
11890  *         return             # <<<<<<<<<<<<<<
11891  *
11892  * idw_smooth = IDWInterpolationSmooth
11893  */
11894   goto __pyx_L0;
11895 
11896   /* "yt/geometry/particle_smooth.pyx":705
11897  *     @cython.wraparound(False)
11898  *     @cython.initializedcheck(False)
11899  *     cdef void process(self, np.int64_t offset, int i, int j, int k,             # <<<<<<<<<<<<<<
11900  *                       int dim[3], np.float64_t cpos[3], np.float64_t **fields,
11901  *                       np.float64_t **index_fields, DistanceQueue dq):
11902  */
11903 
11904   /* function exit code */
11905   __pyx_L0:;
11906   __Pyx_RefNannyFinishContext();
11907 }
11908 
11909 /* "yt/geometry/particle_smooth.pyx":688
11910  * cdef class IDWInterpolationSmooth(ParticleSmoothOperation):
11911  *     cdef np.float64_t *fp
11912  *     cdef public int p2             # <<<<<<<<<<<<<<
11913  *     cdef public object vals
11914  *     def initialize(self):
11915  */
11916 
11917 /* Python wrapper */
11918 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_2p2_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_2p2_1__get__(PyObject * __pyx_v_self)11919 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_2p2_1__get__(PyObject *__pyx_v_self) {
11920   PyObject *__pyx_r = 0;
11921   __Pyx_RefNannyDeclarations
11922   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11923   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_2p2___get__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *)__pyx_v_self));
11924 
11925   /* function exit code */
11926   __Pyx_RefNannyFinishContext();
11927   return __pyx_r;
11928 }
11929 
__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_2p2___get__(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth * __pyx_v_self)11930 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_2p2___get__(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self) {
11931   PyObject *__pyx_r = NULL;
11932   __Pyx_RefNannyDeclarations
11933   PyObject *__pyx_t_1 = NULL;
11934   __Pyx_RefNannySetupContext("__get__", 0);
11935   __Pyx_XDECREF(__pyx_r);
11936   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L1_error)
11937   __Pyx_GOTREF(__pyx_t_1);
11938   __pyx_r = __pyx_t_1;
11939   __pyx_t_1 = 0;
11940   goto __pyx_L0;
11941 
11942   /* function exit code */
11943   __pyx_L1_error:;
11944   __Pyx_XDECREF(__pyx_t_1);
11945   __Pyx_AddTraceback("yt.geometry.particle_smooth.IDWInterpolationSmooth.p2.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11946   __pyx_r = NULL;
11947   __pyx_L0:;
11948   __Pyx_XGIVEREF(__pyx_r);
11949   __Pyx_RefNannyFinishContext();
11950   return __pyx_r;
11951 }
11952 
11953 /* Python wrapper */
11954 static int __pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_2p2_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_2p2_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)11955 static int __pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_2p2_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
11956   int __pyx_r;
11957   __Pyx_RefNannyDeclarations
11958   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
11959   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_2p2_2__set__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *)__pyx_v_self), ((PyObject *)__pyx_v_value));
11960 
11961   /* function exit code */
11962   __Pyx_RefNannyFinishContext();
11963   return __pyx_r;
11964 }
11965 
__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_2p2_2__set__(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth * __pyx_v_self,PyObject * __pyx_v_value)11966 static int __pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_2p2_2__set__(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self, PyObject *__pyx_v_value) {
11967   int __pyx_r;
11968   __Pyx_RefNannyDeclarations
11969   int __pyx_t_1;
11970   __Pyx_RefNannySetupContext("__set__", 0);
11971   __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 688, __pyx_L1_error)
11972   __pyx_v_self->p2 = __pyx_t_1;
11973 
11974   /* function exit code */
11975   __pyx_r = 0;
11976   goto __pyx_L0;
11977   __pyx_L1_error:;
11978   __Pyx_AddTraceback("yt.geometry.particle_smooth.IDWInterpolationSmooth.p2.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11979   __pyx_r = -1;
11980   __pyx_L0:;
11981   __Pyx_RefNannyFinishContext();
11982   return __pyx_r;
11983 }
11984 
11985 /* "yt/geometry/particle_smooth.pyx":689
11986  *     cdef np.float64_t *fp
11987  *     cdef public int p2
11988  *     cdef public object vals             # <<<<<<<<<<<<<<
11989  *     def initialize(self):
11990  *         cdef np.ndarray tarr
11991  */
11992 
11993 /* Python wrapper */
11994 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals_1__get__(PyObject * __pyx_v_self)11995 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals_1__get__(PyObject *__pyx_v_self) {
11996   PyObject *__pyx_r = 0;
11997   __Pyx_RefNannyDeclarations
11998   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11999   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals___get__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *)__pyx_v_self));
12000 
12001   /* function exit code */
12002   __Pyx_RefNannyFinishContext();
12003   return __pyx_r;
12004 }
12005 
__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals___get__(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth * __pyx_v_self)12006 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals___get__(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self) {
12007   PyObject *__pyx_r = NULL;
12008   __Pyx_RefNannyDeclarations
12009   __Pyx_RefNannySetupContext("__get__", 0);
12010   __Pyx_XDECREF(__pyx_r);
12011   __Pyx_INCREF(__pyx_v_self->vals);
12012   __pyx_r = __pyx_v_self->vals;
12013   goto __pyx_L0;
12014 
12015   /* function exit code */
12016   __pyx_L0:;
12017   __Pyx_XGIVEREF(__pyx_r);
12018   __Pyx_RefNannyFinishContext();
12019   return __pyx_r;
12020 }
12021 
12022 /* Python wrapper */
12023 static int __pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)12024 static int __pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
12025   int __pyx_r;
12026   __Pyx_RefNannyDeclarations
12027   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
12028   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals_2__set__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *)__pyx_v_self), ((PyObject *)__pyx_v_value));
12029 
12030   /* function exit code */
12031   __Pyx_RefNannyFinishContext();
12032   return __pyx_r;
12033 }
12034 
__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals_2__set__(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth * __pyx_v_self,PyObject * __pyx_v_value)12035 static int __pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals_2__set__(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self, PyObject *__pyx_v_value) {
12036   int __pyx_r;
12037   __Pyx_RefNannyDeclarations
12038   __Pyx_RefNannySetupContext("__set__", 0);
12039   __Pyx_INCREF(__pyx_v_value);
12040   __Pyx_GIVEREF(__pyx_v_value);
12041   __Pyx_GOTREF(__pyx_v_self->vals);
12042   __Pyx_DECREF(__pyx_v_self->vals);
12043   __pyx_v_self->vals = __pyx_v_value;
12044 
12045   /* function exit code */
12046   __pyx_r = 0;
12047   __Pyx_RefNannyFinishContext();
12048   return __pyx_r;
12049 }
12050 
12051 /* Python wrapper */
12052 static int __pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals_5__del__(PyObject * __pyx_v_self)12053 static int __pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals_5__del__(PyObject *__pyx_v_self) {
12054   int __pyx_r;
12055   __Pyx_RefNannyDeclarations
12056   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
12057   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals_4__del__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *)__pyx_v_self));
12058 
12059   /* function exit code */
12060   __Pyx_RefNannyFinishContext();
12061   return __pyx_r;
12062 }
12063 
__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals_4__del__(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth * __pyx_v_self)12064 static int __pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals_4__del__(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self) {
12065   int __pyx_r;
12066   __Pyx_RefNannyDeclarations
12067   __Pyx_RefNannySetupContext("__del__", 0);
12068   __Pyx_INCREF(Py_None);
12069   __Pyx_GIVEREF(Py_None);
12070   __Pyx_GOTREF(__pyx_v_self->vals);
12071   __Pyx_DECREF(__pyx_v_self->vals);
12072   __pyx_v_self->vals = Py_None;
12073 
12074   /* function exit code */
12075   __pyx_r = 0;
12076   __Pyx_RefNannyFinishContext();
12077   return __pyx_r;
12078 }
12079 
12080 /* "(tree fragment)":1
12081  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
12082  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
12083  * def __setstate_cython__(self, __pyx_state):
12084  */
12085 
12086 /* Python wrapper */
12087 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_5__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)12088 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12089   PyObject *__pyx_r = 0;
12090   __Pyx_RefNannyDeclarations
12091   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
12092   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *)__pyx_v_self));
12093 
12094   /* function exit code */
12095   __Pyx_RefNannyFinishContext();
12096   return __pyx_r;
12097 }
12098 
__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth * __pyx_v_self)12099 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self) {
12100   PyObject *__pyx_r = NULL;
12101   __Pyx_RefNannyDeclarations
12102   PyObject *__pyx_t_1 = NULL;
12103   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
12104 
12105   /* "(tree fragment)":2
12106  * def __reduce_cython__(self):
12107  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
12108  * def __setstate_cython__(self, __pyx_state):
12109  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
12110  */
12111   __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)
12112   __Pyx_GOTREF(__pyx_t_1);
12113   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
12114   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12115   __PYX_ERR(1, 2, __pyx_L1_error)
12116 
12117   /* "(tree fragment)":1
12118  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
12119  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
12120  * def __setstate_cython__(self, __pyx_state):
12121  */
12122 
12123   /* function exit code */
12124   __pyx_L1_error:;
12125   __Pyx_XDECREF(__pyx_t_1);
12126   __Pyx_AddTraceback("yt.geometry.particle_smooth.IDWInterpolationSmooth.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12127   __pyx_r = NULL;
12128   __Pyx_XGIVEREF(__pyx_r);
12129   __Pyx_RefNannyFinishContext();
12130   return __pyx_r;
12131 }
12132 
12133 /* "(tree fragment)":3
12134  * def __reduce_cython__(self):
12135  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
12136  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
12137  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
12138  */
12139 
12140 /* Python wrapper */
12141 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_7__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)12142 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
12143   PyObject *__pyx_r = 0;
12144   __Pyx_RefNannyDeclarations
12145   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
12146   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
12147 
12148   /* function exit code */
12149   __Pyx_RefNannyFinishContext();
12150   return __pyx_r;
12151 }
12152 
__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)12153 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
12154   PyObject *__pyx_r = NULL;
12155   __Pyx_RefNannyDeclarations
12156   PyObject *__pyx_t_1 = NULL;
12157   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
12158 
12159   /* "(tree fragment)":4
12160  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
12161  * def __setstate_cython__(self, __pyx_state):
12162  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
12163  */
12164   __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)
12165   __Pyx_GOTREF(__pyx_t_1);
12166   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
12167   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12168   __PYX_ERR(1, 4, __pyx_L1_error)
12169 
12170   /* "(tree fragment)":3
12171  * def __reduce_cython__(self):
12172  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
12173  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
12174  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
12175  */
12176 
12177   /* function exit code */
12178   __pyx_L1_error:;
12179   __Pyx_XDECREF(__pyx_t_1);
12180   __Pyx_AddTraceback("yt.geometry.particle_smooth.IDWInterpolationSmooth.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12181   __pyx_r = NULL;
12182   __Pyx_XGIVEREF(__pyx_r);
12183   __Pyx_RefNannyFinishContext();
12184   return __pyx_r;
12185 }
12186 
12187 /* "yt/geometry/particle_smooth.pyx":731
12188  * cdef class NthNeighborDistanceSmooth(ParticleSmoothOperation):
12189  *
12190  *     def initialize(self):             # <<<<<<<<<<<<<<
12191  *         return
12192  *
12193  */
12194 
12195 /* Python wrapper */
12196 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_1initialize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_1initialize(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)12197 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_1initialize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12198   PyObject *__pyx_r = 0;
12199   __Pyx_RefNannyDeclarations
12200   __Pyx_RefNannySetupContext("initialize (wrapper)", 0);
12201   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_initialize(((struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *)__pyx_v_self));
12202 
12203   /* function exit code */
12204   __Pyx_RefNannyFinishContext();
12205   return __pyx_r;
12206 }
12207 
__pyx_pf_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_initialize(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth * __pyx_v_self)12208 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_initialize(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *__pyx_v_self) {
12209   PyObject *__pyx_r = NULL;
12210   __Pyx_RefNannyDeclarations
12211   __Pyx_RefNannySetupContext("initialize", 0);
12212 
12213   /* "yt/geometry/particle_smooth.pyx":732
12214  *
12215  *     def initialize(self):
12216  *         return             # <<<<<<<<<<<<<<
12217  *
12218  *     def finalize(self):
12219  */
12220   __Pyx_XDECREF(__pyx_r);
12221   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12222   goto __pyx_L0;
12223 
12224   /* "yt/geometry/particle_smooth.pyx":731
12225  * cdef class NthNeighborDistanceSmooth(ParticleSmoothOperation):
12226  *
12227  *     def initialize(self):             # <<<<<<<<<<<<<<
12228  *         return
12229  *
12230  */
12231 
12232   /* function exit code */
12233   __pyx_L0:;
12234   __Pyx_XGIVEREF(__pyx_r);
12235   __Pyx_RefNannyFinishContext();
12236   return __pyx_r;
12237 }
12238 
12239 /* "yt/geometry/particle_smooth.pyx":734
12240  *         return
12241  *
12242  *     def finalize(self):             # <<<<<<<<<<<<<<
12243  *         return
12244  *
12245  */
12246 
12247 /* Python wrapper */
12248 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_3finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_3finalize(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)12249 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_3finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12250   PyObject *__pyx_r = 0;
12251   __Pyx_RefNannyDeclarations
12252   __Pyx_RefNannySetupContext("finalize (wrapper)", 0);
12253   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_2finalize(((struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *)__pyx_v_self));
12254 
12255   /* function exit code */
12256   __Pyx_RefNannyFinishContext();
12257   return __pyx_r;
12258 }
12259 
__pyx_pf_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_2finalize(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth * __pyx_v_self)12260 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_2finalize(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *__pyx_v_self) {
12261   PyObject *__pyx_r = NULL;
12262   __Pyx_RefNannyDeclarations
12263   __Pyx_RefNannySetupContext("finalize", 0);
12264 
12265   /* "yt/geometry/particle_smooth.pyx":735
12266  *
12267  *     def finalize(self):
12268  *         return             # <<<<<<<<<<<<<<
12269  *
12270  *     @cython.cdivision(True)
12271  */
12272   __Pyx_XDECREF(__pyx_r);
12273   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12274   goto __pyx_L0;
12275 
12276   /* "yt/geometry/particle_smooth.pyx":734
12277  *         return
12278  *
12279  *     def finalize(self):             # <<<<<<<<<<<<<<
12280  *         return
12281  *
12282  */
12283 
12284   /* function exit code */
12285   __pyx_L0:;
12286   __Pyx_XGIVEREF(__pyx_r);
12287   __Pyx_RefNannyFinishContext();
12288   return __pyx_r;
12289 }
12290 
12291 /* "yt/geometry/particle_smooth.pyx":741
12292  *     @cython.wraparound(False)
12293  *     @cython.initializedcheck(False)
12294  *     cdef void process(self, np.int64_t offset, int i, int j, int k,             # <<<<<<<<<<<<<<
12295  *                       int dim[3], np.float64_t cpos[3], np.float64_t **fields,
12296  *                       np.float64_t **index_fields, DistanceQueue dq):
12297  */
12298 
__pyx_f_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_process(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth * __pyx_v_self,__pyx_t_5numpy_int64_t __pyx_v_offset,CYTHON_UNUSED int __pyx_v_i,CYTHON_UNUSED int __pyx_v_j,CYTHON_UNUSED int __pyx_v_k,CYTHON_UNUSED int * __pyx_v_dim,CYTHON_UNUSED __pyx_t_5numpy_float64_t * __pyx_v_cpos,__pyx_t_5numpy_float64_t ** __pyx_v_fields,CYTHON_UNUSED __pyx_t_5numpy_float64_t ** __pyx_v_index_fields,struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue * __pyx_v_dq)12299 static void __pyx_f_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_process(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, CYTHON_UNUSED int __pyx_v_i, CYTHON_UNUSED int __pyx_v_j, CYTHON_UNUSED int __pyx_v_k, CYTHON_UNUSED int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq) {
12300   __pyx_t_5numpy_float64_t __pyx_v_max_r;
12301   __Pyx_RefNannyDeclarations
12302   __Pyx_RefNannySetupContext("process", 0);
12303 
12304   /* "yt/geometry/particle_smooth.pyx":746
12305  *         cdef np.float64_t max_r
12306  *         # We assume "offset" here is the particle index.
12307  *         max_r = sqrt(dq.neighbors[dq.curn-1].r2)             # <<<<<<<<<<<<<<
12308  *         fields[0][offset] = max_r
12309  *
12310  */
12311   __pyx_v_max_r = sqrt((__pyx_v_dq->neighbors[(__pyx_v_dq->__pyx_base.curn - 1)]).r2);
12312 
12313   /* "yt/geometry/particle_smooth.pyx":747
12314  *         # We assume "offset" here is the particle index.
12315  *         max_r = sqrt(dq.neighbors[dq.curn-1].r2)
12316  *         fields[0][offset] = max_r             # <<<<<<<<<<<<<<
12317  *
12318  * nth_neighbor_smooth = NthNeighborDistanceSmooth
12319  */
12320   ((__pyx_v_fields[0])[__pyx_v_offset]) = __pyx_v_max_r;
12321 
12322   /* "yt/geometry/particle_smooth.pyx":741
12323  *     @cython.wraparound(False)
12324  *     @cython.initializedcheck(False)
12325  *     cdef void process(self, np.int64_t offset, int i, int j, int k,             # <<<<<<<<<<<<<<
12326  *                       int dim[3], np.float64_t cpos[3], np.float64_t **fields,
12327  *                       np.float64_t **index_fields, DistanceQueue dq):
12328  */
12329 
12330   /* function exit code */
12331   __Pyx_RefNannyFinishContext();
12332 }
12333 
12334 /* "(tree fragment)":1
12335  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
12336  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
12337  * def __setstate_cython__(self, __pyx_state):
12338  */
12339 
12340 /* Python wrapper */
12341 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_5__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)12342 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12343   PyObject *__pyx_r = 0;
12344   __Pyx_RefNannyDeclarations
12345   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
12346   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *)__pyx_v_self));
12347 
12348   /* function exit code */
12349   __Pyx_RefNannyFinishContext();
12350   return __pyx_r;
12351 }
12352 
__pyx_pf_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth * __pyx_v_self)12353 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *__pyx_v_self) {
12354   PyObject *__pyx_r = NULL;
12355   __Pyx_RefNannyDeclarations
12356   PyObject *__pyx_t_1 = NULL;
12357   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
12358 
12359   /* "(tree fragment)":2
12360  * def __reduce_cython__(self):
12361  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
12362  * def __setstate_cython__(self, __pyx_state):
12363  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
12364  */
12365   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
12366   __Pyx_GOTREF(__pyx_t_1);
12367   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
12368   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12369   __PYX_ERR(1, 2, __pyx_L1_error)
12370 
12371   /* "(tree fragment)":1
12372  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
12373  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
12374  * def __setstate_cython__(self, __pyx_state):
12375  */
12376 
12377   /* function exit code */
12378   __pyx_L1_error:;
12379   __Pyx_XDECREF(__pyx_t_1);
12380   __Pyx_AddTraceback("yt.geometry.particle_smooth.NthNeighborDistanceSmooth.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12381   __pyx_r = NULL;
12382   __Pyx_XGIVEREF(__pyx_r);
12383   __Pyx_RefNannyFinishContext();
12384   return __pyx_r;
12385 }
12386 
12387 /* "(tree fragment)":3
12388  * def __reduce_cython__(self):
12389  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
12390  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
12391  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
12392  */
12393 
12394 /* Python wrapper */
12395 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_7__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)12396 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
12397   PyObject *__pyx_r = 0;
12398   __Pyx_RefNannyDeclarations
12399   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
12400   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
12401 
12402   /* function exit code */
12403   __Pyx_RefNannyFinishContext();
12404   return __pyx_r;
12405 }
12406 
__pyx_pf_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)12407 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
12408   PyObject *__pyx_r = NULL;
12409   __Pyx_RefNannyDeclarations
12410   PyObject *__pyx_t_1 = NULL;
12411   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
12412 
12413   /* "(tree fragment)":4
12414  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
12415  * def __setstate_cython__(self, __pyx_state):
12416  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
12417  */
12418   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
12419   __Pyx_GOTREF(__pyx_t_1);
12420   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
12421   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12422   __PYX_ERR(1, 4, __pyx_L1_error)
12423 
12424   /* "(tree fragment)":3
12425  * def __reduce_cython__(self):
12426  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
12427  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
12428  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
12429  */
12430 
12431   /* function exit code */
12432   __pyx_L1_error:;
12433   __Pyx_XDECREF(__pyx_t_1);
12434   __Pyx_AddTraceback("yt.geometry.particle_smooth.NthNeighborDistanceSmooth.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12435   __pyx_r = NULL;
12436   __Pyx_XGIVEREF(__pyx_r);
12437   __Pyx_RefNannyFinishContext();
12438   return __pyx_r;
12439 }
12440 
12441 /* "yt/geometry/particle_smooth.pyx":752
12442  *
12443  * cdef class SmoothedDensityEstimate(ParticleSmoothOperation):
12444  *     def initialize(self):             # <<<<<<<<<<<<<<
12445  *         return
12446  *
12447  */
12448 
12449 /* Python wrapper */
12450 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_1initialize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_1initialize(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)12451 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_1initialize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12452   PyObject *__pyx_r = 0;
12453   __Pyx_RefNannyDeclarations
12454   __Pyx_RefNannySetupContext("initialize (wrapper)", 0);
12455   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_initialize(((struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *)__pyx_v_self));
12456 
12457   /* function exit code */
12458   __Pyx_RefNannyFinishContext();
12459   return __pyx_r;
12460 }
12461 
__pyx_pf_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_initialize(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate * __pyx_v_self)12462 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_initialize(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *__pyx_v_self) {
12463   PyObject *__pyx_r = NULL;
12464   __Pyx_RefNannyDeclarations
12465   __Pyx_RefNannySetupContext("initialize", 0);
12466 
12467   /* "yt/geometry/particle_smooth.pyx":753
12468  * cdef class SmoothedDensityEstimate(ParticleSmoothOperation):
12469  *     def initialize(self):
12470  *         return             # <<<<<<<<<<<<<<
12471  *
12472  *     def finalize(self):
12473  */
12474   __Pyx_XDECREF(__pyx_r);
12475   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12476   goto __pyx_L0;
12477 
12478   /* "yt/geometry/particle_smooth.pyx":752
12479  *
12480  * cdef class SmoothedDensityEstimate(ParticleSmoothOperation):
12481  *     def initialize(self):             # <<<<<<<<<<<<<<
12482  *         return
12483  *
12484  */
12485 
12486   /* function exit code */
12487   __pyx_L0:;
12488   __Pyx_XGIVEREF(__pyx_r);
12489   __Pyx_RefNannyFinishContext();
12490   return __pyx_r;
12491 }
12492 
12493 /* "yt/geometry/particle_smooth.pyx":755
12494  *         return
12495  *
12496  *     def finalize(self):             # <<<<<<<<<<<<<<
12497  *         return
12498  *
12499  */
12500 
12501 /* Python wrapper */
12502 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_3finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_3finalize(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)12503 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_3finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12504   PyObject *__pyx_r = 0;
12505   __Pyx_RefNannyDeclarations
12506   __Pyx_RefNannySetupContext("finalize (wrapper)", 0);
12507   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_2finalize(((struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *)__pyx_v_self));
12508 
12509   /* function exit code */
12510   __Pyx_RefNannyFinishContext();
12511   return __pyx_r;
12512 }
12513 
__pyx_pf_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_2finalize(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate * __pyx_v_self)12514 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_2finalize(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *__pyx_v_self) {
12515   PyObject *__pyx_r = NULL;
12516   __Pyx_RefNannyDeclarations
12517   __Pyx_RefNannySetupContext("finalize", 0);
12518 
12519   /* "yt/geometry/particle_smooth.pyx":756
12520  *
12521  *     def finalize(self):
12522  *         return             # <<<<<<<<<<<<<<
12523  *
12524  *     @cython.cdivision(True)
12525  */
12526   __Pyx_XDECREF(__pyx_r);
12527   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12528   goto __pyx_L0;
12529 
12530   /* "yt/geometry/particle_smooth.pyx":755
12531  *         return
12532  *
12533  *     def finalize(self):             # <<<<<<<<<<<<<<
12534  *         return
12535  *
12536  */
12537 
12538   /* function exit code */
12539   __pyx_L0:;
12540   __Pyx_XGIVEREF(__pyx_r);
12541   __Pyx_RefNannyFinishContext();
12542   return __pyx_r;
12543 }
12544 
12545 /* "yt/geometry/particle_smooth.pyx":762
12546  *     @cython.wraparound(False)
12547  *     @cython.initializedcheck(False)
12548  *     cdef void process(self, np.int64_t offset, int i, int j, int k,             # <<<<<<<<<<<<<<
12549  *                       int dim[3], np.float64_t cpos[3], np.float64_t **fields,
12550  *                       np.float64_t **index_fields, DistanceQueue dq):
12551  */
12552 
__pyx_f_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate * __pyx_v_self,__pyx_t_5numpy_int64_t __pyx_v_offset,CYTHON_UNUSED int __pyx_v_i,CYTHON_UNUSED int __pyx_v_j,CYTHON_UNUSED int __pyx_v_k,CYTHON_UNUSED int * __pyx_v_dim,CYTHON_UNUSED __pyx_t_5numpy_float64_t * __pyx_v_cpos,__pyx_t_5numpy_float64_t ** __pyx_v_fields,CYTHON_UNUSED __pyx_t_5numpy_float64_t ** __pyx_v_index_fields,struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue * __pyx_v_dq)12553 static void __pyx_f_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, CYTHON_UNUSED int __pyx_v_i, CYTHON_UNUSED int __pyx_v_j, CYTHON_UNUSED int __pyx_v_k, CYTHON_UNUSED int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq) {
12554   __pyx_t_5numpy_float64_t __pyx_v_r2;
12555   __pyx_t_5numpy_float64_t __pyx_v_hsml;
12556   __pyx_t_5numpy_float64_t __pyx_v_dens;
12557   __pyx_t_5numpy_float64_t __pyx_v_mass;
12558   __pyx_t_5numpy_float64_t __pyx_v_weight;
12559   __pyx_t_5numpy_float64_t __pyx_v_lw;
12560   int __pyx_v_pn;
12561   __Pyx_RefNannyDeclarations
12562   int __pyx_t_1;
12563   int __pyx_t_2;
12564   int __pyx_t_3;
12565   __pyx_t_5numpy_float64_t __pyx_t_4;
12566   __Pyx_RefNannySetupContext("process", 0);
12567 
12568   /* "yt/geometry/particle_smooth.pyx":768
12569  *         cdef int pn
12570  *         # We assume "offset" here is the particle index.
12571  *         hsml = sqrt(dq.neighbors[dq.curn-1].r2)             # <<<<<<<<<<<<<<
12572  *         dens = 0.0
12573  *         weight = 0.0
12574  */
12575   __pyx_v_hsml = sqrt((__pyx_v_dq->neighbors[(__pyx_v_dq->__pyx_base.curn - 1)]).r2);
12576 
12577   /* "yt/geometry/particle_smooth.pyx":769
12578  *         # We assume "offset" here is the particle index.
12579  *         hsml = sqrt(dq.neighbors[dq.curn-1].r2)
12580  *         dens = 0.0             # <<<<<<<<<<<<<<
12581  *         weight = 0.0
12582  *         for pn in range(dq.curn):
12583  */
12584   __pyx_v_dens = 0.0;
12585 
12586   /* "yt/geometry/particle_smooth.pyx":770
12587  *         hsml = sqrt(dq.neighbors[dq.curn-1].r2)
12588  *         dens = 0.0
12589  *         weight = 0.0             # <<<<<<<<<<<<<<
12590  *         for pn in range(dq.curn):
12591  *             mass = fields[0][dq.neighbors[pn].pn]
12592  */
12593   __pyx_v_weight = 0.0;
12594 
12595   /* "yt/geometry/particle_smooth.pyx":771
12596  *         dens = 0.0
12597  *         weight = 0.0
12598  *         for pn in range(dq.curn):             # <<<<<<<<<<<<<<
12599  *             mass = fields[0][dq.neighbors[pn].pn]
12600  *             r2 = dq.neighbors[pn].r2
12601  */
12602   __pyx_t_1 = __pyx_v_dq->__pyx_base.curn;
12603   __pyx_t_2 = __pyx_t_1;
12604   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
12605     __pyx_v_pn = __pyx_t_3;
12606 
12607     /* "yt/geometry/particle_smooth.pyx":772
12608  *         weight = 0.0
12609  *         for pn in range(dq.curn):
12610  *             mass = fields[0][dq.neighbors[pn].pn]             # <<<<<<<<<<<<<<
12611  *             r2 = dq.neighbors[pn].r2
12612  *             lw = self.sph_kernel(sqrt(r2) / hsml)
12613  */
12614     __pyx_v_mass = ((__pyx_v_fields[0])[(__pyx_v_dq->neighbors[__pyx_v_pn]).pn]);
12615 
12616     /* "yt/geometry/particle_smooth.pyx":773
12617  *         for pn in range(dq.curn):
12618  *             mass = fields[0][dq.neighbors[pn].pn]
12619  *             r2 = dq.neighbors[pn].r2             # <<<<<<<<<<<<<<
12620  *             lw = self.sph_kernel(sqrt(r2) / hsml)
12621  *             dens += mass * lw
12622  */
12623     __pyx_t_4 = (__pyx_v_dq->neighbors[__pyx_v_pn]).r2;
12624     __pyx_v_r2 = __pyx_t_4;
12625 
12626     /* "yt/geometry/particle_smooth.pyx":774
12627  *             mass = fields[0][dq.neighbors[pn].pn]
12628  *             r2 = dq.neighbors[pn].r2
12629  *             lw = self.sph_kernel(sqrt(r2) / hsml)             # <<<<<<<<<<<<<<
12630  *             dens += mass * lw
12631  *         weight = (4.0/3.0) * 3.1415926 * hsml**3
12632  */
12633     __pyx_v_lw = __pyx_v_self->__pyx_base.sph_kernel((sqrt(__pyx_v_r2) / __pyx_v_hsml));
12634 
12635     /* "yt/geometry/particle_smooth.pyx":775
12636  *             r2 = dq.neighbors[pn].r2
12637  *             lw = self.sph_kernel(sqrt(r2) / hsml)
12638  *             dens += mass * lw             # <<<<<<<<<<<<<<
12639  *         weight = (4.0/3.0) * 3.1415926 * hsml**3
12640  *         fields[1][offset] = dens/weight
12641  */
12642     __pyx_v_dens = (__pyx_v_dens + (__pyx_v_mass * __pyx_v_lw));
12643   }
12644 
12645   /* "yt/geometry/particle_smooth.pyx":776
12646  *             lw = self.sph_kernel(sqrt(r2) / hsml)
12647  *             dens += mass * lw
12648  *         weight = (4.0/3.0) * 3.1415926 * hsml**3             # <<<<<<<<<<<<<<
12649  *         fields[1][offset] = dens/weight
12650  *
12651  */
12652   __pyx_v_weight = (((4.0 / 3.0) * 3.1415926) * pow(__pyx_v_hsml, 3.0));
12653 
12654   /* "yt/geometry/particle_smooth.pyx":777
12655  *             dens += mass * lw
12656  *         weight = (4.0/3.0) * 3.1415926 * hsml**3
12657  *         fields[1][offset] = dens/weight             # <<<<<<<<<<<<<<
12658  *
12659  * density_smooth = SmoothedDensityEstimate
12660  */
12661   ((__pyx_v_fields[1])[__pyx_v_offset]) = (__pyx_v_dens / __pyx_v_weight);
12662 
12663   /* "yt/geometry/particle_smooth.pyx":762
12664  *     @cython.wraparound(False)
12665  *     @cython.initializedcheck(False)
12666  *     cdef void process(self, np.int64_t offset, int i, int j, int k,             # <<<<<<<<<<<<<<
12667  *                       int dim[3], np.float64_t cpos[3], np.float64_t **fields,
12668  *                       np.float64_t **index_fields, DistanceQueue dq):
12669  */
12670 
12671   /* function exit code */
12672   __Pyx_RefNannyFinishContext();
12673 }
12674 
12675 /* "(tree fragment)":1
12676  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
12677  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
12678  * def __setstate_cython__(self, __pyx_state):
12679  */
12680 
12681 /* Python wrapper */
12682 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_5__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)12683 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12684   PyObject *__pyx_r = 0;
12685   __Pyx_RefNannyDeclarations
12686   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
12687   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *)__pyx_v_self));
12688 
12689   /* function exit code */
12690   __Pyx_RefNannyFinishContext();
12691   return __pyx_r;
12692 }
12693 
__pyx_pf_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate * __pyx_v_self)12694 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *__pyx_v_self) {
12695   PyObject *__pyx_r = NULL;
12696   __Pyx_RefNannyDeclarations
12697   PyObject *__pyx_t_1 = NULL;
12698   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
12699 
12700   /* "(tree fragment)":2
12701  * def __reduce_cython__(self):
12702  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
12703  * def __setstate_cython__(self, __pyx_state):
12704  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
12705  */
12706   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
12707   __Pyx_GOTREF(__pyx_t_1);
12708   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
12709   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12710   __PYX_ERR(1, 2, __pyx_L1_error)
12711 
12712   /* "(tree fragment)":1
12713  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
12714  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
12715  * def __setstate_cython__(self, __pyx_state):
12716  */
12717 
12718   /* function exit code */
12719   __pyx_L1_error:;
12720   __Pyx_XDECREF(__pyx_t_1);
12721   __Pyx_AddTraceback("yt.geometry.particle_smooth.SmoothedDensityEstimate.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12722   __pyx_r = NULL;
12723   __Pyx_XGIVEREF(__pyx_r);
12724   __Pyx_RefNannyFinishContext();
12725   return __pyx_r;
12726 }
12727 
12728 /* "(tree fragment)":3
12729  * def __reduce_cython__(self):
12730  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
12731  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
12732  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
12733  */
12734 
12735 /* Python wrapper */
12736 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_7__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)12737 static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
12738   PyObject *__pyx_r = 0;
12739   __Pyx_RefNannyDeclarations
12740   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
12741   __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
12742 
12743   /* function exit code */
12744   __Pyx_RefNannyFinishContext();
12745   return __pyx_r;
12746 }
12747 
__pyx_pf_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)12748 static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
12749   PyObject *__pyx_r = NULL;
12750   __Pyx_RefNannyDeclarations
12751   PyObject *__pyx_t_1 = NULL;
12752   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
12753 
12754   /* "(tree fragment)":4
12755  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
12756  * def __setstate_cython__(self, __pyx_state):
12757  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
12758  */
12759   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
12760   __Pyx_GOTREF(__pyx_t_1);
12761   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
12762   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12763   __PYX_ERR(1, 4, __pyx_L1_error)
12764 
12765   /* "(tree fragment)":3
12766  * def __reduce_cython__(self):
12767  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
12768  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
12769  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
12770  */
12771 
12772   /* function exit code */
12773   __pyx_L1_error:;
12774   __Pyx_XDECREF(__pyx_t_1);
12775   __Pyx_AddTraceback("yt.geometry.particle_smooth.SmoothedDensityEstimate.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12776   __pyx_r = NULL;
12777   __Pyx_XGIVEREF(__pyx_r);
12778   __Pyx_RefNannyFinishContext();
12779   return __pyx_r;
12780 }
12781 
12782 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258
12783  *         # experimental exception made for __getbuffer__ and __releasebuffer__
12784  *         # -- the details of this may change.
12785  *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
12786  *             # This implementation of getbuffer is geared towards Cython
12787  *             # requirements, and does not yet fulfill the PEP.
12788  */
12789 
12790 /* Python wrapper */
12791 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
__pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)12792 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12793   int __pyx_r;
12794   __Pyx_RefNannyDeclarations
12795   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
12796   __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
12797 
12798   /* function exit code */
12799   __Pyx_RefNannyFinishContext();
12800   return __pyx_r;
12801 }
12802 
__pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)12803 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12804   int __pyx_v_i;
12805   int __pyx_v_ndim;
12806   int __pyx_v_endian_detector;
12807   int __pyx_v_little_endian;
12808   int __pyx_v_t;
12809   char *__pyx_v_f;
12810   PyArray_Descr *__pyx_v_descr = 0;
12811   int __pyx_v_offset;
12812   int __pyx_r;
12813   __Pyx_RefNannyDeclarations
12814   int __pyx_t_1;
12815   int __pyx_t_2;
12816   PyObject *__pyx_t_3 = NULL;
12817   int __pyx_t_4;
12818   int __pyx_t_5;
12819   int __pyx_t_6;
12820   PyArray_Descr *__pyx_t_7;
12821   PyObject *__pyx_t_8 = NULL;
12822   char *__pyx_t_9;
12823   if (__pyx_v_info == NULL) {
12824     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
12825     return -1;
12826   }
12827   __Pyx_RefNannySetupContext("__getbuffer__", 0);
12828   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
12829   __Pyx_GIVEREF(__pyx_v_info->obj);
12830 
12831   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265
12832  *
12833  *             cdef int i, ndim
12834  *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
12835  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
12836  *
12837  */
12838   __pyx_v_endian_detector = 1;
12839 
12840   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266
12841  *             cdef int i, ndim
12842  *             cdef int endian_detector = 1
12843  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
12844  *
12845  *             ndim = PyArray_NDIM(self)
12846  */
12847   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
12848 
12849   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268
12850  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
12851  *
12852  *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
12853  *
12854  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
12855  */
12856   __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
12857 
12858   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
12859  *             ndim = PyArray_NDIM(self)
12860  *
12861  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
12862  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
12863  *                 raise ValueError(u"ndarray is not C contiguous")
12864  */
12865   __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
12866   if (__pyx_t_2) {
12867   } else {
12868     __pyx_t_1 = __pyx_t_2;
12869     goto __pyx_L4_bool_binop_done;
12870   }
12871 
12872   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271
12873  *
12874  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
12875  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
12876  *                 raise ValueError(u"ndarray is not C contiguous")
12877  *
12878  */
12879   __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
12880   __pyx_t_1 = __pyx_t_2;
12881   __pyx_L4_bool_binop_done:;
12882 
12883   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
12884  *             ndim = PyArray_NDIM(self)
12885  *
12886  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
12887  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
12888  *                 raise ValueError(u"ndarray is not C contiguous")
12889  */
12890   if (unlikely(__pyx_t_1)) {
12891 
12892     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272
12893  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
12894  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
12895  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
12896  *
12897  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
12898  */
12899     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 272, __pyx_L1_error)
12900     __Pyx_GOTREF(__pyx_t_3);
12901     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12902     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12903     __PYX_ERR(2, 272, __pyx_L1_error)
12904 
12905     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
12906  *             ndim = PyArray_NDIM(self)
12907  *
12908  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
12909  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
12910  *                 raise ValueError(u"ndarray is not C contiguous")
12911  */
12912   }
12913 
12914   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
12915  *                 raise ValueError(u"ndarray is not C contiguous")
12916  *
12917  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
12918  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
12919  *                 raise ValueError(u"ndarray is not Fortran contiguous")
12920  */
12921   __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
12922   if (__pyx_t_2) {
12923   } else {
12924     __pyx_t_1 = __pyx_t_2;
12925     goto __pyx_L7_bool_binop_done;
12926   }
12927 
12928   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275
12929  *
12930  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
12931  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
12932  *                 raise ValueError(u"ndarray is not Fortran contiguous")
12933  *
12934  */
12935   __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
12936   __pyx_t_1 = __pyx_t_2;
12937   __pyx_L7_bool_binop_done:;
12938 
12939   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
12940  *                 raise ValueError(u"ndarray is not C contiguous")
12941  *
12942  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
12943  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
12944  *                 raise ValueError(u"ndarray is not Fortran contiguous")
12945  */
12946   if (unlikely(__pyx_t_1)) {
12947 
12948     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276
12949  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
12950  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
12951  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
12952  *
12953  *             info.buf = PyArray_DATA(self)
12954  */
12955     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 276, __pyx_L1_error)
12956     __Pyx_GOTREF(__pyx_t_3);
12957     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12958     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12959     __PYX_ERR(2, 276, __pyx_L1_error)
12960 
12961     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
12962  *                 raise ValueError(u"ndarray is not C contiguous")
12963  *
12964  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
12965  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
12966  *                 raise ValueError(u"ndarray is not Fortran contiguous")
12967  */
12968   }
12969 
12970   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278
12971  *                 raise ValueError(u"ndarray is not Fortran contiguous")
12972  *
12973  *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
12974  *             info.ndim = ndim
12975  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
12976  */
12977   __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
12978 
12979   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279
12980  *
12981  *             info.buf = PyArray_DATA(self)
12982  *             info.ndim = ndim             # <<<<<<<<<<<<<<
12983  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
12984  *                 # Allocate new buffer for strides and shape info.
12985  */
12986   __pyx_v_info->ndim = __pyx_v_ndim;
12987 
12988   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280
12989  *             info.buf = PyArray_DATA(self)
12990  *             info.ndim = ndim
12991  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
12992  *                 # Allocate new buffer for strides and shape info.
12993  *                 # This is allocated as one block, strides first.
12994  */
12995   __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
12996   if (__pyx_t_1) {
12997 
12998     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283
12999  *                 # Allocate new buffer for strides and shape info.
13000  *                 # This is allocated as one block, strides first.
13001  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)             # <<<<<<<<<<<<<<
13002  *                 info.shape = info.strides + ndim
13003  *                 for i in range(ndim):
13004  */
13005     __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
13006 
13007     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284
13008  *                 # This is allocated as one block, strides first.
13009  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
13010  *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
13011  *                 for i in range(ndim):
13012  *                     info.strides[i] = PyArray_STRIDES(self)[i]
13013  */
13014     __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
13015 
13016     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":285
13017  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
13018  *                 info.shape = info.strides + ndim
13019  *                 for i in range(ndim):             # <<<<<<<<<<<<<<
13020  *                     info.strides[i] = PyArray_STRIDES(self)[i]
13021  *                     info.shape[i] = PyArray_DIMS(self)[i]
13022  */
13023     __pyx_t_4 = __pyx_v_ndim;
13024     __pyx_t_5 = __pyx_t_4;
13025     for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
13026       __pyx_v_i = __pyx_t_6;
13027 
13028       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286
13029  *                 info.shape = info.strides + ndim
13030  *                 for i in range(ndim):
13031  *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
13032  *                     info.shape[i] = PyArray_DIMS(self)[i]
13033  *             else:
13034  */
13035       (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
13036 
13037       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287
13038  *                 for i in range(ndim):
13039  *                     info.strides[i] = PyArray_STRIDES(self)[i]
13040  *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
13041  *             else:
13042  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
13043  */
13044       (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
13045     }
13046 
13047     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280
13048  *             info.buf = PyArray_DATA(self)
13049  *             info.ndim = ndim
13050  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
13051  *                 # Allocate new buffer for strides and shape info.
13052  *                 # This is allocated as one block, strides first.
13053  */
13054     goto __pyx_L9;
13055   }
13056 
13057   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289
13058  *                     info.shape[i] = PyArray_DIMS(self)[i]
13059  *             else:
13060  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
13061  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
13062  *             info.suboffsets = NULL
13063  */
13064   /*else*/ {
13065     __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
13066 
13067     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":290
13068  *             else:
13069  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
13070  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
13071  *             info.suboffsets = NULL
13072  *             info.itemsize = PyArray_ITEMSIZE(self)
13073  */
13074     __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
13075   }
13076   __pyx_L9:;
13077 
13078   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":291
13079  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
13080  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
13081  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
13082  *             info.itemsize = PyArray_ITEMSIZE(self)
13083  *             info.readonly = not PyArray_ISWRITEABLE(self)
13084  */
13085   __pyx_v_info->suboffsets = NULL;
13086 
13087   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292
13088  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
13089  *             info.suboffsets = NULL
13090  *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
13091  *             info.readonly = not PyArray_ISWRITEABLE(self)
13092  *
13093  */
13094   __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
13095 
13096   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":293
13097  *             info.suboffsets = NULL
13098  *             info.itemsize = PyArray_ITEMSIZE(self)
13099  *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
13100  *
13101  *             cdef int t
13102  */
13103   __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
13104 
13105   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296
13106  *
13107  *             cdef int t
13108  *             cdef char* f = NULL             # <<<<<<<<<<<<<<
13109  *             cdef dtype descr = <dtype>PyArray_DESCR(self)
13110  *             cdef int offset
13111  */
13112   __pyx_v_f = NULL;
13113 
13114   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297
13115  *             cdef int t
13116  *             cdef char* f = NULL
13117  *             cdef dtype descr = <dtype>PyArray_DESCR(self)             # <<<<<<<<<<<<<<
13118  *             cdef int offset
13119  *
13120  */
13121   __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
13122   __pyx_t_3 = ((PyObject *)__pyx_t_7);
13123   __Pyx_INCREF(__pyx_t_3);
13124   __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
13125   __pyx_t_3 = 0;
13126 
13127   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":300
13128  *             cdef int offset
13129  *
13130  *             info.obj = self             # <<<<<<<<<<<<<<
13131  *
13132  *             if not PyDataType_HASFIELDS(descr):
13133  */
13134   __Pyx_INCREF(((PyObject *)__pyx_v_self));
13135   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13136   __Pyx_GOTREF(__pyx_v_info->obj);
13137   __Pyx_DECREF(__pyx_v_info->obj);
13138   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
13139 
13140   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302
13141  *             info.obj = self
13142  *
13143  *             if not PyDataType_HASFIELDS(descr):             # <<<<<<<<<<<<<<
13144  *                 t = descr.type_num
13145  *                 if ((descr.byteorder == c'>' and little_endian) or
13146  */
13147   __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
13148   if (__pyx_t_1) {
13149 
13150     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":303
13151  *
13152  *             if not PyDataType_HASFIELDS(descr):
13153  *                 t = descr.type_num             # <<<<<<<<<<<<<<
13154  *                 if ((descr.byteorder == c'>' and little_endian) or
13155  *                     (descr.byteorder == c'<' and not little_endian)):
13156  */
13157     __pyx_t_4 = __pyx_v_descr->type_num;
13158     __pyx_v_t = __pyx_t_4;
13159 
13160     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
13161  *             if not PyDataType_HASFIELDS(descr):
13162  *                 t = descr.type_num
13163  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
13164  *                     (descr.byteorder == c'<' and not little_endian)):
13165  *                     raise ValueError(u"Non-native byte order not supported")
13166  */
13167     __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
13168     if (!__pyx_t_2) {
13169       goto __pyx_L15_next_or;
13170     } else {
13171     }
13172     __pyx_t_2 = (__pyx_v_little_endian != 0);
13173     if (!__pyx_t_2) {
13174     } else {
13175       __pyx_t_1 = __pyx_t_2;
13176       goto __pyx_L14_bool_binop_done;
13177     }
13178     __pyx_L15_next_or:;
13179 
13180     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":305
13181  *                 t = descr.type_num
13182  *                 if ((descr.byteorder == c'>' and little_endian) or
13183  *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
13184  *                     raise ValueError(u"Non-native byte order not supported")
13185  *                 if   t == NPY_BYTE:        f = "b"
13186  */
13187     __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
13188     if (__pyx_t_2) {
13189     } else {
13190       __pyx_t_1 = __pyx_t_2;
13191       goto __pyx_L14_bool_binop_done;
13192     }
13193     __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
13194     __pyx_t_1 = __pyx_t_2;
13195     __pyx_L14_bool_binop_done:;
13196 
13197     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
13198  *             if not PyDataType_HASFIELDS(descr):
13199  *                 t = descr.type_num
13200  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
13201  *                     (descr.byteorder == c'<' and not little_endian)):
13202  *                     raise ValueError(u"Non-native byte order not supported")
13203  */
13204     if (unlikely(__pyx_t_1)) {
13205 
13206       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306
13207  *                 if ((descr.byteorder == c'>' and little_endian) or
13208  *                     (descr.byteorder == c'<' and not little_endian)):
13209  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
13210  *                 if   t == NPY_BYTE:        f = "b"
13211  *                 elif t == NPY_UBYTE:       f = "B"
13212  */
13213       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 306, __pyx_L1_error)
13214       __Pyx_GOTREF(__pyx_t_3);
13215       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13216       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13217       __PYX_ERR(2, 306, __pyx_L1_error)
13218 
13219       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
13220  *             if not PyDataType_HASFIELDS(descr):
13221  *                 t = descr.type_num
13222  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
13223  *                     (descr.byteorder == c'<' and not little_endian)):
13224  *                     raise ValueError(u"Non-native byte order not supported")
13225  */
13226     }
13227 
13228     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":307
13229  *                     (descr.byteorder == c'<' and not little_endian)):
13230  *                     raise ValueError(u"Non-native byte order not supported")
13231  *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
13232  *                 elif t == NPY_UBYTE:       f = "B"
13233  *                 elif t == NPY_SHORT:       f = "h"
13234  */
13235     switch (__pyx_v_t) {
13236       case NPY_BYTE:
13237       __pyx_v_f = ((char *)"b");
13238       break;
13239       case NPY_UBYTE:
13240 
13241       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":308
13242  *                     raise ValueError(u"Non-native byte order not supported")
13243  *                 if   t == NPY_BYTE:        f = "b"
13244  *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
13245  *                 elif t == NPY_SHORT:       f = "h"
13246  *                 elif t == NPY_USHORT:      f = "H"
13247  */
13248       __pyx_v_f = ((char *)"B");
13249       break;
13250       case NPY_SHORT:
13251 
13252       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":309
13253  *                 if   t == NPY_BYTE:        f = "b"
13254  *                 elif t == NPY_UBYTE:       f = "B"
13255  *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
13256  *                 elif t == NPY_USHORT:      f = "H"
13257  *                 elif t == NPY_INT:         f = "i"
13258  */
13259       __pyx_v_f = ((char *)"h");
13260       break;
13261       case NPY_USHORT:
13262 
13263       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":310
13264  *                 elif t == NPY_UBYTE:       f = "B"
13265  *                 elif t == NPY_SHORT:       f = "h"
13266  *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
13267  *                 elif t == NPY_INT:         f = "i"
13268  *                 elif t == NPY_UINT:        f = "I"
13269  */
13270       __pyx_v_f = ((char *)"H");
13271       break;
13272       case NPY_INT:
13273 
13274       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":311
13275  *                 elif t == NPY_SHORT:       f = "h"
13276  *                 elif t == NPY_USHORT:      f = "H"
13277  *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
13278  *                 elif t == NPY_UINT:        f = "I"
13279  *                 elif t == NPY_LONG:        f = "l"
13280  */
13281       __pyx_v_f = ((char *)"i");
13282       break;
13283       case NPY_UINT:
13284 
13285       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":312
13286  *                 elif t == NPY_USHORT:      f = "H"
13287  *                 elif t == NPY_INT:         f = "i"
13288  *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
13289  *                 elif t == NPY_LONG:        f = "l"
13290  *                 elif t == NPY_ULONG:       f = "L"
13291  */
13292       __pyx_v_f = ((char *)"I");
13293       break;
13294       case NPY_LONG:
13295 
13296       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":313
13297  *                 elif t == NPY_INT:         f = "i"
13298  *                 elif t == NPY_UINT:        f = "I"
13299  *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
13300  *                 elif t == NPY_ULONG:       f = "L"
13301  *                 elif t == NPY_LONGLONG:    f = "q"
13302  */
13303       __pyx_v_f = ((char *)"l");
13304       break;
13305       case NPY_ULONG:
13306 
13307       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":314
13308  *                 elif t == NPY_UINT:        f = "I"
13309  *                 elif t == NPY_LONG:        f = "l"
13310  *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
13311  *                 elif t == NPY_LONGLONG:    f = "q"
13312  *                 elif t == NPY_ULONGLONG:   f = "Q"
13313  */
13314       __pyx_v_f = ((char *)"L");
13315       break;
13316       case NPY_LONGLONG:
13317 
13318       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":315
13319  *                 elif t == NPY_LONG:        f = "l"
13320  *                 elif t == NPY_ULONG:       f = "L"
13321  *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
13322  *                 elif t == NPY_ULONGLONG:   f = "Q"
13323  *                 elif t == NPY_FLOAT:       f = "f"
13324  */
13325       __pyx_v_f = ((char *)"q");
13326       break;
13327       case NPY_ULONGLONG:
13328 
13329       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":316
13330  *                 elif t == NPY_ULONG:       f = "L"
13331  *                 elif t == NPY_LONGLONG:    f = "q"
13332  *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
13333  *                 elif t == NPY_FLOAT:       f = "f"
13334  *                 elif t == NPY_DOUBLE:      f = "d"
13335  */
13336       __pyx_v_f = ((char *)"Q");
13337       break;
13338       case NPY_FLOAT:
13339 
13340       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":317
13341  *                 elif t == NPY_LONGLONG:    f = "q"
13342  *                 elif t == NPY_ULONGLONG:   f = "Q"
13343  *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
13344  *                 elif t == NPY_DOUBLE:      f = "d"
13345  *                 elif t == NPY_LONGDOUBLE:  f = "g"
13346  */
13347       __pyx_v_f = ((char *)"f");
13348       break;
13349       case NPY_DOUBLE:
13350 
13351       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":318
13352  *                 elif t == NPY_ULONGLONG:   f = "Q"
13353  *                 elif t == NPY_FLOAT:       f = "f"
13354  *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
13355  *                 elif t == NPY_LONGDOUBLE:  f = "g"
13356  *                 elif t == NPY_CFLOAT:      f = "Zf"
13357  */
13358       __pyx_v_f = ((char *)"d");
13359       break;
13360       case NPY_LONGDOUBLE:
13361 
13362       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":319
13363  *                 elif t == NPY_FLOAT:       f = "f"
13364  *                 elif t == NPY_DOUBLE:      f = "d"
13365  *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
13366  *                 elif t == NPY_CFLOAT:      f = "Zf"
13367  *                 elif t == NPY_CDOUBLE:     f = "Zd"
13368  */
13369       __pyx_v_f = ((char *)"g");
13370       break;
13371       case NPY_CFLOAT:
13372 
13373       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":320
13374  *                 elif t == NPY_DOUBLE:      f = "d"
13375  *                 elif t == NPY_LONGDOUBLE:  f = "g"
13376  *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
13377  *                 elif t == NPY_CDOUBLE:     f = "Zd"
13378  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
13379  */
13380       __pyx_v_f = ((char *)"Zf");
13381       break;
13382       case NPY_CDOUBLE:
13383 
13384       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":321
13385  *                 elif t == NPY_LONGDOUBLE:  f = "g"
13386  *                 elif t == NPY_CFLOAT:      f = "Zf"
13387  *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
13388  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
13389  *                 elif t == NPY_OBJECT:      f = "O"
13390  */
13391       __pyx_v_f = ((char *)"Zd");
13392       break;
13393       case NPY_CLONGDOUBLE:
13394 
13395       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":322
13396  *                 elif t == NPY_CFLOAT:      f = "Zf"
13397  *                 elif t == NPY_CDOUBLE:     f = "Zd"
13398  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
13399  *                 elif t == NPY_OBJECT:      f = "O"
13400  *                 else:
13401  */
13402       __pyx_v_f = ((char *)"Zg");
13403       break;
13404       case NPY_OBJECT:
13405 
13406       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":323
13407  *                 elif t == NPY_CDOUBLE:     f = "Zd"
13408  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
13409  *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
13410  *                 else:
13411  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
13412  */
13413       __pyx_v_f = ((char *)"O");
13414       break;
13415       default:
13416 
13417       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":325
13418  *                 elif t == NPY_OBJECT:      f = "O"
13419  *                 else:
13420  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
13421  *                 info.format = f
13422  *                 return
13423  */
13424       __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 325, __pyx_L1_error)
13425       __Pyx_GOTREF(__pyx_t_3);
13426       __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 325, __pyx_L1_error)
13427       __Pyx_GOTREF(__pyx_t_8);
13428       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13429       __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 325, __pyx_L1_error)
13430       __Pyx_GOTREF(__pyx_t_3);
13431       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13432       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13433       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13434       __PYX_ERR(2, 325, __pyx_L1_error)
13435       break;
13436     }
13437 
13438     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":326
13439  *                 else:
13440  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
13441  *                 info.format = f             # <<<<<<<<<<<<<<
13442  *                 return
13443  *             else:
13444  */
13445     __pyx_v_info->format = __pyx_v_f;
13446 
13447     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":327
13448  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
13449  *                 info.format = f
13450  *                 return             # <<<<<<<<<<<<<<
13451  *             else:
13452  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
13453  */
13454     __pyx_r = 0;
13455     goto __pyx_L0;
13456 
13457     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302
13458  *             info.obj = self
13459  *
13460  *             if not PyDataType_HASFIELDS(descr):             # <<<<<<<<<<<<<<
13461  *                 t = descr.type_num
13462  *                 if ((descr.byteorder == c'>' and little_endian) or
13463  */
13464   }
13465 
13466   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":329
13467  *                 return
13468  *             else:
13469  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
13470  *                 info.format[0] = c'^' # Native data types, manual alignment
13471  *                 offset = 0
13472  */
13473   /*else*/ {
13474     __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
13475 
13476     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":330
13477  *             else:
13478  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
13479  *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
13480  *                 offset = 0
13481  *                 f = _util_dtypestring(descr, info.format + 1,
13482  */
13483     (__pyx_v_info->format[0]) = '^';
13484 
13485     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":331
13486  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
13487  *                 info.format[0] = c'^' # Native data types, manual alignment
13488  *                 offset = 0             # <<<<<<<<<<<<<<
13489  *                 f = _util_dtypestring(descr, info.format + 1,
13490  *                                       info.format + _buffer_format_string_len,
13491  */
13492     __pyx_v_offset = 0;
13493 
13494     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":332
13495  *                 info.format[0] = c'^' # Native data types, manual alignment
13496  *                 offset = 0
13497  *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
13498  *                                       info.format + _buffer_format_string_len,
13499  *                                       &offset)
13500  */
13501     __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(2, 332, __pyx_L1_error)
13502     __pyx_v_f = __pyx_t_9;
13503 
13504     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":335
13505  *                                       info.format + _buffer_format_string_len,
13506  *                                       &offset)
13507  *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
13508  *
13509  *         def __releasebuffer__(ndarray self, Py_buffer* info):
13510  */
13511     (__pyx_v_f[0]) = '\x00';
13512   }
13513 
13514   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258
13515  *         # experimental exception made for __getbuffer__ and __releasebuffer__
13516  *         # -- the details of this may change.
13517  *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
13518  *             # This implementation of getbuffer is geared towards Cython
13519  *             # requirements, and does not yet fulfill the PEP.
13520  */
13521 
13522   /* function exit code */
13523   __pyx_r = 0;
13524   goto __pyx_L0;
13525   __pyx_L1_error:;
13526   __Pyx_XDECREF(__pyx_t_3);
13527   __Pyx_XDECREF(__pyx_t_8);
13528   __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13529   __pyx_r = -1;
13530   if (__pyx_v_info->obj != NULL) {
13531     __Pyx_GOTREF(__pyx_v_info->obj);
13532     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13533   }
13534   goto __pyx_L2;
13535   __pyx_L0:;
13536   if (__pyx_v_info->obj == Py_None) {
13537     __Pyx_GOTREF(__pyx_v_info->obj);
13538     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13539   }
13540   __pyx_L2:;
13541   __Pyx_XDECREF((PyObject *)__pyx_v_descr);
13542   __Pyx_RefNannyFinishContext();
13543   return __pyx_r;
13544 }
13545 
13546 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337
13547  *                 f[0] = c'\0' # Terminate format string
13548  *
13549  *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
13550  *             if PyArray_HASFIELDS(self):
13551  *                 PyObject_Free(info.format)
13552  */
13553 
13554 /* Python wrapper */
13555 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
__pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject * __pyx_v_self,Py_buffer * __pyx_v_info)13556 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
13557   __Pyx_RefNannyDeclarations
13558   __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
13559   __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
13560 
13561   /* function exit code */
13562   __Pyx_RefNannyFinishContext();
13563 }
13564 
__pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info)13565 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
13566   __Pyx_RefNannyDeclarations
13567   int __pyx_t_1;
13568   __Pyx_RefNannySetupContext("__releasebuffer__", 0);
13569 
13570   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338
13571  *
13572  *         def __releasebuffer__(ndarray self, Py_buffer* info):
13573  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
13574  *                 PyObject_Free(info.format)
13575  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
13576  */
13577   __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
13578   if (__pyx_t_1) {
13579 
13580     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":339
13581  *         def __releasebuffer__(ndarray self, Py_buffer* info):
13582  *             if PyArray_HASFIELDS(self):
13583  *                 PyObject_Free(info.format)             # <<<<<<<<<<<<<<
13584  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
13585  *                 PyObject_Free(info.strides)
13586  */
13587     PyObject_Free(__pyx_v_info->format);
13588 
13589     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338
13590  *
13591  *         def __releasebuffer__(ndarray self, Py_buffer* info):
13592  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
13593  *                 PyObject_Free(info.format)
13594  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
13595  */
13596   }
13597 
13598   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340
13599  *             if PyArray_HASFIELDS(self):
13600  *                 PyObject_Free(info.format)
13601  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
13602  *                 PyObject_Free(info.strides)
13603  *                 # info.shape was stored after info.strides in the same block
13604  */
13605   __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
13606   if (__pyx_t_1) {
13607 
13608     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":341
13609  *                 PyObject_Free(info.format)
13610  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
13611  *                 PyObject_Free(info.strides)             # <<<<<<<<<<<<<<
13612  *                 # info.shape was stored after info.strides in the same block
13613  *
13614  */
13615     PyObject_Free(__pyx_v_info->strides);
13616 
13617     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340
13618  *             if PyArray_HASFIELDS(self):
13619  *                 PyObject_Free(info.format)
13620  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
13621  *                 PyObject_Free(info.strides)
13622  *                 # info.shape was stored after info.strides in the same block
13623  */
13624   }
13625 
13626   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337
13627  *                 f[0] = c'\0' # Terminate format string
13628  *
13629  *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
13630  *             if PyArray_HASFIELDS(self):
13631  *                 PyObject_Free(info.format)
13632  */
13633 
13634   /* function exit code */
13635   __Pyx_RefNannyFinishContext();
13636 }
13637 
13638 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821
13639  * ctypedef npy_cdouble     complex_t
13640  *
13641  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
13642  *     return PyArray_MultiIterNew(1, <void*>a)
13643  *
13644  */
13645 
__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject * __pyx_v_a)13646 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
13647   PyObject *__pyx_r = NULL;
13648   __Pyx_RefNannyDeclarations
13649   PyObject *__pyx_t_1 = NULL;
13650   __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
13651 
13652   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":822
13653  *
13654  * cdef inline object PyArray_MultiIterNew1(a):
13655  *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
13656  *
13657  * cdef inline object PyArray_MultiIterNew2(a, b):
13658  */
13659   __Pyx_XDECREF(__pyx_r);
13660   __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 822, __pyx_L1_error)
13661   __Pyx_GOTREF(__pyx_t_1);
13662   __pyx_r = __pyx_t_1;
13663   __pyx_t_1 = 0;
13664   goto __pyx_L0;
13665 
13666   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821
13667  * ctypedef npy_cdouble     complex_t
13668  *
13669  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
13670  *     return PyArray_MultiIterNew(1, <void*>a)
13671  *
13672  */
13673 
13674   /* function exit code */
13675   __pyx_L1_error:;
13676   __Pyx_XDECREF(__pyx_t_1);
13677   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
13678   __pyx_r = 0;
13679   __pyx_L0:;
13680   __Pyx_XGIVEREF(__pyx_r);
13681   __Pyx_RefNannyFinishContext();
13682   return __pyx_r;
13683 }
13684 
13685 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824
13686  *     return PyArray_MultiIterNew(1, <void*>a)
13687  *
13688  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
13689  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
13690  *
13691  */
13692 
__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject * __pyx_v_a,PyObject * __pyx_v_b)13693 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
13694   PyObject *__pyx_r = NULL;
13695   __Pyx_RefNannyDeclarations
13696   PyObject *__pyx_t_1 = NULL;
13697   __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
13698 
13699   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825
13700  *
13701  * cdef inline object PyArray_MultiIterNew2(a, b):
13702  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
13703  *
13704  * cdef inline object PyArray_MultiIterNew3(a, b, c):
13705  */
13706   __Pyx_XDECREF(__pyx_r);
13707   __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 825, __pyx_L1_error)
13708   __Pyx_GOTREF(__pyx_t_1);
13709   __pyx_r = __pyx_t_1;
13710   __pyx_t_1 = 0;
13711   goto __pyx_L0;
13712 
13713   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824
13714  *     return PyArray_MultiIterNew(1, <void*>a)
13715  *
13716  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
13717  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
13718  *
13719  */
13720 
13721   /* function exit code */
13722   __pyx_L1_error:;
13723   __Pyx_XDECREF(__pyx_t_1);
13724   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
13725   __pyx_r = 0;
13726   __pyx_L0:;
13727   __Pyx_XGIVEREF(__pyx_r);
13728   __Pyx_RefNannyFinishContext();
13729   return __pyx_r;
13730 }
13731 
13732 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827
13733  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
13734  *
13735  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
13736  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
13737  *
13738  */
13739 
__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c)13740 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
13741   PyObject *__pyx_r = NULL;
13742   __Pyx_RefNannyDeclarations
13743   PyObject *__pyx_t_1 = NULL;
13744   __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
13745 
13746   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":828
13747  *
13748  * cdef inline object PyArray_MultiIterNew3(a, b, c):
13749  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
13750  *
13751  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
13752  */
13753   __Pyx_XDECREF(__pyx_r);
13754   __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, 828, __pyx_L1_error)
13755   __Pyx_GOTREF(__pyx_t_1);
13756   __pyx_r = __pyx_t_1;
13757   __pyx_t_1 = 0;
13758   goto __pyx_L0;
13759 
13760   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827
13761  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
13762  *
13763  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
13764  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
13765  *
13766  */
13767 
13768   /* function exit code */
13769   __pyx_L1_error:;
13770   __Pyx_XDECREF(__pyx_t_1);
13771   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
13772   __pyx_r = 0;
13773   __pyx_L0:;
13774   __Pyx_XGIVEREF(__pyx_r);
13775   __Pyx_RefNannyFinishContext();
13776   return __pyx_r;
13777 }
13778 
13779 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830
13780  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
13781  *
13782  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
13783  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
13784  *
13785  */
13786 
__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d)13787 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) {
13788   PyObject *__pyx_r = NULL;
13789   __Pyx_RefNannyDeclarations
13790   PyObject *__pyx_t_1 = NULL;
13791   __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
13792 
13793   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831
13794  *
13795  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
13796  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
13797  *
13798  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
13799  */
13800   __Pyx_XDECREF(__pyx_r);
13801   __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, 831, __pyx_L1_error)
13802   __Pyx_GOTREF(__pyx_t_1);
13803   __pyx_r = __pyx_t_1;
13804   __pyx_t_1 = 0;
13805   goto __pyx_L0;
13806 
13807   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830
13808  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
13809  *
13810  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
13811  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
13812  *
13813  */
13814 
13815   /* function exit code */
13816   __pyx_L1_error:;
13817   __Pyx_XDECREF(__pyx_t_1);
13818   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
13819   __pyx_r = 0;
13820   __pyx_L0:;
13821   __Pyx_XGIVEREF(__pyx_r);
13822   __Pyx_RefNannyFinishContext();
13823   return __pyx_r;
13824 }
13825 
13826 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833
13827  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
13828  *
13829  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
13830  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
13831  *
13832  */
13833 
__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)13834 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) {
13835   PyObject *__pyx_r = NULL;
13836   __Pyx_RefNannyDeclarations
13837   PyObject *__pyx_t_1 = NULL;
13838   __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
13839 
13840   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834
13841  *
13842  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
13843  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
13844  *
13845  * cdef inline tuple PyDataType_SHAPE(dtype d):
13846  */
13847   __Pyx_XDECREF(__pyx_r);
13848   __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, 834, __pyx_L1_error)
13849   __Pyx_GOTREF(__pyx_t_1);
13850   __pyx_r = __pyx_t_1;
13851   __pyx_t_1 = 0;
13852   goto __pyx_L0;
13853 
13854   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833
13855  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
13856  *
13857  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
13858  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
13859  *
13860  */
13861 
13862   /* function exit code */
13863   __pyx_L1_error:;
13864   __Pyx_XDECREF(__pyx_t_1);
13865   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
13866   __pyx_r = 0;
13867   __pyx_L0:;
13868   __Pyx_XGIVEREF(__pyx_r);
13869   __Pyx_RefNannyFinishContext();
13870   return __pyx_r;
13871 }
13872 
13873 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836
13874  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
13875  *
13876  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
13877  *     if PyDataType_HASSUBARRAY(d):
13878  *         return <tuple>d.subarray.shape
13879  */
13880 
__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr * __pyx_v_d)13881 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
13882   PyObject *__pyx_r = NULL;
13883   __Pyx_RefNannyDeclarations
13884   int __pyx_t_1;
13885   __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
13886 
13887   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837
13888  *
13889  * cdef inline tuple PyDataType_SHAPE(dtype d):
13890  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
13891  *         return <tuple>d.subarray.shape
13892  *     else:
13893  */
13894   __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
13895   if (__pyx_t_1) {
13896 
13897     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838
13898  * cdef inline tuple PyDataType_SHAPE(dtype d):
13899  *     if PyDataType_HASSUBARRAY(d):
13900  *         return <tuple>d.subarray.shape             # <<<<<<<<<<<<<<
13901  *     else:
13902  *         return ()
13903  */
13904     __Pyx_XDECREF(__pyx_r);
13905     __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
13906     __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
13907     goto __pyx_L0;
13908 
13909     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837
13910  *
13911  * cdef inline tuple PyDataType_SHAPE(dtype d):
13912  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
13913  *         return <tuple>d.subarray.shape
13914  *     else:
13915  */
13916   }
13917 
13918   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840
13919  *         return <tuple>d.subarray.shape
13920  *     else:
13921  *         return ()             # <<<<<<<<<<<<<<
13922  *
13923  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
13924  */
13925   /*else*/ {
13926     __Pyx_XDECREF(__pyx_r);
13927     __Pyx_INCREF(__pyx_empty_tuple);
13928     __pyx_r = __pyx_empty_tuple;
13929     goto __pyx_L0;
13930   }
13931 
13932   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836
13933  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
13934  *
13935  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
13936  *     if PyDataType_HASSUBARRAY(d):
13937  *         return <tuple>d.subarray.shape
13938  */
13939 
13940   /* function exit code */
13941   __pyx_L0:;
13942   __Pyx_XGIVEREF(__pyx_r);
13943   __Pyx_RefNannyFinishContext();
13944   return __pyx_r;
13945 }
13946 
13947 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842
13948  *         return ()
13949  *
13950  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
13951  *     # Recursive utility function used in __getbuffer__ to get format
13952  *     # string. The new location in the format string is returned.
13953  */
13954 
__pyx_f_5numpy__util_dtypestring(PyArray_Descr * __pyx_v_descr,char * __pyx_v_f,char * __pyx_v_end,int * __pyx_v_offset)13955 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
13956   PyArray_Descr *__pyx_v_child = 0;
13957   int __pyx_v_endian_detector;
13958   int __pyx_v_little_endian;
13959   PyObject *__pyx_v_fields = 0;
13960   PyObject *__pyx_v_childname = NULL;
13961   PyObject *__pyx_v_new_offset = NULL;
13962   PyObject *__pyx_v_t = NULL;
13963   char *__pyx_r;
13964   __Pyx_RefNannyDeclarations
13965   PyObject *__pyx_t_1 = NULL;
13966   Py_ssize_t __pyx_t_2;
13967   PyObject *__pyx_t_3 = NULL;
13968   PyObject *__pyx_t_4 = NULL;
13969   int __pyx_t_5;
13970   int __pyx_t_6;
13971   int __pyx_t_7;
13972   long __pyx_t_8;
13973   char *__pyx_t_9;
13974   __Pyx_RefNannySetupContext("_util_dtypestring", 0);
13975 
13976   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847
13977  *
13978  *     cdef dtype child
13979  *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
13980  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
13981  *     cdef tuple fields
13982  */
13983   __pyx_v_endian_detector = 1;
13984 
13985   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848
13986  *     cdef dtype child
13987  *     cdef int endian_detector = 1
13988  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
13989  *     cdef tuple fields
13990  *
13991  */
13992   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
13993 
13994   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851
13995  *     cdef tuple fields
13996  *
13997  *     for childname in descr.names:             # <<<<<<<<<<<<<<
13998  *         fields = descr.fields[childname]
13999  *         child, new_offset = fields
14000  */
14001   if (unlikely(__pyx_v_descr->names == Py_None)) {
14002     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
14003     __PYX_ERR(2, 851, __pyx_L1_error)
14004   }
14005   __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
14006   for (;;) {
14007     if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
14008     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14009     __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(2, 851, __pyx_L1_error)
14010     #else
14011     __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 851, __pyx_L1_error)
14012     __Pyx_GOTREF(__pyx_t_3);
14013     #endif
14014     __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
14015     __pyx_t_3 = 0;
14016 
14017     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852
14018  *
14019  *     for childname in descr.names:
14020  *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
14021  *         child, new_offset = fields
14022  *
14023  */
14024     if (unlikely(__pyx_v_descr->fields == Py_None)) {
14025       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14026       __PYX_ERR(2, 852, __pyx_L1_error)
14027     }
14028     __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 852, __pyx_L1_error)
14029     __Pyx_GOTREF(__pyx_t_3);
14030     if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 852, __pyx_L1_error)
14031     __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
14032     __pyx_t_3 = 0;
14033 
14034     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853
14035  *     for childname in descr.names:
14036  *         fields = descr.fields[childname]
14037  *         child, new_offset = fields             # <<<<<<<<<<<<<<
14038  *
14039  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
14040  */
14041     if (likely(__pyx_v_fields != Py_None)) {
14042       PyObject* sequence = __pyx_v_fields;
14043       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
14044       if (unlikely(size != 2)) {
14045         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
14046         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
14047         __PYX_ERR(2, 853, __pyx_L1_error)
14048       }
14049       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14050       __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
14051       __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
14052       __Pyx_INCREF(__pyx_t_3);
14053       __Pyx_INCREF(__pyx_t_4);
14054       #else
14055       __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 853, __pyx_L1_error)
14056       __Pyx_GOTREF(__pyx_t_3);
14057       __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 853, __pyx_L1_error)
14058       __Pyx_GOTREF(__pyx_t_4);
14059       #endif
14060     } else {
14061       __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 853, __pyx_L1_error)
14062     }
14063     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 853, __pyx_L1_error)
14064     __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
14065     __pyx_t_3 = 0;
14066     __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
14067     __pyx_t_4 = 0;
14068 
14069     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855
14070  *         child, new_offset = fields
14071  *
14072  *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
14073  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
14074  *
14075  */
14076     __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 855, __pyx_L1_error)
14077     __Pyx_GOTREF(__pyx_t_4);
14078     __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 855, __pyx_L1_error)
14079     __Pyx_GOTREF(__pyx_t_3);
14080     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14081     __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 855, __pyx_L1_error)
14082     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14083     __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
14084     if (unlikely(__pyx_t_6)) {
14085 
14086       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856
14087  *
14088  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
14089  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
14090  *
14091  *         if ((child.byteorder == c'>' and little_endian) or
14092  */
14093       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 856, __pyx_L1_error)
14094       __Pyx_GOTREF(__pyx_t_3);
14095       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
14096       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14097       __PYX_ERR(2, 856, __pyx_L1_error)
14098 
14099       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855
14100  *         child, new_offset = fields
14101  *
14102  *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
14103  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
14104  *
14105  */
14106     }
14107 
14108     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
14109  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
14110  *
14111  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
14112  *             (child.byteorder == c'<' and not little_endian)):
14113  *             raise ValueError(u"Non-native byte order not supported")
14114  */
14115     __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
14116     if (!__pyx_t_7) {
14117       goto __pyx_L8_next_or;
14118     } else {
14119     }
14120     __pyx_t_7 = (__pyx_v_little_endian != 0);
14121     if (!__pyx_t_7) {
14122     } else {
14123       __pyx_t_6 = __pyx_t_7;
14124       goto __pyx_L7_bool_binop_done;
14125     }
14126     __pyx_L8_next_or:;
14127 
14128     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":859
14129  *
14130  *         if ((child.byteorder == c'>' and little_endian) or
14131  *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
14132  *             raise ValueError(u"Non-native byte order not supported")
14133  *             # One could encode it in the format string and have Cython
14134  */
14135     __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
14136     if (__pyx_t_7) {
14137     } else {
14138       __pyx_t_6 = __pyx_t_7;
14139       goto __pyx_L7_bool_binop_done;
14140     }
14141     __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
14142     __pyx_t_6 = __pyx_t_7;
14143     __pyx_L7_bool_binop_done:;
14144 
14145     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
14146  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
14147  *
14148  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
14149  *             (child.byteorder == c'<' and not little_endian)):
14150  *             raise ValueError(u"Non-native byte order not supported")
14151  */
14152     if (unlikely(__pyx_t_6)) {
14153 
14154       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860
14155  *         if ((child.byteorder == c'>' and little_endian) or
14156  *             (child.byteorder == c'<' and not little_endian)):
14157  *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
14158  *             # One could encode it in the format string and have Cython
14159  *             # complain instead, BUT: < and > in format strings also imply
14160  */
14161       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 860, __pyx_L1_error)
14162       __Pyx_GOTREF(__pyx_t_3);
14163       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
14164       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14165       __PYX_ERR(2, 860, __pyx_L1_error)
14166 
14167       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
14168  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
14169  *
14170  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
14171  *             (child.byteorder == c'<' and not little_endian)):
14172  *             raise ValueError(u"Non-native byte order not supported")
14173  */
14174     }
14175 
14176     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":870
14177  *
14178  *         # Output padding bytes
14179  *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
14180  *             f[0] = 120 # "x"; pad byte
14181  *             f += 1
14182  */
14183     while (1) {
14184       __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 870, __pyx_L1_error)
14185       __Pyx_GOTREF(__pyx_t_3);
14186       __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 870, __pyx_L1_error)
14187       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14188       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 870, __pyx_L1_error)
14189       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14190       if (!__pyx_t_6) break;
14191 
14192       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":871
14193  *         # Output padding bytes
14194  *         while offset[0] < new_offset:
14195  *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
14196  *             f += 1
14197  *             offset[0] += 1
14198  */
14199       (__pyx_v_f[0]) = 0x78;
14200 
14201       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":872
14202  *         while offset[0] < new_offset:
14203  *             f[0] = 120 # "x"; pad byte
14204  *             f += 1             # <<<<<<<<<<<<<<
14205  *             offset[0] += 1
14206  *
14207  */
14208       __pyx_v_f = (__pyx_v_f + 1);
14209 
14210       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":873
14211  *             f[0] = 120 # "x"; pad byte
14212  *             f += 1
14213  *             offset[0] += 1             # <<<<<<<<<<<<<<
14214  *
14215  *         offset[0] += child.itemsize
14216  */
14217       __pyx_t_8 = 0;
14218       (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
14219     }
14220 
14221     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":875
14222  *             offset[0] += 1
14223  *
14224  *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
14225  *
14226  *         if not PyDataType_HASFIELDS(child):
14227  */
14228     __pyx_t_8 = 0;
14229     (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
14230 
14231     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877
14232  *         offset[0] += child.itemsize
14233  *
14234  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
14235  *             t = child.type_num
14236  *             if end - f < 5:
14237  */
14238     __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
14239     if (__pyx_t_6) {
14240 
14241       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":878
14242  *
14243  *         if not PyDataType_HASFIELDS(child):
14244  *             t = child.type_num             # <<<<<<<<<<<<<<
14245  *             if end - f < 5:
14246  *                 raise RuntimeError(u"Format string allocated too short.")
14247  */
14248       __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 878, __pyx_L1_error)
14249       __Pyx_GOTREF(__pyx_t_4);
14250       __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
14251       __pyx_t_4 = 0;
14252 
14253       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879
14254  *         if not PyDataType_HASFIELDS(child):
14255  *             t = child.type_num
14256  *             if end - f < 5:             # <<<<<<<<<<<<<<
14257  *                 raise RuntimeError(u"Format string allocated too short.")
14258  *
14259  */
14260       __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
14261       if (unlikely(__pyx_t_6)) {
14262 
14263         /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880
14264  *             t = child.type_num
14265  *             if end - f < 5:
14266  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
14267  *
14268  *             # Until ticket #99 is fixed, use integers to avoid warnings
14269  */
14270         __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 880, __pyx_L1_error)
14271         __Pyx_GOTREF(__pyx_t_4);
14272         __Pyx_Raise(__pyx_t_4, 0, 0, 0);
14273         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14274         __PYX_ERR(2, 880, __pyx_L1_error)
14275 
14276         /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879
14277  *         if not PyDataType_HASFIELDS(child):
14278  *             t = child.type_num
14279  *             if end - f < 5:             # <<<<<<<<<<<<<<
14280  *                 raise RuntimeError(u"Format string allocated too short.")
14281  *
14282  */
14283       }
14284 
14285       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":883
14286  *
14287  *             # Until ticket #99 is fixed, use integers to avoid warnings
14288  *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
14289  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
14290  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
14291  */
14292       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 883, __pyx_L1_error)
14293       __Pyx_GOTREF(__pyx_t_4);
14294       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 883, __pyx_L1_error)
14295       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14296       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 883, __pyx_L1_error)
14297       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14298       if (__pyx_t_6) {
14299         (__pyx_v_f[0]) = 98;
14300         goto __pyx_L15;
14301       }
14302 
14303       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":884
14304  *             # Until ticket #99 is fixed, use integers to avoid warnings
14305  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
14306  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
14307  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
14308  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
14309  */
14310       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 884, __pyx_L1_error)
14311       __Pyx_GOTREF(__pyx_t_3);
14312       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 884, __pyx_L1_error)
14313       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14314       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 884, __pyx_L1_error)
14315       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14316       if (__pyx_t_6) {
14317         (__pyx_v_f[0]) = 66;
14318         goto __pyx_L15;
14319       }
14320 
14321       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":885
14322  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
14323  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
14324  *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
14325  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
14326  *             elif t == NPY_INT:         f[0] = 105 #"i"
14327  */
14328       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 885, __pyx_L1_error)
14329       __Pyx_GOTREF(__pyx_t_4);
14330       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 885, __pyx_L1_error)
14331       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14332       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 885, __pyx_L1_error)
14333       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14334       if (__pyx_t_6) {
14335         (__pyx_v_f[0]) = 0x68;
14336         goto __pyx_L15;
14337       }
14338 
14339       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":886
14340  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
14341  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
14342  *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
14343  *             elif t == NPY_INT:         f[0] = 105 #"i"
14344  *             elif t == NPY_UINT:        f[0] =  73 #"I"
14345  */
14346       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 886, __pyx_L1_error)
14347       __Pyx_GOTREF(__pyx_t_3);
14348       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 886, __pyx_L1_error)
14349       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14350       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 886, __pyx_L1_error)
14351       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14352       if (__pyx_t_6) {
14353         (__pyx_v_f[0]) = 72;
14354         goto __pyx_L15;
14355       }
14356 
14357       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":887
14358  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
14359  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
14360  *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
14361  *             elif t == NPY_UINT:        f[0] =  73 #"I"
14362  *             elif t == NPY_LONG:        f[0] = 108 #"l"
14363  */
14364       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 887, __pyx_L1_error)
14365       __Pyx_GOTREF(__pyx_t_4);
14366       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 887, __pyx_L1_error)
14367       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14368       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 887, __pyx_L1_error)
14369       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14370       if (__pyx_t_6) {
14371         (__pyx_v_f[0]) = 0x69;
14372         goto __pyx_L15;
14373       }
14374 
14375       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":888
14376  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
14377  *             elif t == NPY_INT:         f[0] = 105 #"i"
14378  *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
14379  *             elif t == NPY_LONG:        f[0] = 108 #"l"
14380  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
14381  */
14382       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 888, __pyx_L1_error)
14383       __Pyx_GOTREF(__pyx_t_3);
14384       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 888, __pyx_L1_error)
14385       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14386       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 888, __pyx_L1_error)
14387       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14388       if (__pyx_t_6) {
14389         (__pyx_v_f[0]) = 73;
14390         goto __pyx_L15;
14391       }
14392 
14393       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":889
14394  *             elif t == NPY_INT:         f[0] = 105 #"i"
14395  *             elif t == NPY_UINT:        f[0] =  73 #"I"
14396  *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
14397  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
14398  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
14399  */
14400       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 889, __pyx_L1_error)
14401       __Pyx_GOTREF(__pyx_t_4);
14402       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 889, __pyx_L1_error)
14403       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14404       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 889, __pyx_L1_error)
14405       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14406       if (__pyx_t_6) {
14407         (__pyx_v_f[0]) = 0x6C;
14408         goto __pyx_L15;
14409       }
14410 
14411       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":890
14412  *             elif t == NPY_UINT:        f[0] =  73 #"I"
14413  *             elif t == NPY_LONG:        f[0] = 108 #"l"
14414  *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
14415  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
14416  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
14417  */
14418       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 890, __pyx_L1_error)
14419       __Pyx_GOTREF(__pyx_t_3);
14420       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 890, __pyx_L1_error)
14421       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14422       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 890, __pyx_L1_error)
14423       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14424       if (__pyx_t_6) {
14425         (__pyx_v_f[0]) = 76;
14426         goto __pyx_L15;
14427       }
14428 
14429       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":891
14430  *             elif t == NPY_LONG:        f[0] = 108 #"l"
14431  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
14432  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
14433  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
14434  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
14435  */
14436       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 891, __pyx_L1_error)
14437       __Pyx_GOTREF(__pyx_t_4);
14438       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 891, __pyx_L1_error)
14439       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14440       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 891, __pyx_L1_error)
14441       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14442       if (__pyx_t_6) {
14443         (__pyx_v_f[0]) = 0x71;
14444         goto __pyx_L15;
14445       }
14446 
14447       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":892
14448  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
14449  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
14450  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
14451  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
14452  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
14453  */
14454       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 892, __pyx_L1_error)
14455       __Pyx_GOTREF(__pyx_t_3);
14456       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 892, __pyx_L1_error)
14457       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14458       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 892, __pyx_L1_error)
14459       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14460       if (__pyx_t_6) {
14461         (__pyx_v_f[0]) = 81;
14462         goto __pyx_L15;
14463       }
14464 
14465       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":893
14466  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
14467  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
14468  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
14469  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
14470  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
14471  */
14472       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 893, __pyx_L1_error)
14473       __Pyx_GOTREF(__pyx_t_4);
14474       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 893, __pyx_L1_error)
14475       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14476       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 893, __pyx_L1_error)
14477       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14478       if (__pyx_t_6) {
14479         (__pyx_v_f[0]) = 0x66;
14480         goto __pyx_L15;
14481       }
14482 
14483       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":894
14484  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
14485  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
14486  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
14487  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
14488  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
14489  */
14490       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 894, __pyx_L1_error)
14491       __Pyx_GOTREF(__pyx_t_3);
14492       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 894, __pyx_L1_error)
14493       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14494       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 894, __pyx_L1_error)
14495       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14496       if (__pyx_t_6) {
14497         (__pyx_v_f[0]) = 0x64;
14498         goto __pyx_L15;
14499       }
14500 
14501       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":895
14502  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
14503  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
14504  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
14505  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
14506  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
14507  */
14508       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 895, __pyx_L1_error)
14509       __Pyx_GOTREF(__pyx_t_4);
14510       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 895, __pyx_L1_error)
14511       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14512       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 895, __pyx_L1_error)
14513       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14514       if (__pyx_t_6) {
14515         (__pyx_v_f[0]) = 0x67;
14516         goto __pyx_L15;
14517       }
14518 
14519       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":896
14520  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
14521  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
14522  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
14523  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
14524  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
14525  */
14526       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 896, __pyx_L1_error)
14527       __Pyx_GOTREF(__pyx_t_3);
14528       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 896, __pyx_L1_error)
14529       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14530       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 896, __pyx_L1_error)
14531       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14532       if (__pyx_t_6) {
14533         (__pyx_v_f[0]) = 90;
14534         (__pyx_v_f[1]) = 0x66;
14535         __pyx_v_f = (__pyx_v_f + 1);
14536         goto __pyx_L15;
14537       }
14538 
14539       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":897
14540  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
14541  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
14542  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
14543  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
14544  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
14545  */
14546       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 897, __pyx_L1_error)
14547       __Pyx_GOTREF(__pyx_t_4);
14548       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 897, __pyx_L1_error)
14549       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14550       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 897, __pyx_L1_error)
14551       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14552       if (__pyx_t_6) {
14553         (__pyx_v_f[0]) = 90;
14554         (__pyx_v_f[1]) = 0x64;
14555         __pyx_v_f = (__pyx_v_f + 1);
14556         goto __pyx_L15;
14557       }
14558 
14559       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":898
14560  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
14561  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
14562  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
14563  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
14564  *             else:
14565  */
14566       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 898, __pyx_L1_error)
14567       __Pyx_GOTREF(__pyx_t_3);
14568       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 898, __pyx_L1_error)
14569       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14570       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 898, __pyx_L1_error)
14571       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14572       if (__pyx_t_6) {
14573         (__pyx_v_f[0]) = 90;
14574         (__pyx_v_f[1]) = 0x67;
14575         __pyx_v_f = (__pyx_v_f + 1);
14576         goto __pyx_L15;
14577       }
14578 
14579       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":899
14580  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
14581  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
14582  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
14583  *             else:
14584  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
14585  */
14586       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 899, __pyx_L1_error)
14587       __Pyx_GOTREF(__pyx_t_4);
14588       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 899, __pyx_L1_error)
14589       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14590       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 899, __pyx_L1_error)
14591       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14592       if (likely(__pyx_t_6)) {
14593         (__pyx_v_f[0]) = 79;
14594         goto __pyx_L15;
14595       }
14596 
14597       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":901
14598  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
14599  *             else:
14600  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
14601  *             f += 1
14602  *         else:
14603  */
14604       /*else*/ {
14605         __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 901, __pyx_L1_error)
14606         __Pyx_GOTREF(__pyx_t_3);
14607         __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 901, __pyx_L1_error)
14608         __Pyx_GOTREF(__pyx_t_4);
14609         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14610         __Pyx_Raise(__pyx_t_4, 0, 0, 0);
14611         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14612         __PYX_ERR(2, 901, __pyx_L1_error)
14613       }
14614       __pyx_L15:;
14615 
14616       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":902
14617  *             else:
14618  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
14619  *             f += 1             # <<<<<<<<<<<<<<
14620  *         else:
14621  *             # Cython ignores struct boundary information ("T{...}"),
14622  */
14623       __pyx_v_f = (__pyx_v_f + 1);
14624 
14625       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877
14626  *         offset[0] += child.itemsize
14627  *
14628  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
14629  *             t = child.type_num
14630  *             if end - f < 5:
14631  */
14632       goto __pyx_L13;
14633     }
14634 
14635     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":906
14636  *             # Cython ignores struct boundary information ("T{...}"),
14637  *             # so don't output it
14638  *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
14639  *     return f
14640  *
14641  */
14642     /*else*/ {
14643       __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(2, 906, __pyx_L1_error)
14644       __pyx_v_f = __pyx_t_9;
14645     }
14646     __pyx_L13:;
14647 
14648     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851
14649  *     cdef tuple fields
14650  *
14651  *     for childname in descr.names:             # <<<<<<<<<<<<<<
14652  *         fields = descr.fields[childname]
14653  *         child, new_offset = fields
14654  */
14655   }
14656   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14657 
14658   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":907
14659  *             # so don't output it
14660  *             f = _util_dtypestring(child, f, end, offset)
14661  *     return f             # <<<<<<<<<<<<<<
14662  *
14663  *
14664  */
14665   __pyx_r = __pyx_v_f;
14666   goto __pyx_L0;
14667 
14668   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842
14669  *         return ()
14670  *
14671  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
14672  *     # Recursive utility function used in __getbuffer__ to get format
14673  *     # string. The new location in the format string is returned.
14674  */
14675 
14676   /* function exit code */
14677   __pyx_L1_error:;
14678   __Pyx_XDECREF(__pyx_t_1);
14679   __Pyx_XDECREF(__pyx_t_3);
14680   __Pyx_XDECREF(__pyx_t_4);
14681   __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
14682   __pyx_r = NULL;
14683   __pyx_L0:;
14684   __Pyx_XDECREF((PyObject *)__pyx_v_child);
14685   __Pyx_XDECREF(__pyx_v_fields);
14686   __Pyx_XDECREF(__pyx_v_childname);
14687   __Pyx_XDECREF(__pyx_v_new_offset);
14688   __Pyx_XDECREF(__pyx_v_t);
14689   __Pyx_RefNannyFinishContext();
14690   return __pyx_r;
14691 }
14692 
14693 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022
14694  *     int _import_umath() except -1
14695  *
14696  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
14697  *     Py_INCREF(base) # important to do this before stealing the reference below!
14698  *     PyArray_SetBaseObject(arr, base)
14699  */
14700 
__pyx_f_5numpy_set_array_base(PyArrayObject * __pyx_v_arr,PyObject * __pyx_v_base)14701 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
14702   __Pyx_RefNannyDeclarations
14703   __Pyx_RefNannySetupContext("set_array_base", 0);
14704 
14705   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1023
14706  *
14707  * cdef inline void set_array_base(ndarray arr, object base):
14708  *     Py_INCREF(base) # important to do this before stealing the reference below!             # <<<<<<<<<<<<<<
14709  *     PyArray_SetBaseObject(arr, base)
14710  *
14711  */
14712   Py_INCREF(__pyx_v_base);
14713 
14714   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1024
14715  * cdef inline void set_array_base(ndarray arr, object base):
14716  *     Py_INCREF(base) # important to do this before stealing the reference below!
14717  *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
14718  *
14719  * cdef inline object get_array_base(ndarray arr):
14720  */
14721   (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
14722 
14723   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022
14724  *     int _import_umath() except -1
14725  *
14726  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
14727  *     Py_INCREF(base) # important to do this before stealing the reference below!
14728  *     PyArray_SetBaseObject(arr, base)
14729  */
14730 
14731   /* function exit code */
14732   __Pyx_RefNannyFinishContext();
14733 }
14734 
14735 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026
14736  *     PyArray_SetBaseObject(arr, base)
14737  *
14738  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
14739  *     base = PyArray_BASE(arr)
14740  *     if base is NULL:
14741  */
14742 
__pyx_f_5numpy_get_array_base(PyArrayObject * __pyx_v_arr)14743 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
14744   PyObject *__pyx_v_base;
14745   PyObject *__pyx_r = NULL;
14746   __Pyx_RefNannyDeclarations
14747   int __pyx_t_1;
14748   __Pyx_RefNannySetupContext("get_array_base", 0);
14749 
14750   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1027
14751  *
14752  * cdef inline object get_array_base(ndarray arr):
14753  *     base = PyArray_BASE(arr)             # <<<<<<<<<<<<<<
14754  *     if base is NULL:
14755  *         return None
14756  */
14757   __pyx_v_base = PyArray_BASE(__pyx_v_arr);
14758 
14759   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028
14760  * cdef inline object get_array_base(ndarray arr):
14761  *     base = PyArray_BASE(arr)
14762  *     if base is NULL:             # <<<<<<<<<<<<<<
14763  *         return None
14764  *     return <object>base
14765  */
14766   __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
14767   if (__pyx_t_1) {
14768 
14769     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1029
14770  *     base = PyArray_BASE(arr)
14771  *     if base is NULL:
14772  *         return None             # <<<<<<<<<<<<<<
14773  *     return <object>base
14774  *
14775  */
14776     __Pyx_XDECREF(__pyx_r);
14777     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14778     goto __pyx_L0;
14779 
14780     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028
14781  * cdef inline object get_array_base(ndarray arr):
14782  *     base = PyArray_BASE(arr)
14783  *     if base is NULL:             # <<<<<<<<<<<<<<
14784  *         return None
14785  *     return <object>base
14786  */
14787   }
14788 
14789   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1030
14790  *     if base is NULL:
14791  *         return None
14792  *     return <object>base             # <<<<<<<<<<<<<<
14793  *
14794  * # Versions of the import_* functions which are more suitable for
14795  */
14796   __Pyx_XDECREF(__pyx_r);
14797   __Pyx_INCREF(((PyObject *)__pyx_v_base));
14798   __pyx_r = ((PyObject *)__pyx_v_base);
14799   goto __pyx_L0;
14800 
14801   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026
14802  *     PyArray_SetBaseObject(arr, base)
14803  *
14804  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
14805  *     base = PyArray_BASE(arr)
14806  *     if base is NULL:
14807  */
14808 
14809   /* function exit code */
14810   __pyx_L0:;
14811   __Pyx_XGIVEREF(__pyx_r);
14812   __Pyx_RefNannyFinishContext();
14813   return __pyx_r;
14814 }
14815 
14816 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034
14817  * # Versions of the import_* functions which are more suitable for
14818  * # Cython code.
14819  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
14820  *     try:
14821  *         _import_array()
14822  */
14823 
__pyx_f_5numpy_import_array(void)14824 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
14825   int __pyx_r;
14826   __Pyx_RefNannyDeclarations
14827   PyObject *__pyx_t_1 = NULL;
14828   PyObject *__pyx_t_2 = NULL;
14829   PyObject *__pyx_t_3 = NULL;
14830   int __pyx_t_4;
14831   PyObject *__pyx_t_5 = NULL;
14832   PyObject *__pyx_t_6 = NULL;
14833   PyObject *__pyx_t_7 = NULL;
14834   PyObject *__pyx_t_8 = NULL;
14835   __Pyx_RefNannySetupContext("import_array", 0);
14836 
14837   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
14838  * # Cython code.
14839  * cdef inline int import_array() except -1:
14840  *     try:             # <<<<<<<<<<<<<<
14841  *         _import_array()
14842  *     except Exception:
14843  */
14844   {
14845     __Pyx_PyThreadState_declare
14846     __Pyx_PyThreadState_assign
14847     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
14848     __Pyx_XGOTREF(__pyx_t_1);
14849     __Pyx_XGOTREF(__pyx_t_2);
14850     __Pyx_XGOTREF(__pyx_t_3);
14851     /*try:*/ {
14852 
14853       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1036
14854  * cdef inline int import_array() except -1:
14855  *     try:
14856  *         _import_array()             # <<<<<<<<<<<<<<
14857  *     except Exception:
14858  *         raise ImportError("numpy.core.multiarray failed to import")
14859  */
14860       __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1036, __pyx_L3_error)
14861 
14862       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
14863  * # Cython code.
14864  * cdef inline int import_array() except -1:
14865  *     try:             # <<<<<<<<<<<<<<
14866  *         _import_array()
14867  *     except Exception:
14868  */
14869     }
14870     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
14871     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
14872     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14873     goto __pyx_L8_try_end;
14874     __pyx_L3_error:;
14875 
14876     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1037
14877  *     try:
14878  *         _import_array()
14879  *     except Exception:             # <<<<<<<<<<<<<<
14880  *         raise ImportError("numpy.core.multiarray failed to import")
14881  *
14882  */
14883     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
14884     if (__pyx_t_4) {
14885       __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
14886       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1037, __pyx_L5_except_error)
14887       __Pyx_GOTREF(__pyx_t_5);
14888       __Pyx_GOTREF(__pyx_t_6);
14889       __Pyx_GOTREF(__pyx_t_7);
14890 
14891       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038
14892  *         _import_array()
14893  *     except Exception:
14894  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
14895  *
14896  * cdef inline int import_umath() except -1:
14897  */
14898       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1038, __pyx_L5_except_error)
14899       __Pyx_GOTREF(__pyx_t_8);
14900       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
14901       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14902       __PYX_ERR(2, 1038, __pyx_L5_except_error)
14903     }
14904     goto __pyx_L5_except_error;
14905     __pyx_L5_except_error:;
14906 
14907     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
14908  * # Cython code.
14909  * cdef inline int import_array() except -1:
14910  *     try:             # <<<<<<<<<<<<<<
14911  *         _import_array()
14912  *     except Exception:
14913  */
14914     __Pyx_XGIVEREF(__pyx_t_1);
14915     __Pyx_XGIVEREF(__pyx_t_2);
14916     __Pyx_XGIVEREF(__pyx_t_3);
14917     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14918     goto __pyx_L1_error;
14919     __pyx_L8_try_end:;
14920   }
14921 
14922   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034
14923  * # Versions of the import_* functions which are more suitable for
14924  * # Cython code.
14925  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
14926  *     try:
14927  *         _import_array()
14928  */
14929 
14930   /* function exit code */
14931   __pyx_r = 0;
14932   goto __pyx_L0;
14933   __pyx_L1_error:;
14934   __Pyx_XDECREF(__pyx_t_5);
14935   __Pyx_XDECREF(__pyx_t_6);
14936   __Pyx_XDECREF(__pyx_t_7);
14937   __Pyx_XDECREF(__pyx_t_8);
14938   __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
14939   __pyx_r = -1;
14940   __pyx_L0:;
14941   __Pyx_RefNannyFinishContext();
14942   return __pyx_r;
14943 }
14944 
14945 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040
14946  *         raise ImportError("numpy.core.multiarray failed to import")
14947  *
14948  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
14949  *     try:
14950  *         _import_umath()
14951  */
14952 
__pyx_f_5numpy_import_umath(void)14953 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
14954   int __pyx_r;
14955   __Pyx_RefNannyDeclarations
14956   PyObject *__pyx_t_1 = NULL;
14957   PyObject *__pyx_t_2 = NULL;
14958   PyObject *__pyx_t_3 = NULL;
14959   int __pyx_t_4;
14960   PyObject *__pyx_t_5 = NULL;
14961   PyObject *__pyx_t_6 = NULL;
14962   PyObject *__pyx_t_7 = NULL;
14963   PyObject *__pyx_t_8 = NULL;
14964   __Pyx_RefNannySetupContext("import_umath", 0);
14965 
14966   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
14967  *
14968  * cdef inline int import_umath() except -1:
14969  *     try:             # <<<<<<<<<<<<<<
14970  *         _import_umath()
14971  *     except Exception:
14972  */
14973   {
14974     __Pyx_PyThreadState_declare
14975     __Pyx_PyThreadState_assign
14976     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
14977     __Pyx_XGOTREF(__pyx_t_1);
14978     __Pyx_XGOTREF(__pyx_t_2);
14979     __Pyx_XGOTREF(__pyx_t_3);
14980     /*try:*/ {
14981 
14982       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1042
14983  * cdef inline int import_umath() except -1:
14984  *     try:
14985  *         _import_umath()             # <<<<<<<<<<<<<<
14986  *     except Exception:
14987  *         raise ImportError("numpy.core.umath failed to import")
14988  */
14989       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1042, __pyx_L3_error)
14990 
14991       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
14992  *
14993  * cdef inline int import_umath() except -1:
14994  *     try:             # <<<<<<<<<<<<<<
14995  *         _import_umath()
14996  *     except Exception:
14997  */
14998     }
14999     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
15000     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
15001     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15002     goto __pyx_L8_try_end;
15003     __pyx_L3_error:;
15004 
15005     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1043
15006  *     try:
15007  *         _import_umath()
15008  *     except Exception:             # <<<<<<<<<<<<<<
15009  *         raise ImportError("numpy.core.umath failed to import")
15010  *
15011  */
15012     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
15013     if (__pyx_t_4) {
15014       __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
15015       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1043, __pyx_L5_except_error)
15016       __Pyx_GOTREF(__pyx_t_5);
15017       __Pyx_GOTREF(__pyx_t_6);
15018       __Pyx_GOTREF(__pyx_t_7);
15019 
15020       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044
15021  *         _import_umath()
15022  *     except Exception:
15023  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
15024  *
15025  * cdef inline int import_ufunc() except -1:
15026  */
15027       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1044, __pyx_L5_except_error)
15028       __Pyx_GOTREF(__pyx_t_8);
15029       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
15030       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
15031       __PYX_ERR(2, 1044, __pyx_L5_except_error)
15032     }
15033     goto __pyx_L5_except_error;
15034     __pyx_L5_except_error:;
15035 
15036     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
15037  *
15038  * cdef inline int import_umath() except -1:
15039  *     try:             # <<<<<<<<<<<<<<
15040  *         _import_umath()
15041  *     except Exception:
15042  */
15043     __Pyx_XGIVEREF(__pyx_t_1);
15044     __Pyx_XGIVEREF(__pyx_t_2);
15045     __Pyx_XGIVEREF(__pyx_t_3);
15046     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15047     goto __pyx_L1_error;
15048     __pyx_L8_try_end:;
15049   }
15050 
15051   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040
15052  *         raise ImportError("numpy.core.multiarray failed to import")
15053  *
15054  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
15055  *     try:
15056  *         _import_umath()
15057  */
15058 
15059   /* function exit code */
15060   __pyx_r = 0;
15061   goto __pyx_L0;
15062   __pyx_L1_error:;
15063   __Pyx_XDECREF(__pyx_t_5);
15064   __Pyx_XDECREF(__pyx_t_6);
15065   __Pyx_XDECREF(__pyx_t_7);
15066   __Pyx_XDECREF(__pyx_t_8);
15067   __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
15068   __pyx_r = -1;
15069   __pyx_L0:;
15070   __Pyx_RefNannyFinishContext();
15071   return __pyx_r;
15072 }
15073 
15074 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
15075  *         raise ImportError("numpy.core.umath failed to import")
15076  *
15077  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
15078  *     try:
15079  *         _import_umath()
15080  */
15081 
__pyx_f_5numpy_import_ufunc(void)15082 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
15083   int __pyx_r;
15084   __Pyx_RefNannyDeclarations
15085   PyObject *__pyx_t_1 = NULL;
15086   PyObject *__pyx_t_2 = NULL;
15087   PyObject *__pyx_t_3 = NULL;
15088   int __pyx_t_4;
15089   PyObject *__pyx_t_5 = NULL;
15090   PyObject *__pyx_t_6 = NULL;
15091   PyObject *__pyx_t_7 = NULL;
15092   PyObject *__pyx_t_8 = NULL;
15093   __Pyx_RefNannySetupContext("import_ufunc", 0);
15094 
15095   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
15096  *
15097  * cdef inline int import_ufunc() except -1:
15098  *     try:             # <<<<<<<<<<<<<<
15099  *         _import_umath()
15100  *     except Exception:
15101  */
15102   {
15103     __Pyx_PyThreadState_declare
15104     __Pyx_PyThreadState_assign
15105     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
15106     __Pyx_XGOTREF(__pyx_t_1);
15107     __Pyx_XGOTREF(__pyx_t_2);
15108     __Pyx_XGOTREF(__pyx_t_3);
15109     /*try:*/ {
15110 
15111       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1048
15112  * cdef inline int import_ufunc() except -1:
15113  *     try:
15114  *         _import_umath()             # <<<<<<<<<<<<<<
15115  *     except Exception:
15116  *         raise ImportError("numpy.core.umath failed to import")
15117  */
15118       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1048, __pyx_L3_error)
15119 
15120       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
15121  *
15122  * cdef inline int import_ufunc() except -1:
15123  *     try:             # <<<<<<<<<<<<<<
15124  *         _import_umath()
15125  *     except Exception:
15126  */
15127     }
15128     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
15129     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
15130     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15131     goto __pyx_L8_try_end;
15132     __pyx_L3_error:;
15133 
15134     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1049
15135  *     try:
15136  *         _import_umath()
15137  *     except Exception:             # <<<<<<<<<<<<<<
15138  *         raise ImportError("numpy.core.umath failed to import")
15139  */
15140     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
15141     if (__pyx_t_4) {
15142       __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
15143       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1049, __pyx_L5_except_error)
15144       __Pyx_GOTREF(__pyx_t_5);
15145       __Pyx_GOTREF(__pyx_t_6);
15146       __Pyx_GOTREF(__pyx_t_7);
15147 
15148       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1050
15149  *         _import_umath()
15150  *     except Exception:
15151  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
15152  */
15153       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1050, __pyx_L5_except_error)
15154       __Pyx_GOTREF(__pyx_t_8);
15155       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
15156       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
15157       __PYX_ERR(2, 1050, __pyx_L5_except_error)
15158     }
15159     goto __pyx_L5_except_error;
15160     __pyx_L5_except_error:;
15161 
15162     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
15163  *
15164  * cdef inline int import_ufunc() except -1:
15165  *     try:             # <<<<<<<<<<<<<<
15166  *         _import_umath()
15167  *     except Exception:
15168  */
15169     __Pyx_XGIVEREF(__pyx_t_1);
15170     __Pyx_XGIVEREF(__pyx_t_2);
15171     __Pyx_XGIVEREF(__pyx_t_3);
15172     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15173     goto __pyx_L1_error;
15174     __pyx_L8_try_end:;
15175   }
15176 
15177   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
15178  *         raise ImportError("numpy.core.umath failed to import")
15179  *
15180  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
15181  *     try:
15182  *         _import_umath()
15183  */
15184 
15185   /* function exit code */
15186   __pyx_r = 0;
15187   goto __pyx_L0;
15188   __pyx_L1_error:;
15189   __Pyx_XDECREF(__pyx_t_5);
15190   __Pyx_XDECREF(__pyx_t_6);
15191   __Pyx_XDECREF(__pyx_t_7);
15192   __Pyx_XDECREF(__pyx_t_8);
15193   __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
15194   __pyx_r = -1;
15195   __pyx_L0:;
15196   __Pyx_RefNannyFinishContext();
15197   return __pyx_r;
15198 }
15199 
15200 /* "oct_visitors.pxd":51
15201  *     cdef void visit(self, Oct*, np.uint8_t selected)
15202  *
15203  *     cdef inline int oind(self):             # <<<<<<<<<<<<<<
15204  *         cdef int d = (1 << self.oref)
15205  *         return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2])
15206  */
15207 
__pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor * __pyx_v_self)15208 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) {
15209   int __pyx_v_d;
15210   int __pyx_r;
15211   __Pyx_RefNannyDeclarations
15212   __Pyx_RefNannySetupContext("oind", 0);
15213 
15214   /* "oct_visitors.pxd":52
15215  *
15216  *     cdef inline int oind(self):
15217  *         cdef int d = (1 << self.oref)             # <<<<<<<<<<<<<<
15218  *         return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2])
15219  *
15220  */
15221   __pyx_v_d = (1 << __pyx_v_self->oref);
15222 
15223   /* "oct_visitors.pxd":53
15224  *     cdef inline int oind(self):
15225  *         cdef int d = (1 << self.oref)
15226  *         return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2])             # <<<<<<<<<<<<<<
15227  *
15228  *     cdef inline int rind(self):
15229  */
15230   __pyx_r = (((((__pyx_v_self->ind[0]) * __pyx_v_d) + (__pyx_v_self->ind[1])) * __pyx_v_d) + (__pyx_v_self->ind[2]));
15231   goto __pyx_L0;
15232 
15233   /* "oct_visitors.pxd":51
15234  *     cdef void visit(self, Oct*, np.uint8_t selected)
15235  *
15236  *     cdef inline int oind(self):             # <<<<<<<<<<<<<<
15237  *         cdef int d = (1 << self.oref)
15238  *         return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2])
15239  */
15240 
15241   /* function exit code */
15242   __pyx_L0:;
15243   __Pyx_RefNannyFinishContext();
15244   return __pyx_r;
15245 }
15246 
15247 /* "oct_visitors.pxd":55
15248  *         return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2])
15249  *
15250  *     cdef inline int rind(self):             # <<<<<<<<<<<<<<
15251  *         cdef int d = (1 << self.oref)
15252  *         return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0])
15253  */
15254 
__pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor * __pyx_v_self)15255 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) {
15256   int __pyx_v_d;
15257   int __pyx_r;
15258   __Pyx_RefNannyDeclarations
15259   __Pyx_RefNannySetupContext("rind", 0);
15260 
15261   /* "oct_visitors.pxd":56
15262  *
15263  *     cdef inline int rind(self):
15264  *         cdef int d = (1 << self.oref)             # <<<<<<<<<<<<<<
15265  *         return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0])
15266  *
15267  */
15268   __pyx_v_d = (1 << __pyx_v_self->oref);
15269 
15270   /* "oct_visitors.pxd":57
15271  *     cdef inline int rind(self):
15272  *         cdef int d = (1 << self.oref)
15273  *         return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0])             # <<<<<<<<<<<<<<
15274  *
15275  * cdef class CountTotalOcts(OctVisitor):
15276  */
15277   __pyx_r = (((((__pyx_v_self->ind[2]) * __pyx_v_d) + (__pyx_v_self->ind[1])) * __pyx_v_d) + (__pyx_v_self->ind[0]));
15278   goto __pyx_L0;
15279 
15280   /* "oct_visitors.pxd":55
15281  *         return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2])
15282  *
15283  *     cdef inline int rind(self):             # <<<<<<<<<<<<<<
15284  *         cdef int d = (1 << self.oref)
15285  *         return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0])
15286  */
15287 
15288   /* function exit code */
15289   __pyx_L0:;
15290   __Pyx_RefNannyFinishContext();
15291   return __pyx_r;
15292 }
15293 
15294 /* "oct_visitors.pxd":142
15295  *     cdef np.uint64_t[:] morton_ind
15296  *
15297  * cdef inline int cind(int i, int j, int k) nogil:             # <<<<<<<<<<<<<<
15298  *     # THIS ONLY WORKS FOR CHILDREN.  It is not general for zones.
15299  *     return (((i*2)+j)*2+k)
15300  */
15301 
__pyx_f_2yt_8geometry_12oct_visitors_cind(int __pyx_v_i,int __pyx_v_j,int __pyx_v_k)15302 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_cind(int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) {
15303   int __pyx_r;
15304 
15305   /* "oct_visitors.pxd":144
15306  * cdef inline int cind(int i, int j, int k) nogil:
15307  *     # THIS ONLY WORKS FOR CHILDREN.  It is not general for zones.
15308  *     return (((i*2)+j)*2+k)             # <<<<<<<<<<<<<<
15309  *
15310  * from oct_container cimport OctreeContainer
15311  */
15312   __pyx_r = ((((__pyx_v_i * 2) + __pyx_v_j) * 2) + __pyx_v_k);
15313   goto __pyx_L0;
15314 
15315   /* "oct_visitors.pxd":142
15316  *     cdef np.uint64_t[:] morton_ind
15317  *
15318  * cdef inline int cind(int i, int j, int k) nogil:             # <<<<<<<<<<<<<<
15319  *     # THIS ONLY WORKS FOR CHILDREN.  It is not general for zones.
15320  *     return (((i*2)+j)*2+k)
15321  */
15322 
15323   /* function exit code */
15324   __pyx_L0:;
15325   return __pyx_r;
15326 }
15327 
15328 /* "oct_visitors.pxd":165
15329  *     cdef void set_neighbour_info(self, Oct *o, int ishift[3])
15330  *
15331  *     cdef inline np.uint8_t neighbour_rind(self):             # <<<<<<<<<<<<<<
15332  *         cdef int d = (1 << self.oref)
15333  *         return (((self.neigh_ind[2]*d)+self.neigh_ind[1])*d+self.neigh_ind[0])
15334  */
15335 
__pyx_f_2yt_8geometry_12oct_visitors_20BaseNeighbourVisitor_neighbour_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor * __pyx_v_self)15336 static CYTHON_INLINE __pyx_t_5numpy_uint8_t __pyx_f_2yt_8geometry_12oct_visitors_20BaseNeighbourVisitor_neighbour_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor *__pyx_v_self) {
15337   int __pyx_v_d;
15338   __pyx_t_5numpy_uint8_t __pyx_r;
15339   __Pyx_RefNannyDeclarations
15340   __Pyx_RefNannySetupContext("neighbour_rind", 0);
15341 
15342   /* "oct_visitors.pxd":166
15343  *
15344  *     cdef inline np.uint8_t neighbour_rind(self):
15345  *         cdef int d = (1 << self.oref)             # <<<<<<<<<<<<<<
15346  *         return (((self.neigh_ind[2]*d)+self.neigh_ind[1])*d+self.neigh_ind[0])
15347  *
15348  */
15349   __pyx_v_d = (1 << __pyx_v_self->__pyx_base.oref);
15350 
15351   /* "oct_visitors.pxd":167
15352  *     cdef inline np.uint8_t neighbour_rind(self):
15353  *         cdef int d = (1 << self.oref)
15354  *         return (((self.neigh_ind[2]*d)+self.neigh_ind[1])*d+self.neigh_ind[0])             # <<<<<<<<<<<<<<
15355  *
15356  * cdef class NeighbourCellIndexVisitor(BaseNeighbourVisitor):
15357  */
15358   __pyx_r = (((((__pyx_v_self->neigh_ind[2]) * __pyx_v_d) + (__pyx_v_self->neigh_ind[1])) * __pyx_v_d) + (__pyx_v_self->neigh_ind[0]));
15359   goto __pyx_L0;
15360 
15361   /* "oct_visitors.pxd":165
15362  *     cdef void set_neighbour_info(self, Oct *o, int ishift[3])
15363  *
15364  *     cdef inline np.uint8_t neighbour_rind(self):             # <<<<<<<<<<<<<<
15365  *         cdef int d = (1 << self.oref)
15366  *         return (((self.neigh_ind[2]*d)+self.neigh_ind[1])*d+self.neigh_ind[0])
15367  */
15368 
15369   /* function exit code */
15370   __pyx_L0:;
15371   __Pyx_RefNannyFinishContext();
15372   return __pyx_r;
15373 }
15374 
15375 /* "yt/utilities/lib/fp_utils.pxd":13
15376  *
15377  *
15378  * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
15379  *     if i0 > i1: return i0
15380  *     return i1
15381  */
15382 
__pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0,__pyx_t_5numpy_int64_t __pyx_v_i1)15383 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) {
15384   __pyx_t_5numpy_int64_t __pyx_r;
15385   int __pyx_t_1;
15386 
15387   /* "yt/utilities/lib/fp_utils.pxd":14
15388  *
15389  * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil:
15390  *     if i0 > i1: return i0             # <<<<<<<<<<<<<<
15391  *     return i1
15392  *
15393  */
15394   __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0);
15395   if (__pyx_t_1) {
15396     __pyx_r = __pyx_v_i0;
15397     goto __pyx_L0;
15398   }
15399 
15400   /* "yt/utilities/lib/fp_utils.pxd":15
15401  * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil:
15402  *     if i0 > i1: return i0
15403  *     return i1             # <<<<<<<<<<<<<<
15404  *
15405  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:
15406  */
15407   __pyx_r = __pyx_v_i1;
15408   goto __pyx_L0;
15409 
15410   /* "yt/utilities/lib/fp_utils.pxd":13
15411  *
15412  *
15413  * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
15414  *     if i0 > i1: return i0
15415  *     return i1
15416  */
15417 
15418   /* function exit code */
15419   __pyx_L0:;
15420   return __pyx_r;
15421 }
15422 
15423 /* "yt/utilities/lib/fp_utils.pxd":17
15424  *     return i1
15425  *
15426  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
15427  *     if f0 > f1: return f0
15428  *     return f1
15429  */
15430 
__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0,__pyx_t_5numpy_float64_t __pyx_v_f1)15431 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) {
15432   __pyx_t_5numpy_float64_t __pyx_r;
15433   int __pyx_t_1;
15434 
15435   /* "yt/utilities/lib/fp_utils.pxd":18
15436  *
15437  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:
15438  *     if f0 > f1: return f0             # <<<<<<<<<<<<<<
15439  *     return f1
15440  *
15441  */
15442   __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0);
15443   if (__pyx_t_1) {
15444     __pyx_r = __pyx_v_f0;
15445     goto __pyx_L0;
15446   }
15447 
15448   /* "yt/utilities/lib/fp_utils.pxd":19
15449  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:
15450  *     if f0 > f1: return f0
15451  *     return f1             # <<<<<<<<<<<<<<
15452  *
15453  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:
15454  */
15455   __pyx_r = __pyx_v_f1;
15456   goto __pyx_L0;
15457 
15458   /* "yt/utilities/lib/fp_utils.pxd":17
15459  *     return i1
15460  *
15461  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
15462  *     if f0 > f1: return f0
15463  *     return f1
15464  */
15465 
15466   /* function exit code */
15467   __pyx_L0:;
15468   return __pyx_r;
15469 }
15470 
15471 /* "yt/utilities/lib/fp_utils.pxd":21
15472  *     return f1
15473  *
15474  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
15475  *     if i0 < i1: return i0
15476  *     return i1
15477  */
15478 
__pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0,__pyx_t_5numpy_int64_t __pyx_v_i1)15479 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) {
15480   __pyx_t_5numpy_int64_t __pyx_r;
15481   int __pyx_t_1;
15482 
15483   /* "yt/utilities/lib/fp_utils.pxd":22
15484  *
15485  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:
15486  *     if i0 < i1: return i0             # <<<<<<<<<<<<<<
15487  *     return i1
15488  *
15489  */
15490   __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0);
15491   if (__pyx_t_1) {
15492     __pyx_r = __pyx_v_i0;
15493     goto __pyx_L0;
15494   }
15495 
15496   /* "yt/utilities/lib/fp_utils.pxd":23
15497  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:
15498  *     if i0 < i1: return i0
15499  *     return i1             # <<<<<<<<<<<<<<
15500  *
15501  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:
15502  */
15503   __pyx_r = __pyx_v_i1;
15504   goto __pyx_L0;
15505 
15506   /* "yt/utilities/lib/fp_utils.pxd":21
15507  *     return f1
15508  *
15509  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
15510  *     if i0 < i1: return i0
15511  *     return i1
15512  */
15513 
15514   /* function exit code */
15515   __pyx_L0:;
15516   return __pyx_r;
15517 }
15518 
15519 /* "yt/utilities/lib/fp_utils.pxd":25
15520  *     return i1
15521  *
15522  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
15523  *     if f0 < f1: return f0
15524  *     return f1
15525  */
15526 
__pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0,__pyx_t_5numpy_float64_t __pyx_v_f1)15527 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) {
15528   __pyx_t_5numpy_float64_t __pyx_r;
15529   int __pyx_t_1;
15530 
15531   /* "yt/utilities/lib/fp_utils.pxd":26
15532  *
15533  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:
15534  *     if f0 < f1: return f0             # <<<<<<<<<<<<<<
15535  *     return f1
15536  *
15537  */
15538   __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0);
15539   if (__pyx_t_1) {
15540     __pyx_r = __pyx_v_f0;
15541     goto __pyx_L0;
15542   }
15543 
15544   /* "yt/utilities/lib/fp_utils.pxd":27
15545  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:
15546  *     if f0 < f1: return f0
15547  *     return f1             # <<<<<<<<<<<<<<
15548  *
15549  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:
15550  */
15551   __pyx_r = __pyx_v_f1;
15552   goto __pyx_L0;
15553 
15554   /* "yt/utilities/lib/fp_utils.pxd":25
15555  *     return i1
15556  *
15557  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
15558  *     if f0 < f1: return f0
15559  *     return f1
15560  */
15561 
15562   /* function exit code */
15563   __pyx_L0:;
15564   return __pyx_r;
15565 }
15566 
15567 /* "yt/utilities/lib/fp_utils.pxd":29
15568  *     return f1
15569  *
15570  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:             # <<<<<<<<<<<<<<
15571  *     if f0 < 0.0: return -f0
15572  *     return f0
15573  */
15574 
__pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0)15575 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) {
15576   __pyx_t_5numpy_float64_t __pyx_r;
15577   int __pyx_t_1;
15578 
15579   /* "yt/utilities/lib/fp_utils.pxd":30
15580  *
15581  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:
15582  *     if f0 < 0.0: return -f0             # <<<<<<<<<<<<<<
15583  *     return f0
15584  *
15585  */
15586   __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0);
15587   if (__pyx_t_1) {
15588     __pyx_r = (-__pyx_v_f0);
15589     goto __pyx_L0;
15590   }
15591 
15592   /* "yt/utilities/lib/fp_utils.pxd":31
15593  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:
15594  *     if f0 < 0.0: return -f0
15595  *     return f0             # <<<<<<<<<<<<<<
15596  *
15597  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
15598  */
15599   __pyx_r = __pyx_v_f0;
15600   goto __pyx_L0;
15601 
15602   /* "yt/utilities/lib/fp_utils.pxd":29
15603  *     return f1
15604  *
15605  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:             # <<<<<<<<<<<<<<
15606  *     if f0 < 0.0: return -f0
15607  *     return f0
15608  */
15609 
15610   /* function exit code */
15611   __pyx_L0:;
15612   return __pyx_r;
15613 }
15614 
15615 /* "yt/utilities/lib/fp_utils.pxd":33
15616  *     return f0
15617  *
15618  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
15619  *     if i < a: return a
15620  *     if i > b: return b
15621  */
15622 
__pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i,__pyx_t_5numpy_int64_t __pyx_v_a,__pyx_t_5numpy_int64_t __pyx_v_b)15623 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) {
15624   __pyx_t_5numpy_int64_t __pyx_r;
15625   int __pyx_t_1;
15626 
15627   /* "yt/utilities/lib/fp_utils.pxd":34
15628  *
15629  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
15630  *     if i < a: return a             # <<<<<<<<<<<<<<
15631  *     if i > b: return b
15632  *     return i
15633  */
15634   __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0);
15635   if (__pyx_t_1) {
15636     __pyx_r = __pyx_v_a;
15637     goto __pyx_L0;
15638   }
15639 
15640   /* "yt/utilities/lib/fp_utils.pxd":35
15641  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
15642  *     if i < a: return a
15643  *     if i > b: return b             # <<<<<<<<<<<<<<
15644  *     return i
15645  *
15646  */
15647   __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0);
15648   if (__pyx_t_1) {
15649     __pyx_r = __pyx_v_b;
15650     goto __pyx_L0;
15651   }
15652 
15653   /* "yt/utilities/lib/fp_utils.pxd":36
15654  *     if i < a: return a
15655  *     if i > b: return b
15656  *     return i             # <<<<<<<<<<<<<<
15657  *
15658  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
15659  */
15660   __pyx_r = __pyx_v_i;
15661   goto __pyx_L0;
15662 
15663   /* "yt/utilities/lib/fp_utils.pxd":33
15664  *     return f0
15665  *
15666  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
15667  *     if i < a: return a
15668  *     if i > b: return b
15669  */
15670 
15671   /* function exit code */
15672   __pyx_L0:;
15673   return __pyx_r;
15674 }
15675 
15676 /* "yt/utilities/lib/fp_utils.pxd":38
15677  *     return i
15678  *
15679  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
15680  *     if i < a: return a
15681  *     if i > b: return b
15682  */
15683 
__pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i,__pyx_t_5numpy_int64_t __pyx_v_a,__pyx_t_5numpy_int64_t __pyx_v_b)15684 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) {
15685   __pyx_t_5numpy_int64_t __pyx_r;
15686   int __pyx_t_1;
15687 
15688   /* "yt/utilities/lib/fp_utils.pxd":39
15689  *
15690  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
15691  *     if i < a: return a             # <<<<<<<<<<<<<<
15692  *     if i > b: return b
15693  *     return i
15694  */
15695   __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0);
15696   if (__pyx_t_1) {
15697     __pyx_r = __pyx_v_a;
15698     goto __pyx_L0;
15699   }
15700 
15701   /* "yt/utilities/lib/fp_utils.pxd":40
15702  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
15703  *     if i < a: return a
15704  *     if i > b: return b             # <<<<<<<<<<<<<<
15705  *     return i
15706  *
15707  */
15708   __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0);
15709   if (__pyx_t_1) {
15710     __pyx_r = __pyx_v_b;
15711     goto __pyx_L0;
15712   }
15713 
15714   /* "yt/utilities/lib/fp_utils.pxd":41
15715  *     if i < a: return a
15716  *     if i > b: return b
15717  *     return i             # <<<<<<<<<<<<<<
15718  *
15719  * cdef inline np.float64_t fclip(np.float64_t f,
15720  */
15721   __pyx_r = __pyx_v_i;
15722   goto __pyx_L0;
15723 
15724   /* "yt/utilities/lib/fp_utils.pxd":38
15725  *     return i
15726  *
15727  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
15728  *     if i < a: return a
15729  *     if i > b: return b
15730  */
15731 
15732   /* function exit code */
15733   __pyx_L0:;
15734   return __pyx_r;
15735 }
15736 
15737 /* "yt/utilities/lib/fp_utils.pxd":43
15738  *     return i
15739  *
15740  * cdef inline np.float64_t fclip(np.float64_t f,             # <<<<<<<<<<<<<<
15741  *                       np.float64_t a, np.float64_t b) nogil:
15742  *     return fmin(fmax(f, a), b)
15743  */
15744 
__pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f,__pyx_t_5numpy_float64_t __pyx_v_a,__pyx_t_5numpy_float64_t __pyx_v_b)15745 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) {
15746   __pyx_t_5numpy_float64_t __pyx_r;
15747 
15748   /* "yt/utilities/lib/fp_utils.pxd":45
15749  * cdef inline np.float64_t fclip(np.float64_t f,
15750  *                       np.float64_t a, np.float64_t b) nogil:
15751  *     return fmin(fmax(f, a), b)             # <<<<<<<<<<<<<<
15752  *
15753  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:
15754  */
15755   __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b);
15756   goto __pyx_L0;
15757 
15758   /* "yt/utilities/lib/fp_utils.pxd":43
15759  *     return i
15760  *
15761  * cdef inline np.float64_t fclip(np.float64_t f,             # <<<<<<<<<<<<<<
15762  *                       np.float64_t a, np.float64_t b) nogil:
15763  *     return fmin(fmax(f, a), b)
15764  */
15765 
15766   /* function exit code */
15767   __pyx_L0:;
15768   return __pyx_r;
15769 }
15770 
15771 /* "yt/utilities/lib/fp_utils.pxd":47
15772  *     return fmin(fmax(f, a), b)
15773  *
15774  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
15775  *     if i0 > i1: return i0
15776  *     return i1
15777  */
15778 
__pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0,__pyx_t_5numpy_int64_t __pyx_v_i1)15779 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) {
15780   __pyx_t_5numpy_int64_t __pyx_r;
15781   int __pyx_t_1;
15782 
15783   /* "yt/utilities/lib/fp_utils.pxd":48
15784  *
15785  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:
15786  *     if i0 > i1: return i0             # <<<<<<<<<<<<<<
15787  *     return i1
15788  *
15789  */
15790   __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0);
15791   if (__pyx_t_1) {
15792     __pyx_r = __pyx_v_i0;
15793     goto __pyx_L0;
15794   }
15795 
15796   /* "yt/utilities/lib/fp_utils.pxd":49
15797  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:
15798  *     if i0 > i1: return i0
15799  *     return i1             # <<<<<<<<<<<<<<
15800  *
15801  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:
15802  */
15803   __pyx_r = __pyx_v_i1;
15804   goto __pyx_L0;
15805 
15806   /* "yt/utilities/lib/fp_utils.pxd":47
15807  *     return fmin(fmax(f, a), b)
15808  *
15809  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
15810  *     if i0 > i1: return i0
15811  *     return i1
15812  */
15813 
15814   /* function exit code */
15815   __pyx_L0:;
15816   return __pyx_r;
15817 }
15818 
15819 /* "yt/utilities/lib/fp_utils.pxd":51
15820  *     return i1
15821  *
15822  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
15823  *     if i0 < i1: return i0
15824  *     return i1
15825  */
15826 
__pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0,__pyx_t_5numpy_int64_t __pyx_v_i1)15827 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) {
15828   __pyx_t_5numpy_int64_t __pyx_r;
15829   int __pyx_t_1;
15830 
15831   /* "yt/utilities/lib/fp_utils.pxd":52
15832  *
15833  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:
15834  *     if i0 < i1: return i0             # <<<<<<<<<<<<<<
15835  *     return i1
15836  *
15837  */
15838   __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0);
15839   if (__pyx_t_1) {
15840     __pyx_r = __pyx_v_i0;
15841     goto __pyx_L0;
15842   }
15843 
15844   /* "yt/utilities/lib/fp_utils.pxd":53
15845  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:
15846  *     if i0 < i1: return i0
15847  *     return i1             # <<<<<<<<<<<<<<
15848  *
15849  * cdef inline _ensure_code(arr):
15850  */
15851   __pyx_r = __pyx_v_i1;
15852   goto __pyx_L0;
15853 
15854   /* "yt/utilities/lib/fp_utils.pxd":51
15855  *     return i1
15856  *
15857  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
15858  *     if i0 < i1: return i0
15859  *     return i1
15860  */
15861 
15862   /* function exit code */
15863   __pyx_L0:;
15864   return __pyx_r;
15865 }
15866 
15867 /* "yt/utilities/lib/fp_utils.pxd":55
15868  *     return i1
15869  *
15870  * cdef inline _ensure_code(arr):             # <<<<<<<<<<<<<<
15871  *     if hasattr(arr, "units"):
15872  *         if "code_length" == str(arr.units):
15873  */
15874 
__pyx_f_2yt_9utilities_3lib_8fp_utils__ensure_code(PyObject * __pyx_v_arr)15875 static CYTHON_INLINE PyObject *__pyx_f_2yt_9utilities_3lib_8fp_utils__ensure_code(PyObject *__pyx_v_arr) {
15876   PyObject *__pyx_r = NULL;
15877   __Pyx_RefNannyDeclarations
15878   int __pyx_t_1;
15879   int __pyx_t_2;
15880   PyObject *__pyx_t_3 = NULL;
15881   PyObject *__pyx_t_4 = NULL;
15882   PyObject *__pyx_t_5 = NULL;
15883   __Pyx_RefNannySetupContext("_ensure_code", 0);
15884 
15885   /* "yt/utilities/lib/fp_utils.pxd":56
15886  *
15887  * cdef inline _ensure_code(arr):
15888  *     if hasattr(arr, "units"):             # <<<<<<<<<<<<<<
15889  *         if "code_length" == str(arr.units):
15890  *             return arr
15891  */
15892   __pyx_t_1 = __Pyx_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 56, __pyx_L1_error)
15893   __pyx_t_2 = (__pyx_t_1 != 0);
15894   if (__pyx_t_2) {
15895 
15896     /* "yt/utilities/lib/fp_utils.pxd":57
15897  * cdef inline _ensure_code(arr):
15898  *     if hasattr(arr, "units"):
15899  *         if "code_length" == str(arr.units):             # <<<<<<<<<<<<<<
15900  *             return arr
15901  *         arr.convert_to_units("code_length")
15902  */
15903     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 57, __pyx_L1_error)
15904     __Pyx_GOTREF(__pyx_t_3);
15905     __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 57, __pyx_L1_error)
15906     __Pyx_GOTREF(__pyx_t_4);
15907     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15908     __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 57, __pyx_L1_error)
15909     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15910     if (__pyx_t_2) {
15911 
15912       /* "yt/utilities/lib/fp_utils.pxd":58
15913  *     if hasattr(arr, "units"):
15914  *         if "code_length" == str(arr.units):
15915  *             return arr             # <<<<<<<<<<<<<<
15916  *         arr.convert_to_units("code_length")
15917  *     return arr
15918  */
15919       __Pyx_XDECREF(__pyx_r);
15920       __Pyx_INCREF(__pyx_v_arr);
15921       __pyx_r = __pyx_v_arr;
15922       goto __pyx_L0;
15923 
15924       /* "yt/utilities/lib/fp_utils.pxd":57
15925  * cdef inline _ensure_code(arr):
15926  *     if hasattr(arr, "units"):
15927  *         if "code_length" == str(arr.units):             # <<<<<<<<<<<<<<
15928  *             return arr
15929  *         arr.convert_to_units("code_length")
15930  */
15931     }
15932 
15933     /* "yt/utilities/lib/fp_utils.pxd":59
15934  *         if "code_length" == str(arr.units):
15935  *             return arr
15936  *         arr.convert_to_units("code_length")             # <<<<<<<<<<<<<<
15937  *     return arr
15938  */
15939     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 59, __pyx_L1_error)
15940     __Pyx_GOTREF(__pyx_t_3);
15941     __pyx_t_5 = NULL;
15942     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
15943       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
15944       if (likely(__pyx_t_5)) {
15945         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
15946         __Pyx_INCREF(__pyx_t_5);
15947         __Pyx_INCREF(function);
15948         __Pyx_DECREF_SET(__pyx_t_3, function);
15949       }
15950     }
15951     __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_n_s_code_length) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_s_code_length);
15952     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15953     if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 59, __pyx_L1_error)
15954     __Pyx_GOTREF(__pyx_t_4);
15955     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15956     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15957 
15958     /* "yt/utilities/lib/fp_utils.pxd":56
15959  *
15960  * cdef inline _ensure_code(arr):
15961  *     if hasattr(arr, "units"):             # <<<<<<<<<<<<<<
15962  *         if "code_length" == str(arr.units):
15963  *             return arr
15964  */
15965   }
15966 
15967   /* "yt/utilities/lib/fp_utils.pxd":60
15968  *             return arr
15969  *         arr.convert_to_units("code_length")
15970  *     return arr             # <<<<<<<<<<<<<<
15971  */
15972   __Pyx_XDECREF(__pyx_r);
15973   __Pyx_INCREF(__pyx_v_arr);
15974   __pyx_r = __pyx_v_arr;
15975   goto __pyx_L0;
15976 
15977   /* "yt/utilities/lib/fp_utils.pxd":55
15978  *     return i1
15979  *
15980  * cdef inline _ensure_code(arr):             # <<<<<<<<<<<<<<
15981  *     if hasattr(arr, "units"):
15982  *         if "code_length" == str(arr.units):
15983  */
15984 
15985   /* function exit code */
15986   __pyx_L1_error:;
15987   __Pyx_XDECREF(__pyx_t_3);
15988   __Pyx_XDECREF(__pyx_t_4);
15989   __Pyx_XDECREF(__pyx_t_5);
15990   __Pyx_AddTraceback("yt.utilities.lib.fp_utils._ensure_code", __pyx_clineno, __pyx_lineno, __pyx_filename);
15991   __pyx_r = 0;
15992   __pyx_L0:;
15993   __Pyx_XGIVEREF(__pyx_r);
15994   __Pyx_RefNannyFinishContext();
15995   return __pyx_r;
15996 }
15997 
15998 /* "yt/utilities/lib/geometry_utils.pxd":24
15999  * @cython.boundscheck(False)
16000  * @cython.wraparound(False)
16001  * cdef inline np.int64_t ifrexp(np.float64_t x, np.int64_t *e):             # <<<<<<<<<<<<<<
16002  *     cdef np.float64_t m
16003  *     cdef int e0 = 0
16004  */
16005 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_ifrexp(__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_int64_t * __pyx_v_e)16006 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_ifrexp(__pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_int64_t *__pyx_v_e) {
16007   __pyx_t_5numpy_float64_t __pyx_v_m;
16008   int __pyx_v_e0;
16009   __pyx_t_5numpy_int64_t __pyx_r;
16010   __Pyx_RefNannyDeclarations
16011   __Pyx_RefNannySetupContext("ifrexp", 0);
16012 
16013   /* "yt/utilities/lib/geometry_utils.pxd":26
16014  * cdef inline np.int64_t ifrexp(np.float64_t x, np.int64_t *e):
16015  *     cdef np.float64_t m
16016  *     cdef int e0 = 0             # <<<<<<<<<<<<<<
16017  *     m = frexp(x,&e0)
16018  *     e[0] = <np.int64_t>e0
16019  */
16020   __pyx_v_e0 = 0;
16021 
16022   /* "yt/utilities/lib/geometry_utils.pxd":27
16023  *     cdef np.float64_t m
16024  *     cdef int e0 = 0
16025  *     m = frexp(x,&e0)             # <<<<<<<<<<<<<<
16026  *     e[0] = <np.int64_t>e0
16027  *     return <np.int64_t>ldexp(m,<int>DBL_MANT_DIG)
16028  */
16029   __pyx_v_m = frexp(__pyx_v_x, (&__pyx_v_e0));
16030 
16031   /* "yt/utilities/lib/geometry_utils.pxd":28
16032  *     cdef int e0 = 0
16033  *     m = frexp(x,&e0)
16034  *     e[0] = <np.int64_t>e0             # <<<<<<<<<<<<<<
16035  *     return <np.int64_t>ldexp(m,<int>DBL_MANT_DIG)
16036  *
16037  */
16038   (__pyx_v_e[0]) = ((__pyx_t_5numpy_int64_t)__pyx_v_e0);
16039 
16040   /* "yt/utilities/lib/geometry_utils.pxd":29
16041  *     m = frexp(x,&e0)
16042  *     e[0] = <np.int64_t>e0
16043  *     return <np.int64_t>ldexp(m,<int>DBL_MANT_DIG)             # <<<<<<<<<<<<<<
16044  *
16045  * @cython.cdivision(True)
16046  */
16047   __pyx_r = ((__pyx_t_5numpy_int64_t)ldexp(__pyx_v_m, ((int)DBL_MANT_DIG)));
16048   goto __pyx_L0;
16049 
16050   /* "yt/utilities/lib/geometry_utils.pxd":24
16051  * @cython.boundscheck(False)
16052  * @cython.wraparound(False)
16053  * cdef inline np.int64_t ifrexp(np.float64_t x, np.int64_t *e):             # <<<<<<<<<<<<<<
16054  *     cdef np.float64_t m
16055  *     cdef int e0 = 0
16056  */
16057 
16058   /* function exit code */
16059   __pyx_L0:;
16060   __Pyx_RefNannyFinishContext();
16061   return __pyx_r;
16062 }
16063 
16064 /* "yt/utilities/lib/geometry_utils.pxd":34
16065  * @cython.boundscheck(False)
16066  * @cython.wraparound(False)
16067  * cdef inline np.int64_t msdb(np.int64_t a, np.int64_t b):             # <<<<<<<<<<<<<<
16068  *     """Get the most significant differing bit between a and b."""
16069  *     cdef np.int64_t c, ndx
16070  */
16071 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_msdb(__pyx_t_5numpy_int64_t __pyx_v_a,__pyx_t_5numpy_int64_t __pyx_v_b)16072 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_msdb(__pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) {
16073   __pyx_t_5numpy_int64_t __pyx_v_c;
16074   __pyx_t_5numpy_int64_t __pyx_v_ndx;
16075   __pyx_t_5numpy_int64_t __pyx_r;
16076   __Pyx_RefNannyDeclarations
16077   int __pyx_t_1;
16078   __Pyx_RefNannySetupContext("msdb", 0);
16079 
16080   /* "yt/utilities/lib/geometry_utils.pxd":37
16081  *     """Get the most significant differing bit between a and b."""
16082  *     cdef np.int64_t c, ndx
16083  *     c = a ^ b             # <<<<<<<<<<<<<<
16084  *     ndx = 0
16085  *     while (0 < c):
16086  */
16087   __pyx_v_c = (__pyx_v_a ^ __pyx_v_b);
16088 
16089   /* "yt/utilities/lib/geometry_utils.pxd":38
16090  *     cdef np.int64_t c, ndx
16091  *     c = a ^ b
16092  *     ndx = 0             # <<<<<<<<<<<<<<
16093  *     while (0 < c):
16094  *         c = (c >> 1)
16095  */
16096   __pyx_v_ndx = 0;
16097 
16098   /* "yt/utilities/lib/geometry_utils.pxd":39
16099  *     c = a ^ b
16100  *     ndx = 0
16101  *     while (0 < c):             # <<<<<<<<<<<<<<
16102  *         c = (c >> 1)
16103  *         ndx+=1
16104  */
16105   while (1) {
16106     __pyx_t_1 = ((0 < __pyx_v_c) != 0);
16107     if (!__pyx_t_1) break;
16108 
16109     /* "yt/utilities/lib/geometry_utils.pxd":40
16110  *     ndx = 0
16111  *     while (0 < c):
16112  *         c = (c >> 1)             # <<<<<<<<<<<<<<
16113  *         ndx+=1
16114  *     return ndx
16115  */
16116     __pyx_v_c = (__pyx_v_c >> 1);
16117 
16118     /* "yt/utilities/lib/geometry_utils.pxd":41
16119  *     while (0 < c):
16120  *         c = (c >> 1)
16121  *         ndx+=1             # <<<<<<<<<<<<<<
16122  *     return ndx
16123  *
16124  */
16125     __pyx_v_ndx = (__pyx_v_ndx + 1);
16126   }
16127 
16128   /* "yt/utilities/lib/geometry_utils.pxd":42
16129  *         c = (c >> 1)
16130  *         ndx+=1
16131  *     return ndx             # <<<<<<<<<<<<<<
16132  *
16133  * @cython.cdivision(True)
16134  */
16135   __pyx_r = __pyx_v_ndx;
16136   goto __pyx_L0;
16137 
16138   /* "yt/utilities/lib/geometry_utils.pxd":34
16139  * @cython.boundscheck(False)
16140  * @cython.wraparound(False)
16141  * cdef inline np.int64_t msdb(np.int64_t a, np.int64_t b):             # <<<<<<<<<<<<<<
16142  *     """Get the most significant differing bit between a and b."""
16143  *     cdef np.int64_t c, ndx
16144  */
16145 
16146   /* function exit code */
16147   __pyx_L0:;
16148   __Pyx_RefNannyFinishContext();
16149   return __pyx_r;
16150 }
16151 
16152 /* "yt/utilities/lib/geometry_utils.pxd":47
16153  * @cython.boundscheck(False)
16154  * @cython.wraparound(False)
16155  * cdef inline np.int64_t xor_msb(np.float64_t a, np.float64_t b):             # <<<<<<<<<<<<<<
16156  *     """Get the exponent of the highest differing bit between a and b"""
16157  *     # Get mantissa and exponents for each number
16158  */
16159 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_xor_msb(__pyx_t_5numpy_float64_t __pyx_v_a,__pyx_t_5numpy_float64_t __pyx_v_b)16160 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_xor_msb(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) {
16161   __pyx_t_5numpy_int64_t __pyx_v_a_m;
16162   __pyx_t_5numpy_int64_t __pyx_v_a_e;
16163   __pyx_t_5numpy_int64_t __pyx_v_b_m;
16164   __pyx_t_5numpy_int64_t __pyx_v_b_e;
16165   __pyx_t_5numpy_int64_t __pyx_v_x;
16166   __pyx_t_5numpy_int64_t __pyx_v_y;
16167   __pyx_t_5numpy_int64_t __pyx_v_z;
16168   __pyx_t_5numpy_int64_t __pyx_r;
16169   __Pyx_RefNannyDeclarations
16170   int __pyx_t_1;
16171   __Pyx_RefNannySetupContext("xor_msb", 0);
16172 
16173   /* "yt/utilities/lib/geometry_utils.pxd":51
16174  *     # Get mantissa and exponents for each number
16175  *     cdef np.int64_t a_m, a_e, b_m, b_e, x, y, z
16176  *     b_e = 0             # <<<<<<<<<<<<<<
16177  *     a_e = 0
16178  *     a_m = ifrexp(a,&a_e)
16179  */
16180   __pyx_v_b_e = 0;
16181 
16182   /* "yt/utilities/lib/geometry_utils.pxd":52
16183  *     cdef np.int64_t a_m, a_e, b_m, b_e, x, y, z
16184  *     b_e = 0
16185  *     a_e = 0             # <<<<<<<<<<<<<<
16186  *     a_m = ifrexp(a,&a_e)
16187  *     b_m = ifrexp(b,&b_e)
16188  */
16189   __pyx_v_a_e = 0;
16190 
16191   /* "yt/utilities/lib/geometry_utils.pxd":53
16192  *     b_e = 0
16193  *     a_e = 0
16194  *     a_m = ifrexp(a,&a_e)             # <<<<<<<<<<<<<<
16195  *     b_m = ifrexp(b,&b_e)
16196  *     x = <np.int64_t> ((a_e+1)*DBL_MANT_DIG)
16197  */
16198   __pyx_v_a_m = __pyx_f_2yt_9utilities_3lib_14geometry_utils_ifrexp(__pyx_v_a, (&__pyx_v_a_e));
16199 
16200   /* "yt/utilities/lib/geometry_utils.pxd":54
16201  *     a_e = 0
16202  *     a_m = ifrexp(a,&a_e)
16203  *     b_m = ifrexp(b,&b_e)             # <<<<<<<<<<<<<<
16204  *     x = <np.int64_t> ((a_e+1)*DBL_MANT_DIG)
16205  *     y = <np.int64_t> ((b_e+1)*DBL_MANT_DIG)
16206  */
16207   __pyx_v_b_m = __pyx_f_2yt_9utilities_3lib_14geometry_utils_ifrexp(__pyx_v_b, (&__pyx_v_b_e));
16208 
16209   /* "yt/utilities/lib/geometry_utils.pxd":55
16210  *     a_m = ifrexp(a,&a_e)
16211  *     b_m = ifrexp(b,&b_e)
16212  *     x = <np.int64_t> ((a_e+1)*DBL_MANT_DIG)             # <<<<<<<<<<<<<<
16213  *     y = <np.int64_t> ((b_e+1)*DBL_MANT_DIG)
16214  *     # Compare mantissa if exponents equal
16215  */
16216   __pyx_v_x = ((__pyx_t_5numpy_int64_t)((__pyx_v_a_e + 1) * DBL_MANT_DIG));
16217 
16218   /* "yt/utilities/lib/geometry_utils.pxd":56
16219  *     b_m = ifrexp(b,&b_e)
16220  *     x = <np.int64_t> ((a_e+1)*DBL_MANT_DIG)
16221  *     y = <np.int64_t> ((b_e+1)*DBL_MANT_DIG)             # <<<<<<<<<<<<<<
16222  *     # Compare mantissa if exponents equal
16223  *     if x == y:
16224  */
16225   __pyx_v_y = ((__pyx_t_5numpy_int64_t)((__pyx_v_b_e + 1) * DBL_MANT_DIG));
16226 
16227   /* "yt/utilities/lib/geometry_utils.pxd":58
16228  *     y = <np.int64_t> ((b_e+1)*DBL_MANT_DIG)
16229  *     # Compare mantissa if exponents equal
16230  *     if x == y:             # <<<<<<<<<<<<<<
16231  *         if a_m == b_m: return 0
16232  *         z = msdb(a_m,b_m)
16233  */
16234   __pyx_t_1 = ((__pyx_v_x == __pyx_v_y) != 0);
16235   if (__pyx_t_1) {
16236 
16237     /* "yt/utilities/lib/geometry_utils.pxd":59
16238  *     # Compare mantissa if exponents equal
16239  *     if x == y:
16240  *         if a_m == b_m: return 0             # <<<<<<<<<<<<<<
16241  *         z = msdb(a_m,b_m)
16242  *         #if 1: return z
16243  */
16244     __pyx_t_1 = ((__pyx_v_a_m == __pyx_v_b_m) != 0);
16245     if (__pyx_t_1) {
16246       __pyx_r = 0;
16247       goto __pyx_L0;
16248     }
16249 
16250     /* "yt/utilities/lib/geometry_utils.pxd":60
16251  *     if x == y:
16252  *         if a_m == b_m: return 0
16253  *         z = msdb(a_m,b_m)             # <<<<<<<<<<<<<<
16254  *         #if 1: return z
16255  *         x = x - z
16256  */
16257     __pyx_v_z = __pyx_f_2yt_9utilities_3lib_14geometry_utils_msdb(__pyx_v_a_m, __pyx_v_b_m);
16258 
16259     /* "yt/utilities/lib/geometry_utils.pxd":62
16260  *         z = msdb(a_m,b_m)
16261  *         #if 1: return z
16262  *         x = x - z             # <<<<<<<<<<<<<<
16263  *         return x-1 # required so that xor_msb(0.0,1.0)!=xor_msb(1.0,1.0)
16264  *     # Otherwise return largest exponent
16265  */
16266     __pyx_v_x = (__pyx_v_x - __pyx_v_z);
16267 
16268     /* "yt/utilities/lib/geometry_utils.pxd":63
16269  *         #if 1: return z
16270  *         x = x - z
16271  *         return x-1 # required so that xor_msb(0.0,1.0)!=xor_msb(1.0,1.0)             # <<<<<<<<<<<<<<
16272  *     # Otherwise return largest exponent
16273  *     if y < x:
16274  */
16275     __pyx_r = (__pyx_v_x - 1);
16276     goto __pyx_L0;
16277 
16278     /* "yt/utilities/lib/geometry_utils.pxd":58
16279  *     y = <np.int64_t> ((b_e+1)*DBL_MANT_DIG)
16280  *     # Compare mantissa if exponents equal
16281  *     if x == y:             # <<<<<<<<<<<<<<
16282  *         if a_m == b_m: return 0
16283  *         z = msdb(a_m,b_m)
16284  */
16285   }
16286 
16287   /* "yt/utilities/lib/geometry_utils.pxd":65
16288  *         return x-1 # required so that xor_msb(0.0,1.0)!=xor_msb(1.0,1.0)
16289  *     # Otherwise return largest exponent
16290  *     if y < x:             # <<<<<<<<<<<<<<
16291  *         return x
16292  *     else:
16293  */
16294   __pyx_t_1 = ((__pyx_v_y < __pyx_v_x) != 0);
16295   if (__pyx_t_1) {
16296 
16297     /* "yt/utilities/lib/geometry_utils.pxd":66
16298  *     # Otherwise return largest exponent
16299  *     if y < x:
16300  *         return x             # <<<<<<<<<<<<<<
16301  *     else:
16302  *         return y
16303  */
16304     __pyx_r = __pyx_v_x;
16305     goto __pyx_L0;
16306 
16307     /* "yt/utilities/lib/geometry_utils.pxd":65
16308  *         return x-1 # required so that xor_msb(0.0,1.0)!=xor_msb(1.0,1.0)
16309  *     # Otherwise return largest exponent
16310  *     if y < x:             # <<<<<<<<<<<<<<
16311  *         return x
16312  *     else:
16313  */
16314   }
16315 
16316   /* "yt/utilities/lib/geometry_utils.pxd":68
16317  *         return x
16318  *     else:
16319  *         return y             # <<<<<<<<<<<<<<
16320  *
16321  * @cython.cdivision(True)
16322  */
16323   /*else*/ {
16324     __pyx_r = __pyx_v_y;
16325     goto __pyx_L0;
16326   }
16327 
16328   /* "yt/utilities/lib/geometry_utils.pxd":47
16329  * @cython.boundscheck(False)
16330  * @cython.wraparound(False)
16331  * cdef inline np.int64_t xor_msb(np.float64_t a, np.float64_t b):             # <<<<<<<<<<<<<<
16332  *     """Get the exponent of the highest differing bit between a and b"""
16333  *     # Get mantissa and exponents for each number
16334  */
16335 
16336   /* function exit code */
16337   __pyx_L0:;
16338   __Pyx_RefNannyFinishContext();
16339   return __pyx_r;
16340 }
16341 
16342 /* "yt/utilities/lib/geometry_utils.pxd":73
16343  * @cython.boundscheck(False)
16344  * @cython.wraparound(False)
16345  * cdef inline int compare_floats_morton(np.float64_t p[3], np.float64_t q[3]):             # <<<<<<<<<<<<<<
16346  *     cdef int j, out, dim
16347  *     cdef np.int64_t x, y
16348  */
16349 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_compare_floats_morton(__pyx_t_5numpy_float64_t * __pyx_v_p,__pyx_t_5numpy_float64_t * __pyx_v_q)16350 static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_14geometry_utils_compare_floats_morton(__pyx_t_5numpy_float64_t *__pyx_v_p, __pyx_t_5numpy_float64_t *__pyx_v_q) {
16351   int __pyx_v_j;
16352   int __pyx_v_out;
16353   int __pyx_v_dim;
16354   __pyx_t_5numpy_int64_t __pyx_v_x;
16355   __pyx_t_5numpy_int64_t __pyx_v_y;
16356   int __pyx_r;
16357   __Pyx_RefNannyDeclarations
16358   int __pyx_t_1;
16359   int __pyx_t_2;
16360   __Pyx_RefNannySetupContext("compare_floats_morton", 0);
16361 
16362   /* "yt/utilities/lib/geometry_utils.pxd":76
16363  *     cdef int j, out, dim
16364  *     cdef np.int64_t x, y
16365  *     x = -9999999999             # <<<<<<<<<<<<<<
16366  *     y = 0
16367  *     dim = 0
16368  */
16369   __pyx_v_x = -9999999999LL;
16370 
16371   /* "yt/utilities/lib/geometry_utils.pxd":77
16372  *     cdef np.int64_t x, y
16373  *     x = -9999999999
16374  *     y = 0             # <<<<<<<<<<<<<<
16375  *     dim = 0
16376  *     for j in range(3):#[::-1]:
16377  */
16378   __pyx_v_y = 0;
16379 
16380   /* "yt/utilities/lib/geometry_utils.pxd":78
16381  *     x = -9999999999
16382  *     y = 0
16383  *     dim = 0             # <<<<<<<<<<<<<<
16384  *     for j in range(3):#[::-1]:
16385  *         y = xor_msb(p[j],q[j])
16386  */
16387   __pyx_v_dim = 0;
16388 
16389   /* "yt/utilities/lib/geometry_utils.pxd":79
16390  *     y = 0
16391  *     dim = 0
16392  *     for j in range(3):#[::-1]:             # <<<<<<<<<<<<<<
16393  *         y = xor_msb(p[j],q[j])
16394  *         if x < y:
16395  */
16396   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
16397     __pyx_v_j = __pyx_t_1;
16398 
16399     /* "yt/utilities/lib/geometry_utils.pxd":80
16400  *     dim = 0
16401  *     for j in range(3):#[::-1]:
16402  *         y = xor_msb(p[j],q[j])             # <<<<<<<<<<<<<<
16403  *         if x < y:
16404  *            x = y
16405  */
16406     __pyx_v_y = __pyx_f_2yt_9utilities_3lib_14geometry_utils_xor_msb((__pyx_v_p[__pyx_v_j]), (__pyx_v_q[__pyx_v_j]));
16407 
16408     /* "yt/utilities/lib/geometry_utils.pxd":81
16409  *     for j in range(3):#[::-1]:
16410  *         y = xor_msb(p[j],q[j])
16411  *         if x < y:             # <<<<<<<<<<<<<<
16412  *            x = y
16413  *            dim = j
16414  */
16415     __pyx_t_2 = ((__pyx_v_x < __pyx_v_y) != 0);
16416     if (__pyx_t_2) {
16417 
16418       /* "yt/utilities/lib/geometry_utils.pxd":82
16419  *         y = xor_msb(p[j],q[j])
16420  *         if x < y:
16421  *            x = y             # <<<<<<<<<<<<<<
16422  *            dim = j
16423  *     if p[dim] < q[dim]:
16424  */
16425       __pyx_v_x = __pyx_v_y;
16426 
16427       /* "yt/utilities/lib/geometry_utils.pxd":83
16428  *         if x < y:
16429  *            x = y
16430  *            dim = j             # <<<<<<<<<<<<<<
16431  *     if p[dim] < q[dim]:
16432  *         out = 1
16433  */
16434       __pyx_v_dim = __pyx_v_j;
16435 
16436       /* "yt/utilities/lib/geometry_utils.pxd":81
16437  *     for j in range(3):#[::-1]:
16438  *         y = xor_msb(p[j],q[j])
16439  *         if x < y:             # <<<<<<<<<<<<<<
16440  *            x = y
16441  *            dim = j
16442  */
16443     }
16444   }
16445 
16446   /* "yt/utilities/lib/geometry_utils.pxd":84
16447  *            x = y
16448  *            dim = j
16449  *     if p[dim] < q[dim]:             # <<<<<<<<<<<<<<
16450  *         out = 1
16451  *     else:
16452  */
16453   __pyx_t_2 = (((__pyx_v_p[__pyx_v_dim]) < (__pyx_v_q[__pyx_v_dim])) != 0);
16454   if (__pyx_t_2) {
16455 
16456     /* "yt/utilities/lib/geometry_utils.pxd":85
16457  *            dim = j
16458  *     if p[dim] < q[dim]:
16459  *         out = 1             # <<<<<<<<<<<<<<
16460  *     else:
16461  *         out = 0
16462  */
16463     __pyx_v_out = 1;
16464 
16465     /* "yt/utilities/lib/geometry_utils.pxd":84
16466  *            x = y
16467  *            dim = j
16468  *     if p[dim] < q[dim]:             # <<<<<<<<<<<<<<
16469  *         out = 1
16470  *     else:
16471  */
16472     goto __pyx_L6;
16473   }
16474 
16475   /* "yt/utilities/lib/geometry_utils.pxd":87
16476  *         out = 1
16477  *     else:
16478  *         out = 0             # <<<<<<<<<<<<<<
16479  *     return out
16480  *
16481  */
16482   /*else*/ {
16483     __pyx_v_out = 0;
16484   }
16485   __pyx_L6:;
16486 
16487   /* "yt/utilities/lib/geometry_utils.pxd":88
16488  *     else:
16489  *         out = 0
16490  *     return out             # <<<<<<<<<<<<<<
16491  *
16492  * @cython.cdivision(True)
16493  */
16494   __pyx_r = __pyx_v_out;
16495   goto __pyx_L0;
16496 
16497   /* "yt/utilities/lib/geometry_utils.pxd":73
16498  * @cython.boundscheck(False)
16499  * @cython.wraparound(False)
16500  * cdef inline int compare_floats_morton(np.float64_t p[3], np.float64_t q[3]):             # <<<<<<<<<<<<<<
16501  *     cdef int j, out, dim
16502  *     cdef np.int64_t x, y
16503  */
16504 
16505   /* function exit code */
16506   __pyx_L0:;
16507   __Pyx_RefNannyFinishContext();
16508   return __pyx_r;
16509 }
16510 
16511 /* "yt/utilities/lib/geometry_utils.pxd":93
16512  * @cython.boundscheck(False)
16513  * @cython.wraparound(False)
16514  * cdef inline np.float64_t euclidean_distance(np.float64_t[:] p, np.float64_t[:] q):             # <<<<<<<<<<<<<<
16515  *     cdef int j
16516  *     cdef np.float64_t d
16517  */
16518 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_euclidean_distance(__Pyx_memviewslice __pyx_v_p,__Pyx_memviewslice __pyx_v_q)16519 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_euclidean_distance(__Pyx_memviewslice __pyx_v_p, __Pyx_memviewslice __pyx_v_q) {
16520   int __pyx_v_j;
16521   __pyx_t_5numpy_float64_t __pyx_v_d;
16522   __pyx_t_5numpy_float64_t __pyx_r;
16523   __Pyx_RefNannyDeclarations
16524   int __pyx_t_1;
16525   Py_ssize_t __pyx_t_2;
16526   int __pyx_t_3;
16527   Py_ssize_t __pyx_t_4;
16528   __Pyx_RefNannySetupContext("euclidean_distance", 0);
16529 
16530   /* "yt/utilities/lib/geometry_utils.pxd":96
16531  *     cdef int j
16532  *     cdef np.float64_t d
16533  *     d = 0.0             # <<<<<<<<<<<<<<
16534  *     for j in range(3):
16535  *         d+=(p[j]-q[j])**2
16536  */
16537   __pyx_v_d = 0.0;
16538 
16539   /* "yt/utilities/lib/geometry_utils.pxd":97
16540  *     cdef np.float64_t d
16541  *     d = 0.0
16542  *     for j in range(3):             # <<<<<<<<<<<<<<
16543  *         d+=(p[j]-q[j])**2
16544  *     return sqrt(d)
16545  */
16546   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
16547     __pyx_v_j = __pyx_t_1;
16548 
16549     /* "yt/utilities/lib/geometry_utils.pxd":98
16550  *     d = 0.0
16551  *     for j in range(3):
16552  *         d+=(p[j]-q[j])**2             # <<<<<<<<<<<<<<
16553  *     return sqrt(d)
16554  *
16555  */
16556     __pyx_t_2 = __pyx_v_j;
16557     __pyx_t_3 = -1;
16558     if (__pyx_t_2 < 0) {
16559       __pyx_t_2 += __pyx_v_p.shape[0];
16560       if (unlikely(__pyx_t_2 < 0)) __pyx_t_3 = 0;
16561     } else if (unlikely(__pyx_t_2 >= __pyx_v_p.shape[0])) __pyx_t_3 = 0;
16562     if (unlikely(__pyx_t_3 != -1)) {
16563       __Pyx_RaiseBufferIndexError(__pyx_t_3);
16564       __PYX_ERR(4, 98, __pyx_L1_error)
16565     }
16566     __pyx_t_4 = __pyx_v_j;
16567     __pyx_t_3 = -1;
16568     if (__pyx_t_4 < 0) {
16569       __pyx_t_4 += __pyx_v_q.shape[0];
16570       if (unlikely(__pyx_t_4 < 0)) __pyx_t_3 = 0;
16571     } else if (unlikely(__pyx_t_4 >= __pyx_v_q.shape[0])) __pyx_t_3 = 0;
16572     if (unlikely(__pyx_t_3 != -1)) {
16573       __Pyx_RaiseBufferIndexError(__pyx_t_3);
16574       __PYX_ERR(4, 98, __pyx_L1_error)
16575     }
16576     __pyx_v_d = (__pyx_v_d + pow(((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_p.data + __pyx_t_2 * __pyx_v_p.strides[0]) ))) - (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_q.data + __pyx_t_4 * __pyx_v_q.strides[0]) )))), 2.0));
16577   }
16578 
16579   /* "yt/utilities/lib/geometry_utils.pxd":99
16580  *     for j in range(3):
16581  *         d+=(p[j]-q[j])**2
16582  *     return sqrt(d)             # <<<<<<<<<<<<<<
16583  *
16584  * # Todo: allow radius reported independently in each dimension for rectangular domain
16585  */
16586   __pyx_r = sqrt(__pyx_v_d);
16587   goto __pyx_L0;
16588 
16589   /* "yt/utilities/lib/geometry_utils.pxd":93
16590  * @cython.boundscheck(False)
16591  * @cython.wraparound(False)
16592  * cdef inline np.float64_t euclidean_distance(np.float64_t[:] p, np.float64_t[:] q):             # <<<<<<<<<<<<<<
16593  *     cdef int j
16594  *     cdef np.float64_t d
16595  */
16596 
16597   /* function exit code */
16598   __pyx_L1_error:;
16599   __Pyx_WriteUnraisable("yt.utilities.lib.geometry_utils.euclidean_distance", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
16600   __pyx_r = 0;
16601   __pyx_L0:;
16602   __Pyx_RefNannyFinishContext();
16603   return __pyx_r;
16604 }
16605 
16606 /* "yt/utilities/lib/geometry_utils.pxd":105
16607  * @cython.boundscheck(False)
16608  * @cython.wraparound(False)
16609  * cdef inline np.float64_t smallest_quadtree_box(np.float64_t p[3], np.float64_t q[3], np.int32_t order,             # <<<<<<<<<<<<<<
16610  *                                                np.float64_t DLE[3], np.float64_t DRE[3],
16611  *                                                np.float64_t *cx, np.float64_t *cy, np.float64_t *cz):
16612  */
16613 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_smallest_quadtree_box(__pyx_t_5numpy_float64_t * __pyx_v_p,__pyx_t_5numpy_float64_t * __pyx_v_q,__pyx_t_5numpy_int32_t __pyx_v_order,__pyx_t_5numpy_float64_t * __pyx_v_DLE,__pyx_t_5numpy_float64_t * __pyx_v_DRE,__pyx_t_5numpy_float64_t * __pyx_v_cx,__pyx_t_5numpy_float64_t * __pyx_v_cy,__pyx_t_5numpy_float64_t * __pyx_v_cz)16614 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_smallest_quadtree_box(__pyx_t_5numpy_float64_t *__pyx_v_p, __pyx_t_5numpy_float64_t *__pyx_v_q, __pyx_t_5numpy_int32_t __pyx_v_order, __pyx_t_5numpy_float64_t *__pyx_v_DLE, __pyx_t_5numpy_float64_t *__pyx_v_DRE, __pyx_t_5numpy_float64_t *__pyx_v_cx, __pyx_t_5numpy_float64_t *__pyx_v_cy, __pyx_t_5numpy_float64_t *__pyx_v_cz) {
16615   int __pyx_v_j;
16616   __pyx_t_5numpy_float64_t __pyx_v_c[3];
16617   __pyx_t_5numpy_uint64_t __pyx_v_pidx[3];
16618   __pyx_t_5numpy_uint64_t __pyx_v_pidx_next[3];
16619   __pyx_t_5numpy_uint64_t __pyx_v_qidx_next[3];
16620   __pyx_t_5numpy_float64_t __pyx_v_dds[3];
16621   __pyx_t_5numpy_float64_t __pyx_v_rad;
16622   int __pyx_v_lvl;
16623   int __pyx_v_done;
16624   __pyx_t_5numpy_float64_t __pyx_r;
16625   __Pyx_RefNannyDeclarations
16626   int __pyx_t_1;
16627   int __pyx_t_2;
16628   __Pyx_RefNannySetupContext("smallest_quadtree_box", 0);
16629 
16630   /* "yt/utilities/lib/geometry_utils.pxd":112
16631  *     cdef np.uint64_t pidx[3]
16632  *     # cdef np.uint64_t qidx[3]
16633  *     for j in range(3):             # <<<<<<<<<<<<<<
16634  *         pidx[j] = 0
16635  *         # qidx[j] = 0
16636  */
16637   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
16638     __pyx_v_j = __pyx_t_1;
16639 
16640     /* "yt/utilities/lib/geometry_utils.pxd":113
16641  *     # cdef np.uint64_t qidx[3]
16642  *     for j in range(3):
16643  *         pidx[j] = 0             # <<<<<<<<<<<<<<
16644  *         # qidx[j] = 0
16645  *     cdef np.uint64_t pidx_next[3]
16646  */
16647     (__pyx_v_pidx[__pyx_v_j]) = 0;
16648   }
16649 
16650   /* "yt/utilities/lib/geometry_utils.pxd":119
16651  *     cdef np.float64_t dds[3]
16652  *     cdef np.float64_t rad
16653  *     cdef int lvl = 0             # <<<<<<<<<<<<<<
16654  *     cdef int done = 0
16655  *     while not done:
16656  */
16657   __pyx_v_lvl = 0;
16658 
16659   /* "yt/utilities/lib/geometry_utils.pxd":120
16660  *     cdef np.float64_t rad
16661  *     cdef int lvl = 0
16662  *     cdef int done = 0             # <<<<<<<<<<<<<<
16663  *     while not done:
16664  *         if (lvl+1 >= order):
16665  */
16666   __pyx_v_done = 0;
16667 
16668   /* "yt/utilities/lib/geometry_utils.pxd":121
16669  *     cdef int lvl = 0
16670  *     cdef int done = 0
16671  *     while not done:             # <<<<<<<<<<<<<<
16672  *         if (lvl+1 >= order):
16673  *             done = 1
16674  */
16675   while (1) {
16676     __pyx_t_2 = ((!(__pyx_v_done != 0)) != 0);
16677     if (!__pyx_t_2) break;
16678 
16679     /* "yt/utilities/lib/geometry_utils.pxd":122
16680  *     cdef int done = 0
16681  *     while not done:
16682  *         if (lvl+1 >= order):             # <<<<<<<<<<<<<<
16683  *             done = 1
16684  *         for j in range(3):
16685  */
16686     __pyx_t_2 = (((__pyx_v_lvl + 1) >= __pyx_v_order) != 0);
16687     if (__pyx_t_2) {
16688 
16689       /* "yt/utilities/lib/geometry_utils.pxd":123
16690  *     while not done:
16691  *         if (lvl+1 >= order):
16692  *             done = 1             # <<<<<<<<<<<<<<
16693  *         for j in range(3):
16694  *             dds[j] = (DRE[j] - DLE[j])/(1 << (<int> lvl+1))
16695  */
16696       __pyx_v_done = 1;
16697 
16698       /* "yt/utilities/lib/geometry_utils.pxd":122
16699  *     cdef int done = 0
16700  *     while not done:
16701  *         if (lvl+1 >= order):             # <<<<<<<<<<<<<<
16702  *             done = 1
16703  *         for j in range(3):
16704  */
16705     }
16706 
16707     /* "yt/utilities/lib/geometry_utils.pxd":124
16708  *         if (lvl+1 >= order):
16709  *             done = 1
16710  *         for j in range(3):             # <<<<<<<<<<<<<<
16711  *             dds[j] = (DRE[j] - DLE[j])/(1 << (<int> lvl+1))
16712  *             pidx_next[j] = <np.uint64_t>((p[j] - DLE[j])/dds[j])
16713  */
16714     for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
16715       __pyx_v_j = __pyx_t_1;
16716 
16717       /* "yt/utilities/lib/geometry_utils.pxd":125
16718  *             done = 1
16719  *         for j in range(3):
16720  *             dds[j] = (DRE[j] - DLE[j])/(1 << (<int> lvl+1))             # <<<<<<<<<<<<<<
16721  *             pidx_next[j] = <np.uint64_t>((p[j] - DLE[j])/dds[j])
16722  *             qidx_next[j] = <np.uint64_t>((q[j] - DLE[j])/dds[j])
16723  */
16724       (__pyx_v_dds[__pyx_v_j]) = (((__pyx_v_DRE[__pyx_v_j]) - (__pyx_v_DLE[__pyx_v_j])) / (1 << (((int)__pyx_v_lvl) + 1)));
16725 
16726       /* "yt/utilities/lib/geometry_utils.pxd":126
16727  *         for j in range(3):
16728  *             dds[j] = (DRE[j] - DLE[j])/(1 << (<int> lvl+1))
16729  *             pidx_next[j] = <np.uint64_t>((p[j] - DLE[j])/dds[j])             # <<<<<<<<<<<<<<
16730  *             qidx_next[j] = <np.uint64_t>((q[j] - DLE[j])/dds[j])
16731  *         for j in range(3):
16732  */
16733       (__pyx_v_pidx_next[__pyx_v_j]) = ((__pyx_t_5numpy_uint64_t)(((__pyx_v_p[__pyx_v_j]) - (__pyx_v_DLE[__pyx_v_j])) / (__pyx_v_dds[__pyx_v_j])));
16734 
16735       /* "yt/utilities/lib/geometry_utils.pxd":127
16736  *             dds[j] = (DRE[j] - DLE[j])/(1 << (<int> lvl+1))
16737  *             pidx_next[j] = <np.uint64_t>((p[j] - DLE[j])/dds[j])
16738  *             qidx_next[j] = <np.uint64_t>((q[j] - DLE[j])/dds[j])             # <<<<<<<<<<<<<<
16739  *         for j in range(3):
16740  *             if pidx_next[j]!=qidx_next[j]:
16741  */
16742       (__pyx_v_qidx_next[__pyx_v_j]) = ((__pyx_t_5numpy_uint64_t)(((__pyx_v_q[__pyx_v_j]) - (__pyx_v_DLE[__pyx_v_j])) / (__pyx_v_dds[__pyx_v_j])));
16743     }
16744 
16745     /* "yt/utilities/lib/geometry_utils.pxd":128
16746  *             pidx_next[j] = <np.uint64_t>((p[j] - DLE[j])/dds[j])
16747  *             qidx_next[j] = <np.uint64_t>((q[j] - DLE[j])/dds[j])
16748  *         for j in range(3):             # <<<<<<<<<<<<<<
16749  *             if pidx_next[j]!=qidx_next[j]:
16750  *                 done = 1
16751  */
16752     for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
16753       __pyx_v_j = __pyx_t_1;
16754 
16755       /* "yt/utilities/lib/geometry_utils.pxd":129
16756  *             qidx_next[j] = <np.uint64_t>((q[j] - DLE[j])/dds[j])
16757  *         for j in range(3):
16758  *             if pidx_next[j]!=qidx_next[j]:             # <<<<<<<<<<<<<<
16759  *                 done = 1
16760  *                 break
16761  */
16762       __pyx_t_2 = (((__pyx_v_pidx_next[__pyx_v_j]) != (__pyx_v_qidx_next[__pyx_v_j])) != 0);
16763       if (__pyx_t_2) {
16764 
16765         /* "yt/utilities/lib/geometry_utils.pxd":130
16766  *         for j in range(3):
16767  *             if pidx_next[j]!=qidx_next[j]:
16768  *                 done = 1             # <<<<<<<<<<<<<<
16769  *                 break
16770  *         if not done:
16771  */
16772         __pyx_v_done = 1;
16773 
16774         /* "yt/utilities/lib/geometry_utils.pxd":131
16775  *             if pidx_next[j]!=qidx_next[j]:
16776  *                 done = 1
16777  *                 break             # <<<<<<<<<<<<<<
16778  *         if not done:
16779  *             for j in range(3):
16780  */
16781         goto __pyx_L11_break;
16782 
16783         /* "yt/utilities/lib/geometry_utils.pxd":129
16784  *             qidx_next[j] = <np.uint64_t>((q[j] - DLE[j])/dds[j])
16785  *         for j in range(3):
16786  *             if pidx_next[j]!=qidx_next[j]:             # <<<<<<<<<<<<<<
16787  *                 done = 1
16788  *                 break
16789  */
16790       }
16791     }
16792     __pyx_L11_break:;
16793 
16794     /* "yt/utilities/lib/geometry_utils.pxd":132
16795  *                 done = 1
16796  *                 break
16797  *         if not done:             # <<<<<<<<<<<<<<
16798  *             for j in range(3):
16799  *                 pidx[j] = pidx_next[j]
16800  */
16801     __pyx_t_2 = ((!(__pyx_v_done != 0)) != 0);
16802     if (__pyx_t_2) {
16803 
16804       /* "yt/utilities/lib/geometry_utils.pxd":133
16805  *                 break
16806  *         if not done:
16807  *             for j in range(3):             # <<<<<<<<<<<<<<
16808  *                 pidx[j] = pidx_next[j]
16809  *                 # qidx[j] = qidx_next[j]
16810  */
16811       for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
16812         __pyx_v_j = __pyx_t_1;
16813 
16814         /* "yt/utilities/lib/geometry_utils.pxd":134
16815  *         if not done:
16816  *             for j in range(3):
16817  *                 pidx[j] = pidx_next[j]             # <<<<<<<<<<<<<<
16818  *                 # qidx[j] = qidx_next[j]
16819  *             lvl+=1
16820  */
16821         (__pyx_v_pidx[__pyx_v_j]) = (__pyx_v_pidx_next[__pyx_v_j]);
16822       }
16823 
16824       /* "yt/utilities/lib/geometry_utils.pxd":136
16825  *                 pidx[j] = pidx_next[j]
16826  *                 # qidx[j] = qidx_next[j]
16827  *             lvl+=1             # <<<<<<<<<<<<<<
16828  *     rad = 0.0
16829  *     for j in range(3):
16830  */
16831       __pyx_v_lvl = (__pyx_v_lvl + 1);
16832 
16833       /* "yt/utilities/lib/geometry_utils.pxd":132
16834  *                 done = 1
16835  *                 break
16836  *         if not done:             # <<<<<<<<<<<<<<
16837  *             for j in range(3):
16838  *                 pidx[j] = pidx_next[j]
16839  */
16840     }
16841   }
16842 
16843   /* "yt/utilities/lib/geometry_utils.pxd":137
16844  *                 # qidx[j] = qidx_next[j]
16845  *             lvl+=1
16846  *     rad = 0.0             # <<<<<<<<<<<<<<
16847  *     for j in range(3):
16848  *         dds[j] = (DRE[j] - DLE[j])/(1 << lvl)
16849  */
16850   __pyx_v_rad = 0.0;
16851 
16852   /* "yt/utilities/lib/geometry_utils.pxd":138
16853  *             lvl+=1
16854  *     rad = 0.0
16855  *     for j in range(3):             # <<<<<<<<<<<<<<
16856  *         dds[j] = (DRE[j] - DLE[j])/(1 << lvl)
16857  *         c[j] = dds[j]*(<np.float64_t>pidx[j]+0.5)
16858  */
16859   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
16860     __pyx_v_j = __pyx_t_1;
16861 
16862     /* "yt/utilities/lib/geometry_utils.pxd":139
16863  *     rad = 0.0
16864  *     for j in range(3):
16865  *         dds[j] = (DRE[j] - DLE[j])/(1 << lvl)             # <<<<<<<<<<<<<<
16866  *         c[j] = dds[j]*(<np.float64_t>pidx[j]+0.5)
16867  *         rad+=((dds[j]/2.0)**2)
16868  */
16869     (__pyx_v_dds[__pyx_v_j]) = (((__pyx_v_DRE[__pyx_v_j]) - (__pyx_v_DLE[__pyx_v_j])) / (1 << __pyx_v_lvl));
16870 
16871     /* "yt/utilities/lib/geometry_utils.pxd":140
16872  *     for j in range(3):
16873  *         dds[j] = (DRE[j] - DLE[j])/(1 << lvl)
16874  *         c[j] = dds[j]*(<np.float64_t>pidx[j]+0.5)             # <<<<<<<<<<<<<<
16875  *         rad+=((dds[j]/2.0)**2)
16876  *     cx[0] = c[0]
16877  */
16878     (__pyx_v_c[__pyx_v_j]) = ((__pyx_v_dds[__pyx_v_j]) * (((__pyx_t_5numpy_float64_t)(__pyx_v_pidx[__pyx_v_j])) + 0.5));
16879 
16880     /* "yt/utilities/lib/geometry_utils.pxd":141
16881  *         dds[j] = (DRE[j] - DLE[j])/(1 << lvl)
16882  *         c[j] = dds[j]*(<np.float64_t>pidx[j]+0.5)
16883  *         rad+=((dds[j]/2.0)**2)             # <<<<<<<<<<<<<<
16884  *     cx[0] = c[0]
16885  *     cy[0] = c[1]
16886  */
16887     __pyx_v_rad = (__pyx_v_rad + pow(((__pyx_v_dds[__pyx_v_j]) / 2.0), 2.0));
16888   }
16889 
16890   /* "yt/utilities/lib/geometry_utils.pxd":142
16891  *         c[j] = dds[j]*(<np.float64_t>pidx[j]+0.5)
16892  *         rad+=((dds[j]/2.0)**2)
16893  *     cx[0] = c[0]             # <<<<<<<<<<<<<<
16894  *     cy[0] = c[1]
16895  *     cz[0] = c[2]
16896  */
16897   (__pyx_v_cx[0]) = (__pyx_v_c[0]);
16898 
16899   /* "yt/utilities/lib/geometry_utils.pxd":143
16900  *         rad+=((dds[j]/2.0)**2)
16901  *     cx[0] = c[0]
16902  *     cy[0] = c[1]             # <<<<<<<<<<<<<<
16903  *     cz[0] = c[2]
16904  *     return sqrt(rad)
16905  */
16906   (__pyx_v_cy[0]) = (__pyx_v_c[1]);
16907 
16908   /* "yt/utilities/lib/geometry_utils.pxd":144
16909  *     cx[0] = c[0]
16910  *     cy[0] = c[1]
16911  *     cz[0] = c[2]             # <<<<<<<<<<<<<<
16912  *     return sqrt(rad)
16913  *
16914  */
16915   (__pyx_v_cz[0]) = (__pyx_v_c[2]);
16916 
16917   /* "yt/utilities/lib/geometry_utils.pxd":145
16918  *     cy[0] = c[1]
16919  *     cz[0] = c[2]
16920  *     return sqrt(rad)             # <<<<<<<<<<<<<<
16921  *
16922  * #-----------------------------------------------------------------------------
16923  */
16924   __pyx_r = sqrt(__pyx_v_rad);
16925   goto __pyx_L0;
16926 
16927   /* "yt/utilities/lib/geometry_utils.pxd":105
16928  * @cython.boundscheck(False)
16929  * @cython.wraparound(False)
16930  * cdef inline np.float64_t smallest_quadtree_box(np.float64_t p[3], np.float64_t q[3], np.int32_t order,             # <<<<<<<<<<<<<<
16931  *                                                np.float64_t DLE[3], np.float64_t DRE[3],
16932  *                                                np.float64_t *cx, np.float64_t *cy, np.float64_t *cz):
16933  */
16934 
16935   /* function exit code */
16936   __pyx_L0:;
16937   __Pyx_RefNannyFinishContext();
16938   return __pyx_r;
16939 }
16940 
16941 /* "yt/utilities/lib/geometry_utils.pxd":152
16942  * @cython.boundscheck(False)
16943  * @cython.wraparound(False)
16944  * cdef inline np.uint64_t spread_64bits_by3(np.uint64_t x):             # <<<<<<<<<<<<<<
16945  *     x=(x&(<np.uint64_t>0x00000000001FFFFF))
16946  *     x=(x|(x<<20))*(<np.uint64_t>0x000001FFC00003FF)
16947  */
16948 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by3(__pyx_t_5numpy_uint64_t __pyx_v_x)16949 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by3(__pyx_t_5numpy_uint64_t __pyx_v_x) {
16950   __pyx_t_5numpy_uint64_t __pyx_r;
16951   __Pyx_RefNannyDeclarations
16952   __Pyx_RefNannySetupContext("spread_64bits_by3", 0);
16953 
16954   /* "yt/utilities/lib/geometry_utils.pxd":153
16955  * @cython.wraparound(False)
16956  * cdef inline np.uint64_t spread_64bits_by3(np.uint64_t x):
16957  *     x=(x&(<np.uint64_t>0x00000000001FFFFF))             # <<<<<<<<<<<<<<
16958  *     x=(x|(x<<20))*(<np.uint64_t>0x000001FFC00003FF)
16959  *
16960  */
16961   __pyx_v_x = (__pyx_v_x & ((__pyx_t_5numpy_uint64_t)0x00000000001FFFFF));
16962 
16963   /* "yt/utilities/lib/geometry_utils.pxd":154
16964  * cdef inline np.uint64_t spread_64bits_by3(np.uint64_t x):
16965  *     x=(x&(<np.uint64_t>0x00000000001FFFFF))
16966  *     x=(x|(x<<20))*(<np.uint64_t>0x000001FFC00003FF)             # <<<<<<<<<<<<<<
16967  *
16968  * #-----------------------------------------------------------------------------
16969  */
16970   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 20)) * ((__pyx_t_5numpy_uint64_t)0x000001FFC00003FF));
16971 
16972   /* "yt/utilities/lib/geometry_utils.pxd":152
16973  * @cython.boundscheck(False)
16974  * @cython.wraparound(False)
16975  * cdef inline np.uint64_t spread_64bits_by3(np.uint64_t x):             # <<<<<<<<<<<<<<
16976  *     x=(x&(<np.uint64_t>0x00000000001FFFFF))
16977  *     x=(x|(x<<20))*(<np.uint64_t>0x000001FFC00003FF)
16978  */
16979 
16980   /* function exit code */
16981   __pyx_r = 0;
16982   __Pyx_RefNannyFinishContext();
16983   return __pyx_r;
16984 }
16985 
16986 /* "yt/utilities/lib/geometry_utils.pxd":161
16987  * @cython.boundscheck(False)
16988  * @cython.wraparound(False)
16989  * cdef inline np.uint64_t spread_64bits_by2(np.uint64_t x):             # <<<<<<<<<<<<<<
16990  *     # This magic comes from http://stackoverflow.com/questions/1024754/how-to-compute-a-3d-morton-number-interleave-the-bits-of-3-ints
16991  *     # Only reversible up to 2097151
16992  */
16993 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by2(__pyx_t_5numpy_uint64_t __pyx_v_x)16994 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by2(__pyx_t_5numpy_uint64_t __pyx_v_x) {
16995   __pyx_t_5numpy_uint64_t __pyx_r;
16996   __Pyx_RefNannyDeclarations
16997   __Pyx_RefNannySetupContext("spread_64bits_by2", 0);
16998 
16999   /* "yt/utilities/lib/geometry_utils.pxd":166
17000  *     # Select highest 21 bits (Required to be reversible to 21st bit)
17001  *     # x = ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---k jihg fedc ba98 7654 3210
17002  *     x=(x&(<np.uint64_t>0x00000000001FFFFF))             # <<<<<<<<<<<<<<
17003  *     # x = ---- ---- ---- ---- ---- ---k jihg fedc ba-- ---- ---- ---- ---- --98 7654 3210
17004  *     x=(x|(x<<20))&(<np.uint64_t>0x000001FFC00003FF)
17005  */
17006   __pyx_v_x = (__pyx_v_x & ((__pyx_t_5numpy_uint64_t)0x00000000001FFFFF));
17007 
17008   /* "yt/utilities/lib/geometry_utils.pxd":168
17009  *     x=(x&(<np.uint64_t>0x00000000001FFFFF))
17010  *     # x = ---- ---- ---- ---- ---- ---k jihg fedc ba-- ---- ---- ---- ---- --98 7654 3210
17011  *     x=(x|(x<<20))&(<np.uint64_t>0x000001FFC00003FF)             # <<<<<<<<<<<<<<
17012  *     # x = ---- ---- ---- -kji hgf- ---- ---- -edc ba-- ---- ---- 9876 5--- ---- ---4 3210
17013  *     x=(x|(x<<10))&(<np.uint64_t>0x0007E007C00F801F)
17014  */
17015   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 20)) & ((__pyx_t_5numpy_uint64_t)0x000001FFC00003FF));
17016 
17017   /* "yt/utilities/lib/geometry_utils.pxd":170
17018  *     x=(x|(x<<20))&(<np.uint64_t>0x000001FFC00003FF)
17019  *     # x = ---- ---- ---- -kji hgf- ---- ---- -edc ba-- ---- ---- 9876 5--- ---- ---4 3210
17020  *     x=(x|(x<<10))&(<np.uint64_t>0x0007E007C00F801F)             # <<<<<<<<<<<<<<
17021  *     # x = ---- ---- -kji h--- -gf- ---- -edc ---- ba-- ---- 987- ---6 5--- ---4 32-- --10
17022  *     x=(x|(x<<4))&(<np.uint64_t>0x00786070C0E181C3)
17023  */
17024   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 10)) & ((__pyx_t_5numpy_uint64_t)0x0007E007C00F801F));
17025 
17026   /* "yt/utilities/lib/geometry_utils.pxd":172
17027  *     x=(x|(x<<10))&(<np.uint64_t>0x0007E007C00F801F)
17028  *     # x = ---- ---- -kji h--- -gf- ---- -edc ---- ba-- ---- 987- ---6 5--- ---4 32-- --10
17029  *     x=(x|(x<<4))&(<np.uint64_t>0x00786070C0E181C3)             # <<<<<<<<<<<<<<
17030  *     # x = ---- ---k ji-- h--g --f- ---e d--c --b- -a-- --98 --7- -6-- 5--- -43- -2-- 1--0
17031  *     x=(x|(x<<2))&(<np.uint64_t>0x0199219243248649)
17032  */
17033   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 4)) & ((__pyx_t_5numpy_uint64_t)0x00786070C0E181C3));
17034 
17035   /* "yt/utilities/lib/geometry_utils.pxd":174
17036  *     x=(x|(x<<4))&(<np.uint64_t>0x00786070C0E181C3)
17037  *     # x = ---- ---k ji-- h--g --f- ---e d--c --b- -a-- --98 --7- -6-- 5--- -43- -2-- 1--0
17038  *     x=(x|(x<<2))&(<np.uint64_t>0x0199219243248649)             # <<<<<<<<<<<<<<
17039  *     # x = ---- -kj- -i-- h--g --f- -e-- d--c --b- -a-- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
17040  *     x=(x|(x<<2))&(<np.uint64_t>0x0649249249249249)
17041  */
17042   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 2)) & ((__pyx_t_5numpy_uint64_t)0x0199219243248649));
17043 
17044   /* "yt/utilities/lib/geometry_utils.pxd":176
17045  *     x=(x|(x<<2))&(<np.uint64_t>0x0199219243248649)
17046  *     # x = ---- -kj- -i-- h--g --f- -e-- d--c --b- -a-- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
17047  *     x=(x|(x<<2))&(<np.uint64_t>0x0649249249249249)             # <<<<<<<<<<<<<<
17048  *     # x = ---k --j- -i-- h--g --f- -e-- d--c --b- -a-- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
17049  *     x=(x|(x<<2))&(<np.uint64_t>0x1249249249249249)
17050  */
17051   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 2)) & ((__pyx_t_5numpy_uint64_t)0x0649249249249249));
17052 
17053   /* "yt/utilities/lib/geometry_utils.pxd":178
17054  *     x=(x|(x<<2))&(<np.uint64_t>0x0649249249249249)
17055  *     # x = ---k --j- -i-- h--g --f- -e-- d--c --b- -a-- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
17056  *     x=(x|(x<<2))&(<np.uint64_t>0x1249249249249249)             # <<<<<<<<<<<<<<
17057  *     return x
17058  *
17059  */
17060   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 2)) & ((__pyx_t_5numpy_uint64_t)0x1249249249249249));
17061 
17062   /* "yt/utilities/lib/geometry_utils.pxd":179
17063  *     # x = ---k --j- -i-- h--g --f- -e-- d--c --b- -a-- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
17064  *     x=(x|(x<<2))&(<np.uint64_t>0x1249249249249249)
17065  *     return x             # <<<<<<<<<<<<<<
17066  *
17067  * @cython.cdivision(True)
17068  */
17069   __pyx_r = __pyx_v_x;
17070   goto __pyx_L0;
17071 
17072   /* "yt/utilities/lib/geometry_utils.pxd":161
17073  * @cython.boundscheck(False)
17074  * @cython.wraparound(False)
17075  * cdef inline np.uint64_t spread_64bits_by2(np.uint64_t x):             # <<<<<<<<<<<<<<
17076  *     # This magic comes from http://stackoverflow.com/questions/1024754/how-to-compute-a-3d-morton-number-interleave-the-bits-of-3-ints
17077  *     # Only reversible up to 2097151
17078  */
17079 
17080   /* function exit code */
17081   __pyx_L0:;
17082   __Pyx_RefNannyFinishContext();
17083   return __pyx_r;
17084 }
17085 
17086 /* "yt/utilities/lib/geometry_utils.pxd":184
17087  * @cython.boundscheck(False)
17088  * @cython.wraparound(False)
17089  * cdef inline np.uint64_t compact_64bits_by2(np.uint64_t x):             # <<<<<<<<<<<<<<
17090  *     # Reversed magic
17091  *     x=x&(<np.uint64_t>0x1249249249249249)
17092  */
17093 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_64bits_by2(__pyx_t_5numpy_uint64_t __pyx_v_x)17094 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_64bits_by2(__pyx_t_5numpy_uint64_t __pyx_v_x) {
17095   __pyx_t_5numpy_uint64_t __pyx_r;
17096   __Pyx_RefNannyDeclarations
17097   __Pyx_RefNannySetupContext("compact_64bits_by2", 0);
17098 
17099   /* "yt/utilities/lib/geometry_utils.pxd":186
17100  * cdef inline np.uint64_t compact_64bits_by2(np.uint64_t x):
17101  *     # Reversed magic
17102  *     x=x&(<np.uint64_t>0x1249249249249249)             # <<<<<<<<<<<<<<
17103  *     x=(x|(x>>2))&(<np.uint64_t>0x0649249249249249)
17104  *     x=(x|(x>>2))&(<np.uint64_t>0x0199219243248649)
17105  */
17106   __pyx_v_x = (__pyx_v_x & ((__pyx_t_5numpy_uint64_t)0x1249249249249249));
17107 
17108   /* "yt/utilities/lib/geometry_utils.pxd":187
17109  *     # Reversed magic
17110  *     x=x&(<np.uint64_t>0x1249249249249249)
17111  *     x=(x|(x>>2))&(<np.uint64_t>0x0649249249249249)             # <<<<<<<<<<<<<<
17112  *     x=(x|(x>>2))&(<np.uint64_t>0x0199219243248649)
17113  *     x=(x|(x>>2))&(<np.uint64_t>0x00786070C0E181C3)
17114  */
17115   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 2)) & ((__pyx_t_5numpy_uint64_t)0x0649249249249249));
17116 
17117   /* "yt/utilities/lib/geometry_utils.pxd":188
17118  *     x=x&(<np.uint64_t>0x1249249249249249)
17119  *     x=(x|(x>>2))&(<np.uint64_t>0x0649249249249249)
17120  *     x=(x|(x>>2))&(<np.uint64_t>0x0199219243248649)             # <<<<<<<<<<<<<<
17121  *     x=(x|(x>>2))&(<np.uint64_t>0x00786070C0E181C3)
17122  *     x=(x|(x>>4))&(<np.uint64_t>0x0007E007C00F801F)
17123  */
17124   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 2)) & ((__pyx_t_5numpy_uint64_t)0x0199219243248649));
17125 
17126   /* "yt/utilities/lib/geometry_utils.pxd":189
17127  *     x=(x|(x>>2))&(<np.uint64_t>0x0649249249249249)
17128  *     x=(x|(x>>2))&(<np.uint64_t>0x0199219243248649)
17129  *     x=(x|(x>>2))&(<np.uint64_t>0x00786070C0E181C3)             # <<<<<<<<<<<<<<
17130  *     x=(x|(x>>4))&(<np.uint64_t>0x0007E007C00F801F)
17131  *     x=(x|(x>>10))&(<np.uint64_t>0x000001FFC00003FF)
17132  */
17133   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 2)) & ((__pyx_t_5numpy_uint64_t)0x00786070C0E181C3));
17134 
17135   /* "yt/utilities/lib/geometry_utils.pxd":190
17136  *     x=(x|(x>>2))&(<np.uint64_t>0x0199219243248649)
17137  *     x=(x|(x>>2))&(<np.uint64_t>0x00786070C0E181C3)
17138  *     x=(x|(x>>4))&(<np.uint64_t>0x0007E007C00F801F)             # <<<<<<<<<<<<<<
17139  *     x=(x|(x>>10))&(<np.uint64_t>0x000001FFC00003FF)
17140  *     x=(x|(x>>20))&(<np.uint64_t>0x00000000001FFFFF)
17141  */
17142   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 4)) & ((__pyx_t_5numpy_uint64_t)0x0007E007C00F801F));
17143 
17144   /* "yt/utilities/lib/geometry_utils.pxd":191
17145  *     x=(x|(x>>2))&(<np.uint64_t>0x00786070C0E181C3)
17146  *     x=(x|(x>>4))&(<np.uint64_t>0x0007E007C00F801F)
17147  *     x=(x|(x>>10))&(<np.uint64_t>0x000001FFC00003FF)             # <<<<<<<<<<<<<<
17148  *     x=(x|(x>>20))&(<np.uint64_t>0x00000000001FFFFF)
17149  *     return x
17150  */
17151   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 10)) & ((__pyx_t_5numpy_uint64_t)0x000001FFC00003FF));
17152 
17153   /* "yt/utilities/lib/geometry_utils.pxd":192
17154  *     x=(x|(x>>4))&(<np.uint64_t>0x0007E007C00F801F)
17155  *     x=(x|(x>>10))&(<np.uint64_t>0x000001FFC00003FF)
17156  *     x=(x|(x>>20))&(<np.uint64_t>0x00000000001FFFFF)             # <<<<<<<<<<<<<<
17157  *     return x
17158  *
17159  */
17160   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 20)) & ((__pyx_t_5numpy_uint64_t)0x00000000001FFFFF));
17161 
17162   /* "yt/utilities/lib/geometry_utils.pxd":193
17163  *     x=(x|(x>>10))&(<np.uint64_t>0x000001FFC00003FF)
17164  *     x=(x|(x>>20))&(<np.uint64_t>0x00000000001FFFFF)
17165  *     return x             # <<<<<<<<<<<<<<
17166  *
17167  * #-----------------------------------------------------------------------------
17168  */
17169   __pyx_r = __pyx_v_x;
17170   goto __pyx_L0;
17171 
17172   /* "yt/utilities/lib/geometry_utils.pxd":184
17173  * @cython.boundscheck(False)
17174  * @cython.wraparound(False)
17175  * cdef inline np.uint64_t compact_64bits_by2(np.uint64_t x):             # <<<<<<<<<<<<<<
17176  *     # Reversed magic
17177  *     x=x&(<np.uint64_t>0x1249249249249249)
17178  */
17179 
17180   /* function exit code */
17181   __pyx_L0:;
17182   __Pyx_RefNannyFinishContext();
17183   return __pyx_r;
17184 }
17185 
17186 /* "yt/utilities/lib/geometry_utils.pxd":200
17187  * @cython.boundscheck(False)
17188  * @cython.wraparound(False)
17189  * cdef inline np.uint32_t spread_32bits_by2(np.uint32_t x):             # <<<<<<<<<<<<<<
17190  *     # Only reversible up to 1023
17191  *     # Select highest 10 bits (Required to be reversible to 10st bit)
17192  */
17193 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_32bits_by2(__pyx_t_5numpy_uint32_t __pyx_v_x)17194 static CYTHON_INLINE __pyx_t_5numpy_uint32_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_32bits_by2(__pyx_t_5numpy_uint32_t __pyx_v_x) {
17195   __pyx_t_5numpy_uint32_t __pyx_r;
17196   __Pyx_RefNannyDeclarations
17197   __Pyx_RefNannySetupContext("spread_32bits_by2", 0);
17198 
17199   /* "yt/utilities/lib/geometry_utils.pxd":204
17200  *     # Select highest 10 bits (Required to be reversible to 10st bit)
17201  *     # x = ---- ---- ---- ---- ---- --98 7654 3210
17202  *     x=(x&(<np.uint32_t>0x000003FF))             # <<<<<<<<<<<<<<
17203  *     # x = ---- --98 ---- ---- ---- ---- 7654 3210
17204  *     x=(x|(x<<16))&(<np.uint32_t>0xFF0000FF)
17205  */
17206   __pyx_v_x = (__pyx_v_x & ((__pyx_t_5numpy_uint32_t)0x000003FF));
17207 
17208   /* "yt/utilities/lib/geometry_utils.pxd":206
17209  *     x=(x&(<np.uint32_t>0x000003FF))
17210  *     # x = ---- --98 ---- ---- ---- ---- 7654 3210
17211  *     x=(x|(x<<16))&(<np.uint32_t>0xFF0000FF)             # <<<<<<<<<<<<<<
17212  *     # x = ---- --98 ---- ---- 7654 ---- ---- 3210
17213  *     x=(x|(x<<8))&(<np.uint32_t>0x0300F00F)
17214  */
17215   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 16)) & ((__pyx_t_5numpy_uint32_t)0xFF0000FF));
17216 
17217   /* "yt/utilities/lib/geometry_utils.pxd":208
17218  *     x=(x|(x<<16))&(<np.uint32_t>0xFF0000FF)
17219  *     # x = ---- --98 ---- ---- 7654 ---- ---- 3210
17220  *     x=(x|(x<<8))&(<np.uint32_t>0x0300F00F)             # <<<<<<<<<<<<<<
17221  *     # x = ---- --98 ---- 76-- --54 ---- 32-- --10
17222  *     x=(x|(x<<4))&(<np.uint32_t>0x030C30C3)
17223  */
17224   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 8)) & ((__pyx_t_5numpy_uint32_t)0x0300F00F));
17225 
17226   /* "yt/utilities/lib/geometry_utils.pxd":210
17227  *     x=(x|(x<<8))&(<np.uint32_t>0x0300F00F)
17228  *     # x = ---- --98 ---- 76-- --54 ---- 32-- --10
17229  *     x=(x|(x<<4))&(<np.uint32_t>0x030C30C3)             # <<<<<<<<<<<<<<
17230  *     # x = ---- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
17231  *     x=(x|(x<<2))&(<np.uint32_t>0x09249249)
17232  */
17233   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 4)) & ((__pyx_t_5numpy_uint32_t)0x030C30C3));
17234 
17235   /* "yt/utilities/lib/geometry_utils.pxd":212
17236  *     x=(x|(x<<4))&(<np.uint32_t>0x030C30C3)
17237  *     # x = ---- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
17238  *     x=(x|(x<<2))&(<np.uint32_t>0x09249249)             # <<<<<<<<<<<<<<
17239  *     return x
17240  *
17241  */
17242   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 2)) & ((__pyx_t_5numpy_uint32_t)0x09249249));
17243 
17244   /* "yt/utilities/lib/geometry_utils.pxd":213
17245  *     # x = ---- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
17246  *     x=(x|(x<<2))&(<np.uint32_t>0x09249249)
17247  *     return x             # <<<<<<<<<<<<<<
17248  *
17249  * @cython.cdivision(True)
17250  */
17251   __pyx_r = __pyx_v_x;
17252   goto __pyx_L0;
17253 
17254   /* "yt/utilities/lib/geometry_utils.pxd":200
17255  * @cython.boundscheck(False)
17256  * @cython.wraparound(False)
17257  * cdef inline np.uint32_t spread_32bits_by2(np.uint32_t x):             # <<<<<<<<<<<<<<
17258  *     # Only reversible up to 1023
17259  *     # Select highest 10 bits (Required to be reversible to 10st bit)
17260  */
17261 
17262   /* function exit code */
17263   __pyx_L0:;
17264   __Pyx_RefNannyFinishContext();
17265   return __pyx_r;
17266 }
17267 
17268 /* "yt/utilities/lib/geometry_utils.pxd":218
17269  * @cython.boundscheck(False)
17270  * @cython.wraparound(False)
17271  * cdef inline np.uint32_t compact_32bits_by2(np.uint32_t x):             # <<<<<<<<<<<<<<
17272  *     # Reversed magic
17273  *     x=x&(<np.uint32_t>0x09249249)
17274  */
17275 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_32bits_by2(__pyx_t_5numpy_uint32_t __pyx_v_x)17276 static CYTHON_INLINE __pyx_t_5numpy_uint32_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_32bits_by2(__pyx_t_5numpy_uint32_t __pyx_v_x) {
17277   __pyx_t_5numpy_uint32_t __pyx_r;
17278   __Pyx_RefNannyDeclarations
17279   __Pyx_RefNannySetupContext("compact_32bits_by2", 0);
17280 
17281   /* "yt/utilities/lib/geometry_utils.pxd":220
17282  * cdef inline np.uint32_t compact_32bits_by2(np.uint32_t x):
17283  *     # Reversed magic
17284  *     x=x&(<np.uint32_t>0x09249249)             # <<<<<<<<<<<<<<
17285  *     x=(x|(x>>2))&(<np.uint32_t>0x030C30C3)
17286  *     x=(x|(x>>4))&(<np.uint32_t>0x0300F00F)
17287  */
17288   __pyx_v_x = (__pyx_v_x & ((__pyx_t_5numpy_uint32_t)0x09249249));
17289 
17290   /* "yt/utilities/lib/geometry_utils.pxd":221
17291  *     # Reversed magic
17292  *     x=x&(<np.uint32_t>0x09249249)
17293  *     x=(x|(x>>2))&(<np.uint32_t>0x030C30C3)             # <<<<<<<<<<<<<<
17294  *     x=(x|(x>>4))&(<np.uint32_t>0x0300F00F)
17295  *     x=(x|(x>>8))&(<np.uint32_t>0xFF0000FF)
17296  */
17297   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 2)) & ((__pyx_t_5numpy_uint32_t)0x030C30C3));
17298 
17299   /* "yt/utilities/lib/geometry_utils.pxd":222
17300  *     x=x&(<np.uint32_t>0x09249249)
17301  *     x=(x|(x>>2))&(<np.uint32_t>0x030C30C3)
17302  *     x=(x|(x>>4))&(<np.uint32_t>0x0300F00F)             # <<<<<<<<<<<<<<
17303  *     x=(x|(x>>8))&(<np.uint32_t>0xFF0000FF)
17304  *     x=(x|(x>>16))&(<np.uint32_t>0x000003FF)
17305  */
17306   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 4)) & ((__pyx_t_5numpy_uint32_t)0x0300F00F));
17307 
17308   /* "yt/utilities/lib/geometry_utils.pxd":223
17309  *     x=(x|(x>>2))&(<np.uint32_t>0x030C30C3)
17310  *     x=(x|(x>>4))&(<np.uint32_t>0x0300F00F)
17311  *     x=(x|(x>>8))&(<np.uint32_t>0xFF0000FF)             # <<<<<<<<<<<<<<
17312  *     x=(x|(x>>16))&(<np.uint32_t>0x000003FF)
17313  *     return x
17314  */
17315   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 8)) & ((__pyx_t_5numpy_uint32_t)0xFF0000FF));
17316 
17317   /* "yt/utilities/lib/geometry_utils.pxd":224
17318  *     x=(x|(x>>4))&(<np.uint32_t>0x0300F00F)
17319  *     x=(x|(x>>8))&(<np.uint32_t>0xFF0000FF)
17320  *     x=(x|(x>>16))&(<np.uint32_t>0x000003FF)             # <<<<<<<<<<<<<<
17321  *     return x
17322  *
17323  */
17324   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 16)) & ((__pyx_t_5numpy_uint32_t)0x000003FF));
17325 
17326   /* "yt/utilities/lib/geometry_utils.pxd":225
17327  *     x=(x|(x>>8))&(<np.uint32_t>0xFF0000FF)
17328  *     x=(x|(x>>16))&(<np.uint32_t>0x000003FF)
17329  *     return x             # <<<<<<<<<<<<<<
17330  *
17331  * @cython.cdivision(True)
17332  */
17333   __pyx_r = __pyx_v_x;
17334   goto __pyx_L0;
17335 
17336   /* "yt/utilities/lib/geometry_utils.pxd":218
17337  * @cython.boundscheck(False)
17338  * @cython.wraparound(False)
17339  * cdef inline np.uint32_t compact_32bits_by2(np.uint32_t x):             # <<<<<<<<<<<<<<
17340  *     # Reversed magic
17341  *     x=x&(<np.uint32_t>0x09249249)
17342  */
17343 
17344   /* function exit code */
17345   __pyx_L0:;
17346   __Pyx_RefNannyFinishContext();
17347   return __pyx_r;
17348 }
17349 
17350 /* "yt/utilities/lib/geometry_utils.pxd":230
17351  * @cython.boundscheck(False)
17352  * @cython.wraparound(False)
17353  * cdef inline np.uint64_t masked_merge_64bit(np.uint64_t a, np.uint64_t b, np.uint64_t mask):             # <<<<<<<<<<<<<<
17354  *     # https://graphics.stanford.edu/~seander/bithacks.html#MaskedMerge
17355  *     return a ^ ((a ^ b) & mask)
17356  */
17357 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_masked_merge_64bit(__pyx_t_5numpy_uint64_t __pyx_v_a,__pyx_t_5numpy_uint64_t __pyx_v_b,__pyx_t_5numpy_uint64_t __pyx_v_mask)17358 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_masked_merge_64bit(__pyx_t_5numpy_uint64_t __pyx_v_a, __pyx_t_5numpy_uint64_t __pyx_v_b, __pyx_t_5numpy_uint64_t __pyx_v_mask) {
17359   __pyx_t_5numpy_uint64_t __pyx_r;
17360   __Pyx_RefNannyDeclarations
17361   __Pyx_RefNannySetupContext("masked_merge_64bit", 0);
17362 
17363   /* "yt/utilities/lib/geometry_utils.pxd":232
17364  * cdef inline np.uint64_t masked_merge_64bit(np.uint64_t a, np.uint64_t b, np.uint64_t mask):
17365  *     # https://graphics.stanford.edu/~seander/bithacks.html#MaskedMerge
17366  *     return a ^ ((a ^ b) & mask)             # <<<<<<<<<<<<<<
17367  *
17368  * @cython.cdivision(True)
17369  */
17370   __pyx_r = (__pyx_v_a ^ ((__pyx_v_a ^ __pyx_v_b) & __pyx_v_mask));
17371   goto __pyx_L0;
17372 
17373   /* "yt/utilities/lib/geometry_utils.pxd":230
17374  * @cython.boundscheck(False)
17375  * @cython.wraparound(False)
17376  * cdef inline np.uint64_t masked_merge_64bit(np.uint64_t a, np.uint64_t b, np.uint64_t mask):             # <<<<<<<<<<<<<<
17377  *     # https://graphics.stanford.edu/~seander/bithacks.html#MaskedMerge
17378  *     return a ^ ((a ^ b) & mask)
17379  */
17380 
17381   /* function exit code */
17382   __pyx_L0:;
17383   __Pyx_RefNannyFinishContext();
17384   return __pyx_r;
17385 }
17386 
17387 /* "yt/utilities/lib/geometry_utils.pxd":235
17388  *
17389  * @cython.cdivision(True)
17390  * cdef inline np.uint64_t encode_morton_64bit(np.uint64_t x_ind, np.uint64_t y_ind, np.uint64_t z_ind):             # <<<<<<<<<<<<<<
17391  *     cdef np.uint64_t mi
17392  *     mi = 0
17393  */
17394 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit(__pyx_t_5numpy_uint64_t __pyx_v_x_ind,__pyx_t_5numpy_uint64_t __pyx_v_y_ind,__pyx_t_5numpy_uint64_t __pyx_v_z_ind)17395 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit(__pyx_t_5numpy_uint64_t __pyx_v_x_ind, __pyx_t_5numpy_uint64_t __pyx_v_y_ind, __pyx_t_5numpy_uint64_t __pyx_v_z_ind) {
17396   __pyx_t_5numpy_uint64_t __pyx_v_mi;
17397   __pyx_t_5numpy_uint64_t __pyx_r;
17398   __Pyx_RefNannyDeclarations
17399   __Pyx_RefNannySetupContext("encode_morton_64bit", 0);
17400 
17401   /* "yt/utilities/lib/geometry_utils.pxd":237
17402  * cdef inline np.uint64_t encode_morton_64bit(np.uint64_t x_ind, np.uint64_t y_ind, np.uint64_t z_ind):
17403  *     cdef np.uint64_t mi
17404  *     mi = 0             # <<<<<<<<<<<<<<
17405  *     mi |= spread_64bits_by2(z_ind)<<ZSHIFT
17406  *     mi |= spread_64bits_by2(y_ind)<<YSHIFT
17407  */
17408   __pyx_v_mi = 0;
17409 
17410   /* "yt/utilities/lib/geometry_utils.pxd":238
17411  *     cdef np.uint64_t mi
17412  *     mi = 0
17413  *     mi |= spread_64bits_by2(z_ind)<<ZSHIFT             # <<<<<<<<<<<<<<
17414  *     mi |= spread_64bits_by2(y_ind)<<YSHIFT
17415  *     mi |= spread_64bits_by2(x_ind)<<XSHIFT
17416  */
17417   __pyx_v_mi = (__pyx_v_mi | (__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by2(__pyx_v_z_ind) << 0));
17418 
17419   /* "yt/utilities/lib/geometry_utils.pxd":239
17420  *     mi = 0
17421  *     mi |= spread_64bits_by2(z_ind)<<ZSHIFT
17422  *     mi |= spread_64bits_by2(y_ind)<<YSHIFT             # <<<<<<<<<<<<<<
17423  *     mi |= spread_64bits_by2(x_ind)<<XSHIFT
17424  *     return mi
17425  */
17426   __pyx_v_mi = (__pyx_v_mi | (__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by2(__pyx_v_y_ind) << 1));
17427 
17428   /* "yt/utilities/lib/geometry_utils.pxd":240
17429  *     mi |= spread_64bits_by2(z_ind)<<ZSHIFT
17430  *     mi |= spread_64bits_by2(y_ind)<<YSHIFT
17431  *     mi |= spread_64bits_by2(x_ind)<<XSHIFT             # <<<<<<<<<<<<<<
17432  *     return mi
17433  *
17434  */
17435   __pyx_v_mi = (__pyx_v_mi | (__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by2(__pyx_v_x_ind) << 2));
17436 
17437   /* "yt/utilities/lib/geometry_utils.pxd":241
17438  *     mi |= spread_64bits_by2(y_ind)<<YSHIFT
17439  *     mi |= spread_64bits_by2(x_ind)<<XSHIFT
17440  *     return mi             # <<<<<<<<<<<<<<
17441  *
17442  * @cython.cdivision(True)
17443  */
17444   __pyx_r = __pyx_v_mi;
17445   goto __pyx_L0;
17446 
17447   /* "yt/utilities/lib/geometry_utils.pxd":235
17448  *
17449  * @cython.cdivision(True)
17450  * cdef inline np.uint64_t encode_morton_64bit(np.uint64_t x_ind, np.uint64_t y_ind, np.uint64_t z_ind):             # <<<<<<<<<<<<<<
17451  *     cdef np.uint64_t mi
17452  *     mi = 0
17453  */
17454 
17455   /* function exit code */
17456   __pyx_L0:;
17457   __Pyx_RefNannyFinishContext();
17458   return __pyx_r;
17459 }
17460 
17461 /* "yt/utilities/lib/geometry_utils.pxd":244
17462  *
17463  * @cython.cdivision(True)
17464  * cdef inline void decode_morton_64bit(np.uint64_t mi, np.uint64_t *p):             # <<<<<<<<<<<<<<
17465  *     p[0] = compact_64bits_by2(mi>>XSHIFT)
17466  *     p[1] = compact_64bits_by2(mi>>YSHIFT)
17467  */
17468 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_decode_morton_64bit(__pyx_t_5numpy_uint64_t __pyx_v_mi,__pyx_t_5numpy_uint64_t * __pyx_v_p)17469 static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_14geometry_utils_decode_morton_64bit(__pyx_t_5numpy_uint64_t __pyx_v_mi, __pyx_t_5numpy_uint64_t *__pyx_v_p) {
17470   __Pyx_RefNannyDeclarations
17471   __Pyx_RefNannySetupContext("decode_morton_64bit", 0);
17472 
17473   /* "yt/utilities/lib/geometry_utils.pxd":245
17474  * @cython.cdivision(True)
17475  * cdef inline void decode_morton_64bit(np.uint64_t mi, np.uint64_t *p):
17476  *     p[0] = compact_64bits_by2(mi>>XSHIFT)             # <<<<<<<<<<<<<<
17477  *     p[1] = compact_64bits_by2(mi>>YSHIFT)
17478  *     p[2] = compact_64bits_by2(mi>>ZSHIFT)
17479  */
17480   (__pyx_v_p[0]) = __pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_64bits_by2((__pyx_v_mi >> 2));
17481 
17482   /* "yt/utilities/lib/geometry_utils.pxd":246
17483  * cdef inline void decode_morton_64bit(np.uint64_t mi, np.uint64_t *p):
17484  *     p[0] = compact_64bits_by2(mi>>XSHIFT)
17485  *     p[1] = compact_64bits_by2(mi>>YSHIFT)             # <<<<<<<<<<<<<<
17486  *     p[2] = compact_64bits_by2(mi>>ZSHIFT)
17487  *
17488  */
17489   (__pyx_v_p[1]) = __pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_64bits_by2((__pyx_v_mi >> 1));
17490 
17491   /* "yt/utilities/lib/geometry_utils.pxd":247
17492  *     p[0] = compact_64bits_by2(mi>>XSHIFT)
17493  *     p[1] = compact_64bits_by2(mi>>YSHIFT)
17494  *     p[2] = compact_64bits_by2(mi>>ZSHIFT)             # <<<<<<<<<<<<<<
17495  *
17496  * @cython.cdivision(True)
17497  */
17498   (__pyx_v_p[2]) = __pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_64bits_by2((__pyx_v_mi >> 0));
17499 
17500   /* "yt/utilities/lib/geometry_utils.pxd":244
17501  *
17502  * @cython.cdivision(True)
17503  * cdef inline void decode_morton_64bit(np.uint64_t mi, np.uint64_t *p):             # <<<<<<<<<<<<<<
17504  *     p[0] = compact_64bits_by2(mi>>XSHIFT)
17505  *     p[1] = compact_64bits_by2(mi>>YSHIFT)
17506  */
17507 
17508   /* function exit code */
17509   __Pyx_RefNannyFinishContext();
17510 }
17511 
17512 /* "yt/utilities/lib/geometry_utils.pxd":250
17513  *
17514  * @cython.cdivision(True)
17515  * cdef inline np.uint64_t bounded_morton(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
17516  *                                np.float64_t *DLE, np.float64_t *DRE, np.int32_t order):
17517  *     cdef int i
17518  */
17519 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton(__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_float64_t __pyx_v_y,__pyx_t_5numpy_float64_t __pyx_v_z,__pyx_t_5numpy_float64_t * __pyx_v_DLE,__pyx_t_5numpy_float64_t * __pyx_v_DRE,__pyx_t_5numpy_int32_t __pyx_v_order)17520 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton(__pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y, __pyx_t_5numpy_float64_t __pyx_v_z, __pyx_t_5numpy_float64_t *__pyx_v_DLE, __pyx_t_5numpy_float64_t *__pyx_v_DRE, __pyx_t_5numpy_int32_t __pyx_v_order) {
17521   int __pyx_v_i;
17522   __pyx_t_5numpy_float64_t __pyx_v_dds[3];
17523   __pyx_t_5numpy_uint64_t __pyx_v_x_ind;
17524   __pyx_t_5numpy_uint64_t __pyx_v_y_ind;
17525   __pyx_t_5numpy_uint64_t __pyx_v_z_ind;
17526   __pyx_t_5numpy_uint64_t __pyx_v_mi;
17527   __pyx_t_5numpy_uint64_t __pyx_r;
17528   __Pyx_RefNannyDeclarations
17529   int __pyx_t_1;
17530   __Pyx_RefNannySetupContext("bounded_morton", 0);
17531 
17532   /* "yt/utilities/lib/geometry_utils.pxd":256
17533  *     cdef np.uint64_t x_ind, y_ind, z_ind
17534  *     cdef np.uint64_t mi
17535  *     for i in range(3):             # <<<<<<<<<<<<<<
17536  *         dds[i] = (DRE[i] - DLE[i]) / (1 << order)
17537  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])
17538  */
17539   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
17540     __pyx_v_i = __pyx_t_1;
17541 
17542     /* "yt/utilities/lib/geometry_utils.pxd":257
17543  *     cdef np.uint64_t mi
17544  *     for i in range(3):
17545  *         dds[i] = (DRE[i] - DLE[i]) / (1 << order)             # <<<<<<<<<<<<<<
17546  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])
17547  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
17548  */
17549     (__pyx_v_dds[__pyx_v_i]) = (((__pyx_v_DRE[__pyx_v_i]) - (__pyx_v_DLE[__pyx_v_i])) / (1 << __pyx_v_order));
17550   }
17551 
17552   /* "yt/utilities/lib/geometry_utils.pxd":258
17553  *     for i in range(3):
17554  *         dds[i] = (DRE[i] - DLE[i]) / (1 << order)
17555  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])             # <<<<<<<<<<<<<<
17556  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
17557  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
17558  */
17559   __pyx_v_x_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE[0])) / (__pyx_v_dds[0])));
17560 
17561   /* "yt/utilities/lib/geometry_utils.pxd":259
17562  *         dds[i] = (DRE[i] - DLE[i]) / (1 << order)
17563  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])
17564  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])             # <<<<<<<<<<<<<<
17565  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
17566  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)
17567  */
17568   __pyx_v_y_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE[1])) / (__pyx_v_dds[1])));
17569 
17570   /* "yt/utilities/lib/geometry_utils.pxd":260
17571  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])
17572  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
17573  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])             # <<<<<<<<<<<<<<
17574  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)
17575  *     return mi
17576  */
17577   __pyx_v_z_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE[2])) / (__pyx_v_dds[2])));
17578 
17579   /* "yt/utilities/lib/geometry_utils.pxd":261
17580  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
17581  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
17582  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)             # <<<<<<<<<<<<<<
17583  *     return mi
17584  *
17585  */
17586   __pyx_v_mi = __pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit(__pyx_v_x_ind, __pyx_v_y_ind, __pyx_v_z_ind);
17587 
17588   /* "yt/utilities/lib/geometry_utils.pxd":262
17589  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
17590  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)
17591  *     return mi             # <<<<<<<<<<<<<<
17592  *
17593  * @cython.cdivision(True)
17594  */
17595   __pyx_r = __pyx_v_mi;
17596   goto __pyx_L0;
17597 
17598   /* "yt/utilities/lib/geometry_utils.pxd":250
17599  *
17600  * @cython.cdivision(True)
17601  * cdef inline np.uint64_t bounded_morton(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
17602  *                                np.float64_t *DLE, np.float64_t *DRE, np.int32_t order):
17603  *     cdef int i
17604  */
17605 
17606   /* function exit code */
17607   __pyx_L0:;
17608   __Pyx_RefNannyFinishContext();
17609   return __pyx_r;
17610 }
17611 
17612 /* "yt/utilities/lib/geometry_utils.pxd":265
17613  *
17614  * @cython.cdivision(True)
17615  * cdef inline np.uint64_t bounded_morton_relative(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
17616  *                                np.float64_t *DLE, np.float64_t *DRE,
17617  *                                np.int32_t order1, np.int32_t order2):
17618  */
17619 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_relative(__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_float64_t __pyx_v_y,__pyx_t_5numpy_float64_t __pyx_v_z,__pyx_t_5numpy_float64_t * __pyx_v_DLE,__pyx_t_5numpy_float64_t * __pyx_v_DRE,__pyx_t_5numpy_int32_t __pyx_v_order1,__pyx_t_5numpy_int32_t __pyx_v_order2)17620 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_relative(__pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y, __pyx_t_5numpy_float64_t __pyx_v_z, __pyx_t_5numpy_float64_t *__pyx_v_DLE, __pyx_t_5numpy_float64_t *__pyx_v_DRE, __pyx_t_5numpy_int32_t __pyx_v_order1, __pyx_t_5numpy_int32_t __pyx_v_order2) {
17621   int __pyx_v_i;
17622   __pyx_t_5numpy_float64_t __pyx_v_dds1[3];
17623   __pyx_t_5numpy_float64_t __pyx_v_dds2[3];
17624   __pyx_t_5numpy_float64_t __pyx_v_DLE2[3];
17625   __pyx_t_5numpy_uint64_t __pyx_v_x_ind;
17626   __pyx_t_5numpy_uint64_t __pyx_v_y_ind;
17627   __pyx_t_5numpy_uint64_t __pyx_v_z_ind;
17628   __pyx_t_5numpy_uint64_t __pyx_v_mi2;
17629   __pyx_t_5numpy_uint64_t __pyx_r;
17630   __Pyx_RefNannyDeclarations
17631   int __pyx_t_1;
17632   __Pyx_RefNannySetupContext("bounded_morton_relative", 0);
17633 
17634   /* "yt/utilities/lib/geometry_utils.pxd":274
17635  *     cdef np.uint64_t x_ind, y_ind, z_ind
17636  *     cdef np.uint64_t mi2
17637  *     for i in range(3):             # <<<<<<<<<<<<<<
17638  *         dds1[i] = (DRE[i] - DLE[i]) / (1 << order1)
17639  *         dds2[i] = dds1[i] / (1 << order2)
17640  */
17641   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
17642     __pyx_v_i = __pyx_t_1;
17643 
17644     /* "yt/utilities/lib/geometry_utils.pxd":275
17645  *     cdef np.uint64_t mi2
17646  *     for i in range(3):
17647  *         dds1[i] = (DRE[i] - DLE[i]) / (1 << order1)             # <<<<<<<<<<<<<<
17648  *         dds2[i] = dds1[i] / (1 << order2)
17649  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
17650  */
17651     (__pyx_v_dds1[__pyx_v_i]) = (((__pyx_v_DRE[__pyx_v_i]) - (__pyx_v_DLE[__pyx_v_i])) / (1 << __pyx_v_order1));
17652 
17653     /* "yt/utilities/lib/geometry_utils.pxd":276
17654  *     for i in range(3):
17655  *         dds1[i] = (DRE[i] - DLE[i]) / (1 << order1)
17656  *         dds2[i] = dds1[i] / (1 << order2)             # <<<<<<<<<<<<<<
17657  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
17658  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
17659  */
17660     (__pyx_v_dds2[__pyx_v_i]) = ((__pyx_v_dds1[__pyx_v_i]) / (1 << __pyx_v_order2));
17661   }
17662 
17663   /* "yt/utilities/lib/geometry_utils.pxd":277
17664  *         dds1[i] = (DRE[i] - DLE[i]) / (1 << order1)
17665  *         dds2[i] = dds1[i] / (1 << order2)
17666  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]             # <<<<<<<<<<<<<<
17667  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
17668  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
17669  */
17670   (__pyx_v_DLE2[0]) = (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE[0])) / (__pyx_v_dds1[0])))) * (__pyx_v_dds1[0]));
17671 
17672   /* "yt/utilities/lib/geometry_utils.pxd":278
17673  *         dds2[i] = dds1[i] / (1 << order2)
17674  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
17675  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]             # <<<<<<<<<<<<<<
17676  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
17677  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
17678  */
17679   (__pyx_v_DLE2[1]) = (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE[1])) / (__pyx_v_dds1[1])))) * (__pyx_v_dds1[1]));
17680 
17681   /* "yt/utilities/lib/geometry_utils.pxd":279
17682  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
17683  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
17684  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]             # <<<<<<<<<<<<<<
17685  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
17686  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
17687  */
17688   (__pyx_v_DLE2[2]) = (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE[2])) / (__pyx_v_dds1[2])))) * (__pyx_v_dds1[2]));
17689 
17690   /* "yt/utilities/lib/geometry_utils.pxd":280
17691  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
17692  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
17693  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])             # <<<<<<<<<<<<<<
17694  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
17695  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
17696  */
17697   __pyx_v_x_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE2[0])) / (__pyx_v_dds2[0])));
17698 
17699   /* "yt/utilities/lib/geometry_utils.pxd":281
17700  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
17701  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
17702  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])             # <<<<<<<<<<<<<<
17703  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
17704  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)
17705  */
17706   __pyx_v_y_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE2[1])) / (__pyx_v_dds2[1])));
17707 
17708   /* "yt/utilities/lib/geometry_utils.pxd":282
17709  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
17710  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
17711  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])             # <<<<<<<<<<<<<<
17712  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)
17713  *     return mi2
17714  */
17715   __pyx_v_z_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE2[2])) / (__pyx_v_dds2[2])));
17716 
17717   /* "yt/utilities/lib/geometry_utils.pxd":283
17718  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
17719  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
17720  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)             # <<<<<<<<<<<<<<
17721  *     return mi2
17722  *
17723  */
17724   __pyx_v_mi2 = __pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit(__pyx_v_x_ind, __pyx_v_y_ind, __pyx_v_z_ind);
17725 
17726   /* "yt/utilities/lib/geometry_utils.pxd":284
17727  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
17728  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)
17729  *     return mi2             # <<<<<<<<<<<<<<
17730  *
17731  *
17732  */
17733   __pyx_r = __pyx_v_mi2;
17734   goto __pyx_L0;
17735 
17736   /* "yt/utilities/lib/geometry_utils.pxd":265
17737  *
17738  * @cython.cdivision(True)
17739  * cdef inline np.uint64_t bounded_morton_relative(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
17740  *                                np.float64_t *DLE, np.float64_t *DRE,
17741  *                                np.int32_t order1, np.int32_t order2):
17742  */
17743 
17744   /* function exit code */
17745   __pyx_L0:;
17746   __Pyx_RefNannyFinishContext();
17747   return __pyx_r;
17748 }
17749 
17750 /* "yt/utilities/lib/geometry_utils.pxd":289
17751  * # This dosn't seem to be much, if at all, faster...
17752  * @cython.cdivision(True)
17753  * cdef inline np.uint64_t bounded_morton_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
17754  *                                np.float64_t *DLE, np.float64_t *dds):
17755  *     cdef np.uint64_t x_ind, y_ind, z_ind
17756  */
17757 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_dds(__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_float64_t __pyx_v_y,__pyx_t_5numpy_float64_t __pyx_v_z,__pyx_t_5numpy_float64_t * __pyx_v_DLE,__pyx_t_5numpy_float64_t * __pyx_v_dds)17758 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_dds(__pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y, __pyx_t_5numpy_float64_t __pyx_v_z, __pyx_t_5numpy_float64_t *__pyx_v_DLE, __pyx_t_5numpy_float64_t *__pyx_v_dds) {
17759   __pyx_t_5numpy_uint64_t __pyx_v_x_ind;
17760   __pyx_t_5numpy_uint64_t __pyx_v_y_ind;
17761   __pyx_t_5numpy_uint64_t __pyx_v_z_ind;
17762   __pyx_t_5numpy_uint64_t __pyx_v_mi;
17763   __pyx_t_5numpy_uint64_t __pyx_r;
17764   __Pyx_RefNannyDeclarations
17765   __Pyx_RefNannySetupContext("bounded_morton_dds", 0);
17766 
17767   /* "yt/utilities/lib/geometry_utils.pxd":293
17768  *     cdef np.uint64_t x_ind, y_ind, z_ind
17769  *     cdef np.uint64_t mi
17770  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])             # <<<<<<<<<<<<<<
17771  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
17772  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
17773  */
17774   __pyx_v_x_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE[0])) / (__pyx_v_dds[0])));
17775 
17776   /* "yt/utilities/lib/geometry_utils.pxd":294
17777  *     cdef np.uint64_t mi
17778  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])
17779  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])             # <<<<<<<<<<<<<<
17780  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
17781  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)
17782  */
17783   __pyx_v_y_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE[1])) / (__pyx_v_dds[1])));
17784 
17785   /* "yt/utilities/lib/geometry_utils.pxd":295
17786  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])
17787  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
17788  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])             # <<<<<<<<<<<<<<
17789  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)
17790  *     return mi
17791  */
17792   __pyx_v_z_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE[2])) / (__pyx_v_dds[2])));
17793 
17794   /* "yt/utilities/lib/geometry_utils.pxd":296
17795  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
17796  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
17797  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)             # <<<<<<<<<<<<<<
17798  *     return mi
17799  *
17800  */
17801   __pyx_v_mi = __pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit(__pyx_v_x_ind, __pyx_v_y_ind, __pyx_v_z_ind);
17802 
17803   /* "yt/utilities/lib/geometry_utils.pxd":297
17804  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
17805  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)
17806  *     return mi             # <<<<<<<<<<<<<<
17807  *
17808  * @cython.cdivision(True)
17809  */
17810   __pyx_r = __pyx_v_mi;
17811   goto __pyx_L0;
17812 
17813   /* "yt/utilities/lib/geometry_utils.pxd":289
17814  * # This dosn't seem to be much, if at all, faster...
17815  * @cython.cdivision(True)
17816  * cdef inline np.uint64_t bounded_morton_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
17817  *                                np.float64_t *DLE, np.float64_t *dds):
17818  *     cdef np.uint64_t x_ind, y_ind, z_ind
17819  */
17820 
17821   /* function exit code */
17822   __pyx_L0:;
17823   __Pyx_RefNannyFinishContext();
17824   return __pyx_r;
17825 }
17826 
17827 /* "yt/utilities/lib/geometry_utils.pxd":300
17828  *
17829  * @cython.cdivision(True)
17830  * cdef inline np.uint64_t bounded_morton_relative_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
17831  *                                np.float64_t *DLE, np.float64_t *dds1, np.float64_t *dds2):
17832  *     cdef np.float64_t DLE2[3]
17833  */
17834 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_relative_dds(__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_float64_t __pyx_v_y,__pyx_t_5numpy_float64_t __pyx_v_z,__pyx_t_5numpy_float64_t * __pyx_v_DLE,__pyx_t_5numpy_float64_t * __pyx_v_dds1,__pyx_t_5numpy_float64_t * __pyx_v_dds2)17835 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_relative_dds(__pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y, __pyx_t_5numpy_float64_t __pyx_v_z, __pyx_t_5numpy_float64_t *__pyx_v_DLE, __pyx_t_5numpy_float64_t *__pyx_v_dds1, __pyx_t_5numpy_float64_t *__pyx_v_dds2) {
17836   __pyx_t_5numpy_float64_t __pyx_v_DLE2[3];
17837   __pyx_t_5numpy_uint64_t __pyx_v_x_ind;
17838   __pyx_t_5numpy_uint64_t __pyx_v_y_ind;
17839   __pyx_t_5numpy_uint64_t __pyx_v_z_ind;
17840   __pyx_t_5numpy_uint64_t __pyx_v_mi2;
17841   __pyx_t_5numpy_uint64_t __pyx_r;
17842   __Pyx_RefNannyDeclarations
17843   __Pyx_RefNannySetupContext("bounded_morton_relative_dds", 0);
17844 
17845   /* "yt/utilities/lib/geometry_utils.pxd":305
17846  *     cdef np.uint64_t x_ind, y_ind, z_ind
17847  *     cdef np.uint64_t mi2
17848  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]             # <<<<<<<<<<<<<<
17849  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
17850  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
17851  */
17852   (__pyx_v_DLE2[0]) = (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE[0])) / (__pyx_v_dds1[0])))) * (__pyx_v_dds1[0]));
17853 
17854   /* "yt/utilities/lib/geometry_utils.pxd":306
17855  *     cdef np.uint64_t mi2
17856  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
17857  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]             # <<<<<<<<<<<<<<
17858  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
17859  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
17860  */
17861   (__pyx_v_DLE2[1]) = (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE[1])) / (__pyx_v_dds1[1])))) * (__pyx_v_dds1[1]));
17862 
17863   /* "yt/utilities/lib/geometry_utils.pxd":307
17864  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
17865  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
17866  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]             # <<<<<<<<<<<<<<
17867  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
17868  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
17869  */
17870   (__pyx_v_DLE2[2]) = (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE[2])) / (__pyx_v_dds1[2])))) * (__pyx_v_dds1[2]));
17871 
17872   /* "yt/utilities/lib/geometry_utils.pxd":308
17873  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
17874  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
17875  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])             # <<<<<<<<<<<<<<
17876  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
17877  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
17878  */
17879   __pyx_v_x_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE2[0])) / (__pyx_v_dds2[0])));
17880 
17881   /* "yt/utilities/lib/geometry_utils.pxd":309
17882  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
17883  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
17884  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])             # <<<<<<<<<<<<<<
17885  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
17886  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)
17887  */
17888   __pyx_v_y_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE2[1])) / (__pyx_v_dds2[1])));
17889 
17890   /* "yt/utilities/lib/geometry_utils.pxd":310
17891  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
17892  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
17893  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])             # <<<<<<<<<<<<<<
17894  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)
17895  *     return mi2
17896  */
17897   __pyx_v_z_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE2[2])) / (__pyx_v_dds2[2])));
17898 
17899   /* "yt/utilities/lib/geometry_utils.pxd":311
17900  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
17901  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
17902  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)             # <<<<<<<<<<<<<<
17903  *     return mi2
17904  *
17905  */
17906   __pyx_v_mi2 = __pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit(__pyx_v_x_ind, __pyx_v_y_ind, __pyx_v_z_ind);
17907 
17908   /* "yt/utilities/lib/geometry_utils.pxd":312
17909  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
17910  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)
17911  *     return mi2             # <<<<<<<<<<<<<<
17912  *
17913  *
17914  */
17915   __pyx_r = __pyx_v_mi2;
17916   goto __pyx_L0;
17917 
17918   /* "yt/utilities/lib/geometry_utils.pxd":300
17919  *
17920  * @cython.cdivision(True)
17921  * cdef inline np.uint64_t bounded_morton_relative_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
17922  *                                np.float64_t *DLE, np.float64_t *dds1, np.float64_t *dds2):
17923  *     cdef np.float64_t DLE2[3]
17924  */
17925 
17926   /* function exit code */
17927   __pyx_L0:;
17928   __Pyx_RefNannyFinishContext();
17929   return __pyx_r;
17930 }
17931 
17932 /* "yt/utilities/lib/geometry_utils.pxd":316
17933  *
17934  * @cython.cdivision(True)
17935  * cdef inline np.uint64_t bounded_morton_split_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
17936  *                                np.float64_t *DLE, np.float64_t *dds, np.uint64_t *p):
17937  *     cdef np.uint64_t mi
17938  */
17939 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_split_dds(__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_float64_t __pyx_v_y,__pyx_t_5numpy_float64_t __pyx_v_z,__pyx_t_5numpy_float64_t * __pyx_v_DLE,__pyx_t_5numpy_float64_t * __pyx_v_dds,__pyx_t_5numpy_uint64_t * __pyx_v_p)17940 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_split_dds(__pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y, __pyx_t_5numpy_float64_t __pyx_v_z, __pyx_t_5numpy_float64_t *__pyx_v_DLE, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_uint64_t *__pyx_v_p) {
17941   __pyx_t_5numpy_uint64_t __pyx_v_mi;
17942   __pyx_t_5numpy_uint64_t __pyx_r;
17943   __Pyx_RefNannyDeclarations
17944   __Pyx_RefNannySetupContext("bounded_morton_split_dds", 0);
17945 
17946   /* "yt/utilities/lib/geometry_utils.pxd":319
17947  *                                np.float64_t *DLE, np.float64_t *dds, np.uint64_t *p):
17948  *     cdef np.uint64_t mi
17949  *     p[0] = <np.uint64_t> ((x - DLE[0])/dds[0])             # <<<<<<<<<<<<<<
17950  *     p[1] = <np.uint64_t> ((y - DLE[1])/dds[1])
17951  *     p[2] = <np.uint64_t> ((z - DLE[2])/dds[2])
17952  */
17953   (__pyx_v_p[0]) = ((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE[0])) / (__pyx_v_dds[0])));
17954 
17955   /* "yt/utilities/lib/geometry_utils.pxd":320
17956  *     cdef np.uint64_t mi
17957  *     p[0] = <np.uint64_t> ((x - DLE[0])/dds[0])
17958  *     p[1] = <np.uint64_t> ((y - DLE[1])/dds[1])             # <<<<<<<<<<<<<<
17959  *     p[2] = <np.uint64_t> ((z - DLE[2])/dds[2])
17960  *     mi = encode_morton_64bit(p[0], p[1], p[2])
17961  */
17962   (__pyx_v_p[1]) = ((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE[1])) / (__pyx_v_dds[1])));
17963 
17964   /* "yt/utilities/lib/geometry_utils.pxd":321
17965  *     p[0] = <np.uint64_t> ((x - DLE[0])/dds[0])
17966  *     p[1] = <np.uint64_t> ((y - DLE[1])/dds[1])
17967  *     p[2] = <np.uint64_t> ((z - DLE[2])/dds[2])             # <<<<<<<<<<<<<<
17968  *     mi = encode_morton_64bit(p[0], p[1], p[2])
17969  *     return mi
17970  */
17971   (__pyx_v_p[2]) = ((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE[2])) / (__pyx_v_dds[2])));
17972 
17973   /* "yt/utilities/lib/geometry_utils.pxd":322
17974  *     p[1] = <np.uint64_t> ((y - DLE[1])/dds[1])
17975  *     p[2] = <np.uint64_t> ((z - DLE[2])/dds[2])
17976  *     mi = encode_morton_64bit(p[0], p[1], p[2])             # <<<<<<<<<<<<<<
17977  *     return mi
17978  *
17979  */
17980   __pyx_v_mi = __pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit((__pyx_v_p[0]), (__pyx_v_p[1]), (__pyx_v_p[2]));
17981 
17982   /* "yt/utilities/lib/geometry_utils.pxd":323
17983  *     p[2] = <np.uint64_t> ((z - DLE[2])/dds[2])
17984  *     mi = encode_morton_64bit(p[0], p[1], p[2])
17985  *     return mi             # <<<<<<<<<<<<<<
17986  *
17987  * @cython.cdivision(True)
17988  */
17989   __pyx_r = __pyx_v_mi;
17990   goto __pyx_L0;
17991 
17992   /* "yt/utilities/lib/geometry_utils.pxd":316
17993  *
17994  * @cython.cdivision(True)
17995  * cdef inline np.uint64_t bounded_morton_split_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
17996  *                                np.float64_t *DLE, np.float64_t *dds, np.uint64_t *p):
17997  *     cdef np.uint64_t mi
17998  */
17999 
18000   /* function exit code */
18001   __pyx_L0:;
18002   __Pyx_RefNannyFinishContext();
18003   return __pyx_r;
18004 }
18005 
18006 /* "yt/utilities/lib/geometry_utils.pxd":326
18007  *
18008  * @cython.cdivision(True)
18009  * cdef inline np.uint64_t bounded_morton_split_relative_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
18010  *                                np.float64_t *DLE, np.float64_t *dds1, np.float64_t *dds2,
18011  *                                np.uint64_t *p2):
18012  */
18013 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_split_relative_dds(__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_float64_t __pyx_v_y,__pyx_t_5numpy_float64_t __pyx_v_z,__pyx_t_5numpy_float64_t * __pyx_v_DLE,__pyx_t_5numpy_float64_t * __pyx_v_dds1,__pyx_t_5numpy_float64_t * __pyx_v_dds2,__pyx_t_5numpy_uint64_t * __pyx_v_p2)18014 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_split_relative_dds(__pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y, __pyx_t_5numpy_float64_t __pyx_v_z, __pyx_t_5numpy_float64_t *__pyx_v_DLE, __pyx_t_5numpy_float64_t *__pyx_v_dds1, __pyx_t_5numpy_float64_t *__pyx_v_dds2, __pyx_t_5numpy_uint64_t *__pyx_v_p2) {
18015   __pyx_t_5numpy_float64_t __pyx_v_DLE2[3];
18016   __pyx_t_5numpy_uint64_t __pyx_v_mi2;
18017   __pyx_t_5numpy_uint64_t __pyx_r;
18018   __Pyx_RefNannyDeclarations
18019   __Pyx_RefNannySetupContext("bounded_morton_split_relative_dds", 0);
18020 
18021   /* "yt/utilities/lib/geometry_utils.pxd":331
18022  *     cdef np.float64_t DLE2[3]
18023  *     cdef np.uint64_t mi2
18024  *     DLE2[0] = DLE[0] + <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]             # <<<<<<<<<<<<<<
18025  *     DLE2[1] = DLE[1] + <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
18026  *     DLE2[2] = DLE[2] + <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
18027  */
18028   (__pyx_v_DLE2[0]) = ((__pyx_v_DLE[0]) + (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE[0])) / (__pyx_v_dds1[0])))) * (__pyx_v_dds1[0])));
18029 
18030   /* "yt/utilities/lib/geometry_utils.pxd":332
18031  *     cdef np.uint64_t mi2
18032  *     DLE2[0] = DLE[0] + <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
18033  *     DLE2[1] = DLE[1] + <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]             # <<<<<<<<<<<<<<
18034  *     DLE2[2] = DLE[2] + <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
18035  *     p2[0] = <np.uint64_t> ((x - DLE2[0])/dds2[0])
18036  */
18037   (__pyx_v_DLE2[1]) = ((__pyx_v_DLE[1]) + (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE[1])) / (__pyx_v_dds1[1])))) * (__pyx_v_dds1[1])));
18038 
18039   /* "yt/utilities/lib/geometry_utils.pxd":333
18040  *     DLE2[0] = DLE[0] + <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
18041  *     DLE2[1] = DLE[1] + <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
18042  *     DLE2[2] = DLE[2] + <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]             # <<<<<<<<<<<<<<
18043  *     p2[0] = <np.uint64_t> ((x - DLE2[0])/dds2[0])
18044  *     p2[1] = <np.uint64_t> ((y - DLE2[1])/dds2[1])
18045  */
18046   (__pyx_v_DLE2[2]) = ((__pyx_v_DLE[2]) + (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE[2])) / (__pyx_v_dds1[2])))) * (__pyx_v_dds1[2])));
18047 
18048   /* "yt/utilities/lib/geometry_utils.pxd":334
18049  *     DLE2[1] = DLE[1] + <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
18050  *     DLE2[2] = DLE[2] + <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
18051  *     p2[0] = <np.uint64_t> ((x - DLE2[0])/dds2[0])             # <<<<<<<<<<<<<<
18052  *     p2[1] = <np.uint64_t> ((y - DLE2[1])/dds2[1])
18053  *     p2[2] = <np.uint64_t> ((z - DLE2[2])/dds2[2])
18054  */
18055   (__pyx_v_p2[0]) = ((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE2[0])) / (__pyx_v_dds2[0])));
18056 
18057   /* "yt/utilities/lib/geometry_utils.pxd":335
18058  *     DLE2[2] = DLE[2] + <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
18059  *     p2[0] = <np.uint64_t> ((x - DLE2[0])/dds2[0])
18060  *     p2[1] = <np.uint64_t> ((y - DLE2[1])/dds2[1])             # <<<<<<<<<<<<<<
18061  *     p2[2] = <np.uint64_t> ((z - DLE2[2])/dds2[2])
18062  *     mi2 = encode_morton_64bit(p2[0], p2[1], p2[2])
18063  */
18064   (__pyx_v_p2[1]) = ((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE2[1])) / (__pyx_v_dds2[1])));
18065 
18066   /* "yt/utilities/lib/geometry_utils.pxd":336
18067  *     p2[0] = <np.uint64_t> ((x - DLE2[0])/dds2[0])
18068  *     p2[1] = <np.uint64_t> ((y - DLE2[1])/dds2[1])
18069  *     p2[2] = <np.uint64_t> ((z - DLE2[2])/dds2[2])             # <<<<<<<<<<<<<<
18070  *     mi2 = encode_morton_64bit(p2[0], p2[1], p2[2])
18071  *     return mi2
18072  */
18073   (__pyx_v_p2[2]) = ((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE2[2])) / (__pyx_v_dds2[2])));
18074 
18075   /* "yt/utilities/lib/geometry_utils.pxd":337
18076  *     p2[1] = <np.uint64_t> ((y - DLE2[1])/dds2[1])
18077  *     p2[2] = <np.uint64_t> ((z - DLE2[2])/dds2[2])
18078  *     mi2 = encode_morton_64bit(p2[0], p2[1], p2[2])             # <<<<<<<<<<<<<<
18079  *     return mi2
18080  *
18081  */
18082   __pyx_v_mi2 = __pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit((__pyx_v_p2[0]), (__pyx_v_p2[1]), (__pyx_v_p2[2]));
18083 
18084   /* "yt/utilities/lib/geometry_utils.pxd":338
18085  *     p2[2] = <np.uint64_t> ((z - DLE2[2])/dds2[2])
18086  *     mi2 = encode_morton_64bit(p2[0], p2[1], p2[2])
18087  *     return mi2             # <<<<<<<<<<<<<<
18088  *
18089  *
18090  */
18091   __pyx_r = __pyx_v_mi2;
18092   goto __pyx_L0;
18093 
18094   /* "yt/utilities/lib/geometry_utils.pxd":326
18095  *
18096  * @cython.cdivision(True)
18097  * cdef inline np.uint64_t bounded_morton_split_relative_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
18098  *                                np.float64_t *DLE, np.float64_t *dds1, np.float64_t *dds2,
18099  *                                np.uint64_t *p2):
18100  */
18101 
18102   /* function exit code */
18103   __pyx_L0:;
18104   __Pyx_RefNannyFinishContext();
18105   return __pyx_r;
18106 }
18107 
18108 /* "selection_routines.pxd":81
18109  *     cdef public SelectorObject sel2
18110  *
18111  * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2,             # <<<<<<<<<<<<<<
18112  *                                         np.float64_t dw, bint periodic) nogil:
18113  *     cdef np.float64_t rel = x1 - x2
18114  */
18115 
__pyx_f_2yt_8geometry_18selection_routines__periodic_dist(__pyx_t_5numpy_float64_t __pyx_v_x1,__pyx_t_5numpy_float64_t __pyx_v_x2,__pyx_t_5numpy_float64_t __pyx_v_dw,int __pyx_v_periodic)18116 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_18selection_routines__periodic_dist(__pyx_t_5numpy_float64_t __pyx_v_x1, __pyx_t_5numpy_float64_t __pyx_v_x2, __pyx_t_5numpy_float64_t __pyx_v_dw, int __pyx_v_periodic) {
18117   __pyx_t_5numpy_float64_t __pyx_v_rel;
18118   __pyx_t_5numpy_float64_t __pyx_r;
18119   int __pyx_t_1;
18120 
18121   /* "selection_routines.pxd":83
18122  * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2,
18123  *                                         np.float64_t dw, bint periodic) nogil:
18124  *     cdef np.float64_t rel = x1 - x2             # <<<<<<<<<<<<<<
18125  *     if not periodic: return rel
18126  *     if rel > dw * 0.5:
18127  */
18128   __pyx_v_rel = (__pyx_v_x1 - __pyx_v_x2);
18129 
18130   /* "selection_routines.pxd":84
18131  *                                         np.float64_t dw, bint periodic) nogil:
18132  *     cdef np.float64_t rel = x1 - x2
18133  *     if not periodic: return rel             # <<<<<<<<<<<<<<
18134  *     if rel > dw * 0.5:
18135  *         rel -= dw
18136  */
18137   __pyx_t_1 = ((!(__pyx_v_periodic != 0)) != 0);
18138   if (__pyx_t_1) {
18139     __pyx_r = __pyx_v_rel;
18140     goto __pyx_L0;
18141   }
18142 
18143   /* "selection_routines.pxd":85
18144  *     cdef np.float64_t rel = x1 - x2
18145  *     if not periodic: return rel
18146  *     if rel > dw * 0.5:             # <<<<<<<<<<<<<<
18147  *         rel -= dw
18148  *     elif rel < -dw * 0.5:
18149  */
18150   __pyx_t_1 = ((__pyx_v_rel > (__pyx_v_dw * 0.5)) != 0);
18151   if (__pyx_t_1) {
18152 
18153     /* "selection_routines.pxd":86
18154  *     if not periodic: return rel
18155  *     if rel > dw * 0.5:
18156  *         rel -= dw             # <<<<<<<<<<<<<<
18157  *     elif rel < -dw * 0.5:
18158  *         rel += dw
18159  */
18160     __pyx_v_rel = (__pyx_v_rel - __pyx_v_dw);
18161 
18162     /* "selection_routines.pxd":85
18163  *     cdef np.float64_t rel = x1 - x2
18164  *     if not periodic: return rel
18165  *     if rel > dw * 0.5:             # <<<<<<<<<<<<<<
18166  *         rel -= dw
18167  *     elif rel < -dw * 0.5:
18168  */
18169     goto __pyx_L4;
18170   }
18171 
18172   /* "selection_routines.pxd":87
18173  *     if rel > dw * 0.5:
18174  *         rel -= dw
18175  *     elif rel < -dw * 0.5:             # <<<<<<<<<<<<<<
18176  *         rel += dw
18177  *     return rel
18178  */
18179   __pyx_t_1 = ((__pyx_v_rel < ((-__pyx_v_dw) * 0.5)) != 0);
18180   if (__pyx_t_1) {
18181 
18182     /* "selection_routines.pxd":88
18183  *         rel -= dw
18184  *     elif rel < -dw * 0.5:
18185  *         rel += dw             # <<<<<<<<<<<<<<
18186  *     return rel
18187  */
18188     __pyx_v_rel = (__pyx_v_rel + __pyx_v_dw);
18189 
18190     /* "selection_routines.pxd":87
18191  *     if rel > dw * 0.5:
18192  *         rel -= dw
18193  *     elif rel < -dw * 0.5:             # <<<<<<<<<<<<<<
18194  *         rel += dw
18195  *     return rel
18196  */
18197   }
18198   __pyx_L4:;
18199 
18200   /* "selection_routines.pxd":89
18201  *     elif rel < -dw * 0.5:
18202  *         rel += dw
18203  *     return rel             # <<<<<<<<<<<<<<
18204  */
18205   __pyx_r = __pyx_v_rel;
18206   goto __pyx_L0;
18207 
18208   /* "selection_routines.pxd":81
18209  *     cdef public SelectorObject sel2
18210  *
18211  * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2,             # <<<<<<<<<<<<<<
18212  *                                         np.float64_t dw, bint periodic) nogil:
18213  *     cdef np.float64_t rel = x1 - x2
18214  */
18215 
18216   /* function exit code */
18217   __pyx_L0:;
18218   return __pyx_r;
18219 }
18220 
18221 /* "oct_container.pxd":48
18222  *
18223  * cdef class OctObjectPool(ObjectPool):
18224  *     cdef inline OctAllocationContainer *get_cont(self, int i):             # <<<<<<<<<<<<<<
18225  *         return <OctAllocationContainer*> (&self.containers[i])
18226  *
18227  */
18228 
__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool * __pyx_v_self,int __pyx_v_i)18229 static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i) {
18230   struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_r;
18231   __Pyx_RefNannyDeclarations
18232   __Pyx_RefNannySetupContext("get_cont", 0);
18233 
18234   /* "oct_container.pxd":49
18235  * cdef class OctObjectPool(ObjectPool):
18236  *     cdef inline OctAllocationContainer *get_cont(self, int i):
18237  *         return <OctAllocationContainer*> (&self.containers[i])             # <<<<<<<<<<<<<<
18238  *
18239  * cdef OctList *OctList_append(OctList *list, Oct *o)
18240  */
18241   __pyx_r = ((struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *)(&(__pyx_v_self->__pyx_base.containers[__pyx_v_i])));
18242   goto __pyx_L0;
18243 
18244   /* "oct_container.pxd":48
18245  *
18246  * cdef class OctObjectPool(ObjectPool):
18247  *     cdef inline OctAllocationContainer *get_cont(self, int i):             # <<<<<<<<<<<<<<
18248  *         return <OctAllocationContainer*> (&self.containers[i])
18249  *
18250  */
18251 
18252   /* function exit code */
18253   __pyx_L0:;
18254   __Pyx_RefNannyFinishContext();
18255   return __pyx_r;
18256 }
18257 
18258 /* "particle_deposit.pxd":27
18259  *     void *alloca(int)
18260  *
18261  * cdef inline int gind(int i, int j, int k, int dims[3]):             # <<<<<<<<<<<<<<
18262  *     # The ordering is such that we want i to vary the slowest in this instance,
18263  *     # even though in other instances it varies the fastest.  To see this in
18264  */
18265 
__pyx_f_2yt_8geometry_16particle_deposit_gind(int __pyx_v_i,int __pyx_v_j,int __pyx_v_k,int * __pyx_v_dims)18266 static CYTHON_INLINE int __pyx_f_2yt_8geometry_16particle_deposit_gind(int __pyx_v_i, int __pyx_v_j, int __pyx_v_k, int *__pyx_v_dims) {
18267   int __pyx_r;
18268   __Pyx_RefNannyDeclarations
18269   __Pyx_RefNannySetupContext("gind", 0);
18270 
18271   /* "particle_deposit.pxd":32
18272  *     # action, try looking at the results of an n_ref=256 particle CIC plot,
18273  *     # which shows it the most clearly.
18274  *     return ((i*dims[1])+j)*dims[2]+k             # <<<<<<<<<<<<<<
18275  *
18276  *
18277  */
18278   __pyx_r = ((((__pyx_v_i * (__pyx_v_dims[1])) + __pyx_v_j) * (__pyx_v_dims[2])) + __pyx_v_k);
18279   goto __pyx_L0;
18280 
18281   /* "particle_deposit.pxd":27
18282  *     void *alloca(int)
18283  *
18284  * cdef inline int gind(int i, int j, int k, int dims[3]):             # <<<<<<<<<<<<<<
18285  *     # The ordering is such that we want i to vary the slowest in this instance,
18286  *     # even though in other instances it varies the fastest.  To see this in
18287  */
18288 
18289   /* function exit code */
18290   __pyx_L0:;
18291   __Pyx_RefNannyFinishContext();
18292   return __pyx_r;
18293 }
18294 
18295 /* "particle_deposit.pxd":39
18296  * ####################################################
18297  *
18298  * cdef inline np.float64_t sph_kernel_cubic(np.float64_t x) nogil:             # <<<<<<<<<<<<<<
18299  *     cdef np.float64_t kernel
18300  *     # C is 8/pi
18301  */
18302 
__pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_cubic(__pyx_t_5numpy_float64_t __pyx_v_x)18303 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_cubic(__pyx_t_5numpy_float64_t __pyx_v_x) {
18304   __pyx_t_5numpy_float64_t __pyx_v_kernel;
18305   __pyx_t_5numpy_float64_t __pyx_v_C;
18306   __pyx_t_5numpy_float64_t __pyx_r;
18307   int __pyx_t_1;
18308   int __pyx_t_2;
18309 
18310   /* "particle_deposit.pxd":42
18311  *     cdef np.float64_t kernel
18312  *     # C is 8/pi
18313  *     cdef np.float64_t C = 2.5464790894703255             # <<<<<<<<<<<<<<
18314  *     if x <= 0.5:
18315  *         kernel = 1.-6.*x*x*(1.-x)
18316  */
18317   __pyx_v_C = 2.5464790894703255;
18318 
18319   /* "particle_deposit.pxd":43
18320  *     # C is 8/pi
18321  *     cdef np.float64_t C = 2.5464790894703255
18322  *     if x <= 0.5:             # <<<<<<<<<<<<<<
18323  *         kernel = 1.-6.*x*x*(1.-x)
18324  *     elif x>0.5 and x<=1.0:
18325  */
18326   __pyx_t_1 = ((__pyx_v_x <= 0.5) != 0);
18327   if (__pyx_t_1) {
18328 
18329     /* "particle_deposit.pxd":44
18330  *     cdef np.float64_t C = 2.5464790894703255
18331  *     if x <= 0.5:
18332  *         kernel = 1.-6.*x*x*(1.-x)             # <<<<<<<<<<<<<<
18333  *     elif x>0.5 and x<=1.0:
18334  *         kernel = 2.*(1.-x)*(1.-x)*(1.-x)
18335  */
18336     __pyx_v_kernel = (1. - (((6. * __pyx_v_x) * __pyx_v_x) * (1. - __pyx_v_x)));
18337 
18338     /* "particle_deposit.pxd":43
18339  *     # C is 8/pi
18340  *     cdef np.float64_t C = 2.5464790894703255
18341  *     if x <= 0.5:             # <<<<<<<<<<<<<<
18342  *         kernel = 1.-6.*x*x*(1.-x)
18343  *     elif x>0.5 and x<=1.0:
18344  */
18345     goto __pyx_L3;
18346   }
18347 
18348   /* "particle_deposit.pxd":45
18349  *     if x <= 0.5:
18350  *         kernel = 1.-6.*x*x*(1.-x)
18351  *     elif x>0.5 and x<=1.0:             # <<<<<<<<<<<<<<
18352  *         kernel = 2.*(1.-x)*(1.-x)*(1.-x)
18353  *     else:
18354  */
18355   __pyx_t_2 = ((__pyx_v_x > 0.5) != 0);
18356   if (__pyx_t_2) {
18357   } else {
18358     __pyx_t_1 = __pyx_t_2;
18359     goto __pyx_L4_bool_binop_done;
18360   }
18361   __pyx_t_2 = ((__pyx_v_x <= 1.0) != 0);
18362   __pyx_t_1 = __pyx_t_2;
18363   __pyx_L4_bool_binop_done:;
18364   if (__pyx_t_1) {
18365 
18366     /* "particle_deposit.pxd":46
18367  *         kernel = 1.-6.*x*x*(1.-x)
18368  *     elif x>0.5 and x<=1.0:
18369  *         kernel = 2.*(1.-x)*(1.-x)*(1.-x)             # <<<<<<<<<<<<<<
18370  *     else:
18371  *         kernel = 0.
18372  */
18373     __pyx_v_kernel = (((2. * (1. - __pyx_v_x)) * (1. - __pyx_v_x)) * (1. - __pyx_v_x));
18374 
18375     /* "particle_deposit.pxd":45
18376  *     if x <= 0.5:
18377  *         kernel = 1.-6.*x*x*(1.-x)
18378  *     elif x>0.5 and x<=1.0:             # <<<<<<<<<<<<<<
18379  *         kernel = 2.*(1.-x)*(1.-x)*(1.-x)
18380  *     else:
18381  */
18382     goto __pyx_L3;
18383   }
18384 
18385   /* "particle_deposit.pxd":48
18386  *         kernel = 2.*(1.-x)*(1.-x)*(1.-x)
18387  *     else:
18388  *         kernel = 0.             # <<<<<<<<<<<<<<
18389  *     return kernel * C
18390  *
18391  */
18392   /*else*/ {
18393     __pyx_v_kernel = 0.;
18394   }
18395   __pyx_L3:;
18396 
18397   /* "particle_deposit.pxd":49
18398  *     else:
18399  *         kernel = 0.
18400  *     return kernel * C             # <<<<<<<<<<<<<<
18401  *
18402  * ########################################################
18403  */
18404   __pyx_r = (__pyx_v_kernel * __pyx_v_C);
18405   goto __pyx_L0;
18406 
18407   /* "particle_deposit.pxd":39
18408  * ####################################################
18409  *
18410  * cdef inline np.float64_t sph_kernel_cubic(np.float64_t x) nogil:             # <<<<<<<<<<<<<<
18411  *     cdef np.float64_t kernel
18412  *     # C is 8/pi
18413  */
18414 
18415   /* function exit code */
18416   __pyx_L0:;
18417   return __pyx_r;
18418 }
18419 
18420 /* "particle_deposit.pxd":56
18421  *
18422  * # quartic spline
18423  * cdef inline np.float64_t sph_kernel_quartic(np.float64_t x) nogil:             # <<<<<<<<<<<<<<
18424  *     cdef np.float64_t kernel
18425  *     cdef np.float64_t C = 9.71404681957369  # 5.**6/512/np.pi
18426  */
18427 
__pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quartic(__pyx_t_5numpy_float64_t __pyx_v_x)18428 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quartic(__pyx_t_5numpy_float64_t __pyx_v_x) {
18429   __pyx_t_5numpy_float64_t __pyx_v_kernel;
18430   __pyx_t_5numpy_float64_t __pyx_v_C;
18431   __pyx_t_5numpy_float64_t __pyx_r;
18432   int __pyx_t_1;
18433 
18434   /* "particle_deposit.pxd":58
18435  * cdef inline np.float64_t sph_kernel_quartic(np.float64_t x) nogil:
18436  *     cdef np.float64_t kernel
18437  *     cdef np.float64_t C = 9.71404681957369  # 5.**6/512/np.pi             # <<<<<<<<<<<<<<
18438  *     if x < 1:
18439  *         kernel = (1.-x)**4
18440  */
18441   __pyx_v_C = 9.71404681957369;
18442 
18443   /* "particle_deposit.pxd":59
18444  *     cdef np.float64_t kernel
18445  *     cdef np.float64_t C = 9.71404681957369  # 5.**6/512/np.pi
18446  *     if x < 1:             # <<<<<<<<<<<<<<
18447  *         kernel = (1.-x)**4
18448  *         if x < 3./5:
18449  */
18450   __pyx_t_1 = ((__pyx_v_x < 1.0) != 0);
18451   if (__pyx_t_1) {
18452 
18453     /* "particle_deposit.pxd":60
18454  *     cdef np.float64_t C = 9.71404681957369  # 5.**6/512/np.pi
18455  *     if x < 1:
18456  *         kernel = (1.-x)**4             # <<<<<<<<<<<<<<
18457  *         if x < 3./5:
18458  *             kernel -= 5*(3./5-x)**4
18459  */
18460     __pyx_v_kernel = pow((1. - __pyx_v_x), 4.0);
18461 
18462     /* "particle_deposit.pxd":61
18463  *     if x < 1:
18464  *         kernel = (1.-x)**4
18465  *         if x < 3./5:             # <<<<<<<<<<<<<<
18466  *             kernel -= 5*(3./5-x)**4
18467  *             if x < 1./5:
18468  */
18469     __pyx_t_1 = ((__pyx_v_x < (3. / 5.0)) != 0);
18470     if (__pyx_t_1) {
18471 
18472       /* "particle_deposit.pxd":62
18473  *         kernel = (1.-x)**4
18474  *         if x < 3./5:
18475  *             kernel -= 5*(3./5-x)**4             # <<<<<<<<<<<<<<
18476  *             if x < 1./5:
18477  *                 kernel += 10*(1./5-x)**4
18478  */
18479       __pyx_v_kernel = (__pyx_v_kernel - (5.0 * pow(((3. / 5.0) - __pyx_v_x), 4.0)));
18480 
18481       /* "particle_deposit.pxd":63
18482  *         if x < 3./5:
18483  *             kernel -= 5*(3./5-x)**4
18484  *             if x < 1./5:             # <<<<<<<<<<<<<<
18485  *                 kernel += 10*(1./5-x)**4
18486  *     else:
18487  */
18488       __pyx_t_1 = ((__pyx_v_x < (1. / 5.0)) != 0);
18489       if (__pyx_t_1) {
18490 
18491         /* "particle_deposit.pxd":64
18492  *             kernel -= 5*(3./5-x)**4
18493  *             if x < 1./5:
18494  *                 kernel += 10*(1./5-x)**4             # <<<<<<<<<<<<<<
18495  *     else:
18496  *         kernel = 0.
18497  */
18498         __pyx_v_kernel = (__pyx_v_kernel + (10.0 * pow(((1. / 5.0) - __pyx_v_x), 4.0)));
18499 
18500         /* "particle_deposit.pxd":63
18501  *         if x < 3./5:
18502  *             kernel -= 5*(3./5-x)**4
18503  *             if x < 1./5:             # <<<<<<<<<<<<<<
18504  *                 kernel += 10*(1./5-x)**4
18505  *     else:
18506  */
18507       }
18508 
18509       /* "particle_deposit.pxd":61
18510  *     if x < 1:
18511  *         kernel = (1.-x)**4
18512  *         if x < 3./5:             # <<<<<<<<<<<<<<
18513  *             kernel -= 5*(3./5-x)**4
18514  *             if x < 1./5:
18515  */
18516     }
18517 
18518     /* "particle_deposit.pxd":59
18519  *     cdef np.float64_t kernel
18520  *     cdef np.float64_t C = 9.71404681957369  # 5.**6/512/np.pi
18521  *     if x < 1:             # <<<<<<<<<<<<<<
18522  *         kernel = (1.-x)**4
18523  *         if x < 3./5:
18524  */
18525     goto __pyx_L3;
18526   }
18527 
18528   /* "particle_deposit.pxd":66
18529  *                 kernel += 10*(1./5-x)**4
18530  *     else:
18531  *         kernel = 0.             # <<<<<<<<<<<<<<
18532  *     return kernel * C
18533  *
18534  */
18535   /*else*/ {
18536     __pyx_v_kernel = 0.;
18537   }
18538   __pyx_L3:;
18539 
18540   /* "particle_deposit.pxd":67
18541  *     else:
18542  *         kernel = 0.
18543  *     return kernel * C             # <<<<<<<<<<<<<<
18544  *
18545  * # quintic spline
18546  */
18547   __pyx_r = (__pyx_v_kernel * __pyx_v_C);
18548   goto __pyx_L0;
18549 
18550   /* "particle_deposit.pxd":56
18551  *
18552  * # quartic spline
18553  * cdef inline np.float64_t sph_kernel_quartic(np.float64_t x) nogil:             # <<<<<<<<<<<<<<
18554  *     cdef np.float64_t kernel
18555  *     cdef np.float64_t C = 9.71404681957369  # 5.**6/512/np.pi
18556  */
18557 
18558   /* function exit code */
18559   __pyx_L0:;
18560   return __pyx_r;
18561 }
18562 
18563 /* "particle_deposit.pxd":70
18564  *
18565  * # quintic spline
18566  * cdef inline np.float64_t sph_kernel_quintic(np.float64_t x) nogil:             # <<<<<<<<<<<<<<
18567  *     cdef np.float64_t kernel
18568  *     cdef np.float64_t C = 17.403593027098754  # 3.**7/40/np.pi
18569  */
18570 
__pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quintic(__pyx_t_5numpy_float64_t __pyx_v_x)18571 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quintic(__pyx_t_5numpy_float64_t __pyx_v_x) {
18572   __pyx_t_5numpy_float64_t __pyx_v_kernel;
18573   __pyx_t_5numpy_float64_t __pyx_v_C;
18574   __pyx_t_5numpy_float64_t __pyx_r;
18575   int __pyx_t_1;
18576 
18577   /* "particle_deposit.pxd":72
18578  * cdef inline np.float64_t sph_kernel_quintic(np.float64_t x) nogil:
18579  *     cdef np.float64_t kernel
18580  *     cdef np.float64_t C = 17.403593027098754  # 3.**7/40/np.pi             # <<<<<<<<<<<<<<
18581  *     if x < 1:
18582  *         kernel = (1.-x)**5
18583  */
18584   __pyx_v_C = 17.403593027098754;
18585 
18586   /* "particle_deposit.pxd":73
18587  *     cdef np.float64_t kernel
18588  *     cdef np.float64_t C = 17.403593027098754  # 3.**7/40/np.pi
18589  *     if x < 1:             # <<<<<<<<<<<<<<
18590  *         kernel = (1.-x)**5
18591  *         if x < 2./3:
18592  */
18593   __pyx_t_1 = ((__pyx_v_x < 1.0) != 0);
18594   if (__pyx_t_1) {
18595 
18596     /* "particle_deposit.pxd":74
18597  *     cdef np.float64_t C = 17.403593027098754  # 3.**7/40/np.pi
18598  *     if x < 1:
18599  *         kernel = (1.-x)**5             # <<<<<<<<<<<<<<
18600  *         if x < 2./3:
18601  *             kernel -= 6*(2./3-x)**5
18602  */
18603     __pyx_v_kernel = pow((1. - __pyx_v_x), 5.0);
18604 
18605     /* "particle_deposit.pxd":75
18606  *     if x < 1:
18607  *         kernel = (1.-x)**5
18608  *         if x < 2./3:             # <<<<<<<<<<<<<<
18609  *             kernel -= 6*(2./3-x)**5
18610  *             if x < 1./3:
18611  */
18612     __pyx_t_1 = ((__pyx_v_x < (2. / 3.0)) != 0);
18613     if (__pyx_t_1) {
18614 
18615       /* "particle_deposit.pxd":76
18616  *         kernel = (1.-x)**5
18617  *         if x < 2./3:
18618  *             kernel -= 6*(2./3-x)**5             # <<<<<<<<<<<<<<
18619  *             if x < 1./3:
18620  *                 kernel += 15*(1./3-x)**5
18621  */
18622       __pyx_v_kernel = (__pyx_v_kernel - (6.0 * pow(((2. / 3.0) - __pyx_v_x), 5.0)));
18623 
18624       /* "particle_deposit.pxd":77
18625  *         if x < 2./3:
18626  *             kernel -= 6*(2./3-x)**5
18627  *             if x < 1./3:             # <<<<<<<<<<<<<<
18628  *                 kernel += 15*(1./3-x)**5
18629  *     else:
18630  */
18631       __pyx_t_1 = ((__pyx_v_x < (1. / 3.0)) != 0);
18632       if (__pyx_t_1) {
18633 
18634         /* "particle_deposit.pxd":78
18635  *             kernel -= 6*(2./3-x)**5
18636  *             if x < 1./3:
18637  *                 kernel += 15*(1./3-x)**5             # <<<<<<<<<<<<<<
18638  *     else:
18639  *         kernel = 0.
18640  */
18641         __pyx_v_kernel = (__pyx_v_kernel + (15.0 * pow(((1. / 3.0) - __pyx_v_x), 5.0)));
18642 
18643         /* "particle_deposit.pxd":77
18644  *         if x < 2./3:
18645  *             kernel -= 6*(2./3-x)**5
18646  *             if x < 1./3:             # <<<<<<<<<<<<<<
18647  *                 kernel += 15*(1./3-x)**5
18648  *     else:
18649  */
18650       }
18651 
18652       /* "particle_deposit.pxd":75
18653  *     if x < 1:
18654  *         kernel = (1.-x)**5
18655  *         if x < 2./3:             # <<<<<<<<<<<<<<
18656  *             kernel -= 6*(2./3-x)**5
18657  *             if x < 1./3:
18658  */
18659     }
18660 
18661     /* "particle_deposit.pxd":73
18662  *     cdef np.float64_t kernel
18663  *     cdef np.float64_t C = 17.403593027098754  # 3.**7/40/np.pi
18664  *     if x < 1:             # <<<<<<<<<<<<<<
18665  *         kernel = (1.-x)**5
18666  *         if x < 2./3:
18667  */
18668     goto __pyx_L3;
18669   }
18670 
18671   /* "particle_deposit.pxd":80
18672  *                 kernel += 15*(1./3-x)**5
18673  *     else:
18674  *         kernel = 0.             # <<<<<<<<<<<<<<
18675  *     return kernel * C
18676  *
18677  */
18678   /*else*/ {
18679     __pyx_v_kernel = 0.;
18680   }
18681   __pyx_L3:;
18682 
18683   /* "particle_deposit.pxd":81
18684  *     else:
18685  *         kernel = 0.
18686  *     return kernel * C             # <<<<<<<<<<<<<<
18687  *
18688  * # Wendland C2
18689  */
18690   __pyx_r = (__pyx_v_kernel * __pyx_v_C);
18691   goto __pyx_L0;
18692 
18693   /* "particle_deposit.pxd":70
18694  *
18695  * # quintic spline
18696  * cdef inline np.float64_t sph_kernel_quintic(np.float64_t x) nogil:             # <<<<<<<<<<<<<<
18697  *     cdef np.float64_t kernel
18698  *     cdef np.float64_t C = 17.403593027098754  # 3.**7/40/np.pi
18699  */
18700 
18701   /* function exit code */
18702   __pyx_L0:;
18703   return __pyx_r;
18704 }
18705 
18706 /* "particle_deposit.pxd":84
18707  *
18708  * # Wendland C2
18709  * cdef inline np.float64_t sph_kernel_wendland2(np.float64_t x) nogil:             # <<<<<<<<<<<<<<
18710  *     cdef np.float64_t kernel
18711  *     cdef np.float64_t C = 3.3422538049298023  # 21./2/np.pi
18712  */
18713 
__pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland2(__pyx_t_5numpy_float64_t __pyx_v_x)18714 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland2(__pyx_t_5numpy_float64_t __pyx_v_x) {
18715   __pyx_t_5numpy_float64_t __pyx_v_kernel;
18716   __pyx_t_5numpy_float64_t __pyx_v_C;
18717   __pyx_t_5numpy_float64_t __pyx_r;
18718   int __pyx_t_1;
18719 
18720   /* "particle_deposit.pxd":86
18721  * cdef inline np.float64_t sph_kernel_wendland2(np.float64_t x) nogil:
18722  *     cdef np.float64_t kernel
18723  *     cdef np.float64_t C = 3.3422538049298023  # 21./2/np.pi             # <<<<<<<<<<<<<<
18724  *     if x < 1:
18725  *         kernel = (1.-x)**4 * (1+4*x)
18726  */
18727   __pyx_v_C = 3.3422538049298023;
18728 
18729   /* "particle_deposit.pxd":87
18730  *     cdef np.float64_t kernel
18731  *     cdef np.float64_t C = 3.3422538049298023  # 21./2/np.pi
18732  *     if x < 1:             # <<<<<<<<<<<<<<
18733  *         kernel = (1.-x)**4 * (1+4*x)
18734  *     else:
18735  */
18736   __pyx_t_1 = ((__pyx_v_x < 1.0) != 0);
18737   if (__pyx_t_1) {
18738 
18739     /* "particle_deposit.pxd":88
18740  *     cdef np.float64_t C = 3.3422538049298023  # 21./2/np.pi
18741  *     if x < 1:
18742  *         kernel = (1.-x)**4 * (1+4*x)             # <<<<<<<<<<<<<<
18743  *     else:
18744  *         kernel = 0.
18745  */
18746     __pyx_v_kernel = (pow((1. - __pyx_v_x), 4.0) * (1.0 + (4.0 * __pyx_v_x)));
18747 
18748     /* "particle_deposit.pxd":87
18749  *     cdef np.float64_t kernel
18750  *     cdef np.float64_t C = 3.3422538049298023  # 21./2/np.pi
18751  *     if x < 1:             # <<<<<<<<<<<<<<
18752  *         kernel = (1.-x)**4 * (1+4*x)
18753  *     else:
18754  */
18755     goto __pyx_L3;
18756   }
18757 
18758   /* "particle_deposit.pxd":90
18759  *         kernel = (1.-x)**4 * (1+4*x)
18760  *     else:
18761  *         kernel = 0.             # <<<<<<<<<<<<<<
18762  *     return kernel * C
18763  *
18764  */
18765   /*else*/ {
18766     __pyx_v_kernel = 0.;
18767   }
18768   __pyx_L3:;
18769 
18770   /* "particle_deposit.pxd":91
18771  *     else:
18772  *         kernel = 0.
18773  *     return kernel * C             # <<<<<<<<<<<<<<
18774  *
18775  * # Wendland C4
18776  */
18777   __pyx_r = (__pyx_v_kernel * __pyx_v_C);
18778   goto __pyx_L0;
18779 
18780   /* "particle_deposit.pxd":84
18781  *
18782  * # Wendland C2
18783  * cdef inline np.float64_t sph_kernel_wendland2(np.float64_t x) nogil:             # <<<<<<<<<<<<<<
18784  *     cdef np.float64_t kernel
18785  *     cdef np.float64_t C = 3.3422538049298023  # 21./2/np.pi
18786  */
18787 
18788   /* function exit code */
18789   __pyx_L0:;
18790   return __pyx_r;
18791 }
18792 
18793 /* "particle_deposit.pxd":94
18794  *
18795  * # Wendland C4
18796  * cdef inline np.float64_t sph_kernel_wendland4(np.float64_t x) nogil:             # <<<<<<<<<<<<<<
18797  *     cdef np.float64_t kernel
18798  *     cdef np.float64_t C = 4.923856051905513  # 495./32/np.pi
18799  */
18800 
__pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland4(__pyx_t_5numpy_float64_t __pyx_v_x)18801 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland4(__pyx_t_5numpy_float64_t __pyx_v_x) {
18802   __pyx_t_5numpy_float64_t __pyx_v_kernel;
18803   __pyx_t_5numpy_float64_t __pyx_v_C;
18804   __pyx_t_5numpy_float64_t __pyx_r;
18805   int __pyx_t_1;
18806 
18807   /* "particle_deposit.pxd":96
18808  * cdef inline np.float64_t sph_kernel_wendland4(np.float64_t x) nogil:
18809  *     cdef np.float64_t kernel
18810  *     cdef np.float64_t C = 4.923856051905513  # 495./32/np.pi             # <<<<<<<<<<<<<<
18811  *     if x < 1:
18812  *         kernel = (1.-x)**6 * (1+6*x+35./3*x**2)
18813  */
18814   __pyx_v_C = 4.923856051905513;
18815 
18816   /* "particle_deposit.pxd":97
18817  *     cdef np.float64_t kernel
18818  *     cdef np.float64_t C = 4.923856051905513  # 495./32/np.pi
18819  *     if x < 1:             # <<<<<<<<<<<<<<
18820  *         kernel = (1.-x)**6 * (1+6*x+35./3*x**2)
18821  *     else:
18822  */
18823   __pyx_t_1 = ((__pyx_v_x < 1.0) != 0);
18824   if (__pyx_t_1) {
18825 
18826     /* "particle_deposit.pxd":98
18827  *     cdef np.float64_t C = 4.923856051905513  # 495./32/np.pi
18828  *     if x < 1:
18829  *         kernel = (1.-x)**6 * (1+6*x+35./3*x**2)             # <<<<<<<<<<<<<<
18830  *     else:
18831  *         kernel = 0.
18832  */
18833     __pyx_v_kernel = (pow((1. - __pyx_v_x), 6.0) * ((1.0 + (6.0 * __pyx_v_x)) + ((35. / 3.0) * pow(__pyx_v_x, 2.0))));
18834 
18835     /* "particle_deposit.pxd":97
18836  *     cdef np.float64_t kernel
18837  *     cdef np.float64_t C = 4.923856051905513  # 495./32/np.pi
18838  *     if x < 1:             # <<<<<<<<<<<<<<
18839  *         kernel = (1.-x)**6 * (1+6*x+35./3*x**2)
18840  *     else:
18841  */
18842     goto __pyx_L3;
18843   }
18844 
18845   /* "particle_deposit.pxd":100
18846  *         kernel = (1.-x)**6 * (1+6*x+35./3*x**2)
18847  *     else:
18848  *         kernel = 0.             # <<<<<<<<<<<<<<
18849  *     return kernel * C
18850  *
18851  */
18852   /*else*/ {
18853     __pyx_v_kernel = 0.;
18854   }
18855   __pyx_L3:;
18856 
18857   /* "particle_deposit.pxd":101
18858  *     else:
18859  *         kernel = 0.
18860  *     return kernel * C             # <<<<<<<<<<<<<<
18861  *
18862  * # Wendland C6
18863  */
18864   __pyx_r = (__pyx_v_kernel * __pyx_v_C);
18865   goto __pyx_L0;
18866 
18867   /* "particle_deposit.pxd":94
18868  *
18869  * # Wendland C4
18870  * cdef inline np.float64_t sph_kernel_wendland4(np.float64_t x) nogil:             # <<<<<<<<<<<<<<
18871  *     cdef np.float64_t kernel
18872  *     cdef np.float64_t C = 4.923856051905513  # 495./32/np.pi
18873  */
18874 
18875   /* function exit code */
18876   __pyx_L0:;
18877   return __pyx_r;
18878 }
18879 
18880 /* "particle_deposit.pxd":104
18881  *
18882  * # Wendland C6
18883  * cdef inline np.float64_t sph_kernel_wendland6(np.float64_t x) nogil:             # <<<<<<<<<<<<<<
18884  *     cdef np.float64_t kernel
18885  *     cdef np.float64_t C = 6.78895304126366  # 1365./64/np.pi
18886  */
18887 
__pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland6(__pyx_t_5numpy_float64_t __pyx_v_x)18888 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland6(__pyx_t_5numpy_float64_t __pyx_v_x) {
18889   __pyx_t_5numpy_float64_t __pyx_v_kernel;
18890   __pyx_t_5numpy_float64_t __pyx_v_C;
18891   __pyx_t_5numpy_float64_t __pyx_r;
18892   int __pyx_t_1;
18893 
18894   /* "particle_deposit.pxd":106
18895  * cdef inline np.float64_t sph_kernel_wendland6(np.float64_t x) nogil:
18896  *     cdef np.float64_t kernel
18897  *     cdef np.float64_t C = 6.78895304126366  # 1365./64/np.pi             # <<<<<<<<<<<<<<
18898  *     if x < 1:
18899  *         kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3)
18900  */
18901   __pyx_v_C = 6.78895304126366;
18902 
18903   /* "particle_deposit.pxd":107
18904  *     cdef np.float64_t kernel
18905  *     cdef np.float64_t C = 6.78895304126366  # 1365./64/np.pi
18906  *     if x < 1:             # <<<<<<<<<<<<<<
18907  *         kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3)
18908  *     else:
18909  */
18910   __pyx_t_1 = ((__pyx_v_x < 1.0) != 0);
18911   if (__pyx_t_1) {
18912 
18913     /* "particle_deposit.pxd":108
18914  *     cdef np.float64_t C = 6.78895304126366  # 1365./64/np.pi
18915  *     if x < 1:
18916  *         kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3)             # <<<<<<<<<<<<<<
18917  *     else:
18918  *         kernel = 0.
18919  */
18920     __pyx_v_kernel = (pow((1. - __pyx_v_x), 8.0) * (((1.0 + (8.0 * __pyx_v_x)) + (25.0 * pow(__pyx_v_x, 2.0))) + (32.0 * pow(__pyx_v_x, 3.0))));
18921 
18922     /* "particle_deposit.pxd":107
18923  *     cdef np.float64_t kernel
18924  *     cdef np.float64_t C = 6.78895304126366  # 1365./64/np.pi
18925  *     if x < 1:             # <<<<<<<<<<<<<<
18926  *         kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3)
18927  *     else:
18928  */
18929     goto __pyx_L3;
18930   }
18931 
18932   /* "particle_deposit.pxd":110
18933  *         kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3)
18934  *     else:
18935  *         kernel = 0.             # <<<<<<<<<<<<<<
18936  *     return kernel * C
18937  *
18938  */
18939   /*else*/ {
18940     __pyx_v_kernel = 0.;
18941   }
18942   __pyx_L3:;
18943 
18944   /* "particle_deposit.pxd":111
18945  *     else:
18946  *         kernel = 0.
18947  *     return kernel * C             # <<<<<<<<<<<<<<
18948  *
18949  * cdef inline np.float64_t sph_kernel_dummy(np.float64_t x) nogil:
18950  */
18951   __pyx_r = (__pyx_v_kernel * __pyx_v_C);
18952   goto __pyx_L0;
18953 
18954   /* "particle_deposit.pxd":104
18955  *
18956  * # Wendland C6
18957  * cdef inline np.float64_t sph_kernel_wendland6(np.float64_t x) nogil:             # <<<<<<<<<<<<<<
18958  *     cdef np.float64_t kernel
18959  *     cdef np.float64_t C = 6.78895304126366  # 1365./64/np.pi
18960  */
18961 
18962   /* function exit code */
18963   __pyx_L0:;
18964   return __pyx_r;
18965 }
18966 
18967 /* "particle_deposit.pxd":113
18968  *     return kernel * C
18969  *
18970  * cdef inline np.float64_t sph_kernel_dummy(np.float64_t x) nogil:             # <<<<<<<<<<<<<<
18971  *     return 0
18972  *
18973  */
18974 
__pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_dummy(CYTHON_UNUSED __pyx_t_5numpy_float64_t __pyx_v_x)18975 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_dummy(CYTHON_UNUSED __pyx_t_5numpy_float64_t __pyx_v_x) {
18976   __pyx_t_5numpy_float64_t __pyx_r;
18977 
18978   /* "particle_deposit.pxd":114
18979  *
18980  * cdef inline np.float64_t sph_kernel_dummy(np.float64_t x) nogil:
18981  *     return 0             # <<<<<<<<<<<<<<
18982  *
18983  * # I don't know the way to use a dict in a cdef class.
18984  */
18985   __pyx_r = 0.0;
18986   goto __pyx_L0;
18987 
18988   /* "particle_deposit.pxd":113
18989  *     return kernel * C
18990  *
18991  * cdef inline np.float64_t sph_kernel_dummy(np.float64_t x) nogil:             # <<<<<<<<<<<<<<
18992  *     return 0
18993  *
18994  */
18995 
18996   /* function exit code */
18997   __pyx_L0:;
18998   return __pyx_r;
18999 }
19000 
19001 /* "particle_deposit.pxd":120
19002  * # I manually created a function to lookup the kernel functions.
19003  * ctypedef np.float64_t (*kernel_func) (np.float64_t) nogil
19004  * cdef inline kernel_func get_kernel_func(str kernel_name) nogil:             # <<<<<<<<<<<<<<
19005  *     with gil:
19006  *         if kernel_name == 'cubic':
19007  */
19008 
__pyx_f_2yt_8geometry_16particle_deposit_get_kernel_func(PyObject * __pyx_v_kernel_name)19009 static CYTHON_INLINE __pyx_t_2yt_8geometry_16particle_deposit_kernel_func __pyx_f_2yt_8geometry_16particle_deposit_get_kernel_func(PyObject *__pyx_v_kernel_name) {
19010   __pyx_t_2yt_8geometry_16particle_deposit_kernel_func __pyx_r;
19011   __Pyx_RefNannyDeclarations
19012   int __pyx_t_1;
19013   int __pyx_t_2;
19014   #ifdef WITH_THREAD
19015   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19016   #endif
19017   __Pyx_RefNannySetupContext("get_kernel_func", 0);
19018   #ifdef WITH_THREAD
19019   __Pyx_PyGILState_Release(__pyx_gilstate_save);
19020   #endif
19021 
19022   /* "particle_deposit.pxd":121
19023  * ctypedef np.float64_t (*kernel_func) (np.float64_t) nogil
19024  * cdef inline kernel_func get_kernel_func(str kernel_name) nogil:
19025  *     with gil:             # <<<<<<<<<<<<<<
19026  *         if kernel_name == 'cubic':
19027  *             return sph_kernel_cubic
19028  */
19029   /*try:*/ {
19030     {
19031         #ifdef WITH_THREAD
19032         PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19033         #endif
19034         /*try:*/ {
19035 
19036           /* "particle_deposit.pxd":122
19037  * cdef inline kernel_func get_kernel_func(str kernel_name) nogil:
19038  *     with gil:
19039  *         if kernel_name == 'cubic':             # <<<<<<<<<<<<<<
19040  *             return sph_kernel_cubic
19041  *         elif kernel_name == 'quartic':
19042  */
19043           __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_cubic, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 122, __pyx_L7_error)
19044           __pyx_t_2 = (__pyx_t_1 != 0);
19045           if (__pyx_t_2) {
19046 
19047             /* "particle_deposit.pxd":123
19048  *     with gil:
19049  *         if kernel_name == 'cubic':
19050  *             return sph_kernel_cubic             # <<<<<<<<<<<<<<
19051  *         elif kernel_name == 'quartic':
19052  *             return sph_kernel_quartic
19053  */
19054             __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_cubic;
19055             goto __pyx_L6_return;
19056 
19057             /* "particle_deposit.pxd":122
19058  * cdef inline kernel_func get_kernel_func(str kernel_name) nogil:
19059  *     with gil:
19060  *         if kernel_name == 'cubic':             # <<<<<<<<<<<<<<
19061  *             return sph_kernel_cubic
19062  *         elif kernel_name == 'quartic':
19063  */
19064           }
19065 
19066           /* "particle_deposit.pxd":124
19067  *         if kernel_name == 'cubic':
19068  *             return sph_kernel_cubic
19069  *         elif kernel_name == 'quartic':             # <<<<<<<<<<<<<<
19070  *             return sph_kernel_quartic
19071  *         elif kernel_name == 'quintic':
19072  */
19073           __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_quartic, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(5, 124, __pyx_L7_error)
19074           __pyx_t_1 = (__pyx_t_2 != 0);
19075           if (__pyx_t_1) {
19076 
19077             /* "particle_deposit.pxd":125
19078  *             return sph_kernel_cubic
19079  *         elif kernel_name == 'quartic':
19080  *             return sph_kernel_quartic             # <<<<<<<<<<<<<<
19081  *         elif kernel_name == 'quintic':
19082  *             return sph_kernel_quintic
19083  */
19084             __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quartic;
19085             goto __pyx_L6_return;
19086 
19087             /* "particle_deposit.pxd":124
19088  *         if kernel_name == 'cubic':
19089  *             return sph_kernel_cubic
19090  *         elif kernel_name == 'quartic':             # <<<<<<<<<<<<<<
19091  *             return sph_kernel_quartic
19092  *         elif kernel_name == 'quintic':
19093  */
19094           }
19095 
19096           /* "particle_deposit.pxd":126
19097  *         elif kernel_name == 'quartic':
19098  *             return sph_kernel_quartic
19099  *         elif kernel_name == 'quintic':             # <<<<<<<<<<<<<<
19100  *             return sph_kernel_quintic
19101  *         elif kernel_name == 'wendland2':
19102  */
19103           __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_quintic, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 126, __pyx_L7_error)
19104           __pyx_t_2 = (__pyx_t_1 != 0);
19105           if (__pyx_t_2) {
19106 
19107             /* "particle_deposit.pxd":127
19108  *             return sph_kernel_quartic
19109  *         elif kernel_name == 'quintic':
19110  *             return sph_kernel_quintic             # <<<<<<<<<<<<<<
19111  *         elif kernel_name == 'wendland2':
19112  *             return sph_kernel_wendland2
19113  */
19114             __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quintic;
19115             goto __pyx_L6_return;
19116 
19117             /* "particle_deposit.pxd":126
19118  *         elif kernel_name == 'quartic':
19119  *             return sph_kernel_quartic
19120  *         elif kernel_name == 'quintic':             # <<<<<<<<<<<<<<
19121  *             return sph_kernel_quintic
19122  *         elif kernel_name == 'wendland2':
19123  */
19124           }
19125 
19126           /* "particle_deposit.pxd":128
19127  *         elif kernel_name == 'quintic':
19128  *             return sph_kernel_quintic
19129  *         elif kernel_name == 'wendland2':             # <<<<<<<<<<<<<<
19130  *             return sph_kernel_wendland2
19131  *         elif kernel_name == 'wendland4':
19132  */
19133           __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_wendland2, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(5, 128, __pyx_L7_error)
19134           __pyx_t_1 = (__pyx_t_2 != 0);
19135           if (__pyx_t_1) {
19136 
19137             /* "particle_deposit.pxd":129
19138  *             return sph_kernel_quintic
19139  *         elif kernel_name == 'wendland2':
19140  *             return sph_kernel_wendland2             # <<<<<<<<<<<<<<
19141  *         elif kernel_name == 'wendland4':
19142  *             return sph_kernel_wendland4
19143  */
19144             __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland2;
19145             goto __pyx_L6_return;
19146 
19147             /* "particle_deposit.pxd":128
19148  *         elif kernel_name == 'quintic':
19149  *             return sph_kernel_quintic
19150  *         elif kernel_name == 'wendland2':             # <<<<<<<<<<<<<<
19151  *             return sph_kernel_wendland2
19152  *         elif kernel_name == 'wendland4':
19153  */
19154           }
19155 
19156           /* "particle_deposit.pxd":130
19157  *         elif kernel_name == 'wendland2':
19158  *             return sph_kernel_wendland2
19159  *         elif kernel_name == 'wendland4':             # <<<<<<<<<<<<<<
19160  *             return sph_kernel_wendland4
19161  *         elif kernel_name == 'wendland6':
19162  */
19163           __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_wendland4, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 130, __pyx_L7_error)
19164           __pyx_t_2 = (__pyx_t_1 != 0);
19165           if (__pyx_t_2) {
19166 
19167             /* "particle_deposit.pxd":131
19168  *             return sph_kernel_wendland2
19169  *         elif kernel_name == 'wendland4':
19170  *             return sph_kernel_wendland4             # <<<<<<<<<<<<<<
19171  *         elif kernel_name == 'wendland6':
19172  *             return sph_kernel_wendland6
19173  */
19174             __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland4;
19175             goto __pyx_L6_return;
19176 
19177             /* "particle_deposit.pxd":130
19178  *         elif kernel_name == 'wendland2':
19179  *             return sph_kernel_wendland2
19180  *         elif kernel_name == 'wendland4':             # <<<<<<<<<<<<<<
19181  *             return sph_kernel_wendland4
19182  *         elif kernel_name == 'wendland6':
19183  */
19184           }
19185 
19186           /* "particle_deposit.pxd":132
19187  *         elif kernel_name == 'wendland4':
19188  *             return sph_kernel_wendland4
19189  *         elif kernel_name == 'wendland6':             # <<<<<<<<<<<<<<
19190  *             return sph_kernel_wendland6
19191  *         elif kernel_name == 'none':
19192  */
19193           __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_wendland6, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(5, 132, __pyx_L7_error)
19194           __pyx_t_1 = (__pyx_t_2 != 0);
19195           if (__pyx_t_1) {
19196 
19197             /* "particle_deposit.pxd":133
19198  *             return sph_kernel_wendland4
19199  *         elif kernel_name == 'wendland6':
19200  *             return sph_kernel_wendland6             # <<<<<<<<<<<<<<
19201  *         elif kernel_name == 'none':
19202  *             return sph_kernel_dummy
19203  */
19204             __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland6;
19205             goto __pyx_L6_return;
19206 
19207             /* "particle_deposit.pxd":132
19208  *         elif kernel_name == 'wendland4':
19209  *             return sph_kernel_wendland4
19210  *         elif kernel_name == 'wendland6':             # <<<<<<<<<<<<<<
19211  *             return sph_kernel_wendland6
19212  *         elif kernel_name == 'none':
19213  */
19214           }
19215 
19216           /* "particle_deposit.pxd":134
19217  *         elif kernel_name == 'wendland6':
19218  *             return sph_kernel_wendland6
19219  *         elif kernel_name == 'none':             # <<<<<<<<<<<<<<
19220  *             return sph_kernel_dummy
19221  *         else:
19222  */
19223           __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_none, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 134, __pyx_L7_error)
19224           __pyx_t_2 = (__pyx_t_1 != 0);
19225           if (likely(__pyx_t_2)) {
19226 
19227             /* "particle_deposit.pxd":135
19228  *             return sph_kernel_wendland6
19229  *         elif kernel_name == 'none':
19230  *             return sph_kernel_dummy             # <<<<<<<<<<<<<<
19231  *         else:
19232  *             raise NotImplementedError
19233  */
19234             __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_dummy;
19235             goto __pyx_L6_return;
19236 
19237             /* "particle_deposit.pxd":134
19238  *         elif kernel_name == 'wendland6':
19239  *             return sph_kernel_wendland6
19240  *         elif kernel_name == 'none':             # <<<<<<<<<<<<<<
19241  *             return sph_kernel_dummy
19242  *         else:
19243  */
19244           }
19245 
19246           /* "particle_deposit.pxd":137
19247  *             return sph_kernel_dummy
19248  *         else:
19249  *             raise NotImplementedError             # <<<<<<<<<<<<<<
19250  *
19251  * cdef class ParticleDepositOperation:
19252  */
19253           /*else*/ {
19254             __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
19255             __PYX_ERR(5, 137, __pyx_L7_error)
19256           }
19257         }
19258 
19259         /* "particle_deposit.pxd":121
19260  * ctypedef np.float64_t (*kernel_func) (np.float64_t) nogil
19261  * cdef inline kernel_func get_kernel_func(str kernel_name) nogil:
19262  *     with gil:             # <<<<<<<<<<<<<<
19263  *         if kernel_name == 'cubic':
19264  *             return sph_kernel_cubic
19265  */
19266         /*finally:*/ {
19267           __pyx_L6_return: {
19268             #ifdef WITH_THREAD
19269             __Pyx_PyGILState_Release(__pyx_gilstate_save);
19270             #endif
19271             goto __pyx_L3_return;
19272           }
19273           __pyx_L7_error: {
19274             #ifdef WITH_THREAD
19275             __Pyx_PyGILState_Release(__pyx_gilstate_save);
19276             #endif
19277             goto __pyx_L4_error;
19278           }
19279         }
19280     }
19281   }
19282   /*finally:*/ {
19283     __pyx_L3_return: {
19284       #ifdef WITH_THREAD
19285       __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19286       #endif
19287       goto __pyx_L0;
19288     }
19289     __pyx_L4_error: {
19290       #ifdef WITH_THREAD
19291       __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19292       #endif
19293       goto __pyx_L1_error;
19294     }
19295   }
19296 
19297   /* "particle_deposit.pxd":120
19298  * # I manually created a function to lookup the kernel functions.
19299  * ctypedef np.float64_t (*kernel_func) (np.float64_t) nogil
19300  * cdef inline kernel_func get_kernel_func(str kernel_name) nogil:             # <<<<<<<<<<<<<<
19301  *     with gil:
19302  *         if kernel_name == 'cubic':
19303  */
19304 
19305   /* function exit code */
19306   __pyx_r = 0;
19307   goto __pyx_L0;
19308   __pyx_L1_error:;
19309   __Pyx_WriteUnraisable("yt.geometry.particle_deposit.get_kernel_func", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19310   __pyx_r = 0;
19311   __pyx_L0:;
19312   #ifdef WITH_THREAD
19313   __Pyx_PyGILState_Release(__pyx_gilstate_save);
19314   #endif
19315   return __pyx_r;
19316 }
19317 
19318 /* "View.MemoryView":122
19319  *         cdef bint dtype_is_object
19320  *
19321  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
19322  *                   mode="c", bint allocate_buffer=True):
19323  *
19324  */
19325 
19326 /* Python wrapper */
19327 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)19328 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19329   PyObject *__pyx_v_shape = 0;
19330   Py_ssize_t __pyx_v_itemsize;
19331   PyObject *__pyx_v_format = 0;
19332   PyObject *__pyx_v_mode = 0;
19333   int __pyx_v_allocate_buffer;
19334   int __pyx_r;
19335   __Pyx_RefNannyDeclarations
19336   __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
19337   {
19338     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};
19339     PyObject* values[5] = {0,0,0,0,0};
19340     values[3] = ((PyObject *)__pyx_n_s_c);
19341     if (unlikely(__pyx_kwds)) {
19342       Py_ssize_t kw_args;
19343       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19344       switch (pos_args) {
19345         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19346         CYTHON_FALLTHROUGH;
19347         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19348         CYTHON_FALLTHROUGH;
19349         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19350         CYTHON_FALLTHROUGH;
19351         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19352         CYTHON_FALLTHROUGH;
19353         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19354         CYTHON_FALLTHROUGH;
19355         case  0: break;
19356         default: goto __pyx_L5_argtuple_error;
19357       }
19358       kw_args = PyDict_Size(__pyx_kwds);
19359       switch (pos_args) {
19360         case  0:
19361         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
19362         else goto __pyx_L5_argtuple_error;
19363         CYTHON_FALLTHROUGH;
19364         case  1:
19365         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
19366         else {
19367           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
19368         }
19369         CYTHON_FALLTHROUGH;
19370         case  2:
19371         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
19372         else {
19373           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
19374         }
19375         CYTHON_FALLTHROUGH;
19376         case  3:
19377         if (kw_args > 0) {
19378           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
19379           if (value) { values[3] = value; kw_args--; }
19380         }
19381         CYTHON_FALLTHROUGH;
19382         case  4:
19383         if (kw_args > 0) {
19384           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
19385           if (value) { values[4] = value; kw_args--; }
19386         }
19387       }
19388       if (unlikely(kw_args > 0)) {
19389         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
19390       }
19391     } else {
19392       switch (PyTuple_GET_SIZE(__pyx_args)) {
19393         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19394         CYTHON_FALLTHROUGH;
19395         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19396         CYTHON_FALLTHROUGH;
19397         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19398         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19399         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19400         break;
19401         default: goto __pyx_L5_argtuple_error;
19402       }
19403     }
19404     __pyx_v_shape = ((PyObject*)values[0]);
19405     __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)
19406     __pyx_v_format = values[2];
19407     __pyx_v_mode = values[3];
19408     if (values[4]) {
19409       __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)
19410     } else {
19411 
19412       /* "View.MemoryView":123
19413  *
19414  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
19415  *                   mode="c", bint allocate_buffer=True):             # <<<<<<<<<<<<<<
19416  *
19417  *         cdef int idx
19418  */
19419       __pyx_v_allocate_buffer = ((int)1);
19420     }
19421   }
19422   goto __pyx_L4_argument_unpacking_done;
19423   __pyx_L5_argtuple_error:;
19424   __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
19425   __pyx_L3_error:;
19426   __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19427   __Pyx_RefNannyFinishContext();
19428   return -1;
19429   __pyx_L4_argument_unpacking_done:;
19430   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
19431   if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
19432     PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 122, __pyx_L1_error)
19433   }
19434   __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);
19435 
19436   /* "View.MemoryView":122
19437  *         cdef bint dtype_is_object
19438  *
19439  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
19440  *                   mode="c", bint allocate_buffer=True):
19441  *
19442  */
19443 
19444   /* function exit code */
19445   goto __pyx_L0;
19446   __pyx_L1_error:;
19447   __pyx_r = -1;
19448   __pyx_L0:;
19449   __Pyx_RefNannyFinishContext();
19450   return __pyx_r;
19451 }
19452 
__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)19453 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) {
19454   int __pyx_v_idx;
19455   Py_ssize_t __pyx_v_i;
19456   Py_ssize_t __pyx_v_dim;
19457   PyObject **__pyx_v_p;
19458   char __pyx_v_order;
19459   int __pyx_r;
19460   __Pyx_RefNannyDeclarations
19461   Py_ssize_t __pyx_t_1;
19462   int __pyx_t_2;
19463   PyObject *__pyx_t_3 = NULL;
19464   int __pyx_t_4;
19465   PyObject *__pyx_t_5 = NULL;
19466   PyObject *__pyx_t_6 = NULL;
19467   char *__pyx_t_7;
19468   int __pyx_t_8;
19469   Py_ssize_t __pyx_t_9;
19470   PyObject *__pyx_t_10 = NULL;
19471   Py_ssize_t __pyx_t_11;
19472   __Pyx_RefNannySetupContext("__cinit__", 0);
19473   __Pyx_INCREF(__pyx_v_format);
19474 
19475   /* "View.MemoryView":129
19476  *         cdef PyObject **p
19477  *
19478  *         self.ndim = <int> len(shape)             # <<<<<<<<<<<<<<
19479  *         self.itemsize = itemsize
19480  *
19481  */
19482   if (unlikely(__pyx_v_shape == Py_None)) {
19483     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
19484     __PYX_ERR(1, 129, __pyx_L1_error)
19485   }
19486   __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)
19487   __pyx_v_self->ndim = ((int)__pyx_t_1);
19488 
19489   /* "View.MemoryView":130
19490  *
19491  *         self.ndim = <int> len(shape)
19492  *         self.itemsize = itemsize             # <<<<<<<<<<<<<<
19493  *
19494  *         if not self.ndim:
19495  */
19496   __pyx_v_self->itemsize = __pyx_v_itemsize;
19497 
19498   /* "View.MemoryView":132
19499  *         self.itemsize = itemsize
19500  *
19501  *         if not self.ndim:             # <<<<<<<<<<<<<<
19502  *             raise ValueError("Empty shape tuple for cython.array")
19503  *
19504  */
19505   __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
19506   if (unlikely(__pyx_t_2)) {
19507 
19508     /* "View.MemoryView":133
19509  *
19510  *         if not self.ndim:
19511  *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
19512  *
19513  *         if itemsize <= 0:
19514  */
19515     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
19516     __Pyx_GOTREF(__pyx_t_3);
19517     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
19518     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19519     __PYX_ERR(1, 133, __pyx_L1_error)
19520 
19521     /* "View.MemoryView":132
19522  *         self.itemsize = itemsize
19523  *
19524  *         if not self.ndim:             # <<<<<<<<<<<<<<
19525  *             raise ValueError("Empty shape tuple for cython.array")
19526  *
19527  */
19528   }
19529 
19530   /* "View.MemoryView":135
19531  *             raise ValueError("Empty shape tuple for cython.array")
19532  *
19533  *         if itemsize <= 0:             # <<<<<<<<<<<<<<
19534  *             raise ValueError("itemsize <= 0 for cython.array")
19535  *
19536  */
19537   __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
19538   if (unlikely(__pyx_t_2)) {
19539 
19540     /* "View.MemoryView":136
19541  *
19542  *         if itemsize <= 0:
19543  *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
19544  *
19545  *         if not isinstance(format, bytes):
19546  */
19547     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
19548     __Pyx_GOTREF(__pyx_t_3);
19549     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
19550     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19551     __PYX_ERR(1, 136, __pyx_L1_error)
19552 
19553     /* "View.MemoryView":135
19554  *             raise ValueError("Empty shape tuple for cython.array")
19555  *
19556  *         if itemsize <= 0:             # <<<<<<<<<<<<<<
19557  *             raise ValueError("itemsize <= 0 for cython.array")
19558  *
19559  */
19560   }
19561 
19562   /* "View.MemoryView":138
19563  *             raise ValueError("itemsize <= 0 for cython.array")
19564  *
19565  *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
19566  *             format = format.encode('ASCII')
19567  *         self._format = format  # keep a reference to the byte string
19568  */
19569   __pyx_t_2 = PyBytes_Check(__pyx_v_format);
19570   __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
19571   if (__pyx_t_4) {
19572 
19573     /* "View.MemoryView":139
19574  *
19575  *         if not isinstance(format, bytes):
19576  *             format = format.encode('ASCII')             # <<<<<<<<<<<<<<
19577  *         self._format = format  # keep a reference to the byte string
19578  *         self.format = self._format
19579  */
19580     __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)
19581     __Pyx_GOTREF(__pyx_t_5);
19582     __pyx_t_6 = NULL;
19583     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
19584       __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
19585       if (likely(__pyx_t_6)) {
19586         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
19587         __Pyx_INCREF(__pyx_t_6);
19588         __Pyx_INCREF(function);
19589         __Pyx_DECREF_SET(__pyx_t_5, function);
19590       }
19591     }
19592     __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);
19593     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
19594     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
19595     __Pyx_GOTREF(__pyx_t_3);
19596     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19597     __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
19598     __pyx_t_3 = 0;
19599 
19600     /* "View.MemoryView":138
19601  *             raise ValueError("itemsize <= 0 for cython.array")
19602  *
19603  *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
19604  *             format = format.encode('ASCII')
19605  *         self._format = format  # keep a reference to the byte string
19606  */
19607   }
19608 
19609   /* "View.MemoryView":140
19610  *         if not isinstance(format, bytes):
19611  *             format = format.encode('ASCII')
19612  *         self._format = format  # keep a reference to the byte string             # <<<<<<<<<<<<<<
19613  *         self.format = self._format
19614  *
19615  */
19616   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)
19617   __pyx_t_3 = __pyx_v_format;
19618   __Pyx_INCREF(__pyx_t_3);
19619   __Pyx_GIVEREF(__pyx_t_3);
19620   __Pyx_GOTREF(__pyx_v_self->_format);
19621   __Pyx_DECREF(__pyx_v_self->_format);
19622   __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
19623   __pyx_t_3 = 0;
19624 
19625   /* "View.MemoryView":141
19626  *             format = format.encode('ASCII')
19627  *         self._format = format  # keep a reference to the byte string
19628  *         self.format = self._format             # <<<<<<<<<<<<<<
19629  *
19630  *
19631  */
19632   if (unlikely(__pyx_v_self->_format == Py_None)) {
19633     PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
19634     __PYX_ERR(1, 141, __pyx_L1_error)
19635   }
19636   __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
19637   __pyx_v_self->format = __pyx_t_7;
19638 
19639   /* "View.MemoryView":144
19640  *
19641  *
19642  *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)             # <<<<<<<<<<<<<<
19643  *         self._strides = self._shape + self.ndim
19644  *
19645  */
19646   __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
19647 
19648   /* "View.MemoryView":145
19649  *
19650  *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
19651  *         self._strides = self._shape + self.ndim             # <<<<<<<<<<<<<<
19652  *
19653  *         if not self._shape:
19654  */
19655   __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
19656 
19657   /* "View.MemoryView":147
19658  *         self._strides = self._shape + self.ndim
19659  *
19660  *         if not self._shape:             # <<<<<<<<<<<<<<
19661  *             raise MemoryError("unable to allocate shape and strides.")
19662  *
19663  */
19664   __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
19665   if (unlikely(__pyx_t_4)) {
19666 
19667     /* "View.MemoryView":148
19668  *
19669  *         if not self._shape:
19670  *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
19671  *
19672  *
19673  */
19674     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
19675     __Pyx_GOTREF(__pyx_t_3);
19676     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
19677     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19678     __PYX_ERR(1, 148, __pyx_L1_error)
19679 
19680     /* "View.MemoryView":147
19681  *         self._strides = self._shape + self.ndim
19682  *
19683  *         if not self._shape:             # <<<<<<<<<<<<<<
19684  *             raise MemoryError("unable to allocate shape and strides.")
19685  *
19686  */
19687   }
19688 
19689   /* "View.MemoryView":151
19690  *
19691  *
19692  *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
19693  *             if dim <= 0:
19694  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
19695  */
19696   __pyx_t_8 = 0;
19697   __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
19698   for (;;) {
19699     if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
19700     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
19701     __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)
19702     #else
19703     __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)
19704     __Pyx_GOTREF(__pyx_t_5);
19705     #endif
19706     __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)
19707     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19708     __pyx_v_dim = __pyx_t_9;
19709     __pyx_v_idx = __pyx_t_8;
19710     __pyx_t_8 = (__pyx_t_8 + 1);
19711 
19712     /* "View.MemoryView":152
19713  *
19714  *         for idx, dim in enumerate(shape):
19715  *             if dim <= 0:             # <<<<<<<<<<<<<<
19716  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
19717  *             self._shape[idx] = dim
19718  */
19719     __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
19720     if (unlikely(__pyx_t_4)) {
19721 
19722       /* "View.MemoryView":153
19723  *         for idx, dim in enumerate(shape):
19724  *             if dim <= 0:
19725  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))             # <<<<<<<<<<<<<<
19726  *             self._shape[idx] = dim
19727  *
19728  */
19729       __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
19730       __Pyx_GOTREF(__pyx_t_5);
19731       __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
19732       __Pyx_GOTREF(__pyx_t_6);
19733       __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
19734       __Pyx_GOTREF(__pyx_t_10);
19735       __Pyx_GIVEREF(__pyx_t_5);
19736       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
19737       __Pyx_GIVEREF(__pyx_t_6);
19738       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
19739       __pyx_t_5 = 0;
19740       __pyx_t_6 = 0;
19741       __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)
19742       __Pyx_GOTREF(__pyx_t_6);
19743       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
19744       __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
19745       __Pyx_GOTREF(__pyx_t_10);
19746       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19747       __Pyx_Raise(__pyx_t_10, 0, 0, 0);
19748       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
19749       __PYX_ERR(1, 153, __pyx_L1_error)
19750 
19751       /* "View.MemoryView":152
19752  *
19753  *         for idx, dim in enumerate(shape):
19754  *             if dim <= 0:             # <<<<<<<<<<<<<<
19755  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
19756  *             self._shape[idx] = dim
19757  */
19758     }
19759 
19760     /* "View.MemoryView":154
19761  *             if dim <= 0:
19762  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
19763  *             self._shape[idx] = dim             # <<<<<<<<<<<<<<
19764  *
19765  *         cdef char order
19766  */
19767     (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
19768 
19769     /* "View.MemoryView":151
19770  *
19771  *
19772  *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
19773  *             if dim <= 0:
19774  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
19775  */
19776   }
19777   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19778 
19779   /* "View.MemoryView":157
19780  *
19781  *         cdef char order
19782  *         if mode == 'fortran':             # <<<<<<<<<<<<<<
19783  *             order = b'F'
19784  *             self.mode = u'fortran'
19785  */
19786   __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)
19787   if (__pyx_t_4) {
19788 
19789     /* "View.MemoryView":158
19790  *         cdef char order
19791  *         if mode == 'fortran':
19792  *             order = b'F'             # <<<<<<<<<<<<<<
19793  *             self.mode = u'fortran'
19794  *         elif mode == 'c':
19795  */
19796     __pyx_v_order = 'F';
19797 
19798     /* "View.MemoryView":159
19799  *         if mode == 'fortran':
19800  *             order = b'F'
19801  *             self.mode = u'fortran'             # <<<<<<<<<<<<<<
19802  *         elif mode == 'c':
19803  *             order = b'C'
19804  */
19805     __Pyx_INCREF(__pyx_n_u_fortran);
19806     __Pyx_GIVEREF(__pyx_n_u_fortran);
19807     __Pyx_GOTREF(__pyx_v_self->mode);
19808     __Pyx_DECREF(__pyx_v_self->mode);
19809     __pyx_v_self->mode = __pyx_n_u_fortran;
19810 
19811     /* "View.MemoryView":157
19812  *
19813  *         cdef char order
19814  *         if mode == 'fortran':             # <<<<<<<<<<<<<<
19815  *             order = b'F'
19816  *             self.mode = u'fortran'
19817  */
19818     goto __pyx_L10;
19819   }
19820 
19821   /* "View.MemoryView":160
19822  *             order = b'F'
19823  *             self.mode = u'fortran'
19824  *         elif mode == 'c':             # <<<<<<<<<<<<<<
19825  *             order = b'C'
19826  *             self.mode = u'c'
19827  */
19828   __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)
19829   if (likely(__pyx_t_4)) {
19830 
19831     /* "View.MemoryView":161
19832  *             self.mode = u'fortran'
19833  *         elif mode == 'c':
19834  *             order = b'C'             # <<<<<<<<<<<<<<
19835  *             self.mode = u'c'
19836  *         else:
19837  */
19838     __pyx_v_order = 'C';
19839 
19840     /* "View.MemoryView":162
19841  *         elif mode == 'c':
19842  *             order = b'C'
19843  *             self.mode = u'c'             # <<<<<<<<<<<<<<
19844  *         else:
19845  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
19846  */
19847     __Pyx_INCREF(__pyx_n_u_c);
19848     __Pyx_GIVEREF(__pyx_n_u_c);
19849     __Pyx_GOTREF(__pyx_v_self->mode);
19850     __Pyx_DECREF(__pyx_v_self->mode);
19851     __pyx_v_self->mode = __pyx_n_u_c;
19852 
19853     /* "View.MemoryView":160
19854  *             order = b'F'
19855  *             self.mode = u'fortran'
19856  *         elif mode == 'c':             # <<<<<<<<<<<<<<
19857  *             order = b'C'
19858  *             self.mode = u'c'
19859  */
19860     goto __pyx_L10;
19861   }
19862 
19863   /* "View.MemoryView":164
19864  *             self.mode = u'c'
19865  *         else:
19866  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)             # <<<<<<<<<<<<<<
19867  *
19868  *         self.len = fill_contig_strides_array(self._shape, self._strides,
19869  */
19870   /*else*/ {
19871     __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)
19872     __Pyx_GOTREF(__pyx_t_3);
19873     __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
19874     __Pyx_GOTREF(__pyx_t_10);
19875     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19876     __Pyx_Raise(__pyx_t_10, 0, 0, 0);
19877     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
19878     __PYX_ERR(1, 164, __pyx_L1_error)
19879   }
19880   __pyx_L10:;
19881 
19882   /* "View.MemoryView":166
19883  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
19884  *
19885  *         self.len = fill_contig_strides_array(self._shape, self._strides,             # <<<<<<<<<<<<<<
19886  *                                              itemsize, self.ndim, order)
19887  *
19888  */
19889   __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);
19890 
19891   /* "View.MemoryView":169
19892  *                                              itemsize, self.ndim, order)
19893  *
19894  *         self.free_data = allocate_buffer             # <<<<<<<<<<<<<<
19895  *         self.dtype_is_object = format == b'O'
19896  *         if allocate_buffer:
19897  */
19898   __pyx_v_self->free_data = __pyx_v_allocate_buffer;
19899 
19900   /* "View.MemoryView":170
19901  *
19902  *         self.free_data = allocate_buffer
19903  *         self.dtype_is_object = format == b'O'             # <<<<<<<<<<<<<<
19904  *         if allocate_buffer:
19905  *
19906  */
19907   __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)
19908   __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)
19909   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
19910   __pyx_v_self->dtype_is_object = __pyx_t_4;
19911 
19912   /* "View.MemoryView":171
19913  *         self.free_data = allocate_buffer
19914  *         self.dtype_is_object = format == b'O'
19915  *         if allocate_buffer:             # <<<<<<<<<<<<<<
19916  *
19917  *
19918  */
19919   __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
19920   if (__pyx_t_4) {
19921 
19922     /* "View.MemoryView":174
19923  *
19924  *
19925  *             self.data = <char *>malloc(self.len)             # <<<<<<<<<<<<<<
19926  *             if not self.data:
19927  *                 raise MemoryError("unable to allocate array data.")
19928  */
19929     __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
19930 
19931     /* "View.MemoryView":175
19932  *
19933  *             self.data = <char *>malloc(self.len)
19934  *             if not self.data:             # <<<<<<<<<<<<<<
19935  *                 raise MemoryError("unable to allocate array data.")
19936  *
19937  */
19938     __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
19939     if (unlikely(__pyx_t_4)) {
19940 
19941       /* "View.MemoryView":176
19942  *             self.data = <char *>malloc(self.len)
19943  *             if not self.data:
19944  *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
19945  *
19946  *             if self.dtype_is_object:
19947  */
19948       __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
19949       __Pyx_GOTREF(__pyx_t_10);
19950       __Pyx_Raise(__pyx_t_10, 0, 0, 0);
19951       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
19952       __PYX_ERR(1, 176, __pyx_L1_error)
19953 
19954       /* "View.MemoryView":175
19955  *
19956  *             self.data = <char *>malloc(self.len)
19957  *             if not self.data:             # <<<<<<<<<<<<<<
19958  *                 raise MemoryError("unable to allocate array data.")
19959  *
19960  */
19961     }
19962 
19963     /* "View.MemoryView":178
19964  *                 raise MemoryError("unable to allocate array data.")
19965  *
19966  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
19967  *                 p = <PyObject **> self.data
19968  *                 for i in range(self.len / itemsize):
19969  */
19970     __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
19971     if (__pyx_t_4) {
19972 
19973       /* "View.MemoryView":179
19974  *
19975  *             if self.dtype_is_object:
19976  *                 p = <PyObject **> self.data             # <<<<<<<<<<<<<<
19977  *                 for i in range(self.len / itemsize):
19978  *                     p[i] = Py_None
19979  */
19980       __pyx_v_p = ((PyObject **)__pyx_v_self->data);
19981 
19982       /* "View.MemoryView":180
19983  *             if self.dtype_is_object:
19984  *                 p = <PyObject **> self.data
19985  *                 for i in range(self.len / itemsize):             # <<<<<<<<<<<<<<
19986  *                     p[i] = Py_None
19987  *                     Py_INCREF(Py_None)
19988  */
19989       if (unlikely(__pyx_v_itemsize == 0)) {
19990         PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
19991         __PYX_ERR(1, 180, __pyx_L1_error)
19992       }
19993       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))) {
19994         PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
19995         __PYX_ERR(1, 180, __pyx_L1_error)
19996       }
19997       __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
19998       __pyx_t_9 = __pyx_t_1;
19999       for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
20000         __pyx_v_i = __pyx_t_11;
20001 
20002         /* "View.MemoryView":181
20003  *                 p = <PyObject **> self.data
20004  *                 for i in range(self.len / itemsize):
20005  *                     p[i] = Py_None             # <<<<<<<<<<<<<<
20006  *                     Py_INCREF(Py_None)
20007  *
20008  */
20009         (__pyx_v_p[__pyx_v_i]) = Py_None;
20010 
20011         /* "View.MemoryView":182
20012  *                 for i in range(self.len / itemsize):
20013  *                     p[i] = Py_None
20014  *                     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
20015  *
20016  *     @cname('getbuffer')
20017  */
20018         Py_INCREF(Py_None);
20019       }
20020 
20021       /* "View.MemoryView":178
20022  *                 raise MemoryError("unable to allocate array data.")
20023  *
20024  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
20025  *                 p = <PyObject **> self.data
20026  *                 for i in range(self.len / itemsize):
20027  */
20028     }
20029 
20030     /* "View.MemoryView":171
20031  *         self.free_data = allocate_buffer
20032  *         self.dtype_is_object = format == b'O'
20033  *         if allocate_buffer:             # <<<<<<<<<<<<<<
20034  *
20035  *
20036  */
20037   }
20038 
20039   /* "View.MemoryView":122
20040  *         cdef bint dtype_is_object
20041  *
20042  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
20043  *                   mode="c", bint allocate_buffer=True):
20044  *
20045  */
20046 
20047   /* function exit code */
20048   __pyx_r = 0;
20049   goto __pyx_L0;
20050   __pyx_L1_error:;
20051   __Pyx_XDECREF(__pyx_t_3);
20052   __Pyx_XDECREF(__pyx_t_5);
20053   __Pyx_XDECREF(__pyx_t_6);
20054   __Pyx_XDECREF(__pyx_t_10);
20055   __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20056   __pyx_r = -1;
20057   __pyx_L0:;
20058   __Pyx_XDECREF(__pyx_v_format);
20059   __Pyx_RefNannyFinishContext();
20060   return __pyx_r;
20061 }
20062 
20063 /* "View.MemoryView":185
20064  *
20065  *     @cname('getbuffer')
20066  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
20067  *         cdef int bufmode = -1
20068  *         if self.mode == u"c":
20069  */
20070 
20071 /* Python wrapper */
20072 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)20073 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
20074   int __pyx_r;
20075   __Pyx_RefNannyDeclarations
20076   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
20077   __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));
20078 
20079   /* function exit code */
20080   __Pyx_RefNannyFinishContext();
20081   return __pyx_r;
20082 }
20083 
__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)20084 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) {
20085   int __pyx_v_bufmode;
20086   int __pyx_r;
20087   __Pyx_RefNannyDeclarations
20088   int __pyx_t_1;
20089   int __pyx_t_2;
20090   PyObject *__pyx_t_3 = NULL;
20091   char *__pyx_t_4;
20092   Py_ssize_t __pyx_t_5;
20093   int __pyx_t_6;
20094   Py_ssize_t *__pyx_t_7;
20095   if (__pyx_v_info == NULL) {
20096     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
20097     return -1;
20098   }
20099   __Pyx_RefNannySetupContext("__getbuffer__", 0);
20100   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
20101   __Pyx_GIVEREF(__pyx_v_info->obj);
20102 
20103   /* "View.MemoryView":186
20104  *     @cname('getbuffer')
20105  *     def __getbuffer__(self, Py_buffer *info, int flags):
20106  *         cdef int bufmode = -1             # <<<<<<<<<<<<<<
20107  *         if self.mode == u"c":
20108  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
20109  */
20110   __pyx_v_bufmode = -1;
20111 
20112   /* "View.MemoryView":187
20113  *     def __getbuffer__(self, Py_buffer *info, int flags):
20114  *         cdef int bufmode = -1
20115  *         if self.mode == u"c":             # <<<<<<<<<<<<<<
20116  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
20117  *         elif self.mode == u"fortran":
20118  */
20119   __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)
20120   __pyx_t_2 = (__pyx_t_1 != 0);
20121   if (__pyx_t_2) {
20122 
20123     /* "View.MemoryView":188
20124  *         cdef int bufmode = -1
20125  *         if self.mode == u"c":
20126  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
20127  *         elif self.mode == u"fortran":
20128  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
20129  */
20130     __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
20131 
20132     /* "View.MemoryView":187
20133  *     def __getbuffer__(self, Py_buffer *info, int flags):
20134  *         cdef int bufmode = -1
20135  *         if self.mode == u"c":             # <<<<<<<<<<<<<<
20136  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
20137  *         elif self.mode == u"fortran":
20138  */
20139     goto __pyx_L3;
20140   }
20141 
20142   /* "View.MemoryView":189
20143  *         if self.mode == u"c":
20144  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
20145  *         elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
20146  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
20147  *         if not (flags & bufmode):
20148  */
20149   __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)
20150   __pyx_t_1 = (__pyx_t_2 != 0);
20151   if (__pyx_t_1) {
20152 
20153     /* "View.MemoryView":190
20154  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
20155  *         elif self.mode == u"fortran":
20156  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
20157  *         if not (flags & bufmode):
20158  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
20159  */
20160     __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
20161 
20162     /* "View.MemoryView":189
20163  *         if self.mode == u"c":
20164  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
20165  *         elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
20166  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
20167  *         if not (flags & bufmode):
20168  */
20169   }
20170   __pyx_L3:;
20171 
20172   /* "View.MemoryView":191
20173  *         elif self.mode == u"fortran":
20174  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
20175  *         if not (flags & bufmode):             # <<<<<<<<<<<<<<
20176  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
20177  *         info.buf = self.data
20178  */
20179   __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
20180   if (unlikely(__pyx_t_1)) {
20181 
20182     /* "View.MemoryView":192
20183  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
20184  *         if not (flags & bufmode):
20185  *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
20186  *         info.buf = self.data
20187  *         info.len = self.len
20188  */
20189     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
20190     __Pyx_GOTREF(__pyx_t_3);
20191     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20192     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20193     __PYX_ERR(1, 192, __pyx_L1_error)
20194 
20195     /* "View.MemoryView":191
20196  *         elif self.mode == u"fortran":
20197  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
20198  *         if not (flags & bufmode):             # <<<<<<<<<<<<<<
20199  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
20200  *         info.buf = self.data
20201  */
20202   }
20203 
20204   /* "View.MemoryView":193
20205  *         if not (flags & bufmode):
20206  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
20207  *         info.buf = self.data             # <<<<<<<<<<<<<<
20208  *         info.len = self.len
20209  *         info.ndim = self.ndim
20210  */
20211   __pyx_t_4 = __pyx_v_self->data;
20212   __pyx_v_info->buf = __pyx_t_4;
20213 
20214   /* "View.MemoryView":194
20215  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
20216  *         info.buf = self.data
20217  *         info.len = self.len             # <<<<<<<<<<<<<<
20218  *         info.ndim = self.ndim
20219  *         info.shape = self._shape
20220  */
20221   __pyx_t_5 = __pyx_v_self->len;
20222   __pyx_v_info->len = __pyx_t_5;
20223 
20224   /* "View.MemoryView":195
20225  *         info.buf = self.data
20226  *         info.len = self.len
20227  *         info.ndim = self.ndim             # <<<<<<<<<<<<<<
20228  *         info.shape = self._shape
20229  *         info.strides = self._strides
20230  */
20231   __pyx_t_6 = __pyx_v_self->ndim;
20232   __pyx_v_info->ndim = __pyx_t_6;
20233 
20234   /* "View.MemoryView":196
20235  *         info.len = self.len
20236  *         info.ndim = self.ndim
20237  *         info.shape = self._shape             # <<<<<<<<<<<<<<
20238  *         info.strides = self._strides
20239  *         info.suboffsets = NULL
20240  */
20241   __pyx_t_7 = __pyx_v_self->_shape;
20242   __pyx_v_info->shape = __pyx_t_7;
20243 
20244   /* "View.MemoryView":197
20245  *         info.ndim = self.ndim
20246  *         info.shape = self._shape
20247  *         info.strides = self._strides             # <<<<<<<<<<<<<<
20248  *         info.suboffsets = NULL
20249  *         info.itemsize = self.itemsize
20250  */
20251   __pyx_t_7 = __pyx_v_self->_strides;
20252   __pyx_v_info->strides = __pyx_t_7;
20253 
20254   /* "View.MemoryView":198
20255  *         info.shape = self._shape
20256  *         info.strides = self._strides
20257  *         info.suboffsets = NULL             # <<<<<<<<<<<<<<
20258  *         info.itemsize = self.itemsize
20259  *         info.readonly = 0
20260  */
20261   __pyx_v_info->suboffsets = NULL;
20262 
20263   /* "View.MemoryView":199
20264  *         info.strides = self._strides
20265  *         info.suboffsets = NULL
20266  *         info.itemsize = self.itemsize             # <<<<<<<<<<<<<<
20267  *         info.readonly = 0
20268  *
20269  */
20270   __pyx_t_5 = __pyx_v_self->itemsize;
20271   __pyx_v_info->itemsize = __pyx_t_5;
20272 
20273   /* "View.MemoryView":200
20274  *         info.suboffsets = NULL
20275  *         info.itemsize = self.itemsize
20276  *         info.readonly = 0             # <<<<<<<<<<<<<<
20277  *
20278  *         if flags & PyBUF_FORMAT:
20279  */
20280   __pyx_v_info->readonly = 0;
20281 
20282   /* "View.MemoryView":202
20283  *         info.readonly = 0
20284  *
20285  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
20286  *             info.format = self.format
20287  *         else:
20288  */
20289   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
20290   if (__pyx_t_1) {
20291 
20292     /* "View.MemoryView":203
20293  *
20294  *         if flags & PyBUF_FORMAT:
20295  *             info.format = self.format             # <<<<<<<<<<<<<<
20296  *         else:
20297  *             info.format = NULL
20298  */
20299     __pyx_t_4 = __pyx_v_self->format;
20300     __pyx_v_info->format = __pyx_t_4;
20301 
20302     /* "View.MemoryView":202
20303  *         info.readonly = 0
20304  *
20305  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
20306  *             info.format = self.format
20307  *         else:
20308  */
20309     goto __pyx_L5;
20310   }
20311 
20312   /* "View.MemoryView":205
20313  *             info.format = self.format
20314  *         else:
20315  *             info.format = NULL             # <<<<<<<<<<<<<<
20316  *
20317  *         info.obj = self
20318  */
20319   /*else*/ {
20320     __pyx_v_info->format = NULL;
20321   }
20322   __pyx_L5:;
20323 
20324   /* "View.MemoryView":207
20325  *             info.format = NULL
20326  *
20327  *         info.obj = self             # <<<<<<<<<<<<<<
20328  *
20329  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
20330  */
20331   __Pyx_INCREF(((PyObject *)__pyx_v_self));
20332   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
20333   __Pyx_GOTREF(__pyx_v_info->obj);
20334   __Pyx_DECREF(__pyx_v_info->obj);
20335   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
20336 
20337   /* "View.MemoryView":185
20338  *
20339  *     @cname('getbuffer')
20340  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
20341  *         cdef int bufmode = -1
20342  *         if self.mode == u"c":
20343  */
20344 
20345   /* function exit code */
20346   __pyx_r = 0;
20347   goto __pyx_L0;
20348   __pyx_L1_error:;
20349   __Pyx_XDECREF(__pyx_t_3);
20350   __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20351   __pyx_r = -1;
20352   if (__pyx_v_info->obj != NULL) {
20353     __Pyx_GOTREF(__pyx_v_info->obj);
20354     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
20355   }
20356   goto __pyx_L2;
20357   __pyx_L0:;
20358   if (__pyx_v_info->obj == Py_None) {
20359     __Pyx_GOTREF(__pyx_v_info->obj);
20360     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
20361   }
20362   __pyx_L2:;
20363   __Pyx_RefNannyFinishContext();
20364   return __pyx_r;
20365 }
20366 
20367 /* "View.MemoryView":211
20368  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
20369  *
20370  *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
20371  *         if self.callback_free_data != NULL:
20372  *             self.callback_free_data(self.data)
20373  */
20374 
20375 /* Python wrapper */
20376 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_array___dealloc__(PyObject * __pyx_v_self)20377 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
20378   __Pyx_RefNannyDeclarations
20379   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
20380   __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
20381 
20382   /* function exit code */
20383   __Pyx_RefNannyFinishContext();
20384 }
20385 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj * __pyx_v_self)20386 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
20387   __Pyx_RefNannyDeclarations
20388   int __pyx_t_1;
20389   __Pyx_RefNannySetupContext("__dealloc__", 0);
20390 
20391   /* "View.MemoryView":212
20392  *
20393  *     def __dealloc__(array self):
20394  *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
20395  *             self.callback_free_data(self.data)
20396  *         elif self.free_data:
20397  */
20398   __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
20399   if (__pyx_t_1) {
20400 
20401     /* "View.MemoryView":213
20402  *     def __dealloc__(array self):
20403  *         if self.callback_free_data != NULL:
20404  *             self.callback_free_data(self.data)             # <<<<<<<<<<<<<<
20405  *         elif self.free_data:
20406  *             if self.dtype_is_object:
20407  */
20408     __pyx_v_self->callback_free_data(__pyx_v_self->data);
20409 
20410     /* "View.MemoryView":212
20411  *
20412  *     def __dealloc__(array self):
20413  *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
20414  *             self.callback_free_data(self.data)
20415  *         elif self.free_data:
20416  */
20417     goto __pyx_L3;
20418   }
20419 
20420   /* "View.MemoryView":214
20421  *         if self.callback_free_data != NULL:
20422  *             self.callback_free_data(self.data)
20423  *         elif self.free_data:             # <<<<<<<<<<<<<<
20424  *             if self.dtype_is_object:
20425  *                 refcount_objects_in_slice(self.data, self._shape,
20426  */
20427   __pyx_t_1 = (__pyx_v_self->free_data != 0);
20428   if (__pyx_t_1) {
20429 
20430     /* "View.MemoryView":215
20431  *             self.callback_free_data(self.data)
20432  *         elif self.free_data:
20433  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
20434  *                 refcount_objects_in_slice(self.data, self._shape,
20435  *                                           self._strides, self.ndim, False)
20436  */
20437     __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
20438     if (__pyx_t_1) {
20439 
20440       /* "View.MemoryView":216
20441  *         elif self.free_data:
20442  *             if self.dtype_is_object:
20443  *                 refcount_objects_in_slice(self.data, self._shape,             # <<<<<<<<<<<<<<
20444  *                                           self._strides, self.ndim, False)
20445  *             free(self.data)
20446  */
20447       __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
20448 
20449       /* "View.MemoryView":215
20450  *             self.callback_free_data(self.data)
20451  *         elif self.free_data:
20452  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
20453  *                 refcount_objects_in_slice(self.data, self._shape,
20454  *                                           self._strides, self.ndim, False)
20455  */
20456     }
20457 
20458     /* "View.MemoryView":218
20459  *                 refcount_objects_in_slice(self.data, self._shape,
20460  *                                           self._strides, self.ndim, False)
20461  *             free(self.data)             # <<<<<<<<<<<<<<
20462  *         PyObject_Free(self._shape)
20463  *
20464  */
20465     free(__pyx_v_self->data);
20466 
20467     /* "View.MemoryView":214
20468  *         if self.callback_free_data != NULL:
20469  *             self.callback_free_data(self.data)
20470  *         elif self.free_data:             # <<<<<<<<<<<<<<
20471  *             if self.dtype_is_object:
20472  *                 refcount_objects_in_slice(self.data, self._shape,
20473  */
20474   }
20475   __pyx_L3:;
20476 
20477   /* "View.MemoryView":219
20478  *                                           self._strides, self.ndim, False)
20479  *             free(self.data)
20480  *         PyObject_Free(self._shape)             # <<<<<<<<<<<<<<
20481  *
20482  *     @property
20483  */
20484   PyObject_Free(__pyx_v_self->_shape);
20485 
20486   /* "View.MemoryView":211
20487  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
20488  *
20489  *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
20490  *         if self.callback_free_data != NULL:
20491  *             self.callback_free_data(self.data)
20492  */
20493 
20494   /* function exit code */
20495   __Pyx_RefNannyFinishContext();
20496 }
20497 
20498 /* "View.MemoryView":222
20499  *
20500  *     @property
20501  *     def memview(self):             # <<<<<<<<<<<<<<
20502  *         return self.get_memview()
20503  *
20504  */
20505 
20506 /* Python wrapper */
20507 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)20508 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
20509   PyObject *__pyx_r = 0;
20510   __Pyx_RefNannyDeclarations
20511   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
20512   __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
20513 
20514   /* function exit code */
20515   __Pyx_RefNannyFinishContext();
20516   return __pyx_r;
20517 }
20518 
__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj * __pyx_v_self)20519 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
20520   PyObject *__pyx_r = NULL;
20521   __Pyx_RefNannyDeclarations
20522   PyObject *__pyx_t_1 = NULL;
20523   __Pyx_RefNannySetupContext("__get__", 0);
20524 
20525   /* "View.MemoryView":223
20526  *     @property
20527  *     def memview(self):
20528  *         return self.get_memview()             # <<<<<<<<<<<<<<
20529  *
20530  *     @cname('get_memview')
20531  */
20532   __Pyx_XDECREF(__pyx_r);
20533   __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)
20534   __Pyx_GOTREF(__pyx_t_1);
20535   __pyx_r = __pyx_t_1;
20536   __pyx_t_1 = 0;
20537   goto __pyx_L0;
20538 
20539   /* "View.MemoryView":222
20540  *
20541  *     @property
20542  *     def memview(self):             # <<<<<<<<<<<<<<
20543  *         return self.get_memview()
20544  *
20545  */
20546 
20547   /* function exit code */
20548   __pyx_L1_error:;
20549   __Pyx_XDECREF(__pyx_t_1);
20550   __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20551   __pyx_r = NULL;
20552   __pyx_L0:;
20553   __Pyx_XGIVEREF(__pyx_r);
20554   __Pyx_RefNannyFinishContext();
20555   return __pyx_r;
20556 }
20557 
20558 /* "View.MemoryView":226
20559  *
20560  *     @cname('get_memview')
20561  *     cdef get_memview(self):             # <<<<<<<<<<<<<<
20562  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
20563  *         return  memoryview(self, flags, self.dtype_is_object)
20564  */
20565 
__pyx_array_get_memview(struct __pyx_array_obj * __pyx_v_self)20566 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
20567   int __pyx_v_flags;
20568   PyObject *__pyx_r = NULL;
20569   __Pyx_RefNannyDeclarations
20570   PyObject *__pyx_t_1 = NULL;
20571   PyObject *__pyx_t_2 = NULL;
20572   PyObject *__pyx_t_3 = NULL;
20573   __Pyx_RefNannySetupContext("get_memview", 0);
20574 
20575   /* "View.MemoryView":227
20576  *     @cname('get_memview')
20577  *     cdef get_memview(self):
20578  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE             # <<<<<<<<<<<<<<
20579  *         return  memoryview(self, flags, self.dtype_is_object)
20580  *
20581  */
20582   __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
20583 
20584   /* "View.MemoryView":228
20585  *     cdef get_memview(self):
20586  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
20587  *         return  memoryview(self, flags, self.dtype_is_object)             # <<<<<<<<<<<<<<
20588  *
20589  *     def __len__(self):
20590  */
20591   __Pyx_XDECREF(__pyx_r);
20592   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
20593   __Pyx_GOTREF(__pyx_t_1);
20594   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
20595   __Pyx_GOTREF(__pyx_t_2);
20596   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
20597   __Pyx_GOTREF(__pyx_t_3);
20598   __Pyx_INCREF(((PyObject *)__pyx_v_self));
20599   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
20600   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
20601   __Pyx_GIVEREF(__pyx_t_1);
20602   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
20603   __Pyx_GIVEREF(__pyx_t_2);
20604   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
20605   __pyx_t_1 = 0;
20606   __pyx_t_2 = 0;
20607   __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)
20608   __Pyx_GOTREF(__pyx_t_2);
20609   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20610   __pyx_r = __pyx_t_2;
20611   __pyx_t_2 = 0;
20612   goto __pyx_L0;
20613 
20614   /* "View.MemoryView":226
20615  *
20616  *     @cname('get_memview')
20617  *     cdef get_memview(self):             # <<<<<<<<<<<<<<
20618  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
20619  *         return  memoryview(self, flags, self.dtype_is_object)
20620  */
20621 
20622   /* function exit code */
20623   __pyx_L1_error:;
20624   __Pyx_XDECREF(__pyx_t_1);
20625   __Pyx_XDECREF(__pyx_t_2);
20626   __Pyx_XDECREF(__pyx_t_3);
20627   __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
20628   __pyx_r = 0;
20629   __pyx_L0:;
20630   __Pyx_XGIVEREF(__pyx_r);
20631   __Pyx_RefNannyFinishContext();
20632   return __pyx_r;
20633 }
20634 
20635 /* "View.MemoryView":230
20636  *         return  memoryview(self, flags, self.dtype_is_object)
20637  *
20638  *     def __len__(self):             # <<<<<<<<<<<<<<
20639  *         return self._shape[0]
20640  *
20641  */
20642 
20643 /* Python wrapper */
20644 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
__pyx_array___len__(PyObject * __pyx_v_self)20645 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
20646   Py_ssize_t __pyx_r;
20647   __Pyx_RefNannyDeclarations
20648   __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
20649   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
20650 
20651   /* function exit code */
20652   __Pyx_RefNannyFinishContext();
20653   return __pyx_r;
20654 }
20655 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj * __pyx_v_self)20656 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
20657   Py_ssize_t __pyx_r;
20658   __Pyx_RefNannyDeclarations
20659   __Pyx_RefNannySetupContext("__len__", 0);
20660 
20661   /* "View.MemoryView":231
20662  *
20663  *     def __len__(self):
20664  *         return self._shape[0]             # <<<<<<<<<<<<<<
20665  *
20666  *     def __getattr__(self, attr):
20667  */
20668   __pyx_r = (__pyx_v_self->_shape[0]);
20669   goto __pyx_L0;
20670 
20671   /* "View.MemoryView":230
20672  *         return  memoryview(self, flags, self.dtype_is_object)
20673  *
20674  *     def __len__(self):             # <<<<<<<<<<<<<<
20675  *         return self._shape[0]
20676  *
20677  */
20678 
20679   /* function exit code */
20680   __pyx_L0:;
20681   __Pyx_RefNannyFinishContext();
20682   return __pyx_r;
20683 }
20684 
20685 /* "View.MemoryView":233
20686  *         return self._shape[0]
20687  *
20688  *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
20689  *         return getattr(self.memview, attr)
20690  *
20691  */
20692 
20693 /* Python wrapper */
20694 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)20695 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
20696   PyObject *__pyx_r = 0;
20697   __Pyx_RefNannyDeclarations
20698   __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
20699   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
20700 
20701   /* function exit code */
20702   __Pyx_RefNannyFinishContext();
20703   return __pyx_r;
20704 }
20705 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_attr)20706 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
20707   PyObject *__pyx_r = NULL;
20708   __Pyx_RefNannyDeclarations
20709   PyObject *__pyx_t_1 = NULL;
20710   PyObject *__pyx_t_2 = NULL;
20711   __Pyx_RefNannySetupContext("__getattr__", 0);
20712 
20713   /* "View.MemoryView":234
20714  *
20715  *     def __getattr__(self, attr):
20716  *         return getattr(self.memview, attr)             # <<<<<<<<<<<<<<
20717  *
20718  *     def __getitem__(self, item):
20719  */
20720   __Pyx_XDECREF(__pyx_r);
20721   __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)
20722   __Pyx_GOTREF(__pyx_t_1);
20723   __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
20724   __Pyx_GOTREF(__pyx_t_2);
20725   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20726   __pyx_r = __pyx_t_2;
20727   __pyx_t_2 = 0;
20728   goto __pyx_L0;
20729 
20730   /* "View.MemoryView":233
20731  *         return self._shape[0]
20732  *
20733  *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
20734  *         return getattr(self.memview, attr)
20735  *
20736  */
20737 
20738   /* function exit code */
20739   __pyx_L1_error:;
20740   __Pyx_XDECREF(__pyx_t_1);
20741   __Pyx_XDECREF(__pyx_t_2);
20742   __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20743   __pyx_r = NULL;
20744   __pyx_L0:;
20745   __Pyx_XGIVEREF(__pyx_r);
20746   __Pyx_RefNannyFinishContext();
20747   return __pyx_r;
20748 }
20749 
20750 /* "View.MemoryView":236
20751  *         return getattr(self.memview, attr)
20752  *
20753  *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
20754  *         return self.memview[item]
20755  *
20756  */
20757 
20758 /* Python wrapper */
20759 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)20760 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
20761   PyObject *__pyx_r = 0;
20762   __Pyx_RefNannyDeclarations
20763   __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
20764   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
20765 
20766   /* function exit code */
20767   __Pyx_RefNannyFinishContext();
20768   return __pyx_r;
20769 }
20770 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_item)20771 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
20772   PyObject *__pyx_r = NULL;
20773   __Pyx_RefNannyDeclarations
20774   PyObject *__pyx_t_1 = NULL;
20775   PyObject *__pyx_t_2 = NULL;
20776   __Pyx_RefNannySetupContext("__getitem__", 0);
20777 
20778   /* "View.MemoryView":237
20779  *
20780  *     def __getitem__(self, item):
20781  *         return self.memview[item]             # <<<<<<<<<<<<<<
20782  *
20783  *     def __setitem__(self, item, value):
20784  */
20785   __Pyx_XDECREF(__pyx_r);
20786   __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)
20787   __Pyx_GOTREF(__pyx_t_1);
20788   __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
20789   __Pyx_GOTREF(__pyx_t_2);
20790   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20791   __pyx_r = __pyx_t_2;
20792   __pyx_t_2 = 0;
20793   goto __pyx_L0;
20794 
20795   /* "View.MemoryView":236
20796  *         return getattr(self.memview, attr)
20797  *
20798  *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
20799  *         return self.memview[item]
20800  *
20801  */
20802 
20803   /* function exit code */
20804   __pyx_L1_error:;
20805   __Pyx_XDECREF(__pyx_t_1);
20806   __Pyx_XDECREF(__pyx_t_2);
20807   __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20808   __pyx_r = NULL;
20809   __pyx_L0:;
20810   __Pyx_XGIVEREF(__pyx_r);
20811   __Pyx_RefNannyFinishContext();
20812   return __pyx_r;
20813 }
20814 
20815 /* "View.MemoryView":239
20816  *         return self.memview[item]
20817  *
20818  *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
20819  *         self.memview[item] = value
20820  *
20821  */
20822 
20823 /* Python wrapper */
20824 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)20825 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
20826   int __pyx_r;
20827   __Pyx_RefNannyDeclarations
20828   __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
20829   __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));
20830 
20831   /* function exit code */
20832   __Pyx_RefNannyFinishContext();
20833   return __pyx_r;
20834 }
20835 
__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)20836 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) {
20837   int __pyx_r;
20838   __Pyx_RefNannyDeclarations
20839   PyObject *__pyx_t_1 = NULL;
20840   __Pyx_RefNannySetupContext("__setitem__", 0);
20841 
20842   /* "View.MemoryView":240
20843  *
20844  *     def __setitem__(self, item, value):
20845  *         self.memview[item] = value             # <<<<<<<<<<<<<<
20846  *
20847  *
20848  */
20849   __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)
20850   __Pyx_GOTREF(__pyx_t_1);
20851   if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
20852   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20853 
20854   /* "View.MemoryView":239
20855  *         return self.memview[item]
20856  *
20857  *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
20858  *         self.memview[item] = value
20859  *
20860  */
20861 
20862   /* function exit code */
20863   __pyx_r = 0;
20864   goto __pyx_L0;
20865   __pyx_L1_error:;
20866   __Pyx_XDECREF(__pyx_t_1);
20867   __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20868   __pyx_r = -1;
20869   __pyx_L0:;
20870   __Pyx_RefNannyFinishContext();
20871   return __pyx_r;
20872 }
20873 
20874 /* "(tree fragment)":1
20875  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
20876  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20877  * def __setstate_cython__(self, __pyx_state):
20878  */
20879 
20880 /* Python wrapper */
20881 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)20882 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
20883   PyObject *__pyx_r = 0;
20884   __Pyx_RefNannyDeclarations
20885   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
20886   __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
20887 
20888   /* function exit code */
20889   __Pyx_RefNannyFinishContext();
20890   return __pyx_r;
20891 }
20892 
__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj * __pyx_v_self)20893 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
20894   PyObject *__pyx_r = NULL;
20895   __Pyx_RefNannyDeclarations
20896   PyObject *__pyx_t_1 = NULL;
20897   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
20898 
20899   /* "(tree fragment)":2
20900  * def __reduce_cython__(self):
20901  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
20902  * def __setstate_cython__(self, __pyx_state):
20903  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20904  */
20905   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
20906   __Pyx_GOTREF(__pyx_t_1);
20907   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
20908   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20909   __PYX_ERR(1, 2, __pyx_L1_error)
20910 
20911   /* "(tree fragment)":1
20912  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
20913  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20914  * def __setstate_cython__(self, __pyx_state):
20915  */
20916 
20917   /* function exit code */
20918   __pyx_L1_error:;
20919   __Pyx_XDECREF(__pyx_t_1);
20920   __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20921   __pyx_r = NULL;
20922   __Pyx_XGIVEREF(__pyx_r);
20923   __Pyx_RefNannyFinishContext();
20924   return __pyx_r;
20925 }
20926 
20927 /* "(tree fragment)":3
20928  * def __reduce_cython__(self):
20929  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20930  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
20931  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20932  */
20933 
20934 /* Python wrapper */
20935 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)20936 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
20937   PyObject *__pyx_r = 0;
20938   __Pyx_RefNannyDeclarations
20939   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
20940   __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
20941 
20942   /* function exit code */
20943   __Pyx_RefNannyFinishContext();
20944   return __pyx_r;
20945 }
20946 
__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)20947 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) {
20948   PyObject *__pyx_r = NULL;
20949   __Pyx_RefNannyDeclarations
20950   PyObject *__pyx_t_1 = NULL;
20951   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
20952 
20953   /* "(tree fragment)":4
20954  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20955  * def __setstate_cython__(self, __pyx_state):
20956  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
20957  */
20958   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
20959   __Pyx_GOTREF(__pyx_t_1);
20960   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
20961   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20962   __PYX_ERR(1, 4, __pyx_L1_error)
20963 
20964   /* "(tree fragment)":3
20965  * def __reduce_cython__(self):
20966  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20967  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
20968  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20969  */
20970 
20971   /* function exit code */
20972   __pyx_L1_error:;
20973   __Pyx_XDECREF(__pyx_t_1);
20974   __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20975   __pyx_r = NULL;
20976   __Pyx_XGIVEREF(__pyx_r);
20977   __Pyx_RefNannyFinishContext();
20978   return __pyx_r;
20979 }
20980 
20981 /* "View.MemoryView":244
20982  *
20983  * @cname("__pyx_array_new")
20984  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
20985  *                           char *mode, char *buf):
20986  *     cdef array result
20987  */
20988 
__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)20989 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) {
20990   struct __pyx_array_obj *__pyx_v_result = 0;
20991   struct __pyx_array_obj *__pyx_r = NULL;
20992   __Pyx_RefNannyDeclarations
20993   int __pyx_t_1;
20994   PyObject *__pyx_t_2 = NULL;
20995   PyObject *__pyx_t_3 = NULL;
20996   PyObject *__pyx_t_4 = NULL;
20997   PyObject *__pyx_t_5 = NULL;
20998   __Pyx_RefNannySetupContext("array_cwrapper", 0);
20999 
21000   /* "View.MemoryView":248
21001  *     cdef array result
21002  *
21003  *     if buf == NULL:             # <<<<<<<<<<<<<<
21004  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
21005  *     else:
21006  */
21007   __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
21008   if (__pyx_t_1) {
21009 
21010     /* "View.MemoryView":249
21011  *
21012  *     if buf == NULL:
21013  *         result = array(shape, itemsize, format, mode.decode('ASCII'))             # <<<<<<<<<<<<<<
21014  *     else:
21015  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
21016  */
21017     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
21018     __Pyx_GOTREF(__pyx_t_2);
21019     __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
21020     __Pyx_GOTREF(__pyx_t_3);
21021     __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)
21022     __Pyx_GOTREF(__pyx_t_4);
21023     __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
21024     __Pyx_GOTREF(__pyx_t_5);
21025     __Pyx_INCREF(__pyx_v_shape);
21026     __Pyx_GIVEREF(__pyx_v_shape);
21027     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
21028     __Pyx_GIVEREF(__pyx_t_2);
21029     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
21030     __Pyx_GIVEREF(__pyx_t_3);
21031     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
21032     __Pyx_GIVEREF(__pyx_t_4);
21033     PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
21034     __pyx_t_2 = 0;
21035     __pyx_t_3 = 0;
21036     __pyx_t_4 = 0;
21037     __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)
21038     __Pyx_GOTREF(__pyx_t_4);
21039     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21040     __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
21041     __pyx_t_4 = 0;
21042 
21043     /* "View.MemoryView":248
21044  *     cdef array result
21045  *
21046  *     if buf == NULL:             # <<<<<<<<<<<<<<
21047  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
21048  *     else:
21049  */
21050     goto __pyx_L3;
21051   }
21052 
21053   /* "View.MemoryView":251
21054  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
21055  *     else:
21056  *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
21057  *                        allocate_buffer=False)
21058  *         result.data = buf
21059  */
21060   /*else*/ {
21061     __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
21062     __Pyx_GOTREF(__pyx_t_4);
21063     __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
21064     __Pyx_GOTREF(__pyx_t_5);
21065     __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)
21066     __Pyx_GOTREF(__pyx_t_3);
21067     __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
21068     __Pyx_GOTREF(__pyx_t_2);
21069     __Pyx_INCREF(__pyx_v_shape);
21070     __Pyx_GIVEREF(__pyx_v_shape);
21071     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
21072     __Pyx_GIVEREF(__pyx_t_4);
21073     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
21074     __Pyx_GIVEREF(__pyx_t_5);
21075     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
21076     __Pyx_GIVEREF(__pyx_t_3);
21077     PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
21078     __pyx_t_4 = 0;
21079     __pyx_t_5 = 0;
21080     __pyx_t_3 = 0;
21081 
21082     /* "View.MemoryView":252
21083  *     else:
21084  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
21085  *                        allocate_buffer=False)             # <<<<<<<<<<<<<<
21086  *         result.data = buf
21087  *
21088  */
21089     __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
21090     __Pyx_GOTREF(__pyx_t_3);
21091     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
21092 
21093     /* "View.MemoryView":251
21094  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
21095  *     else:
21096  *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
21097  *                        allocate_buffer=False)
21098  *         result.data = buf
21099  */
21100     __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)
21101     __Pyx_GOTREF(__pyx_t_5);
21102     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21103     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21104     __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
21105     __pyx_t_5 = 0;
21106 
21107     /* "View.MemoryView":253
21108  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
21109  *                        allocate_buffer=False)
21110  *         result.data = buf             # <<<<<<<<<<<<<<
21111  *
21112  *     return result
21113  */
21114     __pyx_v_result->data = __pyx_v_buf;
21115   }
21116   __pyx_L3:;
21117 
21118   /* "View.MemoryView":255
21119  *         result.data = buf
21120  *
21121  *     return result             # <<<<<<<<<<<<<<
21122  *
21123  *
21124  */
21125   __Pyx_XDECREF(((PyObject *)__pyx_r));
21126   __Pyx_INCREF(((PyObject *)__pyx_v_result));
21127   __pyx_r = __pyx_v_result;
21128   goto __pyx_L0;
21129 
21130   /* "View.MemoryView":244
21131  *
21132  * @cname("__pyx_array_new")
21133  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
21134  *                           char *mode, char *buf):
21135  *     cdef array result
21136  */
21137 
21138   /* function exit code */
21139   __pyx_L1_error:;
21140   __Pyx_XDECREF(__pyx_t_2);
21141   __Pyx_XDECREF(__pyx_t_3);
21142   __Pyx_XDECREF(__pyx_t_4);
21143   __Pyx_XDECREF(__pyx_t_5);
21144   __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
21145   __pyx_r = 0;
21146   __pyx_L0:;
21147   __Pyx_XDECREF((PyObject *)__pyx_v_result);
21148   __Pyx_XGIVEREF((PyObject *)__pyx_r);
21149   __Pyx_RefNannyFinishContext();
21150   return __pyx_r;
21151 }
21152 
21153 /* "View.MemoryView":281
21154  * cdef class Enum(object):
21155  *     cdef object name
21156  *     def __init__(self, name):             # <<<<<<<<<<<<<<
21157  *         self.name = name
21158  *     def __repr__(self):
21159  */
21160 
21161 /* Python wrapper */
21162 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)21163 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
21164   PyObject *__pyx_v_name = 0;
21165   int __pyx_r;
21166   __Pyx_RefNannyDeclarations
21167   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
21168   {
21169     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
21170     PyObject* values[1] = {0};
21171     if (unlikely(__pyx_kwds)) {
21172       Py_ssize_t kw_args;
21173       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
21174       switch (pos_args) {
21175         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21176         CYTHON_FALLTHROUGH;
21177         case  0: break;
21178         default: goto __pyx_L5_argtuple_error;
21179       }
21180       kw_args = PyDict_Size(__pyx_kwds);
21181       switch (pos_args) {
21182         case  0:
21183         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
21184         else goto __pyx_L5_argtuple_error;
21185       }
21186       if (unlikely(kw_args > 0)) {
21187         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
21188       }
21189     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
21190       goto __pyx_L5_argtuple_error;
21191     } else {
21192       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21193     }
21194     __pyx_v_name = values[0];
21195   }
21196   goto __pyx_L4_argument_unpacking_done;
21197   __pyx_L5_argtuple_error:;
21198   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
21199   __pyx_L3_error:;
21200   __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21201   __Pyx_RefNannyFinishContext();
21202   return -1;
21203   __pyx_L4_argument_unpacking_done:;
21204   __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
21205 
21206   /* function exit code */
21207   __Pyx_RefNannyFinishContext();
21208   return __pyx_r;
21209 }
21210 
__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj * __pyx_v_self,PyObject * __pyx_v_name)21211 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
21212   int __pyx_r;
21213   __Pyx_RefNannyDeclarations
21214   __Pyx_RefNannySetupContext("__init__", 0);
21215 
21216   /* "View.MemoryView":282
21217  *     cdef object name
21218  *     def __init__(self, name):
21219  *         self.name = name             # <<<<<<<<<<<<<<
21220  *     def __repr__(self):
21221  *         return self.name
21222  */
21223   __Pyx_INCREF(__pyx_v_name);
21224   __Pyx_GIVEREF(__pyx_v_name);
21225   __Pyx_GOTREF(__pyx_v_self->name);
21226   __Pyx_DECREF(__pyx_v_self->name);
21227   __pyx_v_self->name = __pyx_v_name;
21228 
21229   /* "View.MemoryView":281
21230  * cdef class Enum(object):
21231  *     cdef object name
21232  *     def __init__(self, name):             # <<<<<<<<<<<<<<
21233  *         self.name = name
21234  *     def __repr__(self):
21235  */
21236 
21237   /* function exit code */
21238   __pyx_r = 0;
21239   __Pyx_RefNannyFinishContext();
21240   return __pyx_r;
21241 }
21242 
21243 /* "View.MemoryView":283
21244  *     def __init__(self, name):
21245  *         self.name = name
21246  *     def __repr__(self):             # <<<<<<<<<<<<<<
21247  *         return self.name
21248  *
21249  */
21250 
21251 /* Python wrapper */
21252 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_MemviewEnum___repr__(PyObject * __pyx_v_self)21253 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
21254   PyObject *__pyx_r = 0;
21255   __Pyx_RefNannyDeclarations
21256   __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
21257   __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
21258 
21259   /* function exit code */
21260   __Pyx_RefNannyFinishContext();
21261   return __pyx_r;
21262 }
21263 
__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj * __pyx_v_self)21264 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
21265   PyObject *__pyx_r = NULL;
21266   __Pyx_RefNannyDeclarations
21267   __Pyx_RefNannySetupContext("__repr__", 0);
21268 
21269   /* "View.MemoryView":284
21270  *         self.name = name
21271  *     def __repr__(self):
21272  *         return self.name             # <<<<<<<<<<<<<<
21273  *
21274  * cdef generic = Enum("<strided and direct or indirect>")
21275  */
21276   __Pyx_XDECREF(__pyx_r);
21277   __Pyx_INCREF(__pyx_v_self->name);
21278   __pyx_r = __pyx_v_self->name;
21279   goto __pyx_L0;
21280 
21281   /* "View.MemoryView":283
21282  *     def __init__(self, name):
21283  *         self.name = name
21284  *     def __repr__(self):             # <<<<<<<<<<<<<<
21285  *         return self.name
21286  *
21287  */
21288 
21289   /* function exit code */
21290   __pyx_L0:;
21291   __Pyx_XGIVEREF(__pyx_r);
21292   __Pyx_RefNannyFinishContext();
21293   return __pyx_r;
21294 }
21295 
21296 /* "(tree fragment)":1
21297  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
21298  *     cdef tuple state
21299  *     cdef object _dict
21300  */
21301 
21302 /* Python wrapper */
21303 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)21304 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
21305   PyObject *__pyx_r = 0;
21306   __Pyx_RefNannyDeclarations
21307   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
21308   __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
21309 
21310   /* function exit code */
21311   __Pyx_RefNannyFinishContext();
21312   return __pyx_r;
21313 }
21314 
__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj * __pyx_v_self)21315 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
21316   PyObject *__pyx_v_state = 0;
21317   PyObject *__pyx_v__dict = 0;
21318   int __pyx_v_use_setstate;
21319   PyObject *__pyx_r = NULL;
21320   __Pyx_RefNannyDeclarations
21321   PyObject *__pyx_t_1 = NULL;
21322   int __pyx_t_2;
21323   int __pyx_t_3;
21324   PyObject *__pyx_t_4 = NULL;
21325   PyObject *__pyx_t_5 = NULL;
21326   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
21327 
21328   /* "(tree fragment)":5
21329  *     cdef object _dict
21330  *     cdef bint use_setstate
21331  *     state = (self.name,)             # <<<<<<<<<<<<<<
21332  *     _dict = getattr(self, '__dict__', None)
21333  *     if _dict is not None:
21334  */
21335   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
21336   __Pyx_GOTREF(__pyx_t_1);
21337   __Pyx_INCREF(__pyx_v_self->name);
21338   __Pyx_GIVEREF(__pyx_v_self->name);
21339   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
21340   __pyx_v_state = ((PyObject*)__pyx_t_1);
21341   __pyx_t_1 = 0;
21342 
21343   /* "(tree fragment)":6
21344  *     cdef bint use_setstate
21345  *     state = (self.name,)
21346  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
21347  *     if _dict is not None:
21348  *         state += (_dict,)
21349  */
21350   __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)
21351   __Pyx_GOTREF(__pyx_t_1);
21352   __pyx_v__dict = __pyx_t_1;
21353   __pyx_t_1 = 0;
21354 
21355   /* "(tree fragment)":7
21356  *     state = (self.name,)
21357  *     _dict = getattr(self, '__dict__', None)
21358  *     if _dict is not None:             # <<<<<<<<<<<<<<
21359  *         state += (_dict,)
21360  *         use_setstate = True
21361  */
21362   __pyx_t_2 = (__pyx_v__dict != Py_None);
21363   __pyx_t_3 = (__pyx_t_2 != 0);
21364   if (__pyx_t_3) {
21365 
21366     /* "(tree fragment)":8
21367  *     _dict = getattr(self, '__dict__', None)
21368  *     if _dict is not None:
21369  *         state += (_dict,)             # <<<<<<<<<<<<<<
21370  *         use_setstate = True
21371  *     else:
21372  */
21373     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
21374     __Pyx_GOTREF(__pyx_t_1);
21375     __Pyx_INCREF(__pyx_v__dict);
21376     __Pyx_GIVEREF(__pyx_v__dict);
21377     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
21378     __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
21379     __Pyx_GOTREF(__pyx_t_4);
21380     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21381     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
21382     __pyx_t_4 = 0;
21383 
21384     /* "(tree fragment)":9
21385  *     if _dict is not None:
21386  *         state += (_dict,)
21387  *         use_setstate = True             # <<<<<<<<<<<<<<
21388  *     else:
21389  *         use_setstate = self.name is not None
21390  */
21391     __pyx_v_use_setstate = 1;
21392 
21393     /* "(tree fragment)":7
21394  *     state = (self.name,)
21395  *     _dict = getattr(self, '__dict__', None)
21396  *     if _dict is not None:             # <<<<<<<<<<<<<<
21397  *         state += (_dict,)
21398  *         use_setstate = True
21399  */
21400     goto __pyx_L3;
21401   }
21402 
21403   /* "(tree fragment)":11
21404  *         use_setstate = True
21405  *     else:
21406  *         use_setstate = self.name is not None             # <<<<<<<<<<<<<<
21407  *     if use_setstate:
21408  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
21409  */
21410   /*else*/ {
21411     __pyx_t_3 = (__pyx_v_self->name != Py_None);
21412     __pyx_v_use_setstate = __pyx_t_3;
21413   }
21414   __pyx_L3:;
21415 
21416   /* "(tree fragment)":12
21417  *     else:
21418  *         use_setstate = self.name is not None
21419  *     if use_setstate:             # <<<<<<<<<<<<<<
21420  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
21421  *     else:
21422  */
21423   __pyx_t_3 = (__pyx_v_use_setstate != 0);
21424   if (__pyx_t_3) {
21425 
21426     /* "(tree fragment)":13
21427  *         use_setstate = self.name is not None
21428  *     if use_setstate:
21429  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state             # <<<<<<<<<<<<<<
21430  *     else:
21431  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
21432  */
21433     __Pyx_XDECREF(__pyx_r);
21434     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
21435     __Pyx_GOTREF(__pyx_t_4);
21436     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
21437     __Pyx_GOTREF(__pyx_t_1);
21438     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
21439     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
21440     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
21441     __Pyx_INCREF(__pyx_int_184977713);
21442     __Pyx_GIVEREF(__pyx_int_184977713);
21443     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
21444     __Pyx_INCREF(Py_None);
21445     __Pyx_GIVEREF(Py_None);
21446     PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
21447     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
21448     __Pyx_GOTREF(__pyx_t_5);
21449     __Pyx_GIVEREF(__pyx_t_4);
21450     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
21451     __Pyx_GIVEREF(__pyx_t_1);
21452     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
21453     __Pyx_INCREF(__pyx_v_state);
21454     __Pyx_GIVEREF(__pyx_v_state);
21455     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
21456     __pyx_t_4 = 0;
21457     __pyx_t_1 = 0;
21458     __pyx_r = __pyx_t_5;
21459     __pyx_t_5 = 0;
21460     goto __pyx_L0;
21461 
21462     /* "(tree fragment)":12
21463  *     else:
21464  *         use_setstate = self.name is not None
21465  *     if use_setstate:             # <<<<<<<<<<<<<<
21466  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
21467  *     else:
21468  */
21469   }
21470 
21471   /* "(tree fragment)":15
21472  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
21473  *     else:
21474  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)             # <<<<<<<<<<<<<<
21475  * def __setstate_cython__(self, __pyx_state):
21476  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
21477  */
21478   /*else*/ {
21479     __Pyx_XDECREF(__pyx_r);
21480     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
21481     __Pyx_GOTREF(__pyx_t_5);
21482     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
21483     __Pyx_GOTREF(__pyx_t_1);
21484     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
21485     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
21486     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
21487     __Pyx_INCREF(__pyx_int_184977713);
21488     __Pyx_GIVEREF(__pyx_int_184977713);
21489     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
21490     __Pyx_INCREF(__pyx_v_state);
21491     __Pyx_GIVEREF(__pyx_v_state);
21492     PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
21493     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
21494     __Pyx_GOTREF(__pyx_t_4);
21495     __Pyx_GIVEREF(__pyx_t_5);
21496     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
21497     __Pyx_GIVEREF(__pyx_t_1);
21498     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
21499     __pyx_t_5 = 0;
21500     __pyx_t_1 = 0;
21501     __pyx_r = __pyx_t_4;
21502     __pyx_t_4 = 0;
21503     goto __pyx_L0;
21504   }
21505 
21506   /* "(tree fragment)":1
21507  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
21508  *     cdef tuple state
21509  *     cdef object _dict
21510  */
21511 
21512   /* function exit code */
21513   __pyx_L1_error:;
21514   __Pyx_XDECREF(__pyx_t_1);
21515   __Pyx_XDECREF(__pyx_t_4);
21516   __Pyx_XDECREF(__pyx_t_5);
21517   __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21518   __pyx_r = NULL;
21519   __pyx_L0:;
21520   __Pyx_XDECREF(__pyx_v_state);
21521   __Pyx_XDECREF(__pyx_v__dict);
21522   __Pyx_XGIVEREF(__pyx_r);
21523   __Pyx_RefNannyFinishContext();
21524   return __pyx_r;
21525 }
21526 
21527 /* "(tree fragment)":16
21528  *     else:
21529  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
21530  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
21531  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
21532  */
21533 
21534 /* Python wrapper */
21535 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)21536 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
21537   PyObject *__pyx_r = 0;
21538   __Pyx_RefNannyDeclarations
21539   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
21540   __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
21541 
21542   /* function exit code */
21543   __Pyx_RefNannyFinishContext();
21544   return __pyx_r;
21545 }
21546 
__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj * __pyx_v_self,PyObject * __pyx_v___pyx_state)21547 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
21548   PyObject *__pyx_r = NULL;
21549   __Pyx_RefNannyDeclarations
21550   PyObject *__pyx_t_1 = NULL;
21551   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
21552 
21553   /* "(tree fragment)":17
21554  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
21555  * def __setstate_cython__(self, __pyx_state):
21556  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
21557  */
21558   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)
21559   __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)
21560   __Pyx_GOTREF(__pyx_t_1);
21561   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21562 
21563   /* "(tree fragment)":16
21564  *     else:
21565  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
21566  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
21567  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
21568  */
21569 
21570   /* function exit code */
21571   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21572   goto __pyx_L0;
21573   __pyx_L1_error:;
21574   __Pyx_XDECREF(__pyx_t_1);
21575   __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21576   __pyx_r = NULL;
21577   __pyx_L0:;
21578   __Pyx_XGIVEREF(__pyx_r);
21579   __Pyx_RefNannyFinishContext();
21580   return __pyx_r;
21581 }
21582 
21583 /* "View.MemoryView":298
21584  *
21585  * @cname('__pyx_align_pointer')
21586  * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
21587  *     "Align pointer memory on a given boundary"
21588  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
21589  */
21590 
__pyx_align_pointer(void * __pyx_v_memory,size_t __pyx_v_alignment)21591 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
21592   Py_intptr_t __pyx_v_aligned_p;
21593   size_t __pyx_v_offset;
21594   void *__pyx_r;
21595   int __pyx_t_1;
21596 
21597   /* "View.MemoryView":300
21598  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
21599  *     "Align pointer memory on a given boundary"
21600  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory             # <<<<<<<<<<<<<<
21601  *     cdef size_t offset
21602  *
21603  */
21604   __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
21605 
21606   /* "View.MemoryView":304
21607  *
21608  *     with cython.cdivision(True):
21609  *         offset = aligned_p % alignment             # <<<<<<<<<<<<<<
21610  *
21611  *     if offset > 0:
21612  */
21613   __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
21614 
21615   /* "View.MemoryView":306
21616  *         offset = aligned_p % alignment
21617  *
21618  *     if offset > 0:             # <<<<<<<<<<<<<<
21619  *         aligned_p += alignment - offset
21620  *
21621  */
21622   __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
21623   if (__pyx_t_1) {
21624 
21625     /* "View.MemoryView":307
21626  *
21627  *     if offset > 0:
21628  *         aligned_p += alignment - offset             # <<<<<<<<<<<<<<
21629  *
21630  *     return <void *> aligned_p
21631  */
21632     __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
21633 
21634     /* "View.MemoryView":306
21635  *         offset = aligned_p % alignment
21636  *
21637  *     if offset > 0:             # <<<<<<<<<<<<<<
21638  *         aligned_p += alignment - offset
21639  *
21640  */
21641   }
21642 
21643   /* "View.MemoryView":309
21644  *         aligned_p += alignment - offset
21645  *
21646  *     return <void *> aligned_p             # <<<<<<<<<<<<<<
21647  *
21648  *
21649  */
21650   __pyx_r = ((void *)__pyx_v_aligned_p);
21651   goto __pyx_L0;
21652 
21653   /* "View.MemoryView":298
21654  *
21655  * @cname('__pyx_align_pointer')
21656  * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
21657  *     "Align pointer memory on a given boundary"
21658  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
21659  */
21660 
21661   /* function exit code */
21662   __pyx_L0:;
21663   return __pyx_r;
21664 }
21665 
21666 /* "View.MemoryView":345
21667  *     cdef __Pyx_TypeInfo *typeinfo
21668  *
21669  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
21670  *         self.obj = obj
21671  *         self.flags = flags
21672  */
21673 
21674 /* Python wrapper */
21675 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)21676 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
21677   PyObject *__pyx_v_obj = 0;
21678   int __pyx_v_flags;
21679   int __pyx_v_dtype_is_object;
21680   int __pyx_r;
21681   __Pyx_RefNannyDeclarations
21682   __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
21683   {
21684     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
21685     PyObject* values[3] = {0,0,0};
21686     if (unlikely(__pyx_kwds)) {
21687       Py_ssize_t kw_args;
21688       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
21689       switch (pos_args) {
21690         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21691         CYTHON_FALLTHROUGH;
21692         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21693         CYTHON_FALLTHROUGH;
21694         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21695         CYTHON_FALLTHROUGH;
21696         case  0: break;
21697         default: goto __pyx_L5_argtuple_error;
21698       }
21699       kw_args = PyDict_Size(__pyx_kwds);
21700       switch (pos_args) {
21701         case  0:
21702         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
21703         else goto __pyx_L5_argtuple_error;
21704         CYTHON_FALLTHROUGH;
21705         case  1:
21706         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
21707         else {
21708           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
21709         }
21710         CYTHON_FALLTHROUGH;
21711         case  2:
21712         if (kw_args > 0) {
21713           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
21714           if (value) { values[2] = value; kw_args--; }
21715         }
21716       }
21717       if (unlikely(kw_args > 0)) {
21718         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
21719       }
21720     } else {
21721       switch (PyTuple_GET_SIZE(__pyx_args)) {
21722         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21723         CYTHON_FALLTHROUGH;
21724         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21725         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21726         break;
21727         default: goto __pyx_L5_argtuple_error;
21728       }
21729     }
21730     __pyx_v_obj = values[0];
21731     __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)
21732     if (values[2]) {
21733       __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)
21734     } else {
21735       __pyx_v_dtype_is_object = ((int)0);
21736     }
21737   }
21738   goto __pyx_L4_argument_unpacking_done;
21739   __pyx_L5_argtuple_error:;
21740   __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
21741   __pyx_L3_error:;
21742   __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21743   __Pyx_RefNannyFinishContext();
21744   return -1;
21745   __pyx_L4_argument_unpacking_done:;
21746   __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);
21747 
21748   /* function exit code */
21749   __Pyx_RefNannyFinishContext();
21750   return __pyx_r;
21751 }
21752 
__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)21753 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) {
21754   int __pyx_r;
21755   __Pyx_RefNannyDeclarations
21756   int __pyx_t_1;
21757   int __pyx_t_2;
21758   int __pyx_t_3;
21759   int __pyx_t_4;
21760   __Pyx_RefNannySetupContext("__cinit__", 0);
21761 
21762   /* "View.MemoryView":346
21763  *
21764  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
21765  *         self.obj = obj             # <<<<<<<<<<<<<<
21766  *         self.flags = flags
21767  *         if type(self) is memoryview or obj is not None:
21768  */
21769   __Pyx_INCREF(__pyx_v_obj);
21770   __Pyx_GIVEREF(__pyx_v_obj);
21771   __Pyx_GOTREF(__pyx_v_self->obj);
21772   __Pyx_DECREF(__pyx_v_self->obj);
21773   __pyx_v_self->obj = __pyx_v_obj;
21774 
21775   /* "View.MemoryView":347
21776  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
21777  *         self.obj = obj
21778  *         self.flags = flags             # <<<<<<<<<<<<<<
21779  *         if type(self) is memoryview or obj is not None:
21780  *             __Pyx_GetBuffer(obj, &self.view, flags)
21781  */
21782   __pyx_v_self->flags = __pyx_v_flags;
21783 
21784   /* "View.MemoryView":348
21785  *         self.obj = obj
21786  *         self.flags = flags
21787  *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
21788  *             __Pyx_GetBuffer(obj, &self.view, flags)
21789  *             if <PyObject *> self.view.obj == NULL:
21790  */
21791   __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
21792   __pyx_t_3 = (__pyx_t_2 != 0);
21793   if (!__pyx_t_3) {
21794   } else {
21795     __pyx_t_1 = __pyx_t_3;
21796     goto __pyx_L4_bool_binop_done;
21797   }
21798   __pyx_t_3 = (__pyx_v_obj != Py_None);
21799   __pyx_t_2 = (__pyx_t_3 != 0);
21800   __pyx_t_1 = __pyx_t_2;
21801   __pyx_L4_bool_binop_done:;
21802   if (__pyx_t_1) {
21803 
21804     /* "View.MemoryView":349
21805  *         self.flags = flags
21806  *         if type(self) is memoryview or obj is not None:
21807  *             __Pyx_GetBuffer(obj, &self.view, flags)             # <<<<<<<<<<<<<<
21808  *             if <PyObject *> self.view.obj == NULL:
21809  *                 (<__pyx_buffer *> &self.view).obj = Py_None
21810  */
21811     __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)
21812 
21813     /* "View.MemoryView":350
21814  *         if type(self) is memoryview or obj is not None:
21815  *             __Pyx_GetBuffer(obj, &self.view, flags)
21816  *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
21817  *                 (<__pyx_buffer *> &self.view).obj = Py_None
21818  *                 Py_INCREF(Py_None)
21819  */
21820     __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
21821     if (__pyx_t_1) {
21822 
21823       /* "View.MemoryView":351
21824  *             __Pyx_GetBuffer(obj, &self.view, flags)
21825  *             if <PyObject *> self.view.obj == NULL:
21826  *                 (<__pyx_buffer *> &self.view).obj = Py_None             # <<<<<<<<<<<<<<
21827  *                 Py_INCREF(Py_None)
21828  *
21829  */
21830       ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
21831 
21832       /* "View.MemoryView":352
21833  *             if <PyObject *> self.view.obj == NULL:
21834  *                 (<__pyx_buffer *> &self.view).obj = Py_None
21835  *                 Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
21836  *
21837  *         global __pyx_memoryview_thread_locks_used
21838  */
21839       Py_INCREF(Py_None);
21840 
21841       /* "View.MemoryView":350
21842  *         if type(self) is memoryview or obj is not None:
21843  *             __Pyx_GetBuffer(obj, &self.view, flags)
21844  *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
21845  *                 (<__pyx_buffer *> &self.view).obj = Py_None
21846  *                 Py_INCREF(Py_None)
21847  */
21848     }
21849 
21850     /* "View.MemoryView":348
21851  *         self.obj = obj
21852  *         self.flags = flags
21853  *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
21854  *             __Pyx_GetBuffer(obj, &self.view, flags)
21855  *             if <PyObject *> self.view.obj == NULL:
21856  */
21857   }
21858 
21859   /* "View.MemoryView":355
21860  *
21861  *         global __pyx_memoryview_thread_locks_used
21862  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:             # <<<<<<<<<<<<<<
21863  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
21864  *             __pyx_memoryview_thread_locks_used += 1
21865  */
21866   __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
21867   if (__pyx_t_1) {
21868 
21869     /* "View.MemoryView":356
21870  *         global __pyx_memoryview_thread_locks_used
21871  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
21872  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]             # <<<<<<<<<<<<<<
21873  *             __pyx_memoryview_thread_locks_used += 1
21874  *         if self.lock is NULL:
21875  */
21876     __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
21877 
21878     /* "View.MemoryView":357
21879  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
21880  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
21881  *             __pyx_memoryview_thread_locks_used += 1             # <<<<<<<<<<<<<<
21882  *         if self.lock is NULL:
21883  *             self.lock = PyThread_allocate_lock()
21884  */
21885     __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
21886 
21887     /* "View.MemoryView":355
21888  *
21889  *         global __pyx_memoryview_thread_locks_used
21890  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:             # <<<<<<<<<<<<<<
21891  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
21892  *             __pyx_memoryview_thread_locks_used += 1
21893  */
21894   }
21895 
21896   /* "View.MemoryView":358
21897  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
21898  *             __pyx_memoryview_thread_locks_used += 1
21899  *         if self.lock is NULL:             # <<<<<<<<<<<<<<
21900  *             self.lock = PyThread_allocate_lock()
21901  *             if self.lock is NULL:
21902  */
21903   __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
21904   if (__pyx_t_1) {
21905 
21906     /* "View.MemoryView":359
21907  *             __pyx_memoryview_thread_locks_used += 1
21908  *         if self.lock is NULL:
21909  *             self.lock = PyThread_allocate_lock()             # <<<<<<<<<<<<<<
21910  *             if self.lock is NULL:
21911  *                 raise MemoryError
21912  */
21913     __pyx_v_self->lock = PyThread_allocate_lock();
21914 
21915     /* "View.MemoryView":360
21916  *         if self.lock is NULL:
21917  *             self.lock = PyThread_allocate_lock()
21918  *             if self.lock is NULL:             # <<<<<<<<<<<<<<
21919  *                 raise MemoryError
21920  *
21921  */
21922     __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
21923     if (unlikely(__pyx_t_1)) {
21924 
21925       /* "View.MemoryView":361
21926  *             self.lock = PyThread_allocate_lock()
21927  *             if self.lock is NULL:
21928  *                 raise MemoryError             # <<<<<<<<<<<<<<
21929  *
21930  *         if flags & PyBUF_FORMAT:
21931  */
21932       PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
21933 
21934       /* "View.MemoryView":360
21935  *         if self.lock is NULL:
21936  *             self.lock = PyThread_allocate_lock()
21937  *             if self.lock is NULL:             # <<<<<<<<<<<<<<
21938  *                 raise MemoryError
21939  *
21940  */
21941     }
21942 
21943     /* "View.MemoryView":358
21944  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
21945  *             __pyx_memoryview_thread_locks_used += 1
21946  *         if self.lock is NULL:             # <<<<<<<<<<<<<<
21947  *             self.lock = PyThread_allocate_lock()
21948  *             if self.lock is NULL:
21949  */
21950   }
21951 
21952   /* "View.MemoryView":363
21953  *                 raise MemoryError
21954  *
21955  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
21956  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
21957  *         else:
21958  */
21959   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
21960   if (__pyx_t_1) {
21961 
21962     /* "View.MemoryView":364
21963  *
21964  *         if flags & PyBUF_FORMAT:
21965  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')             # <<<<<<<<<<<<<<
21966  *         else:
21967  *             self.dtype_is_object = dtype_is_object
21968  */
21969     __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
21970     if (__pyx_t_2) {
21971     } else {
21972       __pyx_t_1 = __pyx_t_2;
21973       goto __pyx_L11_bool_binop_done;
21974     }
21975     __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
21976     __pyx_t_1 = __pyx_t_2;
21977     __pyx_L11_bool_binop_done:;
21978     __pyx_v_self->dtype_is_object = __pyx_t_1;
21979 
21980     /* "View.MemoryView":363
21981  *                 raise MemoryError
21982  *
21983  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
21984  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
21985  *         else:
21986  */
21987     goto __pyx_L10;
21988   }
21989 
21990   /* "View.MemoryView":366
21991  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
21992  *         else:
21993  *             self.dtype_is_object = dtype_is_object             # <<<<<<<<<<<<<<
21994  *
21995  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
21996  */
21997   /*else*/ {
21998     __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
21999   }
22000   __pyx_L10:;
22001 
22002   /* "View.MemoryView":368
22003  *             self.dtype_is_object = dtype_is_object
22004  *
22005  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(             # <<<<<<<<<<<<<<
22006  *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
22007  *         self.typeinfo = NULL
22008  */
22009   __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
22010 
22011   /* "View.MemoryView":370
22012  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
22013  *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
22014  *         self.typeinfo = NULL             # <<<<<<<<<<<<<<
22015  *
22016  *     def __dealloc__(memoryview self):
22017  */
22018   __pyx_v_self->typeinfo = NULL;
22019 
22020   /* "View.MemoryView":345
22021  *     cdef __Pyx_TypeInfo *typeinfo
22022  *
22023  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
22024  *         self.obj = obj
22025  *         self.flags = flags
22026  */
22027 
22028   /* function exit code */
22029   __pyx_r = 0;
22030   goto __pyx_L0;
22031   __pyx_L1_error:;
22032   __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22033   __pyx_r = -1;
22034   __pyx_L0:;
22035   __Pyx_RefNannyFinishContext();
22036   return __pyx_r;
22037 }
22038 
22039 /* "View.MemoryView":372
22040  *         self.typeinfo = NULL
22041  *
22042  *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
22043  *         if self.obj is not None:
22044  *             __Pyx_ReleaseBuffer(&self.view)
22045  */
22046 
22047 /* Python wrapper */
22048 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___dealloc__(PyObject * __pyx_v_self)22049 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
22050   __Pyx_RefNannyDeclarations
22051   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
22052   __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
22053 
22054   /* function exit code */
22055   __Pyx_RefNannyFinishContext();
22056 }
22057 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj * __pyx_v_self)22058 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
22059   int __pyx_v_i;
22060   __Pyx_RefNannyDeclarations
22061   int __pyx_t_1;
22062   int __pyx_t_2;
22063   int __pyx_t_3;
22064   int __pyx_t_4;
22065   int __pyx_t_5;
22066   PyThread_type_lock __pyx_t_6;
22067   PyThread_type_lock __pyx_t_7;
22068   __Pyx_RefNannySetupContext("__dealloc__", 0);
22069 
22070   /* "View.MemoryView":373
22071  *
22072  *     def __dealloc__(memoryview self):
22073  *         if self.obj is not None:             # <<<<<<<<<<<<<<
22074  *             __Pyx_ReleaseBuffer(&self.view)
22075  *
22076  */
22077   __pyx_t_1 = (__pyx_v_self->obj != Py_None);
22078   __pyx_t_2 = (__pyx_t_1 != 0);
22079   if (__pyx_t_2) {
22080 
22081     /* "View.MemoryView":374
22082  *     def __dealloc__(memoryview self):
22083  *         if self.obj is not None:
22084  *             __Pyx_ReleaseBuffer(&self.view)             # <<<<<<<<<<<<<<
22085  *
22086  *         cdef int i
22087  */
22088     __Pyx_ReleaseBuffer((&__pyx_v_self->view));
22089 
22090     /* "View.MemoryView":373
22091  *
22092  *     def __dealloc__(memoryview self):
22093  *         if self.obj is not None:             # <<<<<<<<<<<<<<
22094  *             __Pyx_ReleaseBuffer(&self.view)
22095  *
22096  */
22097   }
22098 
22099   /* "View.MemoryView":378
22100  *         cdef int i
22101  *         global __pyx_memoryview_thread_locks_used
22102  *         if self.lock != NULL:             # <<<<<<<<<<<<<<
22103  *             for i in range(__pyx_memoryview_thread_locks_used):
22104  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
22105  */
22106   __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
22107   if (__pyx_t_2) {
22108 
22109     /* "View.MemoryView":379
22110  *         global __pyx_memoryview_thread_locks_used
22111  *         if self.lock != NULL:
22112  *             for i in range(__pyx_memoryview_thread_locks_used):             # <<<<<<<<<<<<<<
22113  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
22114  *                     __pyx_memoryview_thread_locks_used -= 1
22115  */
22116     __pyx_t_3 = __pyx_memoryview_thread_locks_used;
22117     __pyx_t_4 = __pyx_t_3;
22118     for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
22119       __pyx_v_i = __pyx_t_5;
22120 
22121       /* "View.MemoryView":380
22122  *         if self.lock != NULL:
22123  *             for i in range(__pyx_memoryview_thread_locks_used):
22124  *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
22125  *                     __pyx_memoryview_thread_locks_used -= 1
22126  *                     if i != __pyx_memoryview_thread_locks_used:
22127  */
22128       __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
22129       if (__pyx_t_2) {
22130 
22131         /* "View.MemoryView":381
22132  *             for i in range(__pyx_memoryview_thread_locks_used):
22133  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
22134  *                     __pyx_memoryview_thread_locks_used -= 1             # <<<<<<<<<<<<<<
22135  *                     if i != __pyx_memoryview_thread_locks_used:
22136  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
22137  */
22138         __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
22139 
22140         /* "View.MemoryView":382
22141  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
22142  *                     __pyx_memoryview_thread_locks_used -= 1
22143  *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
22144  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
22145  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
22146  */
22147         __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
22148         if (__pyx_t_2) {
22149 
22150           /* "View.MemoryView":384
22151  *                     if i != __pyx_memoryview_thread_locks_used:
22152  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
22153  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])             # <<<<<<<<<<<<<<
22154  *                     break
22155  *             else:
22156  */
22157           __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
22158           __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
22159 
22160           /* "View.MemoryView":383
22161  *                     __pyx_memoryview_thread_locks_used -= 1
22162  *                     if i != __pyx_memoryview_thread_locks_used:
22163  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (             # <<<<<<<<<<<<<<
22164  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
22165  *                     break
22166  */
22167           (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
22168           (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
22169 
22170           /* "View.MemoryView":382
22171  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
22172  *                     __pyx_memoryview_thread_locks_used -= 1
22173  *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
22174  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
22175  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
22176  */
22177         }
22178 
22179         /* "View.MemoryView":385
22180  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
22181  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
22182  *                     break             # <<<<<<<<<<<<<<
22183  *             else:
22184  *                 PyThread_free_lock(self.lock)
22185  */
22186         goto __pyx_L6_break;
22187 
22188         /* "View.MemoryView":380
22189  *         if self.lock != NULL:
22190  *             for i in range(__pyx_memoryview_thread_locks_used):
22191  *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
22192  *                     __pyx_memoryview_thread_locks_used -= 1
22193  *                     if i != __pyx_memoryview_thread_locks_used:
22194  */
22195       }
22196     }
22197     /*else*/ {
22198 
22199       /* "View.MemoryView":387
22200  *                     break
22201  *             else:
22202  *                 PyThread_free_lock(self.lock)             # <<<<<<<<<<<<<<
22203  *
22204  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
22205  */
22206       PyThread_free_lock(__pyx_v_self->lock);
22207     }
22208     __pyx_L6_break:;
22209 
22210     /* "View.MemoryView":378
22211  *         cdef int i
22212  *         global __pyx_memoryview_thread_locks_used
22213  *         if self.lock != NULL:             # <<<<<<<<<<<<<<
22214  *             for i in range(__pyx_memoryview_thread_locks_used):
22215  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
22216  */
22217   }
22218 
22219   /* "View.MemoryView":372
22220  *         self.typeinfo = NULL
22221  *
22222  *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
22223  *         if self.obj is not None:
22224  *             __Pyx_ReleaseBuffer(&self.view)
22225  */
22226 
22227   /* function exit code */
22228   __Pyx_RefNannyFinishContext();
22229 }
22230 
22231 /* "View.MemoryView":389
22232  *                 PyThread_free_lock(self.lock)
22233  *
22234  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
22235  *         cdef Py_ssize_t dim
22236  *         cdef char *itemp = <char *> self.view.buf
22237  */
22238 
__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index)22239 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
22240   Py_ssize_t __pyx_v_dim;
22241   char *__pyx_v_itemp;
22242   PyObject *__pyx_v_idx = NULL;
22243   char *__pyx_r;
22244   __Pyx_RefNannyDeclarations
22245   Py_ssize_t __pyx_t_1;
22246   PyObject *__pyx_t_2 = NULL;
22247   Py_ssize_t __pyx_t_3;
22248   PyObject *(*__pyx_t_4)(PyObject *);
22249   PyObject *__pyx_t_5 = NULL;
22250   Py_ssize_t __pyx_t_6;
22251   char *__pyx_t_7;
22252   __Pyx_RefNannySetupContext("get_item_pointer", 0);
22253 
22254   /* "View.MemoryView":391
22255  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
22256  *         cdef Py_ssize_t dim
22257  *         cdef char *itemp = <char *> self.view.buf             # <<<<<<<<<<<<<<
22258  *
22259  *         for dim, idx in enumerate(index):
22260  */
22261   __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
22262 
22263   /* "View.MemoryView":393
22264  *         cdef char *itemp = <char *> self.view.buf
22265  *
22266  *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
22267  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
22268  *
22269  */
22270   __pyx_t_1 = 0;
22271   if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
22272     __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
22273     __pyx_t_4 = NULL;
22274   } else {
22275     __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 393, __pyx_L1_error)
22276     __Pyx_GOTREF(__pyx_t_2);
22277     __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 393, __pyx_L1_error)
22278   }
22279   for (;;) {
22280     if (likely(!__pyx_t_4)) {
22281       if (likely(PyList_CheckExact(__pyx_t_2))) {
22282         if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
22283         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22284         __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, 393, __pyx_L1_error)
22285         #else
22286         __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 393, __pyx_L1_error)
22287         __Pyx_GOTREF(__pyx_t_5);
22288         #endif
22289       } else {
22290         if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
22291         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22292         __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, 393, __pyx_L1_error)
22293         #else
22294         __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 393, __pyx_L1_error)
22295         __Pyx_GOTREF(__pyx_t_5);
22296         #endif
22297       }
22298     } else {
22299       __pyx_t_5 = __pyx_t_4(__pyx_t_2);
22300       if (unlikely(!__pyx_t_5)) {
22301         PyObject* exc_type = PyErr_Occurred();
22302         if (exc_type) {
22303           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
22304           else __PYX_ERR(1, 393, __pyx_L1_error)
22305         }
22306         break;
22307       }
22308       __Pyx_GOTREF(__pyx_t_5);
22309     }
22310     __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
22311     __pyx_t_5 = 0;
22312     __pyx_v_dim = __pyx_t_1;
22313     __pyx_t_1 = (__pyx_t_1 + 1);
22314 
22315     /* "View.MemoryView":394
22316  *
22317  *         for dim, idx in enumerate(index):
22318  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)             # <<<<<<<<<<<<<<
22319  *
22320  *         return itemp
22321  */
22322     __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 394, __pyx_L1_error)
22323     __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, 394, __pyx_L1_error)
22324     __pyx_v_itemp = __pyx_t_7;
22325 
22326     /* "View.MemoryView":393
22327  *         cdef char *itemp = <char *> self.view.buf
22328  *
22329  *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
22330  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
22331  *
22332  */
22333   }
22334   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22335 
22336   /* "View.MemoryView":396
22337  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
22338  *
22339  *         return itemp             # <<<<<<<<<<<<<<
22340  *
22341  *
22342  */
22343   __pyx_r = __pyx_v_itemp;
22344   goto __pyx_L0;
22345 
22346   /* "View.MemoryView":389
22347  *                 PyThread_free_lock(self.lock)
22348  *
22349  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
22350  *         cdef Py_ssize_t dim
22351  *         cdef char *itemp = <char *> self.view.buf
22352  */
22353 
22354   /* function exit code */
22355   __pyx_L1_error:;
22356   __Pyx_XDECREF(__pyx_t_2);
22357   __Pyx_XDECREF(__pyx_t_5);
22358   __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
22359   __pyx_r = NULL;
22360   __pyx_L0:;
22361   __Pyx_XDECREF(__pyx_v_idx);
22362   __Pyx_RefNannyFinishContext();
22363   return __pyx_r;
22364 }
22365 
22366 /* "View.MemoryView":399
22367  *
22368  *
22369  *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
22370  *         if index is Ellipsis:
22371  *             return self
22372  */
22373 
22374 /* Python wrapper */
22375 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)22376 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
22377   PyObject *__pyx_r = 0;
22378   __Pyx_RefNannyDeclarations
22379   __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
22380   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
22381 
22382   /* function exit code */
22383   __Pyx_RefNannyFinishContext();
22384   return __pyx_r;
22385 }
22386 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index)22387 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
22388   PyObject *__pyx_v_have_slices = NULL;
22389   PyObject *__pyx_v_indices = NULL;
22390   char *__pyx_v_itemp;
22391   PyObject *__pyx_r = NULL;
22392   __Pyx_RefNannyDeclarations
22393   int __pyx_t_1;
22394   int __pyx_t_2;
22395   PyObject *__pyx_t_3 = NULL;
22396   PyObject *__pyx_t_4 = NULL;
22397   PyObject *__pyx_t_5 = NULL;
22398   char *__pyx_t_6;
22399   __Pyx_RefNannySetupContext("__getitem__", 0);
22400 
22401   /* "View.MemoryView":400
22402  *
22403  *     def __getitem__(memoryview self, object index):
22404  *         if index is Ellipsis:             # <<<<<<<<<<<<<<
22405  *             return self
22406  *
22407  */
22408   __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
22409   __pyx_t_2 = (__pyx_t_1 != 0);
22410   if (__pyx_t_2) {
22411 
22412     /* "View.MemoryView":401
22413  *     def __getitem__(memoryview self, object index):
22414  *         if index is Ellipsis:
22415  *             return self             # <<<<<<<<<<<<<<
22416  *
22417  *         have_slices, indices = _unellipsify(index, self.view.ndim)
22418  */
22419     __Pyx_XDECREF(__pyx_r);
22420     __Pyx_INCREF(((PyObject *)__pyx_v_self));
22421     __pyx_r = ((PyObject *)__pyx_v_self);
22422     goto __pyx_L0;
22423 
22424     /* "View.MemoryView":400
22425  *
22426  *     def __getitem__(memoryview self, object index):
22427  *         if index is Ellipsis:             # <<<<<<<<<<<<<<
22428  *             return self
22429  *
22430  */
22431   }
22432 
22433   /* "View.MemoryView":403
22434  *             return self
22435  *
22436  *         have_slices, indices = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
22437  *
22438  *         cdef char *itemp
22439  */
22440   __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 403, __pyx_L1_error)
22441   __Pyx_GOTREF(__pyx_t_3);
22442   if (likely(__pyx_t_3 != Py_None)) {
22443     PyObject* sequence = __pyx_t_3;
22444     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
22445     if (unlikely(size != 2)) {
22446       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
22447       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
22448       __PYX_ERR(1, 403, __pyx_L1_error)
22449     }
22450     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22451     __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
22452     __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
22453     __Pyx_INCREF(__pyx_t_4);
22454     __Pyx_INCREF(__pyx_t_5);
22455     #else
22456     __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 403, __pyx_L1_error)
22457     __Pyx_GOTREF(__pyx_t_4);
22458     __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 403, __pyx_L1_error)
22459     __Pyx_GOTREF(__pyx_t_5);
22460     #endif
22461     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22462   } else {
22463     __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 403, __pyx_L1_error)
22464   }
22465   __pyx_v_have_slices = __pyx_t_4;
22466   __pyx_t_4 = 0;
22467   __pyx_v_indices = __pyx_t_5;
22468   __pyx_t_5 = 0;
22469 
22470   /* "View.MemoryView":406
22471  *
22472  *         cdef char *itemp
22473  *         if have_slices:             # <<<<<<<<<<<<<<
22474  *             return memview_slice(self, indices)
22475  *         else:
22476  */
22477   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 406, __pyx_L1_error)
22478   if (__pyx_t_2) {
22479 
22480     /* "View.MemoryView":407
22481  *         cdef char *itemp
22482  *         if have_slices:
22483  *             return memview_slice(self, indices)             # <<<<<<<<<<<<<<
22484  *         else:
22485  *             itemp = self.get_item_pointer(indices)
22486  */
22487     __Pyx_XDECREF(__pyx_r);
22488     __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
22489     __Pyx_GOTREF(__pyx_t_3);
22490     __pyx_r = __pyx_t_3;
22491     __pyx_t_3 = 0;
22492     goto __pyx_L0;
22493 
22494     /* "View.MemoryView":406
22495  *
22496  *         cdef char *itemp
22497  *         if have_slices:             # <<<<<<<<<<<<<<
22498  *             return memview_slice(self, indices)
22499  *         else:
22500  */
22501   }
22502 
22503   /* "View.MemoryView":409
22504  *             return memview_slice(self, indices)
22505  *         else:
22506  *             itemp = self.get_item_pointer(indices)             # <<<<<<<<<<<<<<
22507  *             return self.convert_item_to_object(itemp)
22508  *
22509  */
22510   /*else*/ {
22511     __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, 409, __pyx_L1_error)
22512     __pyx_v_itemp = __pyx_t_6;
22513 
22514     /* "View.MemoryView":410
22515  *         else:
22516  *             itemp = self.get_item_pointer(indices)
22517  *             return self.convert_item_to_object(itemp)             # <<<<<<<<<<<<<<
22518  *
22519  *     def __setitem__(memoryview self, object index, object value):
22520  */
22521     __Pyx_XDECREF(__pyx_r);
22522     __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, 410, __pyx_L1_error)
22523     __Pyx_GOTREF(__pyx_t_3);
22524     __pyx_r = __pyx_t_3;
22525     __pyx_t_3 = 0;
22526     goto __pyx_L0;
22527   }
22528 
22529   /* "View.MemoryView":399
22530  *
22531  *
22532  *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
22533  *         if index is Ellipsis:
22534  *             return self
22535  */
22536 
22537   /* function exit code */
22538   __pyx_L1_error:;
22539   __Pyx_XDECREF(__pyx_t_3);
22540   __Pyx_XDECREF(__pyx_t_4);
22541   __Pyx_XDECREF(__pyx_t_5);
22542   __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22543   __pyx_r = NULL;
22544   __pyx_L0:;
22545   __Pyx_XDECREF(__pyx_v_have_slices);
22546   __Pyx_XDECREF(__pyx_v_indices);
22547   __Pyx_XGIVEREF(__pyx_r);
22548   __Pyx_RefNannyFinishContext();
22549   return __pyx_r;
22550 }
22551 
22552 /* "View.MemoryView":412
22553  *             return self.convert_item_to_object(itemp)
22554  *
22555  *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
22556  *         if self.view.readonly:
22557  *             raise TypeError("Cannot assign to read-only memoryview")
22558  */
22559 
22560 /* Python wrapper */
22561 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)22562 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
22563   int __pyx_r;
22564   __Pyx_RefNannyDeclarations
22565   __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
22566   __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));
22567 
22568   /* function exit code */
22569   __Pyx_RefNannyFinishContext();
22570   return __pyx_r;
22571 }
22572 
__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)22573 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) {
22574   PyObject *__pyx_v_have_slices = NULL;
22575   PyObject *__pyx_v_obj = NULL;
22576   int __pyx_r;
22577   __Pyx_RefNannyDeclarations
22578   int __pyx_t_1;
22579   PyObject *__pyx_t_2 = NULL;
22580   PyObject *__pyx_t_3 = NULL;
22581   PyObject *__pyx_t_4 = NULL;
22582   __Pyx_RefNannySetupContext("__setitem__", 0);
22583   __Pyx_INCREF(__pyx_v_index);
22584 
22585   /* "View.MemoryView":413
22586  *
22587  *     def __setitem__(memoryview self, object index, object value):
22588  *         if self.view.readonly:             # <<<<<<<<<<<<<<
22589  *             raise TypeError("Cannot assign to read-only memoryview")
22590  *
22591  */
22592   __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
22593   if (unlikely(__pyx_t_1)) {
22594 
22595     /* "View.MemoryView":414
22596  *     def __setitem__(memoryview self, object index, object value):
22597  *         if self.view.readonly:
22598  *             raise TypeError("Cannot assign to read-only memoryview")             # <<<<<<<<<<<<<<
22599  *
22600  *         have_slices, index = _unellipsify(index, self.view.ndim)
22601  */
22602     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 414, __pyx_L1_error)
22603     __Pyx_GOTREF(__pyx_t_2);
22604     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
22605     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22606     __PYX_ERR(1, 414, __pyx_L1_error)
22607 
22608     /* "View.MemoryView":413
22609  *
22610  *     def __setitem__(memoryview self, object index, object value):
22611  *         if self.view.readonly:             # <<<<<<<<<<<<<<
22612  *             raise TypeError("Cannot assign to read-only memoryview")
22613  *
22614  */
22615   }
22616 
22617   /* "View.MemoryView":416
22618  *             raise TypeError("Cannot assign to read-only memoryview")
22619  *
22620  *         have_slices, index = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
22621  *
22622  *         if have_slices:
22623  */
22624   __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 416, __pyx_L1_error)
22625   __Pyx_GOTREF(__pyx_t_2);
22626   if (likely(__pyx_t_2 != Py_None)) {
22627     PyObject* sequence = __pyx_t_2;
22628     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
22629     if (unlikely(size != 2)) {
22630       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
22631       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
22632       __PYX_ERR(1, 416, __pyx_L1_error)
22633     }
22634     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22635     __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
22636     __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
22637     __Pyx_INCREF(__pyx_t_3);
22638     __Pyx_INCREF(__pyx_t_4);
22639     #else
22640     __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error)
22641     __Pyx_GOTREF(__pyx_t_3);
22642     __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 416, __pyx_L1_error)
22643     __Pyx_GOTREF(__pyx_t_4);
22644     #endif
22645     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22646   } else {
22647     __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 416, __pyx_L1_error)
22648   }
22649   __pyx_v_have_slices = __pyx_t_3;
22650   __pyx_t_3 = 0;
22651   __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
22652   __pyx_t_4 = 0;
22653 
22654   /* "View.MemoryView":418
22655  *         have_slices, index = _unellipsify(index, self.view.ndim)
22656  *
22657  *         if have_slices:             # <<<<<<<<<<<<<<
22658  *             obj = self.is_slice(value)
22659  *             if obj:
22660  */
22661   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 418, __pyx_L1_error)
22662   if (__pyx_t_1) {
22663 
22664     /* "View.MemoryView":419
22665  *
22666  *         if have_slices:
22667  *             obj = self.is_slice(value)             # <<<<<<<<<<<<<<
22668  *             if obj:
22669  *                 self.setitem_slice_assignment(self[index], obj)
22670  */
22671     __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, 419, __pyx_L1_error)
22672     __Pyx_GOTREF(__pyx_t_2);
22673     __pyx_v_obj = __pyx_t_2;
22674     __pyx_t_2 = 0;
22675 
22676     /* "View.MemoryView":420
22677  *         if have_slices:
22678  *             obj = self.is_slice(value)
22679  *             if obj:             # <<<<<<<<<<<<<<
22680  *                 self.setitem_slice_assignment(self[index], obj)
22681  *             else:
22682  */
22683     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 420, __pyx_L1_error)
22684     if (__pyx_t_1) {
22685 
22686       /* "View.MemoryView":421
22687  *             obj = self.is_slice(value)
22688  *             if obj:
22689  *                 self.setitem_slice_assignment(self[index], obj)             # <<<<<<<<<<<<<<
22690  *             else:
22691  *                 self.setitem_slice_assign_scalar(self[index], value)
22692  */
22693       __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 421, __pyx_L1_error)
22694       __Pyx_GOTREF(__pyx_t_2);
22695       __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, 421, __pyx_L1_error)
22696       __Pyx_GOTREF(__pyx_t_4);
22697       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22698       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22699 
22700       /* "View.MemoryView":420
22701  *         if have_slices:
22702  *             obj = self.is_slice(value)
22703  *             if obj:             # <<<<<<<<<<<<<<
22704  *                 self.setitem_slice_assignment(self[index], obj)
22705  *             else:
22706  */
22707       goto __pyx_L5;
22708     }
22709 
22710     /* "View.MemoryView":423
22711  *                 self.setitem_slice_assignment(self[index], obj)
22712  *             else:
22713  *                 self.setitem_slice_assign_scalar(self[index], value)             # <<<<<<<<<<<<<<
22714  *         else:
22715  *             self.setitem_indexed(index, value)
22716  */
22717     /*else*/ {
22718       __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 423, __pyx_L1_error)
22719       __Pyx_GOTREF(__pyx_t_4);
22720       if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 423, __pyx_L1_error)
22721       __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, 423, __pyx_L1_error)
22722       __Pyx_GOTREF(__pyx_t_2);
22723       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22724       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22725     }
22726     __pyx_L5:;
22727 
22728     /* "View.MemoryView":418
22729  *         have_slices, index = _unellipsify(index, self.view.ndim)
22730  *
22731  *         if have_slices:             # <<<<<<<<<<<<<<
22732  *             obj = self.is_slice(value)
22733  *             if obj:
22734  */
22735     goto __pyx_L4;
22736   }
22737 
22738   /* "View.MemoryView":425
22739  *                 self.setitem_slice_assign_scalar(self[index], value)
22740  *         else:
22741  *             self.setitem_indexed(index, value)             # <<<<<<<<<<<<<<
22742  *
22743  *     cdef is_slice(self, obj):
22744  */
22745   /*else*/ {
22746     __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, 425, __pyx_L1_error)
22747     __Pyx_GOTREF(__pyx_t_2);
22748     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22749   }
22750   __pyx_L4:;
22751 
22752   /* "View.MemoryView":412
22753  *             return self.convert_item_to_object(itemp)
22754  *
22755  *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
22756  *         if self.view.readonly:
22757  *             raise TypeError("Cannot assign to read-only memoryview")
22758  */
22759 
22760   /* function exit code */
22761   __pyx_r = 0;
22762   goto __pyx_L0;
22763   __pyx_L1_error:;
22764   __Pyx_XDECREF(__pyx_t_2);
22765   __Pyx_XDECREF(__pyx_t_3);
22766   __Pyx_XDECREF(__pyx_t_4);
22767   __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22768   __pyx_r = -1;
22769   __pyx_L0:;
22770   __Pyx_XDECREF(__pyx_v_have_slices);
22771   __Pyx_XDECREF(__pyx_v_obj);
22772   __Pyx_XDECREF(__pyx_v_index);
22773   __Pyx_RefNannyFinishContext();
22774   return __pyx_r;
22775 }
22776 
22777 /* "View.MemoryView":427
22778  *             self.setitem_indexed(index, value)
22779  *
22780  *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
22781  *         if not isinstance(obj, memoryview):
22782  *             try:
22783  */
22784 
__pyx_memoryview_is_slice(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_obj)22785 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
22786   PyObject *__pyx_r = NULL;
22787   __Pyx_RefNannyDeclarations
22788   int __pyx_t_1;
22789   int __pyx_t_2;
22790   PyObject *__pyx_t_3 = NULL;
22791   PyObject *__pyx_t_4 = NULL;
22792   PyObject *__pyx_t_5 = NULL;
22793   PyObject *__pyx_t_6 = NULL;
22794   PyObject *__pyx_t_7 = NULL;
22795   PyObject *__pyx_t_8 = NULL;
22796   int __pyx_t_9;
22797   __Pyx_RefNannySetupContext("is_slice", 0);
22798   __Pyx_INCREF(__pyx_v_obj);
22799 
22800   /* "View.MemoryView":428
22801  *
22802  *     cdef is_slice(self, obj):
22803  *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
22804  *             try:
22805  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
22806  */
22807   __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
22808   __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
22809   if (__pyx_t_2) {
22810 
22811     /* "View.MemoryView":429
22812  *     cdef is_slice(self, obj):
22813  *         if not isinstance(obj, memoryview):
22814  *             try:             # <<<<<<<<<<<<<<
22815  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
22816  *                                  self.dtype_is_object)
22817  */
22818     {
22819       __Pyx_PyThreadState_declare
22820       __Pyx_PyThreadState_assign
22821       __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
22822       __Pyx_XGOTREF(__pyx_t_3);
22823       __Pyx_XGOTREF(__pyx_t_4);
22824       __Pyx_XGOTREF(__pyx_t_5);
22825       /*try:*/ {
22826 
22827         /* "View.MemoryView":430
22828  *         if not isinstance(obj, memoryview):
22829  *             try:
22830  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
22831  *                                  self.dtype_is_object)
22832  *             except TypeError:
22833  */
22834         __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 430, __pyx_L4_error)
22835         __Pyx_GOTREF(__pyx_t_6);
22836 
22837         /* "View.MemoryView":431
22838  *             try:
22839  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
22840  *                                  self.dtype_is_object)             # <<<<<<<<<<<<<<
22841  *             except TypeError:
22842  *                 return None
22843  */
22844         __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 431, __pyx_L4_error)
22845         __Pyx_GOTREF(__pyx_t_7);
22846 
22847         /* "View.MemoryView":430
22848  *         if not isinstance(obj, memoryview):
22849  *             try:
22850  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
22851  *                                  self.dtype_is_object)
22852  *             except TypeError:
22853  */
22854         __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 430, __pyx_L4_error)
22855         __Pyx_GOTREF(__pyx_t_8);
22856         __Pyx_INCREF(__pyx_v_obj);
22857         __Pyx_GIVEREF(__pyx_v_obj);
22858         PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
22859         __Pyx_GIVEREF(__pyx_t_6);
22860         PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
22861         __Pyx_GIVEREF(__pyx_t_7);
22862         PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
22863         __pyx_t_6 = 0;
22864         __pyx_t_7 = 0;
22865         __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 430, __pyx_L4_error)
22866         __Pyx_GOTREF(__pyx_t_7);
22867         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22868         __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
22869         __pyx_t_7 = 0;
22870 
22871         /* "View.MemoryView":429
22872  *     cdef is_slice(self, obj):
22873  *         if not isinstance(obj, memoryview):
22874  *             try:             # <<<<<<<<<<<<<<
22875  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
22876  *                                  self.dtype_is_object)
22877  */
22878       }
22879       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
22880       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
22881       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
22882       goto __pyx_L9_try_end;
22883       __pyx_L4_error:;
22884       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
22885       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
22886       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
22887 
22888       /* "View.MemoryView":432
22889  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
22890  *                                  self.dtype_is_object)
22891  *             except TypeError:             # <<<<<<<<<<<<<<
22892  *                 return None
22893  *
22894  */
22895       __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
22896       if (__pyx_t_9) {
22897         __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
22898         if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 432, __pyx_L6_except_error)
22899         __Pyx_GOTREF(__pyx_t_7);
22900         __Pyx_GOTREF(__pyx_t_8);
22901         __Pyx_GOTREF(__pyx_t_6);
22902 
22903         /* "View.MemoryView":433
22904  *                                  self.dtype_is_object)
22905  *             except TypeError:
22906  *                 return None             # <<<<<<<<<<<<<<
22907  *
22908  *         return obj
22909  */
22910         __Pyx_XDECREF(__pyx_r);
22911         __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22912         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22913         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22914         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22915         goto __pyx_L7_except_return;
22916       }
22917       goto __pyx_L6_except_error;
22918       __pyx_L6_except_error:;
22919 
22920       /* "View.MemoryView":429
22921  *     cdef is_slice(self, obj):
22922  *         if not isinstance(obj, memoryview):
22923  *             try:             # <<<<<<<<<<<<<<
22924  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
22925  *                                  self.dtype_is_object)
22926  */
22927       __Pyx_XGIVEREF(__pyx_t_3);
22928       __Pyx_XGIVEREF(__pyx_t_4);
22929       __Pyx_XGIVEREF(__pyx_t_5);
22930       __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
22931       goto __pyx_L1_error;
22932       __pyx_L7_except_return:;
22933       __Pyx_XGIVEREF(__pyx_t_3);
22934       __Pyx_XGIVEREF(__pyx_t_4);
22935       __Pyx_XGIVEREF(__pyx_t_5);
22936       __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
22937       goto __pyx_L0;
22938       __pyx_L9_try_end:;
22939     }
22940 
22941     /* "View.MemoryView":428
22942  *
22943  *     cdef is_slice(self, obj):
22944  *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
22945  *             try:
22946  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
22947  */
22948   }
22949 
22950   /* "View.MemoryView":435
22951  *                 return None
22952  *
22953  *         return obj             # <<<<<<<<<<<<<<
22954  *
22955  *     cdef setitem_slice_assignment(self, dst, src):
22956  */
22957   __Pyx_XDECREF(__pyx_r);
22958   __Pyx_INCREF(__pyx_v_obj);
22959   __pyx_r = __pyx_v_obj;
22960   goto __pyx_L0;
22961 
22962   /* "View.MemoryView":427
22963  *             self.setitem_indexed(index, value)
22964  *
22965  *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
22966  *         if not isinstance(obj, memoryview):
22967  *             try:
22968  */
22969 
22970   /* function exit code */
22971   __pyx_L1_error:;
22972   __Pyx_XDECREF(__pyx_t_6);
22973   __Pyx_XDECREF(__pyx_t_7);
22974   __Pyx_XDECREF(__pyx_t_8);
22975   __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
22976   __pyx_r = 0;
22977   __pyx_L0:;
22978   __Pyx_XDECREF(__pyx_v_obj);
22979   __Pyx_XGIVEREF(__pyx_r);
22980   __Pyx_RefNannyFinishContext();
22981   return __pyx_r;
22982 }
22983 
22984 /* "View.MemoryView":437
22985  *         return obj
22986  *
22987  *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
22988  *         cdef __Pyx_memviewslice dst_slice
22989  *         cdef __Pyx_memviewslice src_slice
22990  */
22991 
__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_dst,PyObject * __pyx_v_src)22992 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
22993   __Pyx_memviewslice __pyx_v_dst_slice;
22994   __Pyx_memviewslice __pyx_v_src_slice;
22995   PyObject *__pyx_r = NULL;
22996   __Pyx_RefNannyDeclarations
22997   PyObject *__pyx_t_1 = NULL;
22998   int __pyx_t_2;
22999   int __pyx_t_3;
23000   int __pyx_t_4;
23001   __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
23002 
23003   /* "View.MemoryView":441
23004  *         cdef __Pyx_memviewslice src_slice
23005  *
23006  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
23007  *                                  get_slice_from_memview(dst, &dst_slice)[0],
23008  *                                  src.ndim, dst.ndim, self.dtype_is_object)
23009  */
23010   if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 441, __pyx_L1_error)
23011 
23012   /* "View.MemoryView":442
23013  *
23014  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
23015  *                                  get_slice_from_memview(dst, &dst_slice)[0],             # <<<<<<<<<<<<<<
23016  *                                  src.ndim, dst.ndim, self.dtype_is_object)
23017  *
23018  */
23019   if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 442, __pyx_L1_error)
23020 
23021   /* "View.MemoryView":443
23022  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
23023  *                                  get_slice_from_memview(dst, &dst_slice)[0],
23024  *                                  src.ndim, dst.ndim, self.dtype_is_object)             # <<<<<<<<<<<<<<
23025  *
23026  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
23027  */
23028   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 443, __pyx_L1_error)
23029   __Pyx_GOTREF(__pyx_t_1);
23030   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 443, __pyx_L1_error)
23031   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23032   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 443, __pyx_L1_error)
23033   __Pyx_GOTREF(__pyx_t_1);
23034   __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 443, __pyx_L1_error)
23035   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23036 
23037   /* "View.MemoryView":441
23038  *         cdef __Pyx_memviewslice src_slice
23039  *
23040  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
23041  *                                  get_slice_from_memview(dst, &dst_slice)[0],
23042  *                                  src.ndim, dst.ndim, self.dtype_is_object)
23043  */
23044   __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 441, __pyx_L1_error)
23045 
23046   /* "View.MemoryView":437
23047  *         return obj
23048  *
23049  *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
23050  *         cdef __Pyx_memviewslice dst_slice
23051  *         cdef __Pyx_memviewslice src_slice
23052  */
23053 
23054   /* function exit code */
23055   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23056   goto __pyx_L0;
23057   __pyx_L1_error:;
23058   __Pyx_XDECREF(__pyx_t_1);
23059   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
23060   __pyx_r = 0;
23061   __pyx_L0:;
23062   __Pyx_XGIVEREF(__pyx_r);
23063   __Pyx_RefNannyFinishContext();
23064   return __pyx_r;
23065 }
23066 
23067 /* "View.MemoryView":445
23068  *                                  src.ndim, dst.ndim, self.dtype_is_object)
23069  *
23070  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
23071  *         cdef int array[128]
23072  *         cdef void *tmp = NULL
23073  */
23074 
__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj * __pyx_v_self,struct __pyx_memoryview_obj * __pyx_v_dst,PyObject * __pyx_v_value)23075 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) {
23076   int __pyx_v_array[0x80];
23077   void *__pyx_v_tmp;
23078   void *__pyx_v_item;
23079   __Pyx_memviewslice *__pyx_v_dst_slice;
23080   __Pyx_memviewslice __pyx_v_tmp_slice;
23081   PyObject *__pyx_r = NULL;
23082   __Pyx_RefNannyDeclarations
23083   int __pyx_t_1;
23084   PyObject *__pyx_t_2 = NULL;
23085   int __pyx_t_3;
23086   int __pyx_t_4;
23087   char const *__pyx_t_5;
23088   PyObject *__pyx_t_6 = NULL;
23089   PyObject *__pyx_t_7 = NULL;
23090   PyObject *__pyx_t_8 = NULL;
23091   PyObject *__pyx_t_9 = NULL;
23092   PyObject *__pyx_t_10 = NULL;
23093   PyObject *__pyx_t_11 = NULL;
23094   __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
23095 
23096   /* "View.MemoryView":447
23097  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
23098  *         cdef int array[128]
23099  *         cdef void *tmp = NULL             # <<<<<<<<<<<<<<
23100  *         cdef void *item
23101  *
23102  */
23103   __pyx_v_tmp = NULL;
23104 
23105   /* "View.MemoryView":452
23106  *         cdef __Pyx_memviewslice *dst_slice
23107  *         cdef __Pyx_memviewslice tmp_slice
23108  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)             # <<<<<<<<<<<<<<
23109  *
23110  *         if <size_t>self.view.itemsize > sizeof(array):
23111  */
23112   __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
23113 
23114   /* "View.MemoryView":454
23115  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
23116  *
23117  *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
23118  *             tmp = PyMem_Malloc(self.view.itemsize)
23119  *             if tmp == NULL:
23120  */
23121   __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
23122   if (__pyx_t_1) {
23123 
23124     /* "View.MemoryView":455
23125  *
23126  *         if <size_t>self.view.itemsize > sizeof(array):
23127  *             tmp = PyMem_Malloc(self.view.itemsize)             # <<<<<<<<<<<<<<
23128  *             if tmp == NULL:
23129  *                 raise MemoryError
23130  */
23131     __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
23132 
23133     /* "View.MemoryView":456
23134  *         if <size_t>self.view.itemsize > sizeof(array):
23135  *             tmp = PyMem_Malloc(self.view.itemsize)
23136  *             if tmp == NULL:             # <<<<<<<<<<<<<<
23137  *                 raise MemoryError
23138  *             item = tmp
23139  */
23140     __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
23141     if (unlikely(__pyx_t_1)) {
23142 
23143       /* "View.MemoryView":457
23144  *             tmp = PyMem_Malloc(self.view.itemsize)
23145  *             if tmp == NULL:
23146  *                 raise MemoryError             # <<<<<<<<<<<<<<
23147  *             item = tmp
23148  *         else:
23149  */
23150       PyErr_NoMemory(); __PYX_ERR(1, 457, __pyx_L1_error)
23151 
23152       /* "View.MemoryView":456
23153  *         if <size_t>self.view.itemsize > sizeof(array):
23154  *             tmp = PyMem_Malloc(self.view.itemsize)
23155  *             if tmp == NULL:             # <<<<<<<<<<<<<<
23156  *                 raise MemoryError
23157  *             item = tmp
23158  */
23159     }
23160 
23161     /* "View.MemoryView":458
23162  *             if tmp == NULL:
23163  *                 raise MemoryError
23164  *             item = tmp             # <<<<<<<<<<<<<<
23165  *         else:
23166  *             item = <void *> array
23167  */
23168     __pyx_v_item = __pyx_v_tmp;
23169 
23170     /* "View.MemoryView":454
23171  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
23172  *
23173  *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
23174  *             tmp = PyMem_Malloc(self.view.itemsize)
23175  *             if tmp == NULL:
23176  */
23177     goto __pyx_L3;
23178   }
23179 
23180   /* "View.MemoryView":460
23181  *             item = tmp
23182  *         else:
23183  *             item = <void *> array             # <<<<<<<<<<<<<<
23184  *
23185  *         try:
23186  */
23187   /*else*/ {
23188     __pyx_v_item = ((void *)__pyx_v_array);
23189   }
23190   __pyx_L3:;
23191 
23192   /* "View.MemoryView":462
23193  *             item = <void *> array
23194  *
23195  *         try:             # <<<<<<<<<<<<<<
23196  *             if self.dtype_is_object:
23197  *                 (<PyObject **> item)[0] = <PyObject *> value
23198  */
23199   /*try:*/ {
23200 
23201     /* "View.MemoryView":463
23202  *
23203  *         try:
23204  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
23205  *                 (<PyObject **> item)[0] = <PyObject *> value
23206  *             else:
23207  */
23208     __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
23209     if (__pyx_t_1) {
23210 
23211       /* "View.MemoryView":464
23212  *         try:
23213  *             if self.dtype_is_object:
23214  *                 (<PyObject **> item)[0] = <PyObject *> value             # <<<<<<<<<<<<<<
23215  *             else:
23216  *                 self.assign_item_from_object(<char *> item, value)
23217  */
23218       (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
23219 
23220       /* "View.MemoryView":463
23221  *
23222  *         try:
23223  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
23224  *                 (<PyObject **> item)[0] = <PyObject *> value
23225  *             else:
23226  */
23227       goto __pyx_L8;
23228     }
23229 
23230     /* "View.MemoryView":466
23231  *                 (<PyObject **> item)[0] = <PyObject *> value
23232  *             else:
23233  *                 self.assign_item_from_object(<char *> item, value)             # <<<<<<<<<<<<<<
23234  *
23235  *
23236  */
23237     /*else*/ {
23238       __pyx_t_2 = ((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_2)) __PYX_ERR(1, 466, __pyx_L6_error)
23239       __Pyx_GOTREF(__pyx_t_2);
23240       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23241     }
23242     __pyx_L8:;
23243 
23244     /* "View.MemoryView":470
23245  *
23246  *
23247  *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
23248  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
23249  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
23250  */
23251     __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
23252     if (__pyx_t_1) {
23253 
23254       /* "View.MemoryView":471
23255  *
23256  *             if self.view.suboffsets != NULL:
23257  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)             # <<<<<<<<<<<<<<
23258  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
23259  *                                 item, self.dtype_is_object)
23260  */
23261       __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 471, __pyx_L6_error)
23262       __Pyx_GOTREF(__pyx_t_2);
23263       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23264 
23265       /* "View.MemoryView":470
23266  *
23267  *
23268  *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
23269  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
23270  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
23271  */
23272     }
23273 
23274     /* "View.MemoryView":472
23275  *             if self.view.suboffsets != NULL:
23276  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
23277  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,             # <<<<<<<<<<<<<<
23278  *                                 item, self.dtype_is_object)
23279  *         finally:
23280  */
23281     __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);
23282   }
23283 
23284   /* "View.MemoryView":475
23285  *                                 item, self.dtype_is_object)
23286  *         finally:
23287  *             PyMem_Free(tmp)             # <<<<<<<<<<<<<<
23288  *
23289  *     cdef setitem_indexed(self, index, value):
23290  */
23291   /*finally:*/ {
23292     /*normal exit:*/{
23293       PyMem_Free(__pyx_v_tmp);
23294       goto __pyx_L7;
23295     }
23296     __pyx_L6_error:;
23297     /*exception exit:*/{
23298       __Pyx_PyThreadState_declare
23299       __Pyx_PyThreadState_assign
23300       __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
23301       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23302       if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
23303       if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
23304       __Pyx_XGOTREF(__pyx_t_6);
23305       __Pyx_XGOTREF(__pyx_t_7);
23306       __Pyx_XGOTREF(__pyx_t_8);
23307       __Pyx_XGOTREF(__pyx_t_9);
23308       __Pyx_XGOTREF(__pyx_t_10);
23309       __Pyx_XGOTREF(__pyx_t_11);
23310       __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
23311       {
23312         PyMem_Free(__pyx_v_tmp);
23313       }
23314       if (PY_MAJOR_VERSION >= 3) {
23315         __Pyx_XGIVEREF(__pyx_t_9);
23316         __Pyx_XGIVEREF(__pyx_t_10);
23317         __Pyx_XGIVEREF(__pyx_t_11);
23318         __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
23319       }
23320       __Pyx_XGIVEREF(__pyx_t_6);
23321       __Pyx_XGIVEREF(__pyx_t_7);
23322       __Pyx_XGIVEREF(__pyx_t_8);
23323       __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
23324       __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
23325       __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
23326       goto __pyx_L1_error;
23327     }
23328     __pyx_L7:;
23329   }
23330 
23331   /* "View.MemoryView":445
23332  *                                  src.ndim, dst.ndim, self.dtype_is_object)
23333  *
23334  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
23335  *         cdef int array[128]
23336  *         cdef void *tmp = NULL
23337  */
23338 
23339   /* function exit code */
23340   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23341   goto __pyx_L0;
23342   __pyx_L1_error:;
23343   __Pyx_XDECREF(__pyx_t_2);
23344   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
23345   __pyx_r = 0;
23346   __pyx_L0:;
23347   __Pyx_XGIVEREF(__pyx_r);
23348   __Pyx_RefNannyFinishContext();
23349   return __pyx_r;
23350 }
23351 
23352 /* "View.MemoryView":477
23353  *             PyMem_Free(tmp)
23354  *
23355  *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
23356  *         cdef char *itemp = self.get_item_pointer(index)
23357  *         self.assign_item_from_object(itemp, value)
23358  */
23359 
__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index,PyObject * __pyx_v_value)23360 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
23361   char *__pyx_v_itemp;
23362   PyObject *__pyx_r = NULL;
23363   __Pyx_RefNannyDeclarations
23364   char *__pyx_t_1;
23365   PyObject *__pyx_t_2 = NULL;
23366   __Pyx_RefNannySetupContext("setitem_indexed", 0);
23367 
23368   /* "View.MemoryView":478
23369  *
23370  *     cdef setitem_indexed(self, index, value):
23371  *         cdef char *itemp = self.get_item_pointer(index)             # <<<<<<<<<<<<<<
23372  *         self.assign_item_from_object(itemp, value)
23373  *
23374  */
23375   __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, 478, __pyx_L1_error)
23376   __pyx_v_itemp = __pyx_t_1;
23377 
23378   /* "View.MemoryView":479
23379  *     cdef setitem_indexed(self, index, value):
23380  *         cdef char *itemp = self.get_item_pointer(index)
23381  *         self.assign_item_from_object(itemp, value)             # <<<<<<<<<<<<<<
23382  *
23383  *     cdef convert_item_to_object(self, char *itemp):
23384  */
23385   __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, 479, __pyx_L1_error)
23386   __Pyx_GOTREF(__pyx_t_2);
23387   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23388 
23389   /* "View.MemoryView":477
23390  *             PyMem_Free(tmp)
23391  *
23392  *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
23393  *         cdef char *itemp = self.get_item_pointer(index)
23394  *         self.assign_item_from_object(itemp, value)
23395  */
23396 
23397   /* function exit code */
23398   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23399   goto __pyx_L0;
23400   __pyx_L1_error:;
23401   __Pyx_XDECREF(__pyx_t_2);
23402   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
23403   __pyx_r = 0;
23404   __pyx_L0:;
23405   __Pyx_XGIVEREF(__pyx_r);
23406   __Pyx_RefNannyFinishContext();
23407   return __pyx_r;
23408 }
23409 
23410 /* "View.MemoryView":481
23411  *         self.assign_item_from_object(itemp, value)
23412  *
23413  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
23414  *         """Only used if instantiated manually by the user, or if Cython doesn't
23415  *         know how to convert the type"""
23416  */
23417 
__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj * __pyx_v_self,char * __pyx_v_itemp)23418 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
23419   PyObject *__pyx_v_struct = NULL;
23420   PyObject *__pyx_v_bytesitem = 0;
23421   PyObject *__pyx_v_result = NULL;
23422   PyObject *__pyx_r = NULL;
23423   __Pyx_RefNannyDeclarations
23424   PyObject *__pyx_t_1 = NULL;
23425   PyObject *__pyx_t_2 = NULL;
23426   PyObject *__pyx_t_3 = NULL;
23427   PyObject *__pyx_t_4 = NULL;
23428   PyObject *__pyx_t_5 = NULL;
23429   PyObject *__pyx_t_6 = NULL;
23430   PyObject *__pyx_t_7 = NULL;
23431   int __pyx_t_8;
23432   PyObject *__pyx_t_9 = NULL;
23433   size_t __pyx_t_10;
23434   int __pyx_t_11;
23435   __Pyx_RefNannySetupContext("convert_item_to_object", 0);
23436 
23437   /* "View.MemoryView":484
23438  *         """Only used if instantiated manually by the user, or if Cython doesn't
23439  *         know how to convert the type"""
23440  *         import struct             # <<<<<<<<<<<<<<
23441  *         cdef bytes bytesitem
23442  *
23443  */
23444   __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 484, __pyx_L1_error)
23445   __Pyx_GOTREF(__pyx_t_1);
23446   __pyx_v_struct = __pyx_t_1;
23447   __pyx_t_1 = 0;
23448 
23449   /* "View.MemoryView":487
23450  *         cdef bytes bytesitem
23451  *
23452  *         bytesitem = itemp[:self.view.itemsize]             # <<<<<<<<<<<<<<
23453  *         try:
23454  *             result = struct.unpack(self.view.format, bytesitem)
23455  */
23456   __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __pyx_L1_error)
23457   __Pyx_GOTREF(__pyx_t_1);
23458   __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
23459   __pyx_t_1 = 0;
23460 
23461   /* "View.MemoryView":488
23462  *
23463  *         bytesitem = itemp[:self.view.itemsize]
23464  *         try:             # <<<<<<<<<<<<<<
23465  *             result = struct.unpack(self.view.format, bytesitem)
23466  *         except struct.error:
23467  */
23468   {
23469     __Pyx_PyThreadState_declare
23470     __Pyx_PyThreadState_assign
23471     __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
23472     __Pyx_XGOTREF(__pyx_t_2);
23473     __Pyx_XGOTREF(__pyx_t_3);
23474     __Pyx_XGOTREF(__pyx_t_4);
23475     /*try:*/ {
23476 
23477       /* "View.MemoryView":489
23478  *         bytesitem = itemp[:self.view.itemsize]
23479  *         try:
23480  *             result = struct.unpack(self.view.format, bytesitem)             # <<<<<<<<<<<<<<
23481  *         except struct.error:
23482  *             raise ValueError("Unable to convert item to object")
23483  */
23484       __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 489, __pyx_L3_error)
23485       __Pyx_GOTREF(__pyx_t_5);
23486       __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 489, __pyx_L3_error)
23487       __Pyx_GOTREF(__pyx_t_6);
23488       __pyx_t_7 = NULL;
23489       __pyx_t_8 = 0;
23490       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
23491         __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
23492         if (likely(__pyx_t_7)) {
23493           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
23494           __Pyx_INCREF(__pyx_t_7);
23495           __Pyx_INCREF(function);
23496           __Pyx_DECREF_SET(__pyx_t_5, function);
23497           __pyx_t_8 = 1;
23498         }
23499       }
23500       #if CYTHON_FAST_PYCALL
23501       if (PyFunction_Check(__pyx_t_5)) {
23502         PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
23503         __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, 489, __pyx_L3_error)
23504         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
23505         __Pyx_GOTREF(__pyx_t_1);
23506         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23507       } else
23508       #endif
23509       #if CYTHON_FAST_PYCCALL
23510       if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
23511         PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
23512         __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, 489, __pyx_L3_error)
23513         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
23514         __Pyx_GOTREF(__pyx_t_1);
23515         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23516       } else
23517       #endif
23518       {
23519         __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 489, __pyx_L3_error)
23520         __Pyx_GOTREF(__pyx_t_9);
23521         if (__pyx_t_7) {
23522           __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
23523         }
23524         __Pyx_GIVEREF(__pyx_t_6);
23525         PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
23526         __Pyx_INCREF(__pyx_v_bytesitem);
23527         __Pyx_GIVEREF(__pyx_v_bytesitem);
23528         PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
23529         __pyx_t_6 = 0;
23530         __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 489, __pyx_L3_error)
23531         __Pyx_GOTREF(__pyx_t_1);
23532         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
23533       }
23534       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23535       __pyx_v_result = __pyx_t_1;
23536       __pyx_t_1 = 0;
23537 
23538       /* "View.MemoryView":488
23539  *
23540  *         bytesitem = itemp[:self.view.itemsize]
23541  *         try:             # <<<<<<<<<<<<<<
23542  *             result = struct.unpack(self.view.format, bytesitem)
23543  *         except struct.error:
23544  */
23545     }
23546 
23547     /* "View.MemoryView":493
23548  *             raise ValueError("Unable to convert item to object")
23549  *         else:
23550  *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
23551  *                 return result[0]
23552  *             return result
23553  */
23554     /*else:*/ {
23555       __pyx_t_10 = strlen(__pyx_v_self->view.format);
23556       __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
23557       if (__pyx_t_11) {
23558 
23559         /* "View.MemoryView":494
23560  *         else:
23561  *             if len(self.view.format) == 1:
23562  *                 return result[0]             # <<<<<<<<<<<<<<
23563  *             return result
23564  *
23565  */
23566         __Pyx_XDECREF(__pyx_r);
23567         __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, 494, __pyx_L5_except_error)
23568         __Pyx_GOTREF(__pyx_t_1);
23569         __pyx_r = __pyx_t_1;
23570         __pyx_t_1 = 0;
23571         goto __pyx_L6_except_return;
23572 
23573         /* "View.MemoryView":493
23574  *             raise ValueError("Unable to convert item to object")
23575  *         else:
23576  *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
23577  *                 return result[0]
23578  *             return result
23579  */
23580       }
23581 
23582       /* "View.MemoryView":495
23583  *             if len(self.view.format) == 1:
23584  *                 return result[0]
23585  *             return result             # <<<<<<<<<<<<<<
23586  *
23587  *     cdef assign_item_from_object(self, char *itemp, object value):
23588  */
23589       __Pyx_XDECREF(__pyx_r);
23590       __Pyx_INCREF(__pyx_v_result);
23591       __pyx_r = __pyx_v_result;
23592       goto __pyx_L6_except_return;
23593     }
23594     __pyx_L3_error:;
23595     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
23596     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
23597     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
23598     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
23599     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
23600 
23601     /* "View.MemoryView":490
23602  *         try:
23603  *             result = struct.unpack(self.view.format, bytesitem)
23604  *         except struct.error:             # <<<<<<<<<<<<<<
23605  *             raise ValueError("Unable to convert item to object")
23606  *         else:
23607  */
23608     __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
23609     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 490, __pyx_L5_except_error)
23610     __Pyx_GOTREF(__pyx_t_6);
23611     __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
23612     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23613     __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
23614     __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
23615     if (__pyx_t_8) {
23616       __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
23617       if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 490, __pyx_L5_except_error)
23618       __Pyx_GOTREF(__pyx_t_9);
23619       __Pyx_GOTREF(__pyx_t_5);
23620       __Pyx_GOTREF(__pyx_t_1);
23621 
23622       /* "View.MemoryView":491
23623  *             result = struct.unpack(self.view.format, bytesitem)
23624  *         except struct.error:
23625  *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
23626  *         else:
23627  *             if len(self.view.format) == 1:
23628  */
23629       __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 491, __pyx_L5_except_error)
23630       __Pyx_GOTREF(__pyx_t_6);
23631       __Pyx_Raise(__pyx_t_6, 0, 0, 0);
23632       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23633       __PYX_ERR(1, 491, __pyx_L5_except_error)
23634     }
23635     goto __pyx_L5_except_error;
23636     __pyx_L5_except_error:;
23637 
23638     /* "View.MemoryView":488
23639  *
23640  *         bytesitem = itemp[:self.view.itemsize]
23641  *         try:             # <<<<<<<<<<<<<<
23642  *             result = struct.unpack(self.view.format, bytesitem)
23643  *         except struct.error:
23644  */
23645     __Pyx_XGIVEREF(__pyx_t_2);
23646     __Pyx_XGIVEREF(__pyx_t_3);
23647     __Pyx_XGIVEREF(__pyx_t_4);
23648     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
23649     goto __pyx_L1_error;
23650     __pyx_L6_except_return:;
23651     __Pyx_XGIVEREF(__pyx_t_2);
23652     __Pyx_XGIVEREF(__pyx_t_3);
23653     __Pyx_XGIVEREF(__pyx_t_4);
23654     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
23655     goto __pyx_L0;
23656   }
23657 
23658   /* "View.MemoryView":481
23659  *         self.assign_item_from_object(itemp, value)
23660  *
23661  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
23662  *         """Only used if instantiated manually by the user, or if Cython doesn't
23663  *         know how to convert the type"""
23664  */
23665 
23666   /* function exit code */
23667   __pyx_L1_error:;
23668   __Pyx_XDECREF(__pyx_t_1);
23669   __Pyx_XDECREF(__pyx_t_5);
23670   __Pyx_XDECREF(__pyx_t_6);
23671   __Pyx_XDECREF(__pyx_t_7);
23672   __Pyx_XDECREF(__pyx_t_9);
23673   __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
23674   __pyx_r = 0;
23675   __pyx_L0:;
23676   __Pyx_XDECREF(__pyx_v_struct);
23677   __Pyx_XDECREF(__pyx_v_bytesitem);
23678   __Pyx_XDECREF(__pyx_v_result);
23679   __Pyx_XGIVEREF(__pyx_r);
23680   __Pyx_RefNannyFinishContext();
23681   return __pyx_r;
23682 }
23683 
23684 /* "View.MemoryView":497
23685  *             return result
23686  *
23687  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
23688  *         """Only used if instantiated manually by the user, or if Cython doesn't
23689  *         know how to convert the type"""
23690  */
23691 
__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj * __pyx_v_self,char * __pyx_v_itemp,PyObject * __pyx_v_value)23692 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
23693   PyObject *__pyx_v_struct = NULL;
23694   char __pyx_v_c;
23695   PyObject *__pyx_v_bytesvalue = 0;
23696   Py_ssize_t __pyx_v_i;
23697   PyObject *__pyx_r = NULL;
23698   __Pyx_RefNannyDeclarations
23699   PyObject *__pyx_t_1 = NULL;
23700   int __pyx_t_2;
23701   int __pyx_t_3;
23702   PyObject *__pyx_t_4 = NULL;
23703   PyObject *__pyx_t_5 = NULL;
23704   PyObject *__pyx_t_6 = NULL;
23705   int __pyx_t_7;
23706   PyObject *__pyx_t_8 = NULL;
23707   Py_ssize_t __pyx_t_9;
23708   PyObject *__pyx_t_10 = NULL;
23709   char *__pyx_t_11;
23710   char *__pyx_t_12;
23711   char *__pyx_t_13;
23712   char *__pyx_t_14;
23713   __Pyx_RefNannySetupContext("assign_item_from_object", 0);
23714 
23715   /* "View.MemoryView":500
23716  *         """Only used if instantiated manually by the user, or if Cython doesn't
23717  *         know how to convert the type"""
23718  *         import struct             # <<<<<<<<<<<<<<
23719  *         cdef char c
23720  *         cdef bytes bytesvalue
23721  */
23722   __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 500, __pyx_L1_error)
23723   __Pyx_GOTREF(__pyx_t_1);
23724   __pyx_v_struct = __pyx_t_1;
23725   __pyx_t_1 = 0;
23726 
23727   /* "View.MemoryView":505
23728  *         cdef Py_ssize_t i
23729  *
23730  *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
23731  *             bytesvalue = struct.pack(self.view.format, *value)
23732  *         else:
23733  */
23734   __pyx_t_2 = PyTuple_Check(__pyx_v_value);
23735   __pyx_t_3 = (__pyx_t_2 != 0);
23736   if (__pyx_t_3) {
23737 
23738     /* "View.MemoryView":506
23739  *
23740  *         if isinstance(value, tuple):
23741  *             bytesvalue = struct.pack(self.view.format, *value)             # <<<<<<<<<<<<<<
23742  *         else:
23743  *             bytesvalue = struct.pack(self.view.format, value)
23744  */
23745     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 506, __pyx_L1_error)
23746     __Pyx_GOTREF(__pyx_t_1);
23747     __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 506, __pyx_L1_error)
23748     __Pyx_GOTREF(__pyx_t_4);
23749     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 506, __pyx_L1_error)
23750     __Pyx_GOTREF(__pyx_t_5);
23751     __Pyx_GIVEREF(__pyx_t_4);
23752     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
23753     __pyx_t_4 = 0;
23754     __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 506, __pyx_L1_error)
23755     __Pyx_GOTREF(__pyx_t_4);
23756     __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 506, __pyx_L1_error)
23757     __Pyx_GOTREF(__pyx_t_6);
23758     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23759     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23760     __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 506, __pyx_L1_error)
23761     __Pyx_GOTREF(__pyx_t_4);
23762     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23763     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23764     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, 506, __pyx_L1_error)
23765     __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
23766     __pyx_t_4 = 0;
23767 
23768     /* "View.MemoryView":505
23769  *         cdef Py_ssize_t i
23770  *
23771  *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
23772  *             bytesvalue = struct.pack(self.view.format, *value)
23773  *         else:
23774  */
23775     goto __pyx_L3;
23776   }
23777 
23778   /* "View.MemoryView":508
23779  *             bytesvalue = struct.pack(self.view.format, *value)
23780  *         else:
23781  *             bytesvalue = struct.pack(self.view.format, value)             # <<<<<<<<<<<<<<
23782  *
23783  *         for i, c in enumerate(bytesvalue):
23784  */
23785   /*else*/ {
23786     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 508, __pyx_L1_error)
23787     __Pyx_GOTREF(__pyx_t_6);
23788     __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 508, __pyx_L1_error)
23789     __Pyx_GOTREF(__pyx_t_1);
23790     __pyx_t_5 = NULL;
23791     __pyx_t_7 = 0;
23792     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
23793       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
23794       if (likely(__pyx_t_5)) {
23795         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
23796         __Pyx_INCREF(__pyx_t_5);
23797         __Pyx_INCREF(function);
23798         __Pyx_DECREF_SET(__pyx_t_6, function);
23799         __pyx_t_7 = 1;
23800       }
23801     }
23802     #if CYTHON_FAST_PYCALL
23803     if (PyFunction_Check(__pyx_t_6)) {
23804       PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
23805       __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, 508, __pyx_L1_error)
23806       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
23807       __Pyx_GOTREF(__pyx_t_4);
23808       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23809     } else
23810     #endif
23811     #if CYTHON_FAST_PYCCALL
23812     if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
23813       PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
23814       __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, 508, __pyx_L1_error)
23815       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
23816       __Pyx_GOTREF(__pyx_t_4);
23817       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23818     } else
23819     #endif
23820     {
23821       __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 508, __pyx_L1_error)
23822       __Pyx_GOTREF(__pyx_t_8);
23823       if (__pyx_t_5) {
23824         __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
23825       }
23826       __Pyx_GIVEREF(__pyx_t_1);
23827       PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
23828       __Pyx_INCREF(__pyx_v_value);
23829       __Pyx_GIVEREF(__pyx_v_value);
23830       PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
23831       __pyx_t_1 = 0;
23832       __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 508, __pyx_L1_error)
23833       __Pyx_GOTREF(__pyx_t_4);
23834       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23835     }
23836     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23837     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, 508, __pyx_L1_error)
23838     __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
23839     __pyx_t_4 = 0;
23840   }
23841   __pyx_L3:;
23842 
23843   /* "View.MemoryView":510
23844  *             bytesvalue = struct.pack(self.view.format, value)
23845  *
23846  *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
23847  *             itemp[i] = c
23848  *
23849  */
23850   __pyx_t_9 = 0;
23851   if (unlikely(__pyx_v_bytesvalue == Py_None)) {
23852     PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
23853     __PYX_ERR(1, 510, __pyx_L1_error)
23854   }
23855   __Pyx_INCREF(__pyx_v_bytesvalue);
23856   __pyx_t_10 = __pyx_v_bytesvalue;
23857   __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
23858   __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
23859   for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
23860     __pyx_t_11 = __pyx_t_14;
23861     __pyx_v_c = (__pyx_t_11[0]);
23862 
23863     /* "View.MemoryView":511
23864  *
23865  *         for i, c in enumerate(bytesvalue):
23866  *             itemp[i] = c             # <<<<<<<<<<<<<<
23867  *
23868  *     @cname('getbuffer')
23869  */
23870     __pyx_v_i = __pyx_t_9;
23871 
23872     /* "View.MemoryView":510
23873  *             bytesvalue = struct.pack(self.view.format, value)
23874  *
23875  *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
23876  *             itemp[i] = c
23877  *
23878  */
23879     __pyx_t_9 = (__pyx_t_9 + 1);
23880 
23881     /* "View.MemoryView":511
23882  *
23883  *         for i, c in enumerate(bytesvalue):
23884  *             itemp[i] = c             # <<<<<<<<<<<<<<
23885  *
23886  *     @cname('getbuffer')
23887  */
23888     (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
23889   }
23890   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
23891 
23892   /* "View.MemoryView":497
23893  *             return result
23894  *
23895  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
23896  *         """Only used if instantiated manually by the user, or if Cython doesn't
23897  *         know how to convert the type"""
23898  */
23899 
23900   /* function exit code */
23901   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23902   goto __pyx_L0;
23903   __pyx_L1_error:;
23904   __Pyx_XDECREF(__pyx_t_1);
23905   __Pyx_XDECREF(__pyx_t_4);
23906   __Pyx_XDECREF(__pyx_t_5);
23907   __Pyx_XDECREF(__pyx_t_6);
23908   __Pyx_XDECREF(__pyx_t_8);
23909   __Pyx_XDECREF(__pyx_t_10);
23910   __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
23911   __pyx_r = 0;
23912   __pyx_L0:;
23913   __Pyx_XDECREF(__pyx_v_struct);
23914   __Pyx_XDECREF(__pyx_v_bytesvalue);
23915   __Pyx_XGIVEREF(__pyx_r);
23916   __Pyx_RefNannyFinishContext();
23917   return __pyx_r;
23918 }
23919 
23920 /* "View.MemoryView":514
23921  *
23922  *     @cname('getbuffer')
23923  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
23924  *         if flags & PyBUF_WRITABLE and self.view.readonly:
23925  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
23926  */
23927 
23928 /* Python wrapper */
23929 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)23930 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
23931   int __pyx_r;
23932   __Pyx_RefNannyDeclarations
23933   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
23934   __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));
23935 
23936   /* function exit code */
23937   __Pyx_RefNannyFinishContext();
23938   return __pyx_r;
23939 }
23940 
__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)23941 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) {
23942   int __pyx_r;
23943   __Pyx_RefNannyDeclarations
23944   int __pyx_t_1;
23945   int __pyx_t_2;
23946   PyObject *__pyx_t_3 = NULL;
23947   Py_ssize_t *__pyx_t_4;
23948   char *__pyx_t_5;
23949   void *__pyx_t_6;
23950   int __pyx_t_7;
23951   Py_ssize_t __pyx_t_8;
23952   if (__pyx_v_info == NULL) {
23953     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
23954     return -1;
23955   }
23956   __Pyx_RefNannySetupContext("__getbuffer__", 0);
23957   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
23958   __Pyx_GIVEREF(__pyx_v_info->obj);
23959 
23960   /* "View.MemoryView":515
23961  *     @cname('getbuffer')
23962  *     def __getbuffer__(self, Py_buffer *info, int flags):
23963  *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
23964  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
23965  *
23966  */
23967   __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
23968   if (__pyx_t_2) {
23969   } else {
23970     __pyx_t_1 = __pyx_t_2;
23971     goto __pyx_L4_bool_binop_done;
23972   }
23973   __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
23974   __pyx_t_1 = __pyx_t_2;
23975   __pyx_L4_bool_binop_done:;
23976   if (unlikely(__pyx_t_1)) {
23977 
23978     /* "View.MemoryView":516
23979  *     def __getbuffer__(self, Py_buffer *info, int flags):
23980  *         if flags & PyBUF_WRITABLE and self.view.readonly:
23981  *             raise ValueError("Cannot create writable memory view from read-only memoryview")             # <<<<<<<<<<<<<<
23982  *
23983  *         if flags & PyBUF_ND:
23984  */
23985     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 516, __pyx_L1_error)
23986     __Pyx_GOTREF(__pyx_t_3);
23987     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
23988     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23989     __PYX_ERR(1, 516, __pyx_L1_error)
23990 
23991     /* "View.MemoryView":515
23992  *     @cname('getbuffer')
23993  *     def __getbuffer__(self, Py_buffer *info, int flags):
23994  *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
23995  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
23996  *
23997  */
23998   }
23999 
24000   /* "View.MemoryView":518
24001  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
24002  *
24003  *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
24004  *             info.shape = self.view.shape
24005  *         else:
24006  */
24007   __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
24008   if (__pyx_t_1) {
24009 
24010     /* "View.MemoryView":519
24011  *
24012  *         if flags & PyBUF_ND:
24013  *             info.shape = self.view.shape             # <<<<<<<<<<<<<<
24014  *         else:
24015  *             info.shape = NULL
24016  */
24017     __pyx_t_4 = __pyx_v_self->view.shape;
24018     __pyx_v_info->shape = __pyx_t_4;
24019 
24020     /* "View.MemoryView":518
24021  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
24022  *
24023  *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
24024  *             info.shape = self.view.shape
24025  *         else:
24026  */
24027     goto __pyx_L6;
24028   }
24029 
24030   /* "View.MemoryView":521
24031  *             info.shape = self.view.shape
24032  *         else:
24033  *             info.shape = NULL             # <<<<<<<<<<<<<<
24034  *
24035  *         if flags & PyBUF_STRIDES:
24036  */
24037   /*else*/ {
24038     __pyx_v_info->shape = NULL;
24039   }
24040   __pyx_L6:;
24041 
24042   /* "View.MemoryView":523
24043  *             info.shape = NULL
24044  *
24045  *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
24046  *             info.strides = self.view.strides
24047  *         else:
24048  */
24049   __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
24050   if (__pyx_t_1) {
24051 
24052     /* "View.MemoryView":524
24053  *
24054  *         if flags & PyBUF_STRIDES:
24055  *             info.strides = self.view.strides             # <<<<<<<<<<<<<<
24056  *         else:
24057  *             info.strides = NULL
24058  */
24059     __pyx_t_4 = __pyx_v_self->view.strides;
24060     __pyx_v_info->strides = __pyx_t_4;
24061 
24062     /* "View.MemoryView":523
24063  *             info.shape = NULL
24064  *
24065  *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
24066  *             info.strides = self.view.strides
24067  *         else:
24068  */
24069     goto __pyx_L7;
24070   }
24071 
24072   /* "View.MemoryView":526
24073  *             info.strides = self.view.strides
24074  *         else:
24075  *             info.strides = NULL             # <<<<<<<<<<<<<<
24076  *
24077  *         if flags & PyBUF_INDIRECT:
24078  */
24079   /*else*/ {
24080     __pyx_v_info->strides = NULL;
24081   }
24082   __pyx_L7:;
24083 
24084   /* "View.MemoryView":528
24085  *             info.strides = NULL
24086  *
24087  *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
24088  *             info.suboffsets = self.view.suboffsets
24089  *         else:
24090  */
24091   __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
24092   if (__pyx_t_1) {
24093 
24094     /* "View.MemoryView":529
24095  *
24096  *         if flags & PyBUF_INDIRECT:
24097  *             info.suboffsets = self.view.suboffsets             # <<<<<<<<<<<<<<
24098  *         else:
24099  *             info.suboffsets = NULL
24100  */
24101     __pyx_t_4 = __pyx_v_self->view.suboffsets;
24102     __pyx_v_info->suboffsets = __pyx_t_4;
24103 
24104     /* "View.MemoryView":528
24105  *             info.strides = NULL
24106  *
24107  *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
24108  *             info.suboffsets = self.view.suboffsets
24109  *         else:
24110  */
24111     goto __pyx_L8;
24112   }
24113 
24114   /* "View.MemoryView":531
24115  *             info.suboffsets = self.view.suboffsets
24116  *         else:
24117  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
24118  *
24119  *         if flags & PyBUF_FORMAT:
24120  */
24121   /*else*/ {
24122     __pyx_v_info->suboffsets = NULL;
24123   }
24124   __pyx_L8:;
24125 
24126   /* "View.MemoryView":533
24127  *             info.suboffsets = NULL
24128  *
24129  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
24130  *             info.format = self.view.format
24131  *         else:
24132  */
24133   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
24134   if (__pyx_t_1) {
24135 
24136     /* "View.MemoryView":534
24137  *
24138  *         if flags & PyBUF_FORMAT:
24139  *             info.format = self.view.format             # <<<<<<<<<<<<<<
24140  *         else:
24141  *             info.format = NULL
24142  */
24143     __pyx_t_5 = __pyx_v_self->view.format;
24144     __pyx_v_info->format = __pyx_t_5;
24145 
24146     /* "View.MemoryView":533
24147  *             info.suboffsets = NULL
24148  *
24149  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
24150  *             info.format = self.view.format
24151  *         else:
24152  */
24153     goto __pyx_L9;
24154   }
24155 
24156   /* "View.MemoryView":536
24157  *             info.format = self.view.format
24158  *         else:
24159  *             info.format = NULL             # <<<<<<<<<<<<<<
24160  *
24161  *         info.buf = self.view.buf
24162  */
24163   /*else*/ {
24164     __pyx_v_info->format = NULL;
24165   }
24166   __pyx_L9:;
24167 
24168   /* "View.MemoryView":538
24169  *             info.format = NULL
24170  *
24171  *         info.buf = self.view.buf             # <<<<<<<<<<<<<<
24172  *         info.ndim = self.view.ndim
24173  *         info.itemsize = self.view.itemsize
24174  */
24175   __pyx_t_6 = __pyx_v_self->view.buf;
24176   __pyx_v_info->buf = __pyx_t_6;
24177 
24178   /* "View.MemoryView":539
24179  *
24180  *         info.buf = self.view.buf
24181  *         info.ndim = self.view.ndim             # <<<<<<<<<<<<<<
24182  *         info.itemsize = self.view.itemsize
24183  *         info.len = self.view.len
24184  */
24185   __pyx_t_7 = __pyx_v_self->view.ndim;
24186   __pyx_v_info->ndim = __pyx_t_7;
24187 
24188   /* "View.MemoryView":540
24189  *         info.buf = self.view.buf
24190  *         info.ndim = self.view.ndim
24191  *         info.itemsize = self.view.itemsize             # <<<<<<<<<<<<<<
24192  *         info.len = self.view.len
24193  *         info.readonly = self.view.readonly
24194  */
24195   __pyx_t_8 = __pyx_v_self->view.itemsize;
24196   __pyx_v_info->itemsize = __pyx_t_8;
24197 
24198   /* "View.MemoryView":541
24199  *         info.ndim = self.view.ndim
24200  *         info.itemsize = self.view.itemsize
24201  *         info.len = self.view.len             # <<<<<<<<<<<<<<
24202  *         info.readonly = self.view.readonly
24203  *         info.obj = self
24204  */
24205   __pyx_t_8 = __pyx_v_self->view.len;
24206   __pyx_v_info->len = __pyx_t_8;
24207 
24208   /* "View.MemoryView":542
24209  *         info.itemsize = self.view.itemsize
24210  *         info.len = self.view.len
24211  *         info.readonly = self.view.readonly             # <<<<<<<<<<<<<<
24212  *         info.obj = self
24213  *
24214  */
24215   __pyx_t_1 = __pyx_v_self->view.readonly;
24216   __pyx_v_info->readonly = __pyx_t_1;
24217 
24218   /* "View.MemoryView":543
24219  *         info.len = self.view.len
24220  *         info.readonly = self.view.readonly
24221  *         info.obj = self             # <<<<<<<<<<<<<<
24222  *
24223  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
24224  */
24225   __Pyx_INCREF(((PyObject *)__pyx_v_self));
24226   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
24227   __Pyx_GOTREF(__pyx_v_info->obj);
24228   __Pyx_DECREF(__pyx_v_info->obj);
24229   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
24230 
24231   /* "View.MemoryView":514
24232  *
24233  *     @cname('getbuffer')
24234  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
24235  *         if flags & PyBUF_WRITABLE and self.view.readonly:
24236  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
24237  */
24238 
24239   /* function exit code */
24240   __pyx_r = 0;
24241   goto __pyx_L0;
24242   __pyx_L1_error:;
24243   __Pyx_XDECREF(__pyx_t_3);
24244   __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24245   __pyx_r = -1;
24246   if (__pyx_v_info->obj != NULL) {
24247     __Pyx_GOTREF(__pyx_v_info->obj);
24248     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
24249   }
24250   goto __pyx_L2;
24251   __pyx_L0:;
24252   if (__pyx_v_info->obj == Py_None) {
24253     __Pyx_GOTREF(__pyx_v_info->obj);
24254     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
24255   }
24256   __pyx_L2:;
24257   __Pyx_RefNannyFinishContext();
24258   return __pyx_r;
24259 }
24260 
24261 /* "View.MemoryView":549
24262  *
24263  *     @property
24264  *     def T(self):             # <<<<<<<<<<<<<<
24265  *         cdef _memoryviewslice result = memoryview_copy(self)
24266  *         transpose_memslice(&result.from_slice)
24267  */
24268 
24269 /* Python wrapper */
24270 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)24271 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
24272   PyObject *__pyx_r = 0;
24273   __Pyx_RefNannyDeclarations
24274   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
24275   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
24276 
24277   /* function exit code */
24278   __Pyx_RefNannyFinishContext();
24279   return __pyx_r;
24280 }
24281 
__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj * __pyx_v_self)24282 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
24283   struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
24284   PyObject *__pyx_r = NULL;
24285   __Pyx_RefNannyDeclarations
24286   PyObject *__pyx_t_1 = NULL;
24287   int __pyx_t_2;
24288   __Pyx_RefNannySetupContext("__get__", 0);
24289 
24290   /* "View.MemoryView":550
24291  *     @property
24292  *     def T(self):
24293  *         cdef _memoryviewslice result = memoryview_copy(self)             # <<<<<<<<<<<<<<
24294  *         transpose_memslice(&result.from_slice)
24295  *         return result
24296  */
24297   __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 550, __pyx_L1_error)
24298   __Pyx_GOTREF(__pyx_t_1);
24299   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 550, __pyx_L1_error)
24300   __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
24301   __pyx_t_1 = 0;
24302 
24303   /* "View.MemoryView":551
24304  *     def T(self):
24305  *         cdef _memoryviewslice result = memoryview_copy(self)
24306  *         transpose_memslice(&result.from_slice)             # <<<<<<<<<<<<<<
24307  *         return result
24308  *
24309  */
24310   __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 551, __pyx_L1_error)
24311 
24312   /* "View.MemoryView":552
24313  *         cdef _memoryviewslice result = memoryview_copy(self)
24314  *         transpose_memslice(&result.from_slice)
24315  *         return result             # <<<<<<<<<<<<<<
24316  *
24317  *     @property
24318  */
24319   __Pyx_XDECREF(__pyx_r);
24320   __Pyx_INCREF(((PyObject *)__pyx_v_result));
24321   __pyx_r = ((PyObject *)__pyx_v_result);
24322   goto __pyx_L0;
24323 
24324   /* "View.MemoryView":549
24325  *
24326  *     @property
24327  *     def T(self):             # <<<<<<<<<<<<<<
24328  *         cdef _memoryviewslice result = memoryview_copy(self)
24329  *         transpose_memslice(&result.from_slice)
24330  */
24331 
24332   /* function exit code */
24333   __pyx_L1_error:;
24334   __Pyx_XDECREF(__pyx_t_1);
24335   __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24336   __pyx_r = NULL;
24337   __pyx_L0:;
24338   __Pyx_XDECREF((PyObject *)__pyx_v_result);
24339   __Pyx_XGIVEREF(__pyx_r);
24340   __Pyx_RefNannyFinishContext();
24341   return __pyx_r;
24342 }
24343 
24344 /* "View.MemoryView":555
24345  *
24346  *     @property
24347  *     def base(self):             # <<<<<<<<<<<<<<
24348  *         return self.obj
24349  *
24350  */
24351 
24352 /* Python wrapper */
24353 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)24354 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
24355   PyObject *__pyx_r = 0;
24356   __Pyx_RefNannyDeclarations
24357   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
24358   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
24359 
24360   /* function exit code */
24361   __Pyx_RefNannyFinishContext();
24362   return __pyx_r;
24363 }
24364 
__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj * __pyx_v_self)24365 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
24366   PyObject *__pyx_r = NULL;
24367   __Pyx_RefNannyDeclarations
24368   __Pyx_RefNannySetupContext("__get__", 0);
24369 
24370   /* "View.MemoryView":556
24371  *     @property
24372  *     def base(self):
24373  *         return self.obj             # <<<<<<<<<<<<<<
24374  *
24375  *     @property
24376  */
24377   __Pyx_XDECREF(__pyx_r);
24378   __Pyx_INCREF(__pyx_v_self->obj);
24379   __pyx_r = __pyx_v_self->obj;
24380   goto __pyx_L0;
24381 
24382   /* "View.MemoryView":555
24383  *
24384  *     @property
24385  *     def base(self):             # <<<<<<<<<<<<<<
24386  *         return self.obj
24387  *
24388  */
24389 
24390   /* function exit code */
24391   __pyx_L0:;
24392   __Pyx_XGIVEREF(__pyx_r);
24393   __Pyx_RefNannyFinishContext();
24394   return __pyx_r;
24395 }
24396 
24397 /* "View.MemoryView":559
24398  *
24399  *     @property
24400  *     def shape(self):             # <<<<<<<<<<<<<<
24401  *         return tuple([length for length in self.view.shape[:self.view.ndim]])
24402  *
24403  */
24404 
24405 /* Python wrapper */
24406 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)24407 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
24408   PyObject *__pyx_r = 0;
24409   __Pyx_RefNannyDeclarations
24410   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
24411   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
24412 
24413   /* function exit code */
24414   __Pyx_RefNannyFinishContext();
24415   return __pyx_r;
24416 }
24417 
__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj * __pyx_v_self)24418 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
24419   Py_ssize_t __pyx_v_length;
24420   PyObject *__pyx_r = NULL;
24421   __Pyx_RefNannyDeclarations
24422   PyObject *__pyx_t_1 = NULL;
24423   Py_ssize_t *__pyx_t_2;
24424   Py_ssize_t *__pyx_t_3;
24425   Py_ssize_t *__pyx_t_4;
24426   PyObject *__pyx_t_5 = NULL;
24427   __Pyx_RefNannySetupContext("__get__", 0);
24428 
24429   /* "View.MemoryView":560
24430  *     @property
24431  *     def shape(self):
24432  *         return tuple([length for length in self.view.shape[:self.view.ndim]])             # <<<<<<<<<<<<<<
24433  *
24434  *     @property
24435  */
24436   __Pyx_XDECREF(__pyx_r);
24437   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 560, __pyx_L1_error)
24438   __Pyx_GOTREF(__pyx_t_1);
24439   __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
24440   for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
24441     __pyx_t_2 = __pyx_t_4;
24442     __pyx_v_length = (__pyx_t_2[0]);
24443     __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 560, __pyx_L1_error)
24444     __Pyx_GOTREF(__pyx_t_5);
24445     if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 560, __pyx_L1_error)
24446     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24447   }
24448   __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 560, __pyx_L1_error)
24449   __Pyx_GOTREF(__pyx_t_5);
24450   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24451   __pyx_r = __pyx_t_5;
24452   __pyx_t_5 = 0;
24453   goto __pyx_L0;
24454 
24455   /* "View.MemoryView":559
24456  *
24457  *     @property
24458  *     def shape(self):             # <<<<<<<<<<<<<<
24459  *         return tuple([length for length in self.view.shape[:self.view.ndim]])
24460  *
24461  */
24462 
24463   /* function exit code */
24464   __pyx_L1_error:;
24465   __Pyx_XDECREF(__pyx_t_1);
24466   __Pyx_XDECREF(__pyx_t_5);
24467   __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24468   __pyx_r = NULL;
24469   __pyx_L0:;
24470   __Pyx_XGIVEREF(__pyx_r);
24471   __Pyx_RefNannyFinishContext();
24472   return __pyx_r;
24473 }
24474 
24475 /* "View.MemoryView":563
24476  *
24477  *     @property
24478  *     def strides(self):             # <<<<<<<<<<<<<<
24479  *         if self.view.strides == NULL:
24480  *
24481  */
24482 
24483 /* Python wrapper */
24484 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)24485 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
24486   PyObject *__pyx_r = 0;
24487   __Pyx_RefNannyDeclarations
24488   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
24489   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
24490 
24491   /* function exit code */
24492   __Pyx_RefNannyFinishContext();
24493   return __pyx_r;
24494 }
24495 
__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj * __pyx_v_self)24496 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
24497   Py_ssize_t __pyx_v_stride;
24498   PyObject *__pyx_r = NULL;
24499   __Pyx_RefNannyDeclarations
24500   int __pyx_t_1;
24501   PyObject *__pyx_t_2 = NULL;
24502   Py_ssize_t *__pyx_t_3;
24503   Py_ssize_t *__pyx_t_4;
24504   Py_ssize_t *__pyx_t_5;
24505   PyObject *__pyx_t_6 = NULL;
24506   __Pyx_RefNannySetupContext("__get__", 0);
24507 
24508   /* "View.MemoryView":564
24509  *     @property
24510  *     def strides(self):
24511  *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
24512  *
24513  *             raise ValueError("Buffer view does not expose strides")
24514  */
24515   __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
24516   if (unlikely(__pyx_t_1)) {
24517 
24518     /* "View.MemoryView":566
24519  *         if self.view.strides == NULL:
24520  *
24521  *             raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
24522  *
24523  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
24524  */
24525     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 566, __pyx_L1_error)
24526     __Pyx_GOTREF(__pyx_t_2);
24527     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
24528     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24529     __PYX_ERR(1, 566, __pyx_L1_error)
24530 
24531     /* "View.MemoryView":564
24532  *     @property
24533  *     def strides(self):
24534  *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
24535  *
24536  *             raise ValueError("Buffer view does not expose strides")
24537  */
24538   }
24539 
24540   /* "View.MemoryView":568
24541  *             raise ValueError("Buffer view does not expose strides")
24542  *
24543  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])             # <<<<<<<<<<<<<<
24544  *
24545  *     @property
24546  */
24547   __Pyx_XDECREF(__pyx_r);
24548   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 568, __pyx_L1_error)
24549   __Pyx_GOTREF(__pyx_t_2);
24550   __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
24551   for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
24552     __pyx_t_3 = __pyx_t_5;
24553     __pyx_v_stride = (__pyx_t_3[0]);
24554     __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 568, __pyx_L1_error)
24555     __Pyx_GOTREF(__pyx_t_6);
24556     if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 568, __pyx_L1_error)
24557     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24558   }
24559   __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 568, __pyx_L1_error)
24560   __Pyx_GOTREF(__pyx_t_6);
24561   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24562   __pyx_r = __pyx_t_6;
24563   __pyx_t_6 = 0;
24564   goto __pyx_L0;
24565 
24566   /* "View.MemoryView":563
24567  *
24568  *     @property
24569  *     def strides(self):             # <<<<<<<<<<<<<<
24570  *         if self.view.strides == NULL:
24571  *
24572  */
24573 
24574   /* function exit code */
24575   __pyx_L1_error:;
24576   __Pyx_XDECREF(__pyx_t_2);
24577   __Pyx_XDECREF(__pyx_t_6);
24578   __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24579   __pyx_r = NULL;
24580   __pyx_L0:;
24581   __Pyx_XGIVEREF(__pyx_r);
24582   __Pyx_RefNannyFinishContext();
24583   return __pyx_r;
24584 }
24585 
24586 /* "View.MemoryView":571
24587  *
24588  *     @property
24589  *     def suboffsets(self):             # <<<<<<<<<<<<<<
24590  *         if self.view.suboffsets == NULL:
24591  *             return (-1,) * self.view.ndim
24592  */
24593 
24594 /* Python wrapper */
24595 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)24596 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
24597   PyObject *__pyx_r = 0;
24598   __Pyx_RefNannyDeclarations
24599   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
24600   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
24601 
24602   /* function exit code */
24603   __Pyx_RefNannyFinishContext();
24604   return __pyx_r;
24605 }
24606 
__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj * __pyx_v_self)24607 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
24608   Py_ssize_t __pyx_v_suboffset;
24609   PyObject *__pyx_r = NULL;
24610   __Pyx_RefNannyDeclarations
24611   int __pyx_t_1;
24612   PyObject *__pyx_t_2 = NULL;
24613   PyObject *__pyx_t_3 = NULL;
24614   Py_ssize_t *__pyx_t_4;
24615   Py_ssize_t *__pyx_t_5;
24616   Py_ssize_t *__pyx_t_6;
24617   __Pyx_RefNannySetupContext("__get__", 0);
24618 
24619   /* "View.MemoryView":572
24620  *     @property
24621  *     def suboffsets(self):
24622  *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
24623  *             return (-1,) * self.view.ndim
24624  *
24625  */
24626   __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
24627   if (__pyx_t_1) {
24628 
24629     /* "View.MemoryView":573
24630  *     def suboffsets(self):
24631  *         if self.view.suboffsets == NULL:
24632  *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
24633  *
24634  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
24635  */
24636     __Pyx_XDECREF(__pyx_r);
24637     __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 573, __pyx_L1_error)
24638     __Pyx_GOTREF(__pyx_t_2);
24639     __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__38, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 573, __pyx_L1_error)
24640     __Pyx_GOTREF(__pyx_t_3);
24641     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24642     __pyx_r = __pyx_t_3;
24643     __pyx_t_3 = 0;
24644     goto __pyx_L0;
24645 
24646     /* "View.MemoryView":572
24647  *     @property
24648  *     def suboffsets(self):
24649  *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
24650  *             return (-1,) * self.view.ndim
24651  *
24652  */
24653   }
24654 
24655   /* "View.MemoryView":575
24656  *             return (-1,) * self.view.ndim
24657  *
24658  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])             # <<<<<<<<<<<<<<
24659  *
24660  *     @property
24661  */
24662   __Pyx_XDECREF(__pyx_r);
24663   __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 575, __pyx_L1_error)
24664   __Pyx_GOTREF(__pyx_t_3);
24665   __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
24666   for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
24667     __pyx_t_4 = __pyx_t_6;
24668     __pyx_v_suboffset = (__pyx_t_4[0]);
24669     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 575, __pyx_L1_error)
24670     __Pyx_GOTREF(__pyx_t_2);
24671     if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 575, __pyx_L1_error)
24672     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24673   }
24674   __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 575, __pyx_L1_error)
24675   __Pyx_GOTREF(__pyx_t_2);
24676   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24677   __pyx_r = __pyx_t_2;
24678   __pyx_t_2 = 0;
24679   goto __pyx_L0;
24680 
24681   /* "View.MemoryView":571
24682  *
24683  *     @property
24684  *     def suboffsets(self):             # <<<<<<<<<<<<<<
24685  *         if self.view.suboffsets == NULL:
24686  *             return (-1,) * self.view.ndim
24687  */
24688 
24689   /* function exit code */
24690   __pyx_L1_error:;
24691   __Pyx_XDECREF(__pyx_t_2);
24692   __Pyx_XDECREF(__pyx_t_3);
24693   __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24694   __pyx_r = NULL;
24695   __pyx_L0:;
24696   __Pyx_XGIVEREF(__pyx_r);
24697   __Pyx_RefNannyFinishContext();
24698   return __pyx_r;
24699 }
24700 
24701 /* "View.MemoryView":578
24702  *
24703  *     @property
24704  *     def ndim(self):             # <<<<<<<<<<<<<<
24705  *         return self.view.ndim
24706  *
24707  */
24708 
24709 /* Python wrapper */
24710 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)24711 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
24712   PyObject *__pyx_r = 0;
24713   __Pyx_RefNannyDeclarations
24714   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
24715   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
24716 
24717   /* function exit code */
24718   __Pyx_RefNannyFinishContext();
24719   return __pyx_r;
24720 }
24721 
__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj * __pyx_v_self)24722 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
24723   PyObject *__pyx_r = NULL;
24724   __Pyx_RefNannyDeclarations
24725   PyObject *__pyx_t_1 = NULL;
24726   __Pyx_RefNannySetupContext("__get__", 0);
24727 
24728   /* "View.MemoryView":579
24729  *     @property
24730  *     def ndim(self):
24731  *         return self.view.ndim             # <<<<<<<<<<<<<<
24732  *
24733  *     @property
24734  */
24735   __Pyx_XDECREF(__pyx_r);
24736   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 579, __pyx_L1_error)
24737   __Pyx_GOTREF(__pyx_t_1);
24738   __pyx_r = __pyx_t_1;
24739   __pyx_t_1 = 0;
24740   goto __pyx_L0;
24741 
24742   /* "View.MemoryView":578
24743  *
24744  *     @property
24745  *     def ndim(self):             # <<<<<<<<<<<<<<
24746  *         return self.view.ndim
24747  *
24748  */
24749 
24750   /* function exit code */
24751   __pyx_L1_error:;
24752   __Pyx_XDECREF(__pyx_t_1);
24753   __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24754   __pyx_r = NULL;
24755   __pyx_L0:;
24756   __Pyx_XGIVEREF(__pyx_r);
24757   __Pyx_RefNannyFinishContext();
24758   return __pyx_r;
24759 }
24760 
24761 /* "View.MemoryView":582
24762  *
24763  *     @property
24764  *     def itemsize(self):             # <<<<<<<<<<<<<<
24765  *         return self.view.itemsize
24766  *
24767  */
24768 
24769 /* Python wrapper */
24770 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)24771 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
24772   PyObject *__pyx_r = 0;
24773   __Pyx_RefNannyDeclarations
24774   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
24775   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
24776 
24777   /* function exit code */
24778   __Pyx_RefNannyFinishContext();
24779   return __pyx_r;
24780 }
24781 
__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj * __pyx_v_self)24782 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
24783   PyObject *__pyx_r = NULL;
24784   __Pyx_RefNannyDeclarations
24785   PyObject *__pyx_t_1 = NULL;
24786   __Pyx_RefNannySetupContext("__get__", 0);
24787 
24788   /* "View.MemoryView":583
24789  *     @property
24790  *     def itemsize(self):
24791  *         return self.view.itemsize             # <<<<<<<<<<<<<<
24792  *
24793  *     @property
24794  */
24795   __Pyx_XDECREF(__pyx_r);
24796   __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
24797   __Pyx_GOTREF(__pyx_t_1);
24798   __pyx_r = __pyx_t_1;
24799   __pyx_t_1 = 0;
24800   goto __pyx_L0;
24801 
24802   /* "View.MemoryView":582
24803  *
24804  *     @property
24805  *     def itemsize(self):             # <<<<<<<<<<<<<<
24806  *         return self.view.itemsize
24807  *
24808  */
24809 
24810   /* function exit code */
24811   __pyx_L1_error:;
24812   __Pyx_XDECREF(__pyx_t_1);
24813   __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24814   __pyx_r = NULL;
24815   __pyx_L0:;
24816   __Pyx_XGIVEREF(__pyx_r);
24817   __Pyx_RefNannyFinishContext();
24818   return __pyx_r;
24819 }
24820 
24821 /* "View.MemoryView":586
24822  *
24823  *     @property
24824  *     def nbytes(self):             # <<<<<<<<<<<<<<
24825  *         return self.size * self.view.itemsize
24826  *
24827  */
24828 
24829 /* Python wrapper */
24830 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)24831 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
24832   PyObject *__pyx_r = 0;
24833   __Pyx_RefNannyDeclarations
24834   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
24835   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
24836 
24837   /* function exit code */
24838   __Pyx_RefNannyFinishContext();
24839   return __pyx_r;
24840 }
24841 
__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj * __pyx_v_self)24842 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
24843   PyObject *__pyx_r = NULL;
24844   __Pyx_RefNannyDeclarations
24845   PyObject *__pyx_t_1 = NULL;
24846   PyObject *__pyx_t_2 = NULL;
24847   PyObject *__pyx_t_3 = NULL;
24848   __Pyx_RefNannySetupContext("__get__", 0);
24849 
24850   /* "View.MemoryView":587
24851  *     @property
24852  *     def nbytes(self):
24853  *         return self.size * self.view.itemsize             # <<<<<<<<<<<<<<
24854  *
24855  *     @property
24856  */
24857   __Pyx_XDECREF(__pyx_r);
24858   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
24859   __Pyx_GOTREF(__pyx_t_1);
24860   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 587, __pyx_L1_error)
24861   __Pyx_GOTREF(__pyx_t_2);
24862   __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 587, __pyx_L1_error)
24863   __Pyx_GOTREF(__pyx_t_3);
24864   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24865   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24866   __pyx_r = __pyx_t_3;
24867   __pyx_t_3 = 0;
24868   goto __pyx_L0;
24869 
24870   /* "View.MemoryView":586
24871  *
24872  *     @property
24873  *     def nbytes(self):             # <<<<<<<<<<<<<<
24874  *         return self.size * self.view.itemsize
24875  *
24876  */
24877 
24878   /* function exit code */
24879   __pyx_L1_error:;
24880   __Pyx_XDECREF(__pyx_t_1);
24881   __Pyx_XDECREF(__pyx_t_2);
24882   __Pyx_XDECREF(__pyx_t_3);
24883   __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24884   __pyx_r = NULL;
24885   __pyx_L0:;
24886   __Pyx_XGIVEREF(__pyx_r);
24887   __Pyx_RefNannyFinishContext();
24888   return __pyx_r;
24889 }
24890 
24891 /* "View.MemoryView":590
24892  *
24893  *     @property
24894  *     def size(self):             # <<<<<<<<<<<<<<
24895  *         if self._size is None:
24896  *             result = 1
24897  */
24898 
24899 /* Python wrapper */
24900 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)24901 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
24902   PyObject *__pyx_r = 0;
24903   __Pyx_RefNannyDeclarations
24904   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
24905   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
24906 
24907   /* function exit code */
24908   __Pyx_RefNannyFinishContext();
24909   return __pyx_r;
24910 }
24911 
__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj * __pyx_v_self)24912 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
24913   PyObject *__pyx_v_result = NULL;
24914   PyObject *__pyx_v_length = NULL;
24915   PyObject *__pyx_r = NULL;
24916   __Pyx_RefNannyDeclarations
24917   int __pyx_t_1;
24918   int __pyx_t_2;
24919   Py_ssize_t *__pyx_t_3;
24920   Py_ssize_t *__pyx_t_4;
24921   Py_ssize_t *__pyx_t_5;
24922   PyObject *__pyx_t_6 = NULL;
24923   __Pyx_RefNannySetupContext("__get__", 0);
24924 
24925   /* "View.MemoryView":591
24926  *     @property
24927  *     def size(self):
24928  *         if self._size is None:             # <<<<<<<<<<<<<<
24929  *             result = 1
24930  *
24931  */
24932   __pyx_t_1 = (__pyx_v_self->_size == Py_None);
24933   __pyx_t_2 = (__pyx_t_1 != 0);
24934   if (__pyx_t_2) {
24935 
24936     /* "View.MemoryView":592
24937  *     def size(self):
24938  *         if self._size is None:
24939  *             result = 1             # <<<<<<<<<<<<<<
24940  *
24941  *             for length in self.view.shape[:self.view.ndim]:
24942  */
24943     __Pyx_INCREF(__pyx_int_1);
24944     __pyx_v_result = __pyx_int_1;
24945 
24946     /* "View.MemoryView":594
24947  *             result = 1
24948  *
24949  *             for length in self.view.shape[:self.view.ndim]:             # <<<<<<<<<<<<<<
24950  *                 result *= length
24951  *
24952  */
24953     __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
24954     for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
24955       __pyx_t_3 = __pyx_t_5;
24956       __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 594, __pyx_L1_error)
24957       __Pyx_GOTREF(__pyx_t_6);
24958       __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
24959       __pyx_t_6 = 0;
24960 
24961       /* "View.MemoryView":595
24962  *
24963  *             for length in self.view.shape[:self.view.ndim]:
24964  *                 result *= length             # <<<<<<<<<<<<<<
24965  *
24966  *             self._size = result
24967  */
24968       __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 595, __pyx_L1_error)
24969       __Pyx_GOTREF(__pyx_t_6);
24970       __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
24971       __pyx_t_6 = 0;
24972     }
24973 
24974     /* "View.MemoryView":597
24975  *                 result *= length
24976  *
24977  *             self._size = result             # <<<<<<<<<<<<<<
24978  *
24979  *         return self._size
24980  */
24981     __Pyx_INCREF(__pyx_v_result);
24982     __Pyx_GIVEREF(__pyx_v_result);
24983     __Pyx_GOTREF(__pyx_v_self->_size);
24984     __Pyx_DECREF(__pyx_v_self->_size);
24985     __pyx_v_self->_size = __pyx_v_result;
24986 
24987     /* "View.MemoryView":591
24988  *     @property
24989  *     def size(self):
24990  *         if self._size is None:             # <<<<<<<<<<<<<<
24991  *             result = 1
24992  *
24993  */
24994   }
24995 
24996   /* "View.MemoryView":599
24997  *             self._size = result
24998  *
24999  *         return self._size             # <<<<<<<<<<<<<<
25000  *
25001  *     def __len__(self):
25002  */
25003   __Pyx_XDECREF(__pyx_r);
25004   __Pyx_INCREF(__pyx_v_self->_size);
25005   __pyx_r = __pyx_v_self->_size;
25006   goto __pyx_L0;
25007 
25008   /* "View.MemoryView":590
25009  *
25010  *     @property
25011  *     def size(self):             # <<<<<<<<<<<<<<
25012  *         if self._size is None:
25013  *             result = 1
25014  */
25015 
25016   /* function exit code */
25017   __pyx_L1_error:;
25018   __Pyx_XDECREF(__pyx_t_6);
25019   __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
25020   __pyx_r = NULL;
25021   __pyx_L0:;
25022   __Pyx_XDECREF(__pyx_v_result);
25023   __Pyx_XDECREF(__pyx_v_length);
25024   __Pyx_XGIVEREF(__pyx_r);
25025   __Pyx_RefNannyFinishContext();
25026   return __pyx_r;
25027 }
25028 
25029 /* "View.MemoryView":601
25030  *         return self._size
25031  *
25032  *     def __len__(self):             # <<<<<<<<<<<<<<
25033  *         if self.view.ndim >= 1:
25034  *             return self.view.shape[0]
25035  */
25036 
25037 /* Python wrapper */
25038 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___len__(PyObject * __pyx_v_self)25039 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
25040   Py_ssize_t __pyx_r;
25041   __Pyx_RefNannyDeclarations
25042   __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
25043   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
25044 
25045   /* function exit code */
25046   __Pyx_RefNannyFinishContext();
25047   return __pyx_r;
25048 }
25049 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj * __pyx_v_self)25050 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
25051   Py_ssize_t __pyx_r;
25052   __Pyx_RefNannyDeclarations
25053   int __pyx_t_1;
25054   __Pyx_RefNannySetupContext("__len__", 0);
25055 
25056   /* "View.MemoryView":602
25057  *
25058  *     def __len__(self):
25059  *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
25060  *             return self.view.shape[0]
25061  *
25062  */
25063   __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
25064   if (__pyx_t_1) {
25065 
25066     /* "View.MemoryView":603
25067  *     def __len__(self):
25068  *         if self.view.ndim >= 1:
25069  *             return self.view.shape[0]             # <<<<<<<<<<<<<<
25070  *
25071  *         return 0
25072  */
25073     __pyx_r = (__pyx_v_self->view.shape[0]);
25074     goto __pyx_L0;
25075 
25076     /* "View.MemoryView":602
25077  *
25078  *     def __len__(self):
25079  *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
25080  *             return self.view.shape[0]
25081  *
25082  */
25083   }
25084 
25085   /* "View.MemoryView":605
25086  *             return self.view.shape[0]
25087  *
25088  *         return 0             # <<<<<<<<<<<<<<
25089  *
25090  *     def __repr__(self):
25091  */
25092   __pyx_r = 0;
25093   goto __pyx_L0;
25094 
25095   /* "View.MemoryView":601
25096  *         return self._size
25097  *
25098  *     def __len__(self):             # <<<<<<<<<<<<<<
25099  *         if self.view.ndim >= 1:
25100  *             return self.view.shape[0]
25101  */
25102 
25103   /* function exit code */
25104   __pyx_L0:;
25105   __Pyx_RefNannyFinishContext();
25106   return __pyx_r;
25107 }
25108 
25109 /* "View.MemoryView":607
25110  *         return 0
25111  *
25112  *     def __repr__(self):             # <<<<<<<<<<<<<<
25113  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
25114  *                                                id(self))
25115  */
25116 
25117 /* Python wrapper */
25118 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___repr__(PyObject * __pyx_v_self)25119 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
25120   PyObject *__pyx_r = 0;
25121   __Pyx_RefNannyDeclarations
25122   __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
25123   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
25124 
25125   /* function exit code */
25126   __Pyx_RefNannyFinishContext();
25127   return __pyx_r;
25128 }
25129 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj * __pyx_v_self)25130 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
25131   PyObject *__pyx_r = NULL;
25132   __Pyx_RefNannyDeclarations
25133   PyObject *__pyx_t_1 = NULL;
25134   PyObject *__pyx_t_2 = NULL;
25135   PyObject *__pyx_t_3 = NULL;
25136   __Pyx_RefNannySetupContext("__repr__", 0);
25137 
25138   /* "View.MemoryView":608
25139  *
25140  *     def __repr__(self):
25141  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
25142  *                                                id(self))
25143  *
25144  */
25145   __Pyx_XDECREF(__pyx_r);
25146   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 608, __pyx_L1_error)
25147   __Pyx_GOTREF(__pyx_t_1);
25148   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 608, __pyx_L1_error)
25149   __Pyx_GOTREF(__pyx_t_2);
25150   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25151   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 608, __pyx_L1_error)
25152   __Pyx_GOTREF(__pyx_t_1);
25153   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25154 
25155   /* "View.MemoryView":609
25156  *     def __repr__(self):
25157  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
25158  *                                                id(self))             # <<<<<<<<<<<<<<
25159  *
25160  *     def __str__(self):
25161  */
25162   __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 609, __pyx_L1_error)
25163   __Pyx_GOTREF(__pyx_t_2);
25164 
25165   /* "View.MemoryView":608
25166  *
25167  *     def __repr__(self):
25168  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
25169  *                                                id(self))
25170  *
25171  */
25172   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 608, __pyx_L1_error)
25173   __Pyx_GOTREF(__pyx_t_3);
25174   __Pyx_GIVEREF(__pyx_t_1);
25175   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
25176   __Pyx_GIVEREF(__pyx_t_2);
25177   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
25178   __pyx_t_1 = 0;
25179   __pyx_t_2 = 0;
25180   __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, 608, __pyx_L1_error)
25181   __Pyx_GOTREF(__pyx_t_2);
25182   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25183   __pyx_r = __pyx_t_2;
25184   __pyx_t_2 = 0;
25185   goto __pyx_L0;
25186 
25187   /* "View.MemoryView":607
25188  *         return 0
25189  *
25190  *     def __repr__(self):             # <<<<<<<<<<<<<<
25191  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
25192  *                                                id(self))
25193  */
25194 
25195   /* function exit code */
25196   __pyx_L1_error:;
25197   __Pyx_XDECREF(__pyx_t_1);
25198   __Pyx_XDECREF(__pyx_t_2);
25199   __Pyx_XDECREF(__pyx_t_3);
25200   __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
25201   __pyx_r = NULL;
25202   __pyx_L0:;
25203   __Pyx_XGIVEREF(__pyx_r);
25204   __Pyx_RefNannyFinishContext();
25205   return __pyx_r;
25206 }
25207 
25208 /* "View.MemoryView":611
25209  *                                                id(self))
25210  *
25211  *     def __str__(self):             # <<<<<<<<<<<<<<
25212  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
25213  *
25214  */
25215 
25216 /* Python wrapper */
25217 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___str__(PyObject * __pyx_v_self)25218 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
25219   PyObject *__pyx_r = 0;
25220   __Pyx_RefNannyDeclarations
25221   __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
25222   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
25223 
25224   /* function exit code */
25225   __Pyx_RefNannyFinishContext();
25226   return __pyx_r;
25227 }
25228 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj * __pyx_v_self)25229 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
25230   PyObject *__pyx_r = NULL;
25231   __Pyx_RefNannyDeclarations
25232   PyObject *__pyx_t_1 = NULL;
25233   PyObject *__pyx_t_2 = NULL;
25234   __Pyx_RefNannySetupContext("__str__", 0);
25235 
25236   /* "View.MemoryView":612
25237  *
25238  *     def __str__(self):
25239  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)             # <<<<<<<<<<<<<<
25240  *
25241  *
25242  */
25243   __Pyx_XDECREF(__pyx_r);
25244   __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)
25245   __Pyx_GOTREF(__pyx_t_1);
25246   __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)
25247   __Pyx_GOTREF(__pyx_t_2);
25248   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25249   __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)
25250   __Pyx_GOTREF(__pyx_t_1);
25251   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25252   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
25253   __Pyx_GOTREF(__pyx_t_2);
25254   __Pyx_GIVEREF(__pyx_t_1);
25255   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
25256   __pyx_t_1 = 0;
25257   __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
25258   __Pyx_GOTREF(__pyx_t_1);
25259   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25260   __pyx_r = __pyx_t_1;
25261   __pyx_t_1 = 0;
25262   goto __pyx_L0;
25263 
25264   /* "View.MemoryView":611
25265  *                                                id(self))
25266  *
25267  *     def __str__(self):             # <<<<<<<<<<<<<<
25268  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
25269  *
25270  */
25271 
25272   /* function exit code */
25273   __pyx_L1_error:;
25274   __Pyx_XDECREF(__pyx_t_1);
25275   __Pyx_XDECREF(__pyx_t_2);
25276   __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
25277   __pyx_r = NULL;
25278   __pyx_L0:;
25279   __Pyx_XGIVEREF(__pyx_r);
25280   __Pyx_RefNannyFinishContext();
25281   return __pyx_r;
25282 }
25283 
25284 /* "View.MemoryView":615
25285  *
25286  *
25287  *     def is_c_contig(self):             # <<<<<<<<<<<<<<
25288  *         cdef __Pyx_memviewslice *mslice
25289  *         cdef __Pyx_memviewslice tmp
25290  */
25291 
25292 /* Python wrapper */
25293 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)25294 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
25295   PyObject *__pyx_r = 0;
25296   __Pyx_RefNannyDeclarations
25297   __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
25298   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
25299 
25300   /* function exit code */
25301   __Pyx_RefNannyFinishContext();
25302   return __pyx_r;
25303 }
25304 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj * __pyx_v_self)25305 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
25306   __Pyx_memviewslice *__pyx_v_mslice;
25307   __Pyx_memviewslice __pyx_v_tmp;
25308   PyObject *__pyx_r = NULL;
25309   __Pyx_RefNannyDeclarations
25310   PyObject *__pyx_t_1 = NULL;
25311   __Pyx_RefNannySetupContext("is_c_contig", 0);
25312 
25313   /* "View.MemoryView":618
25314  *         cdef __Pyx_memviewslice *mslice
25315  *         cdef __Pyx_memviewslice tmp
25316  *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
25317  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
25318  *
25319  */
25320   __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
25321 
25322   /* "View.MemoryView":619
25323  *         cdef __Pyx_memviewslice tmp
25324  *         mslice = get_slice_from_memview(self, &tmp)
25325  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)             # <<<<<<<<<<<<<<
25326  *
25327  *     def is_f_contig(self):
25328  */
25329   __Pyx_XDECREF(__pyx_r);
25330   __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 619, __pyx_L1_error)
25331   __Pyx_GOTREF(__pyx_t_1);
25332   __pyx_r = __pyx_t_1;
25333   __pyx_t_1 = 0;
25334   goto __pyx_L0;
25335 
25336   /* "View.MemoryView":615
25337  *
25338  *
25339  *     def is_c_contig(self):             # <<<<<<<<<<<<<<
25340  *         cdef __Pyx_memviewslice *mslice
25341  *         cdef __Pyx_memviewslice tmp
25342  */
25343 
25344   /* function exit code */
25345   __pyx_L1_error:;
25346   __Pyx_XDECREF(__pyx_t_1);
25347   __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
25348   __pyx_r = NULL;
25349   __pyx_L0:;
25350   __Pyx_XGIVEREF(__pyx_r);
25351   __Pyx_RefNannyFinishContext();
25352   return __pyx_r;
25353 }
25354 
25355 /* "View.MemoryView":621
25356  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
25357  *
25358  *     def is_f_contig(self):             # <<<<<<<<<<<<<<
25359  *         cdef __Pyx_memviewslice *mslice
25360  *         cdef __Pyx_memviewslice tmp
25361  */
25362 
25363 /* Python wrapper */
25364 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)25365 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
25366   PyObject *__pyx_r = 0;
25367   __Pyx_RefNannyDeclarations
25368   __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
25369   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
25370 
25371   /* function exit code */
25372   __Pyx_RefNannyFinishContext();
25373   return __pyx_r;
25374 }
25375 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj * __pyx_v_self)25376 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
25377   __Pyx_memviewslice *__pyx_v_mslice;
25378   __Pyx_memviewslice __pyx_v_tmp;
25379   PyObject *__pyx_r = NULL;
25380   __Pyx_RefNannyDeclarations
25381   PyObject *__pyx_t_1 = NULL;
25382   __Pyx_RefNannySetupContext("is_f_contig", 0);
25383 
25384   /* "View.MemoryView":624
25385  *         cdef __Pyx_memviewslice *mslice
25386  *         cdef __Pyx_memviewslice tmp
25387  *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
25388  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
25389  *
25390  */
25391   __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
25392 
25393   /* "View.MemoryView":625
25394  *         cdef __Pyx_memviewslice tmp
25395  *         mslice = get_slice_from_memview(self, &tmp)
25396  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)             # <<<<<<<<<<<<<<
25397  *
25398  *     def copy(self):
25399  */
25400   __Pyx_XDECREF(__pyx_r);
25401   __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 625, __pyx_L1_error)
25402   __Pyx_GOTREF(__pyx_t_1);
25403   __pyx_r = __pyx_t_1;
25404   __pyx_t_1 = 0;
25405   goto __pyx_L0;
25406 
25407   /* "View.MemoryView":621
25408  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
25409  *
25410  *     def is_f_contig(self):             # <<<<<<<<<<<<<<
25411  *         cdef __Pyx_memviewslice *mslice
25412  *         cdef __Pyx_memviewslice tmp
25413  */
25414 
25415   /* function exit code */
25416   __pyx_L1_error:;
25417   __Pyx_XDECREF(__pyx_t_1);
25418   __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
25419   __pyx_r = NULL;
25420   __pyx_L0:;
25421   __Pyx_XGIVEREF(__pyx_r);
25422   __Pyx_RefNannyFinishContext();
25423   return __pyx_r;
25424 }
25425 
25426 /* "View.MemoryView":627
25427  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
25428  *
25429  *     def copy(self):             # <<<<<<<<<<<<<<
25430  *         cdef __Pyx_memviewslice mslice
25431  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
25432  */
25433 
25434 /* Python wrapper */
25435 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)25436 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
25437   PyObject *__pyx_r = 0;
25438   __Pyx_RefNannyDeclarations
25439   __Pyx_RefNannySetupContext("copy (wrapper)", 0);
25440   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
25441 
25442   /* function exit code */
25443   __Pyx_RefNannyFinishContext();
25444   return __pyx_r;
25445 }
25446 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj * __pyx_v_self)25447 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
25448   __Pyx_memviewslice __pyx_v_mslice;
25449   int __pyx_v_flags;
25450   PyObject *__pyx_r = NULL;
25451   __Pyx_RefNannyDeclarations
25452   __Pyx_memviewslice __pyx_t_1;
25453   PyObject *__pyx_t_2 = NULL;
25454   __Pyx_RefNannySetupContext("copy", 0);
25455 
25456   /* "View.MemoryView":629
25457  *     def copy(self):
25458  *         cdef __Pyx_memviewslice mslice
25459  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS             # <<<<<<<<<<<<<<
25460  *
25461  *         slice_copy(self, &mslice)
25462  */
25463   __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
25464 
25465   /* "View.MemoryView":631
25466  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
25467  *
25468  *         slice_copy(self, &mslice)             # <<<<<<<<<<<<<<
25469  *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
25470  *                                    self.view.itemsize,
25471  */
25472   __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
25473 
25474   /* "View.MemoryView":632
25475  *
25476  *         slice_copy(self, &mslice)
25477  *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,             # <<<<<<<<<<<<<<
25478  *                                    self.view.itemsize,
25479  *                                    flags|PyBUF_C_CONTIGUOUS,
25480  */
25481   __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, 632, __pyx_L1_error)
25482   __pyx_v_mslice = __pyx_t_1;
25483 
25484   /* "View.MemoryView":637
25485  *                                    self.dtype_is_object)
25486  *
25487  *         return memoryview_copy_from_slice(self, &mslice)             # <<<<<<<<<<<<<<
25488  *
25489  *     def copy_fortran(self):
25490  */
25491   __Pyx_XDECREF(__pyx_r);
25492   __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 637, __pyx_L1_error)
25493   __Pyx_GOTREF(__pyx_t_2);
25494   __pyx_r = __pyx_t_2;
25495   __pyx_t_2 = 0;
25496   goto __pyx_L0;
25497 
25498   /* "View.MemoryView":627
25499  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
25500  *
25501  *     def copy(self):             # <<<<<<<<<<<<<<
25502  *         cdef __Pyx_memviewslice mslice
25503  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
25504  */
25505 
25506   /* function exit code */
25507   __pyx_L1_error:;
25508   __Pyx_XDECREF(__pyx_t_2);
25509   __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
25510   __pyx_r = NULL;
25511   __pyx_L0:;
25512   __Pyx_XGIVEREF(__pyx_r);
25513   __Pyx_RefNannyFinishContext();
25514   return __pyx_r;
25515 }
25516 
25517 /* "View.MemoryView":639
25518  *         return memoryview_copy_from_slice(self, &mslice)
25519  *
25520  *     def copy_fortran(self):             # <<<<<<<<<<<<<<
25521  *         cdef __Pyx_memviewslice src, dst
25522  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
25523  */
25524 
25525 /* Python wrapper */
25526 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)25527 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
25528   PyObject *__pyx_r = 0;
25529   __Pyx_RefNannyDeclarations
25530   __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
25531   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
25532 
25533   /* function exit code */
25534   __Pyx_RefNannyFinishContext();
25535   return __pyx_r;
25536 }
25537 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj * __pyx_v_self)25538 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
25539   __Pyx_memviewslice __pyx_v_src;
25540   __Pyx_memviewslice __pyx_v_dst;
25541   int __pyx_v_flags;
25542   PyObject *__pyx_r = NULL;
25543   __Pyx_RefNannyDeclarations
25544   __Pyx_memviewslice __pyx_t_1;
25545   PyObject *__pyx_t_2 = NULL;
25546   __Pyx_RefNannySetupContext("copy_fortran", 0);
25547 
25548   /* "View.MemoryView":641
25549  *     def copy_fortran(self):
25550  *         cdef __Pyx_memviewslice src, dst
25551  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS             # <<<<<<<<<<<<<<
25552  *
25553  *         slice_copy(self, &src)
25554  */
25555   __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
25556 
25557   /* "View.MemoryView":643
25558  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
25559  *
25560  *         slice_copy(self, &src)             # <<<<<<<<<<<<<<
25561  *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,
25562  *                                 self.view.itemsize,
25563  */
25564   __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
25565 
25566   /* "View.MemoryView":644
25567  *
25568  *         slice_copy(self, &src)
25569  *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,             # <<<<<<<<<<<<<<
25570  *                                 self.view.itemsize,
25571  *                                 flags|PyBUF_F_CONTIGUOUS,
25572  */
25573   __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, 644, __pyx_L1_error)
25574   __pyx_v_dst = __pyx_t_1;
25575 
25576   /* "View.MemoryView":649
25577  *                                 self.dtype_is_object)
25578  *
25579  *         return memoryview_copy_from_slice(self, &dst)             # <<<<<<<<<<<<<<
25580  *
25581  *
25582  */
25583   __Pyx_XDECREF(__pyx_r);
25584   __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 649, __pyx_L1_error)
25585   __Pyx_GOTREF(__pyx_t_2);
25586   __pyx_r = __pyx_t_2;
25587   __pyx_t_2 = 0;
25588   goto __pyx_L0;
25589 
25590   /* "View.MemoryView":639
25591  *         return memoryview_copy_from_slice(self, &mslice)
25592  *
25593  *     def copy_fortran(self):             # <<<<<<<<<<<<<<
25594  *         cdef __Pyx_memviewslice src, dst
25595  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
25596  */
25597 
25598   /* function exit code */
25599   __pyx_L1_error:;
25600   __Pyx_XDECREF(__pyx_t_2);
25601   __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
25602   __pyx_r = NULL;
25603   __pyx_L0:;
25604   __Pyx_XGIVEREF(__pyx_r);
25605   __Pyx_RefNannyFinishContext();
25606   return __pyx_r;
25607 }
25608 
25609 /* "(tree fragment)":1
25610  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
25611  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25612  * def __setstate_cython__(self, __pyx_state):
25613  */
25614 
25615 /* Python wrapper */
25616 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)25617 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
25618   PyObject *__pyx_r = 0;
25619   __Pyx_RefNannyDeclarations
25620   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
25621   __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
25622 
25623   /* function exit code */
25624   __Pyx_RefNannyFinishContext();
25625   return __pyx_r;
25626 }
25627 
__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj * __pyx_v_self)25628 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
25629   PyObject *__pyx_r = NULL;
25630   __Pyx_RefNannyDeclarations
25631   PyObject *__pyx_t_1 = NULL;
25632   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
25633 
25634   /* "(tree fragment)":2
25635  * def __reduce_cython__(self):
25636  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
25637  * def __setstate_cython__(self, __pyx_state):
25638  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25639  */
25640   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
25641   __Pyx_GOTREF(__pyx_t_1);
25642   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
25643   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25644   __PYX_ERR(1, 2, __pyx_L1_error)
25645 
25646   /* "(tree fragment)":1
25647  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
25648  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25649  * def __setstate_cython__(self, __pyx_state):
25650  */
25651 
25652   /* function exit code */
25653   __pyx_L1_error:;
25654   __Pyx_XDECREF(__pyx_t_1);
25655   __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
25656   __pyx_r = NULL;
25657   __Pyx_XGIVEREF(__pyx_r);
25658   __Pyx_RefNannyFinishContext();
25659   return __pyx_r;
25660 }
25661 
25662 /* "(tree fragment)":3
25663  * def __reduce_cython__(self):
25664  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25665  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
25666  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25667  */
25668 
25669 /* Python wrapper */
25670 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)25671 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
25672   PyObject *__pyx_r = 0;
25673   __Pyx_RefNannyDeclarations
25674   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
25675   __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
25676 
25677   /* function exit code */
25678   __Pyx_RefNannyFinishContext();
25679   return __pyx_r;
25680 }
25681 
__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)25682 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) {
25683   PyObject *__pyx_r = NULL;
25684   __Pyx_RefNannyDeclarations
25685   PyObject *__pyx_t_1 = NULL;
25686   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
25687 
25688   /* "(tree fragment)":4
25689  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25690  * def __setstate_cython__(self, __pyx_state):
25691  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
25692  */
25693   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
25694   __Pyx_GOTREF(__pyx_t_1);
25695   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
25696   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25697   __PYX_ERR(1, 4, __pyx_L1_error)
25698 
25699   /* "(tree fragment)":3
25700  * def __reduce_cython__(self):
25701  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25702  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
25703  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25704  */
25705 
25706   /* function exit code */
25707   __pyx_L1_error:;
25708   __Pyx_XDECREF(__pyx_t_1);
25709   __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
25710   __pyx_r = NULL;
25711   __Pyx_XGIVEREF(__pyx_r);
25712   __Pyx_RefNannyFinishContext();
25713   return __pyx_r;
25714 }
25715 
25716 /* "View.MemoryView":653
25717  *
25718  * @cname('__pyx_memoryview_new')
25719  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
25720  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
25721  *     result.typeinfo = typeinfo
25722  */
25723 
__pyx_memoryview_new(PyObject * __pyx_v_o,int __pyx_v_flags,int __pyx_v_dtype_is_object,__Pyx_TypeInfo * __pyx_v_typeinfo)25724 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
25725   struct __pyx_memoryview_obj *__pyx_v_result = 0;
25726   PyObject *__pyx_r = NULL;
25727   __Pyx_RefNannyDeclarations
25728   PyObject *__pyx_t_1 = NULL;
25729   PyObject *__pyx_t_2 = NULL;
25730   PyObject *__pyx_t_3 = NULL;
25731   __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
25732 
25733   /* "View.MemoryView":654
25734  * @cname('__pyx_memoryview_new')
25735  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
25736  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)             # <<<<<<<<<<<<<<
25737  *     result.typeinfo = typeinfo
25738  *     return result
25739  */
25740   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 654, __pyx_L1_error)
25741   __Pyx_GOTREF(__pyx_t_1);
25742   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 654, __pyx_L1_error)
25743   __Pyx_GOTREF(__pyx_t_2);
25744   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 654, __pyx_L1_error)
25745   __Pyx_GOTREF(__pyx_t_3);
25746   __Pyx_INCREF(__pyx_v_o);
25747   __Pyx_GIVEREF(__pyx_v_o);
25748   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
25749   __Pyx_GIVEREF(__pyx_t_1);
25750   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
25751   __Pyx_GIVEREF(__pyx_t_2);
25752   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
25753   __pyx_t_1 = 0;
25754   __pyx_t_2 = 0;
25755   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 654, __pyx_L1_error)
25756   __Pyx_GOTREF(__pyx_t_2);
25757   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25758   __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
25759   __pyx_t_2 = 0;
25760 
25761   /* "View.MemoryView":655
25762  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
25763  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
25764  *     result.typeinfo = typeinfo             # <<<<<<<<<<<<<<
25765  *     return result
25766  *
25767  */
25768   __pyx_v_result->typeinfo = __pyx_v_typeinfo;
25769 
25770   /* "View.MemoryView":656
25771  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
25772  *     result.typeinfo = typeinfo
25773  *     return result             # <<<<<<<<<<<<<<
25774  *
25775  * @cname('__pyx_memoryview_check')
25776  */
25777   __Pyx_XDECREF(__pyx_r);
25778   __Pyx_INCREF(((PyObject *)__pyx_v_result));
25779   __pyx_r = ((PyObject *)__pyx_v_result);
25780   goto __pyx_L0;
25781 
25782   /* "View.MemoryView":653
25783  *
25784  * @cname('__pyx_memoryview_new')
25785  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
25786  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
25787  *     result.typeinfo = typeinfo
25788  */
25789 
25790   /* function exit code */
25791   __pyx_L1_error:;
25792   __Pyx_XDECREF(__pyx_t_1);
25793   __Pyx_XDECREF(__pyx_t_2);
25794   __Pyx_XDECREF(__pyx_t_3);
25795   __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
25796   __pyx_r = 0;
25797   __pyx_L0:;
25798   __Pyx_XDECREF((PyObject *)__pyx_v_result);
25799   __Pyx_XGIVEREF(__pyx_r);
25800   __Pyx_RefNannyFinishContext();
25801   return __pyx_r;
25802 }
25803 
25804 /* "View.MemoryView":659
25805  *
25806  * @cname('__pyx_memoryview_check')
25807  * cdef inline bint memoryview_check(object o):             # <<<<<<<<<<<<<<
25808  *     return isinstance(o, memoryview)
25809  *
25810  */
25811 
__pyx_memoryview_check(PyObject * __pyx_v_o)25812 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
25813   int __pyx_r;
25814   __Pyx_RefNannyDeclarations
25815   int __pyx_t_1;
25816   __Pyx_RefNannySetupContext("memoryview_check", 0);
25817 
25818   /* "View.MemoryView":660
25819  * @cname('__pyx_memoryview_check')
25820  * cdef inline bint memoryview_check(object o):
25821  *     return isinstance(o, memoryview)             # <<<<<<<<<<<<<<
25822  *
25823  * cdef tuple _unellipsify(object index, int ndim):
25824  */
25825   __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
25826   __pyx_r = __pyx_t_1;
25827   goto __pyx_L0;
25828 
25829   /* "View.MemoryView":659
25830  *
25831  * @cname('__pyx_memoryview_check')
25832  * cdef inline bint memoryview_check(object o):             # <<<<<<<<<<<<<<
25833  *     return isinstance(o, memoryview)
25834  *
25835  */
25836 
25837   /* function exit code */
25838   __pyx_L0:;
25839   __Pyx_RefNannyFinishContext();
25840   return __pyx_r;
25841 }
25842 
25843 /* "View.MemoryView":662
25844  *     return isinstance(o, memoryview)
25845  *
25846  * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
25847  *     """
25848  *     Replace all ellipses with full slices and fill incomplete indices with
25849  */
25850 
_unellipsify(PyObject * __pyx_v_index,int __pyx_v_ndim)25851 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
25852   PyObject *__pyx_v_tup = NULL;
25853   PyObject *__pyx_v_result = NULL;
25854   int __pyx_v_have_slices;
25855   int __pyx_v_seen_ellipsis;
25856   CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
25857   PyObject *__pyx_v_item = NULL;
25858   Py_ssize_t __pyx_v_nslices;
25859   PyObject *__pyx_r = NULL;
25860   __Pyx_RefNannyDeclarations
25861   int __pyx_t_1;
25862   int __pyx_t_2;
25863   PyObject *__pyx_t_3 = NULL;
25864   PyObject *__pyx_t_4 = NULL;
25865   Py_ssize_t __pyx_t_5;
25866   PyObject *(*__pyx_t_6)(PyObject *);
25867   PyObject *__pyx_t_7 = NULL;
25868   Py_ssize_t __pyx_t_8;
25869   int __pyx_t_9;
25870   int __pyx_t_10;
25871   PyObject *__pyx_t_11 = NULL;
25872   __Pyx_RefNannySetupContext("_unellipsify", 0);
25873 
25874   /* "View.MemoryView":667
25875  *     full slices.
25876  *     """
25877  *     if not isinstance(index, tuple):             # <<<<<<<<<<<<<<
25878  *         tup = (index,)
25879  *     else:
25880  */
25881   __pyx_t_1 = PyTuple_Check(__pyx_v_index);
25882   __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
25883   if (__pyx_t_2) {
25884 
25885     /* "View.MemoryView":668
25886  *     """
25887  *     if not isinstance(index, tuple):
25888  *         tup = (index,)             # <<<<<<<<<<<<<<
25889  *     else:
25890  *         tup = index
25891  */
25892     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 668, __pyx_L1_error)
25893     __Pyx_GOTREF(__pyx_t_3);
25894     __Pyx_INCREF(__pyx_v_index);
25895     __Pyx_GIVEREF(__pyx_v_index);
25896     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
25897     __pyx_v_tup = __pyx_t_3;
25898     __pyx_t_3 = 0;
25899 
25900     /* "View.MemoryView":667
25901  *     full slices.
25902  *     """
25903  *     if not isinstance(index, tuple):             # <<<<<<<<<<<<<<
25904  *         tup = (index,)
25905  *     else:
25906  */
25907     goto __pyx_L3;
25908   }
25909 
25910   /* "View.MemoryView":670
25911  *         tup = (index,)
25912  *     else:
25913  *         tup = index             # <<<<<<<<<<<<<<
25914  *
25915  *     result = []
25916  */
25917   /*else*/ {
25918     __Pyx_INCREF(__pyx_v_index);
25919     __pyx_v_tup = __pyx_v_index;
25920   }
25921   __pyx_L3:;
25922 
25923   /* "View.MemoryView":672
25924  *         tup = index
25925  *
25926  *     result = []             # <<<<<<<<<<<<<<
25927  *     have_slices = False
25928  *     seen_ellipsis = False
25929  */
25930   __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
25931   __Pyx_GOTREF(__pyx_t_3);
25932   __pyx_v_result = ((PyObject*)__pyx_t_3);
25933   __pyx_t_3 = 0;
25934 
25935   /* "View.MemoryView":673
25936  *
25937  *     result = []
25938  *     have_slices = False             # <<<<<<<<<<<<<<
25939  *     seen_ellipsis = False
25940  *     for idx, item in enumerate(tup):
25941  */
25942   __pyx_v_have_slices = 0;
25943 
25944   /* "View.MemoryView":674
25945  *     result = []
25946  *     have_slices = False
25947  *     seen_ellipsis = False             # <<<<<<<<<<<<<<
25948  *     for idx, item in enumerate(tup):
25949  *         if item is Ellipsis:
25950  */
25951   __pyx_v_seen_ellipsis = 0;
25952 
25953   /* "View.MemoryView":675
25954  *     have_slices = False
25955  *     seen_ellipsis = False
25956  *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
25957  *         if item is Ellipsis:
25958  *             if not seen_ellipsis:
25959  */
25960   __Pyx_INCREF(__pyx_int_0);
25961   __pyx_t_3 = __pyx_int_0;
25962   if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
25963     __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
25964     __pyx_t_6 = NULL;
25965   } else {
25966     __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 675, __pyx_L1_error)
25967     __Pyx_GOTREF(__pyx_t_4);
25968     __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 675, __pyx_L1_error)
25969   }
25970   for (;;) {
25971     if (likely(!__pyx_t_6)) {
25972       if (likely(PyList_CheckExact(__pyx_t_4))) {
25973         if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
25974         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25975         __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, 675, __pyx_L1_error)
25976         #else
25977         __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error)
25978         __Pyx_GOTREF(__pyx_t_7);
25979         #endif
25980       } else {
25981         if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
25982         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25983         __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, 675, __pyx_L1_error)
25984         #else
25985         __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error)
25986         __Pyx_GOTREF(__pyx_t_7);
25987         #endif
25988       }
25989     } else {
25990       __pyx_t_7 = __pyx_t_6(__pyx_t_4);
25991       if (unlikely(!__pyx_t_7)) {
25992         PyObject* exc_type = PyErr_Occurred();
25993         if (exc_type) {
25994           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
25995           else __PYX_ERR(1, 675, __pyx_L1_error)
25996         }
25997         break;
25998       }
25999       __Pyx_GOTREF(__pyx_t_7);
26000     }
26001     __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
26002     __pyx_t_7 = 0;
26003     __Pyx_INCREF(__pyx_t_3);
26004     __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
26005     __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error)
26006     __Pyx_GOTREF(__pyx_t_7);
26007     __Pyx_DECREF(__pyx_t_3);
26008     __pyx_t_3 = __pyx_t_7;
26009     __pyx_t_7 = 0;
26010 
26011     /* "View.MemoryView":676
26012  *     seen_ellipsis = False
26013  *     for idx, item in enumerate(tup):
26014  *         if item is Ellipsis:             # <<<<<<<<<<<<<<
26015  *             if not seen_ellipsis:
26016  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
26017  */
26018     __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
26019     __pyx_t_1 = (__pyx_t_2 != 0);
26020     if (__pyx_t_1) {
26021 
26022       /* "View.MemoryView":677
26023  *     for idx, item in enumerate(tup):
26024  *         if item is Ellipsis:
26025  *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
26026  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
26027  *                 seen_ellipsis = True
26028  */
26029       __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
26030       if (__pyx_t_1) {
26031 
26032         /* "View.MemoryView":678
26033  *         if item is Ellipsis:
26034  *             if not seen_ellipsis:
26035  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))             # <<<<<<<<<<<<<<
26036  *                 seen_ellipsis = True
26037  *             else:
26038  */
26039         __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 678, __pyx_L1_error)
26040         __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, 678, __pyx_L1_error)
26041         __Pyx_GOTREF(__pyx_t_7);
26042         { Py_ssize_t __pyx_temp;
26043           for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
26044             __Pyx_INCREF(__pyx_slice__4);
26045             __Pyx_GIVEREF(__pyx_slice__4);
26046             PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__4);
26047           }
26048         }
26049         __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 678, __pyx_L1_error)
26050         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26051 
26052         /* "View.MemoryView":679
26053  *             if not seen_ellipsis:
26054  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
26055  *                 seen_ellipsis = True             # <<<<<<<<<<<<<<
26056  *             else:
26057  *                 result.append(slice(None))
26058  */
26059         __pyx_v_seen_ellipsis = 1;
26060 
26061         /* "View.MemoryView":677
26062  *     for idx, item in enumerate(tup):
26063  *         if item is Ellipsis:
26064  *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
26065  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
26066  *                 seen_ellipsis = True
26067  */
26068         goto __pyx_L7;
26069       }
26070 
26071       /* "View.MemoryView":681
26072  *                 seen_ellipsis = True
26073  *             else:
26074  *                 result.append(slice(None))             # <<<<<<<<<<<<<<
26075  *             have_slices = True
26076  *         else:
26077  */
26078       /*else*/ {
26079         __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__4); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 681, __pyx_L1_error)
26080       }
26081       __pyx_L7:;
26082 
26083       /* "View.MemoryView":682
26084  *             else:
26085  *                 result.append(slice(None))
26086  *             have_slices = True             # <<<<<<<<<<<<<<
26087  *         else:
26088  *             if not isinstance(item, slice) and not PyIndex_Check(item):
26089  */
26090       __pyx_v_have_slices = 1;
26091 
26092       /* "View.MemoryView":676
26093  *     seen_ellipsis = False
26094  *     for idx, item in enumerate(tup):
26095  *         if item is Ellipsis:             # <<<<<<<<<<<<<<
26096  *             if not seen_ellipsis:
26097  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
26098  */
26099       goto __pyx_L6;
26100     }
26101 
26102     /* "View.MemoryView":684
26103  *             have_slices = True
26104  *         else:
26105  *             if not isinstance(item, slice) and not PyIndex_Check(item):             # <<<<<<<<<<<<<<
26106  *                 raise TypeError("Cannot index with type '%s'" % type(item))
26107  *
26108  */
26109     /*else*/ {
26110       __pyx_t_2 = PySlice_Check(__pyx_v_item);
26111       __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
26112       if (__pyx_t_10) {
26113       } else {
26114         __pyx_t_1 = __pyx_t_10;
26115         goto __pyx_L9_bool_binop_done;
26116       }
26117       __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
26118       __pyx_t_1 = __pyx_t_10;
26119       __pyx_L9_bool_binop_done:;
26120       if (unlikely(__pyx_t_1)) {
26121 
26122         /* "View.MemoryView":685
26123  *         else:
26124  *             if not isinstance(item, slice) and not PyIndex_Check(item):
26125  *                 raise TypeError("Cannot index with type '%s'" % type(item))             # <<<<<<<<<<<<<<
26126  *
26127  *             have_slices = have_slices or isinstance(item, slice)
26128  */
26129         __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, 685, __pyx_L1_error)
26130         __Pyx_GOTREF(__pyx_t_7);
26131         __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 685, __pyx_L1_error)
26132         __Pyx_GOTREF(__pyx_t_11);
26133         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26134         __Pyx_Raise(__pyx_t_11, 0, 0, 0);
26135         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
26136         __PYX_ERR(1, 685, __pyx_L1_error)
26137 
26138         /* "View.MemoryView":684
26139  *             have_slices = True
26140  *         else:
26141  *             if not isinstance(item, slice) and not PyIndex_Check(item):             # <<<<<<<<<<<<<<
26142  *                 raise TypeError("Cannot index with type '%s'" % type(item))
26143  *
26144  */
26145       }
26146 
26147       /* "View.MemoryView":687
26148  *                 raise TypeError("Cannot index with type '%s'" % type(item))
26149  *
26150  *             have_slices = have_slices or isinstance(item, slice)             # <<<<<<<<<<<<<<
26151  *             result.append(item)
26152  *
26153  */
26154       __pyx_t_10 = (__pyx_v_have_slices != 0);
26155       if (!__pyx_t_10) {
26156       } else {
26157         __pyx_t_1 = __pyx_t_10;
26158         goto __pyx_L11_bool_binop_done;
26159       }
26160       __pyx_t_10 = PySlice_Check(__pyx_v_item);
26161       __pyx_t_2 = (__pyx_t_10 != 0);
26162       __pyx_t_1 = __pyx_t_2;
26163       __pyx_L11_bool_binop_done:;
26164       __pyx_v_have_slices = __pyx_t_1;
26165 
26166       /* "View.MemoryView":688
26167  *
26168  *             have_slices = have_slices or isinstance(item, slice)
26169  *             result.append(item)             # <<<<<<<<<<<<<<
26170  *
26171  *     nslices = ndim - len(result)
26172  */
26173       __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 688, __pyx_L1_error)
26174     }
26175     __pyx_L6:;
26176 
26177     /* "View.MemoryView":675
26178  *     have_slices = False
26179  *     seen_ellipsis = False
26180  *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
26181  *         if item is Ellipsis:
26182  *             if not seen_ellipsis:
26183  */
26184   }
26185   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26186   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26187 
26188   /* "View.MemoryView":690
26189  *             result.append(item)
26190  *
26191  *     nslices = ndim - len(result)             # <<<<<<<<<<<<<<
26192  *     if nslices:
26193  *         result.extend([slice(None)] * nslices)
26194  */
26195   __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 690, __pyx_L1_error)
26196   __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
26197 
26198   /* "View.MemoryView":691
26199  *
26200  *     nslices = ndim - len(result)
26201  *     if nslices:             # <<<<<<<<<<<<<<
26202  *         result.extend([slice(None)] * nslices)
26203  *
26204  */
26205   __pyx_t_1 = (__pyx_v_nslices != 0);
26206   if (__pyx_t_1) {
26207 
26208     /* "View.MemoryView":692
26209  *     nslices = ndim - len(result)
26210  *     if nslices:
26211  *         result.extend([slice(None)] * nslices)             # <<<<<<<<<<<<<<
26212  *
26213  *     return have_slices or nslices, tuple(result)
26214  */
26215     __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 692, __pyx_L1_error)
26216     __Pyx_GOTREF(__pyx_t_3);
26217     { Py_ssize_t __pyx_temp;
26218       for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
26219         __Pyx_INCREF(__pyx_slice__4);
26220         __Pyx_GIVEREF(__pyx_slice__4);
26221         PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__4);
26222       }
26223     }
26224     __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
26225     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26226 
26227     /* "View.MemoryView":691
26228  *
26229  *     nslices = ndim - len(result)
26230  *     if nslices:             # <<<<<<<<<<<<<<
26231  *         result.extend([slice(None)] * nslices)
26232  *
26233  */
26234   }
26235 
26236   /* "View.MemoryView":694
26237  *         result.extend([slice(None)] * nslices)
26238  *
26239  *     return have_slices or nslices, tuple(result)             # <<<<<<<<<<<<<<
26240  *
26241  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
26242  */
26243   __Pyx_XDECREF(__pyx_r);
26244   if (!__pyx_v_have_slices) {
26245   } else {
26246     __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 694, __pyx_L1_error)
26247     __Pyx_GOTREF(__pyx_t_4);
26248     __pyx_t_3 = __pyx_t_4;
26249     __pyx_t_4 = 0;
26250     goto __pyx_L14_bool_binop_done;
26251   }
26252   __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 694, __pyx_L1_error)
26253   __Pyx_GOTREF(__pyx_t_4);
26254   __pyx_t_3 = __pyx_t_4;
26255   __pyx_t_4 = 0;
26256   __pyx_L14_bool_binop_done:;
26257   __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 694, __pyx_L1_error)
26258   __Pyx_GOTREF(__pyx_t_4);
26259   __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 694, __pyx_L1_error)
26260   __Pyx_GOTREF(__pyx_t_11);
26261   __Pyx_GIVEREF(__pyx_t_3);
26262   PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
26263   __Pyx_GIVEREF(__pyx_t_4);
26264   PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
26265   __pyx_t_3 = 0;
26266   __pyx_t_4 = 0;
26267   __pyx_r = ((PyObject*)__pyx_t_11);
26268   __pyx_t_11 = 0;
26269   goto __pyx_L0;
26270 
26271   /* "View.MemoryView":662
26272  *     return isinstance(o, memoryview)
26273  *
26274  * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
26275  *     """
26276  *     Replace all ellipses with full slices and fill incomplete indices with
26277  */
26278 
26279   /* function exit code */
26280   __pyx_L1_error:;
26281   __Pyx_XDECREF(__pyx_t_3);
26282   __Pyx_XDECREF(__pyx_t_4);
26283   __Pyx_XDECREF(__pyx_t_7);
26284   __Pyx_XDECREF(__pyx_t_11);
26285   __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
26286   __pyx_r = 0;
26287   __pyx_L0:;
26288   __Pyx_XDECREF(__pyx_v_tup);
26289   __Pyx_XDECREF(__pyx_v_result);
26290   __Pyx_XDECREF(__pyx_v_idx);
26291   __Pyx_XDECREF(__pyx_v_item);
26292   __Pyx_XGIVEREF(__pyx_r);
26293   __Pyx_RefNannyFinishContext();
26294   return __pyx_r;
26295 }
26296 
26297 /* "View.MemoryView":696
26298  *     return have_slices or nslices, tuple(result)
26299  *
26300  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
26301  *     for suboffset in suboffsets[:ndim]:
26302  *         if suboffset >= 0:
26303  */
26304 
assert_direct_dimensions(Py_ssize_t * __pyx_v_suboffsets,int __pyx_v_ndim)26305 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
26306   Py_ssize_t __pyx_v_suboffset;
26307   PyObject *__pyx_r = NULL;
26308   __Pyx_RefNannyDeclarations
26309   Py_ssize_t *__pyx_t_1;
26310   Py_ssize_t *__pyx_t_2;
26311   Py_ssize_t *__pyx_t_3;
26312   int __pyx_t_4;
26313   PyObject *__pyx_t_5 = NULL;
26314   __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
26315 
26316   /* "View.MemoryView":697
26317  *
26318  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
26319  *     for suboffset in suboffsets[:ndim]:             # <<<<<<<<<<<<<<
26320  *         if suboffset >= 0:
26321  *             raise ValueError("Indirect dimensions not supported")
26322  */
26323   __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
26324   for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
26325     __pyx_t_1 = __pyx_t_3;
26326     __pyx_v_suboffset = (__pyx_t_1[0]);
26327 
26328     /* "View.MemoryView":698
26329  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
26330  *     for suboffset in suboffsets[:ndim]:
26331  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
26332  *             raise ValueError("Indirect dimensions not supported")
26333  *
26334  */
26335     __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
26336     if (unlikely(__pyx_t_4)) {
26337 
26338       /* "View.MemoryView":699
26339  *     for suboffset in suboffsets[:ndim]:
26340  *         if suboffset >= 0:
26341  *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
26342  *
26343  *
26344  */
26345       __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 699, __pyx_L1_error)
26346       __Pyx_GOTREF(__pyx_t_5);
26347       __Pyx_Raise(__pyx_t_5, 0, 0, 0);
26348       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26349       __PYX_ERR(1, 699, __pyx_L1_error)
26350 
26351       /* "View.MemoryView":698
26352  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
26353  *     for suboffset in suboffsets[:ndim]:
26354  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
26355  *             raise ValueError("Indirect dimensions not supported")
26356  *
26357  */
26358     }
26359   }
26360 
26361   /* "View.MemoryView":696
26362  *     return have_slices or nslices, tuple(result)
26363  *
26364  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
26365  *     for suboffset in suboffsets[:ndim]:
26366  *         if suboffset >= 0:
26367  */
26368 
26369   /* function exit code */
26370   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
26371   goto __pyx_L0;
26372   __pyx_L1_error:;
26373   __Pyx_XDECREF(__pyx_t_5);
26374   __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
26375   __pyx_r = 0;
26376   __pyx_L0:;
26377   __Pyx_XGIVEREF(__pyx_r);
26378   __Pyx_RefNannyFinishContext();
26379   return __pyx_r;
26380 }
26381 
26382 /* "View.MemoryView":706
26383  *
26384  * @cname('__pyx_memview_slice')
26385  * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
26386  *     cdef int new_ndim = 0, suboffset_dim = -1, dim
26387  *     cdef bint negative_step
26388  */
26389 
__pyx_memview_slice(struct __pyx_memoryview_obj * __pyx_v_memview,PyObject * __pyx_v_indices)26390 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
26391   int __pyx_v_new_ndim;
26392   int __pyx_v_suboffset_dim;
26393   int __pyx_v_dim;
26394   __Pyx_memviewslice __pyx_v_src;
26395   __Pyx_memviewslice __pyx_v_dst;
26396   __Pyx_memviewslice *__pyx_v_p_src;
26397   struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
26398   __Pyx_memviewslice *__pyx_v_p_dst;
26399   int *__pyx_v_p_suboffset_dim;
26400   Py_ssize_t __pyx_v_start;
26401   Py_ssize_t __pyx_v_stop;
26402   Py_ssize_t __pyx_v_step;
26403   int __pyx_v_have_start;
26404   int __pyx_v_have_stop;
26405   int __pyx_v_have_step;
26406   PyObject *__pyx_v_index = NULL;
26407   struct __pyx_memoryview_obj *__pyx_r = NULL;
26408   __Pyx_RefNannyDeclarations
26409   int __pyx_t_1;
26410   int __pyx_t_2;
26411   PyObject *__pyx_t_3 = NULL;
26412   struct __pyx_memoryview_obj *__pyx_t_4;
26413   char *__pyx_t_5;
26414   int __pyx_t_6;
26415   Py_ssize_t __pyx_t_7;
26416   PyObject *(*__pyx_t_8)(PyObject *);
26417   PyObject *__pyx_t_9 = NULL;
26418   Py_ssize_t __pyx_t_10;
26419   int __pyx_t_11;
26420   Py_ssize_t __pyx_t_12;
26421   __Pyx_RefNannySetupContext("memview_slice", 0);
26422 
26423   /* "View.MemoryView":707
26424  * @cname('__pyx_memview_slice')
26425  * cdef memoryview memview_slice(memoryview memview, object indices):
26426  *     cdef int new_ndim = 0, suboffset_dim = -1, dim             # <<<<<<<<<<<<<<
26427  *     cdef bint negative_step
26428  *     cdef __Pyx_memviewslice src, dst
26429  */
26430   __pyx_v_new_ndim = 0;
26431   __pyx_v_suboffset_dim = -1;
26432 
26433   /* "View.MemoryView":714
26434  *
26435  *
26436  *     memset(&dst, 0, sizeof(dst))             # <<<<<<<<<<<<<<
26437  *
26438  *     cdef _memoryviewslice memviewsliceobj
26439  */
26440   (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
26441 
26442   /* "View.MemoryView":718
26443  *     cdef _memoryviewslice memviewsliceobj
26444  *
26445  *     assert memview.view.ndim > 0             # <<<<<<<<<<<<<<
26446  *
26447  *     if isinstance(memview, _memoryviewslice):
26448  */
26449   #ifndef CYTHON_WITHOUT_ASSERTIONS
26450   if (unlikely(!Py_OptimizeFlag)) {
26451     if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
26452       PyErr_SetNone(PyExc_AssertionError);
26453       __PYX_ERR(1, 718, __pyx_L1_error)
26454     }
26455   }
26456   #endif
26457 
26458   /* "View.MemoryView":720
26459  *     assert memview.view.ndim > 0
26460  *
26461  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
26462  *         memviewsliceobj = memview
26463  *         p_src = &memviewsliceobj.from_slice
26464  */
26465   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
26466   __pyx_t_2 = (__pyx_t_1 != 0);
26467   if (__pyx_t_2) {
26468 
26469     /* "View.MemoryView":721
26470  *
26471  *     if isinstance(memview, _memoryviewslice):
26472  *         memviewsliceobj = memview             # <<<<<<<<<<<<<<
26473  *         p_src = &memviewsliceobj.from_slice
26474  *     else:
26475  */
26476     if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 721, __pyx_L1_error)
26477     __pyx_t_3 = ((PyObject *)__pyx_v_memview);
26478     __Pyx_INCREF(__pyx_t_3);
26479     __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
26480     __pyx_t_3 = 0;
26481 
26482     /* "View.MemoryView":722
26483  *     if isinstance(memview, _memoryviewslice):
26484  *         memviewsliceobj = memview
26485  *         p_src = &memviewsliceobj.from_slice             # <<<<<<<<<<<<<<
26486  *     else:
26487  *         slice_copy(memview, &src)
26488  */
26489     __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
26490 
26491     /* "View.MemoryView":720
26492  *     assert memview.view.ndim > 0
26493  *
26494  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
26495  *         memviewsliceobj = memview
26496  *         p_src = &memviewsliceobj.from_slice
26497  */
26498     goto __pyx_L3;
26499   }
26500 
26501   /* "View.MemoryView":724
26502  *         p_src = &memviewsliceobj.from_slice
26503  *     else:
26504  *         slice_copy(memview, &src)             # <<<<<<<<<<<<<<
26505  *         p_src = &src
26506  *
26507  */
26508   /*else*/ {
26509     __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
26510 
26511     /* "View.MemoryView":725
26512  *     else:
26513  *         slice_copy(memview, &src)
26514  *         p_src = &src             # <<<<<<<<<<<<<<
26515  *
26516  *
26517  */
26518     __pyx_v_p_src = (&__pyx_v_src);
26519   }
26520   __pyx_L3:;
26521 
26522   /* "View.MemoryView":731
26523  *
26524  *
26525  *     dst.memview = p_src.memview             # <<<<<<<<<<<<<<
26526  *     dst.data = p_src.data
26527  *
26528  */
26529   __pyx_t_4 = __pyx_v_p_src->memview;
26530   __pyx_v_dst.memview = __pyx_t_4;
26531 
26532   /* "View.MemoryView":732
26533  *
26534  *     dst.memview = p_src.memview
26535  *     dst.data = p_src.data             # <<<<<<<<<<<<<<
26536  *
26537  *
26538  */
26539   __pyx_t_5 = __pyx_v_p_src->data;
26540   __pyx_v_dst.data = __pyx_t_5;
26541 
26542   /* "View.MemoryView":737
26543  *
26544  *
26545  *     cdef __Pyx_memviewslice *p_dst = &dst             # <<<<<<<<<<<<<<
26546  *     cdef int *p_suboffset_dim = &suboffset_dim
26547  *     cdef Py_ssize_t start, stop, step
26548  */
26549   __pyx_v_p_dst = (&__pyx_v_dst);
26550 
26551   /* "View.MemoryView":738
26552  *
26553  *     cdef __Pyx_memviewslice *p_dst = &dst
26554  *     cdef int *p_suboffset_dim = &suboffset_dim             # <<<<<<<<<<<<<<
26555  *     cdef Py_ssize_t start, stop, step
26556  *     cdef bint have_start, have_stop, have_step
26557  */
26558   __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
26559 
26560   /* "View.MemoryView":742
26561  *     cdef bint have_start, have_stop, have_step
26562  *
26563  *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
26564  *         if PyIndex_Check(index):
26565  *             slice_memviewslice(
26566  */
26567   __pyx_t_6 = 0;
26568   if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
26569     __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
26570     __pyx_t_8 = NULL;
26571   } else {
26572     __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 742, __pyx_L1_error)
26573     __Pyx_GOTREF(__pyx_t_3);
26574     __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 742, __pyx_L1_error)
26575   }
26576   for (;;) {
26577     if (likely(!__pyx_t_8)) {
26578       if (likely(PyList_CheckExact(__pyx_t_3))) {
26579         if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
26580         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26581         __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, 742, __pyx_L1_error)
26582         #else
26583         __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 742, __pyx_L1_error)
26584         __Pyx_GOTREF(__pyx_t_9);
26585         #endif
26586       } else {
26587         if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
26588         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26589         __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, 742, __pyx_L1_error)
26590         #else
26591         __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 742, __pyx_L1_error)
26592         __Pyx_GOTREF(__pyx_t_9);
26593         #endif
26594       }
26595     } else {
26596       __pyx_t_9 = __pyx_t_8(__pyx_t_3);
26597       if (unlikely(!__pyx_t_9)) {
26598         PyObject* exc_type = PyErr_Occurred();
26599         if (exc_type) {
26600           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
26601           else __PYX_ERR(1, 742, __pyx_L1_error)
26602         }
26603         break;
26604       }
26605       __Pyx_GOTREF(__pyx_t_9);
26606     }
26607     __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
26608     __pyx_t_9 = 0;
26609     __pyx_v_dim = __pyx_t_6;
26610     __pyx_t_6 = (__pyx_t_6 + 1);
26611 
26612     /* "View.MemoryView":743
26613  *
26614  *     for dim, index in enumerate(indices):
26615  *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
26616  *             slice_memviewslice(
26617  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
26618  */
26619     __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
26620     if (__pyx_t_2) {
26621 
26622       /* "View.MemoryView":747
26623  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
26624  *                 dim, new_ndim, p_suboffset_dim,
26625  *                 index, 0, 0, # start, stop, step             # <<<<<<<<<<<<<<
26626  *                 0, 0, 0, # have_{start,stop,step}
26627  *                 False)
26628  */
26629       __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 747, __pyx_L1_error)
26630 
26631       /* "View.MemoryView":744
26632  *     for dim, index in enumerate(indices):
26633  *         if PyIndex_Check(index):
26634  *             slice_memviewslice(             # <<<<<<<<<<<<<<
26635  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
26636  *                 dim, new_ndim, p_suboffset_dim,
26637  */
26638       __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, 744, __pyx_L1_error)
26639 
26640       /* "View.MemoryView":743
26641  *
26642  *     for dim, index in enumerate(indices):
26643  *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
26644  *             slice_memviewslice(
26645  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
26646  */
26647       goto __pyx_L6;
26648     }
26649 
26650     /* "View.MemoryView":750
26651  *                 0, 0, 0, # have_{start,stop,step}
26652  *                 False)
26653  *         elif index is None:             # <<<<<<<<<<<<<<
26654  *             p_dst.shape[new_ndim] = 1
26655  *             p_dst.strides[new_ndim] = 0
26656  */
26657     __pyx_t_2 = (__pyx_v_index == Py_None);
26658     __pyx_t_1 = (__pyx_t_2 != 0);
26659     if (__pyx_t_1) {
26660 
26661       /* "View.MemoryView":751
26662  *                 False)
26663  *         elif index is None:
26664  *             p_dst.shape[new_ndim] = 1             # <<<<<<<<<<<<<<
26665  *             p_dst.strides[new_ndim] = 0
26666  *             p_dst.suboffsets[new_ndim] = -1
26667  */
26668       (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
26669 
26670       /* "View.MemoryView":752
26671  *         elif index is None:
26672  *             p_dst.shape[new_ndim] = 1
26673  *             p_dst.strides[new_ndim] = 0             # <<<<<<<<<<<<<<
26674  *             p_dst.suboffsets[new_ndim] = -1
26675  *             new_ndim += 1
26676  */
26677       (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
26678 
26679       /* "View.MemoryView":753
26680  *             p_dst.shape[new_ndim] = 1
26681  *             p_dst.strides[new_ndim] = 0
26682  *             p_dst.suboffsets[new_ndim] = -1             # <<<<<<<<<<<<<<
26683  *             new_ndim += 1
26684  *         else:
26685  */
26686       (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
26687 
26688       /* "View.MemoryView":754
26689  *             p_dst.strides[new_ndim] = 0
26690  *             p_dst.suboffsets[new_ndim] = -1
26691  *             new_ndim += 1             # <<<<<<<<<<<<<<
26692  *         else:
26693  *             start = index.start or 0
26694  */
26695       __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
26696 
26697       /* "View.MemoryView":750
26698  *                 0, 0, 0, # have_{start,stop,step}
26699  *                 False)
26700  *         elif index is None:             # <<<<<<<<<<<<<<
26701  *             p_dst.shape[new_ndim] = 1
26702  *             p_dst.strides[new_ndim] = 0
26703  */
26704       goto __pyx_L6;
26705     }
26706 
26707     /* "View.MemoryView":756
26708  *             new_ndim += 1
26709  *         else:
26710  *             start = index.start or 0             # <<<<<<<<<<<<<<
26711  *             stop = index.stop or 0
26712  *             step = index.step or 0
26713  */
26714     /*else*/ {
26715       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 756, __pyx_L1_error)
26716       __Pyx_GOTREF(__pyx_t_9);
26717       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 756, __pyx_L1_error)
26718       if (!__pyx_t_1) {
26719         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26720       } else {
26721         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 756, __pyx_L1_error)
26722         __pyx_t_10 = __pyx_t_12;
26723         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26724         goto __pyx_L7_bool_binop_done;
26725       }
26726       __pyx_t_10 = 0;
26727       __pyx_L7_bool_binop_done:;
26728       __pyx_v_start = __pyx_t_10;
26729 
26730       /* "View.MemoryView":757
26731  *         else:
26732  *             start = index.start or 0
26733  *             stop = index.stop or 0             # <<<<<<<<<<<<<<
26734  *             step = index.step or 0
26735  *
26736  */
26737       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 757, __pyx_L1_error)
26738       __Pyx_GOTREF(__pyx_t_9);
26739       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 757, __pyx_L1_error)
26740       if (!__pyx_t_1) {
26741         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26742       } else {
26743         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 757, __pyx_L1_error)
26744         __pyx_t_10 = __pyx_t_12;
26745         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26746         goto __pyx_L9_bool_binop_done;
26747       }
26748       __pyx_t_10 = 0;
26749       __pyx_L9_bool_binop_done:;
26750       __pyx_v_stop = __pyx_t_10;
26751 
26752       /* "View.MemoryView":758
26753  *             start = index.start or 0
26754  *             stop = index.stop or 0
26755  *             step = index.step or 0             # <<<<<<<<<<<<<<
26756  *
26757  *             have_start = index.start is not None
26758  */
26759       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 758, __pyx_L1_error)
26760       __Pyx_GOTREF(__pyx_t_9);
26761       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 758, __pyx_L1_error)
26762       if (!__pyx_t_1) {
26763         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26764       } else {
26765         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 758, __pyx_L1_error)
26766         __pyx_t_10 = __pyx_t_12;
26767         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26768         goto __pyx_L11_bool_binop_done;
26769       }
26770       __pyx_t_10 = 0;
26771       __pyx_L11_bool_binop_done:;
26772       __pyx_v_step = __pyx_t_10;
26773 
26774       /* "View.MemoryView":760
26775  *             step = index.step or 0
26776  *
26777  *             have_start = index.start is not None             # <<<<<<<<<<<<<<
26778  *             have_stop = index.stop is not None
26779  *             have_step = index.step is not None
26780  */
26781       __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)
26782       __Pyx_GOTREF(__pyx_t_9);
26783       __pyx_t_1 = (__pyx_t_9 != Py_None);
26784       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26785       __pyx_v_have_start = __pyx_t_1;
26786 
26787       /* "View.MemoryView":761
26788  *
26789  *             have_start = index.start is not None
26790  *             have_stop = index.stop is not None             # <<<<<<<<<<<<<<
26791  *             have_step = index.step is not None
26792  *
26793  */
26794       __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)
26795       __Pyx_GOTREF(__pyx_t_9);
26796       __pyx_t_1 = (__pyx_t_9 != Py_None);
26797       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26798       __pyx_v_have_stop = __pyx_t_1;
26799 
26800       /* "View.MemoryView":762
26801  *             have_start = index.start is not None
26802  *             have_stop = index.stop is not None
26803  *             have_step = index.step is not None             # <<<<<<<<<<<<<<
26804  *
26805  *             slice_memviewslice(
26806  */
26807       __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)
26808       __Pyx_GOTREF(__pyx_t_9);
26809       __pyx_t_1 = (__pyx_t_9 != Py_None);
26810       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26811       __pyx_v_have_step = __pyx_t_1;
26812 
26813       /* "View.MemoryView":764
26814  *             have_step = index.step is not None
26815  *
26816  *             slice_memviewslice(             # <<<<<<<<<<<<<<
26817  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
26818  *                 dim, new_ndim, p_suboffset_dim,
26819  */
26820       __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, 764, __pyx_L1_error)
26821 
26822       /* "View.MemoryView":770
26823  *                 have_start, have_stop, have_step,
26824  *                 True)
26825  *             new_ndim += 1             # <<<<<<<<<<<<<<
26826  *
26827  *     if isinstance(memview, _memoryviewslice):
26828  */
26829       __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
26830     }
26831     __pyx_L6:;
26832 
26833     /* "View.MemoryView":742
26834  *     cdef bint have_start, have_stop, have_step
26835  *
26836  *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
26837  *         if PyIndex_Check(index):
26838  *             slice_memviewslice(
26839  */
26840   }
26841   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26842 
26843   /* "View.MemoryView":772
26844  *             new_ndim += 1
26845  *
26846  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
26847  *         return memoryview_fromslice(dst, new_ndim,
26848  *                                     memviewsliceobj.to_object_func,
26849  */
26850   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
26851   __pyx_t_2 = (__pyx_t_1 != 0);
26852   if (__pyx_t_2) {
26853 
26854     /* "View.MemoryView":773
26855  *
26856  *     if isinstance(memview, _memoryviewslice):
26857  *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
26858  *                                     memviewsliceobj.to_object_func,
26859  *                                     memviewsliceobj.to_dtype_func,
26860  */
26861     __Pyx_XDECREF(((PyObject *)__pyx_r));
26862 
26863     /* "View.MemoryView":774
26864  *     if isinstance(memview, _memoryviewslice):
26865  *         return memoryview_fromslice(dst, new_ndim,
26866  *                                     memviewsliceobj.to_object_func,             # <<<<<<<<<<<<<<
26867  *                                     memviewsliceobj.to_dtype_func,
26868  *                                     memview.dtype_is_object)
26869  */
26870     if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 774, __pyx_L1_error) }
26871 
26872     /* "View.MemoryView":775
26873  *         return memoryview_fromslice(dst, new_ndim,
26874  *                                     memviewsliceobj.to_object_func,
26875  *                                     memviewsliceobj.to_dtype_func,             # <<<<<<<<<<<<<<
26876  *                                     memview.dtype_is_object)
26877  *     else:
26878  */
26879     if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 775, __pyx_L1_error) }
26880 
26881     /* "View.MemoryView":773
26882  *
26883  *     if isinstance(memview, _memoryviewslice):
26884  *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
26885  *                                     memviewsliceobj.to_object_func,
26886  *                                     memviewsliceobj.to_dtype_func,
26887  */
26888     __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, 773, __pyx_L1_error)
26889     __Pyx_GOTREF(__pyx_t_3);
26890     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 773, __pyx_L1_error)
26891     __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
26892     __pyx_t_3 = 0;
26893     goto __pyx_L0;
26894 
26895     /* "View.MemoryView":772
26896  *             new_ndim += 1
26897  *
26898  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
26899  *         return memoryview_fromslice(dst, new_ndim,
26900  *                                     memviewsliceobj.to_object_func,
26901  */
26902   }
26903 
26904   /* "View.MemoryView":778
26905  *                                     memview.dtype_is_object)
26906  *     else:
26907  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
26908  *                                     memview.dtype_is_object)
26909  *
26910  */
26911   /*else*/ {
26912     __Pyx_XDECREF(((PyObject *)__pyx_r));
26913 
26914     /* "View.MemoryView":779
26915  *     else:
26916  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,
26917  *                                     memview.dtype_is_object)             # <<<<<<<<<<<<<<
26918  *
26919  *
26920  */
26921     __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, 778, __pyx_L1_error)
26922     __Pyx_GOTREF(__pyx_t_3);
26923 
26924     /* "View.MemoryView":778
26925  *                                     memview.dtype_is_object)
26926  *     else:
26927  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
26928  *                                     memview.dtype_is_object)
26929  *
26930  */
26931     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 778, __pyx_L1_error)
26932     __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
26933     __pyx_t_3 = 0;
26934     goto __pyx_L0;
26935   }
26936 
26937   /* "View.MemoryView":706
26938  *
26939  * @cname('__pyx_memview_slice')
26940  * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
26941  *     cdef int new_ndim = 0, suboffset_dim = -1, dim
26942  *     cdef bint negative_step
26943  */
26944 
26945   /* function exit code */
26946   __pyx_L1_error:;
26947   __Pyx_XDECREF(__pyx_t_3);
26948   __Pyx_XDECREF(__pyx_t_9);
26949   __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
26950   __pyx_r = 0;
26951   __pyx_L0:;
26952   __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
26953   __Pyx_XDECREF(__pyx_v_index);
26954   __Pyx_XGIVEREF((PyObject *)__pyx_r);
26955   __Pyx_RefNannyFinishContext();
26956   return __pyx_r;
26957 }
26958 
26959 /* "View.MemoryView":803
26960  *
26961  * @cname('__pyx_memoryview_slice_memviewslice')
26962  * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
26963  *         __Pyx_memviewslice *dst,
26964  *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
26965  */
26966 
__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)26967 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) {
26968   Py_ssize_t __pyx_v_new_shape;
26969   int __pyx_v_negative_step;
26970   int __pyx_r;
26971   int __pyx_t_1;
26972   int __pyx_t_2;
26973   int __pyx_t_3;
26974 
26975   /* "View.MemoryView":823
26976  *     cdef bint negative_step
26977  *
26978  *     if not is_slice:             # <<<<<<<<<<<<<<
26979  *
26980  *         if start < 0:
26981  */
26982   __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
26983   if (__pyx_t_1) {
26984 
26985     /* "View.MemoryView":825
26986  *     if not is_slice:
26987  *
26988  *         if start < 0:             # <<<<<<<<<<<<<<
26989  *             start += shape
26990  *         if not 0 <= start < shape:
26991  */
26992     __pyx_t_1 = ((__pyx_v_start < 0) != 0);
26993     if (__pyx_t_1) {
26994 
26995       /* "View.MemoryView":826
26996  *
26997  *         if start < 0:
26998  *             start += shape             # <<<<<<<<<<<<<<
26999  *         if not 0 <= start < shape:
27000  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
27001  */
27002       __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
27003 
27004       /* "View.MemoryView":825
27005  *     if not is_slice:
27006  *
27007  *         if start < 0:             # <<<<<<<<<<<<<<
27008  *             start += shape
27009  *         if not 0 <= start < shape:
27010  */
27011     }
27012 
27013     /* "View.MemoryView":827
27014  *         if start < 0:
27015  *             start += shape
27016  *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
27017  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
27018  *     else:
27019  */
27020     __pyx_t_1 = (0 <= __pyx_v_start);
27021     if (__pyx_t_1) {
27022       __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
27023     }
27024     __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
27025     if (__pyx_t_2) {
27026 
27027       /* "View.MemoryView":828
27028  *             start += shape
27029  *         if not 0 <= start < shape:
27030  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)             # <<<<<<<<<<<<<<
27031  *     else:
27032  *
27033  */
27034       __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, 828, __pyx_L1_error)
27035 
27036       /* "View.MemoryView":827
27037  *         if start < 0:
27038  *             start += shape
27039  *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
27040  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
27041  *     else:
27042  */
27043     }
27044 
27045     /* "View.MemoryView":823
27046  *     cdef bint negative_step
27047  *
27048  *     if not is_slice:             # <<<<<<<<<<<<<<
27049  *
27050  *         if start < 0:
27051  */
27052     goto __pyx_L3;
27053   }
27054 
27055   /* "View.MemoryView":831
27056  *     else:
27057  *
27058  *         negative_step = have_step != 0 and step < 0             # <<<<<<<<<<<<<<
27059  *
27060  *         if have_step and step == 0:
27061  */
27062   /*else*/ {
27063     __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
27064     if (__pyx_t_1) {
27065     } else {
27066       __pyx_t_2 = __pyx_t_1;
27067       goto __pyx_L6_bool_binop_done;
27068     }
27069     __pyx_t_1 = ((__pyx_v_step < 0) != 0);
27070     __pyx_t_2 = __pyx_t_1;
27071     __pyx_L6_bool_binop_done:;
27072     __pyx_v_negative_step = __pyx_t_2;
27073 
27074     /* "View.MemoryView":833
27075  *         negative_step = have_step != 0 and step < 0
27076  *
27077  *         if have_step and step == 0:             # <<<<<<<<<<<<<<
27078  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
27079  *
27080  */
27081     __pyx_t_1 = (__pyx_v_have_step != 0);
27082     if (__pyx_t_1) {
27083     } else {
27084       __pyx_t_2 = __pyx_t_1;
27085       goto __pyx_L9_bool_binop_done;
27086     }
27087     __pyx_t_1 = ((__pyx_v_step == 0) != 0);
27088     __pyx_t_2 = __pyx_t_1;
27089     __pyx_L9_bool_binop_done:;
27090     if (__pyx_t_2) {
27091 
27092       /* "View.MemoryView":834
27093  *
27094  *         if have_step and step == 0:
27095  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)             # <<<<<<<<<<<<<<
27096  *
27097  *
27098  */
27099       __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, 834, __pyx_L1_error)
27100 
27101       /* "View.MemoryView":833
27102  *         negative_step = have_step != 0 and step < 0
27103  *
27104  *         if have_step and step == 0:             # <<<<<<<<<<<<<<
27105  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
27106  *
27107  */
27108     }
27109 
27110     /* "View.MemoryView":837
27111  *
27112  *
27113  *         if have_start:             # <<<<<<<<<<<<<<
27114  *             if start < 0:
27115  *                 start += shape
27116  */
27117     __pyx_t_2 = (__pyx_v_have_start != 0);
27118     if (__pyx_t_2) {
27119 
27120       /* "View.MemoryView":838
27121  *
27122  *         if have_start:
27123  *             if start < 0:             # <<<<<<<<<<<<<<
27124  *                 start += shape
27125  *                 if start < 0:
27126  */
27127       __pyx_t_2 = ((__pyx_v_start < 0) != 0);
27128       if (__pyx_t_2) {
27129 
27130         /* "View.MemoryView":839
27131  *         if have_start:
27132  *             if start < 0:
27133  *                 start += shape             # <<<<<<<<<<<<<<
27134  *                 if start < 0:
27135  *                     start = 0
27136  */
27137         __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
27138 
27139         /* "View.MemoryView":840
27140  *             if start < 0:
27141  *                 start += shape
27142  *                 if start < 0:             # <<<<<<<<<<<<<<
27143  *                     start = 0
27144  *             elif start >= shape:
27145  */
27146         __pyx_t_2 = ((__pyx_v_start < 0) != 0);
27147         if (__pyx_t_2) {
27148 
27149           /* "View.MemoryView":841
27150  *                 start += shape
27151  *                 if start < 0:
27152  *                     start = 0             # <<<<<<<<<<<<<<
27153  *             elif start >= shape:
27154  *                 if negative_step:
27155  */
27156           __pyx_v_start = 0;
27157 
27158           /* "View.MemoryView":840
27159  *             if start < 0:
27160  *                 start += shape
27161  *                 if start < 0:             # <<<<<<<<<<<<<<
27162  *                     start = 0
27163  *             elif start >= shape:
27164  */
27165         }
27166 
27167         /* "View.MemoryView":838
27168  *
27169  *         if have_start:
27170  *             if start < 0:             # <<<<<<<<<<<<<<
27171  *                 start += shape
27172  *                 if start < 0:
27173  */
27174         goto __pyx_L12;
27175       }
27176 
27177       /* "View.MemoryView":842
27178  *                 if start < 0:
27179  *                     start = 0
27180  *             elif start >= shape:             # <<<<<<<<<<<<<<
27181  *                 if negative_step:
27182  *                     start = shape - 1
27183  */
27184       __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
27185       if (__pyx_t_2) {
27186 
27187         /* "View.MemoryView":843
27188  *                     start = 0
27189  *             elif start >= shape:
27190  *                 if negative_step:             # <<<<<<<<<<<<<<
27191  *                     start = shape - 1
27192  *                 else:
27193  */
27194         __pyx_t_2 = (__pyx_v_negative_step != 0);
27195         if (__pyx_t_2) {
27196 
27197           /* "View.MemoryView":844
27198  *             elif start >= shape:
27199  *                 if negative_step:
27200  *                     start = shape - 1             # <<<<<<<<<<<<<<
27201  *                 else:
27202  *                     start = shape
27203  */
27204           __pyx_v_start = (__pyx_v_shape - 1);
27205 
27206           /* "View.MemoryView":843
27207  *                     start = 0
27208  *             elif start >= shape:
27209  *                 if negative_step:             # <<<<<<<<<<<<<<
27210  *                     start = shape - 1
27211  *                 else:
27212  */
27213           goto __pyx_L14;
27214         }
27215 
27216         /* "View.MemoryView":846
27217  *                     start = shape - 1
27218  *                 else:
27219  *                     start = shape             # <<<<<<<<<<<<<<
27220  *         else:
27221  *             if negative_step:
27222  */
27223         /*else*/ {
27224           __pyx_v_start = __pyx_v_shape;
27225         }
27226         __pyx_L14:;
27227 
27228         /* "View.MemoryView":842
27229  *                 if start < 0:
27230  *                     start = 0
27231  *             elif start >= shape:             # <<<<<<<<<<<<<<
27232  *                 if negative_step:
27233  *                     start = shape - 1
27234  */
27235       }
27236       __pyx_L12:;
27237 
27238       /* "View.MemoryView":837
27239  *
27240  *
27241  *         if have_start:             # <<<<<<<<<<<<<<
27242  *             if start < 0:
27243  *                 start += shape
27244  */
27245       goto __pyx_L11;
27246     }
27247 
27248     /* "View.MemoryView":848
27249  *                     start = shape
27250  *         else:
27251  *             if negative_step:             # <<<<<<<<<<<<<<
27252  *                 start = shape - 1
27253  *             else:
27254  */
27255     /*else*/ {
27256       __pyx_t_2 = (__pyx_v_negative_step != 0);
27257       if (__pyx_t_2) {
27258 
27259         /* "View.MemoryView":849
27260  *         else:
27261  *             if negative_step:
27262  *                 start = shape - 1             # <<<<<<<<<<<<<<
27263  *             else:
27264  *                 start = 0
27265  */
27266         __pyx_v_start = (__pyx_v_shape - 1);
27267 
27268         /* "View.MemoryView":848
27269  *                     start = shape
27270  *         else:
27271  *             if negative_step:             # <<<<<<<<<<<<<<
27272  *                 start = shape - 1
27273  *             else:
27274  */
27275         goto __pyx_L15;
27276       }
27277 
27278       /* "View.MemoryView":851
27279  *                 start = shape - 1
27280  *             else:
27281  *                 start = 0             # <<<<<<<<<<<<<<
27282  *
27283  *         if have_stop:
27284  */
27285       /*else*/ {
27286         __pyx_v_start = 0;
27287       }
27288       __pyx_L15:;
27289     }
27290     __pyx_L11:;
27291 
27292     /* "View.MemoryView":853
27293  *                 start = 0
27294  *
27295  *         if have_stop:             # <<<<<<<<<<<<<<
27296  *             if stop < 0:
27297  *                 stop += shape
27298  */
27299     __pyx_t_2 = (__pyx_v_have_stop != 0);
27300     if (__pyx_t_2) {
27301 
27302       /* "View.MemoryView":854
27303  *
27304  *         if have_stop:
27305  *             if stop < 0:             # <<<<<<<<<<<<<<
27306  *                 stop += shape
27307  *                 if stop < 0:
27308  */
27309       __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
27310       if (__pyx_t_2) {
27311 
27312         /* "View.MemoryView":855
27313  *         if have_stop:
27314  *             if stop < 0:
27315  *                 stop += shape             # <<<<<<<<<<<<<<
27316  *                 if stop < 0:
27317  *                     stop = 0
27318  */
27319         __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
27320 
27321         /* "View.MemoryView":856
27322  *             if stop < 0:
27323  *                 stop += shape
27324  *                 if stop < 0:             # <<<<<<<<<<<<<<
27325  *                     stop = 0
27326  *             elif stop > shape:
27327  */
27328         __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
27329         if (__pyx_t_2) {
27330 
27331           /* "View.MemoryView":857
27332  *                 stop += shape
27333  *                 if stop < 0:
27334  *                     stop = 0             # <<<<<<<<<<<<<<
27335  *             elif stop > shape:
27336  *                 stop = shape
27337  */
27338           __pyx_v_stop = 0;
27339 
27340           /* "View.MemoryView":856
27341  *             if stop < 0:
27342  *                 stop += shape
27343  *                 if stop < 0:             # <<<<<<<<<<<<<<
27344  *                     stop = 0
27345  *             elif stop > shape:
27346  */
27347         }
27348 
27349         /* "View.MemoryView":854
27350  *
27351  *         if have_stop:
27352  *             if stop < 0:             # <<<<<<<<<<<<<<
27353  *                 stop += shape
27354  *                 if stop < 0:
27355  */
27356         goto __pyx_L17;
27357       }
27358 
27359       /* "View.MemoryView":858
27360  *                 if stop < 0:
27361  *                     stop = 0
27362  *             elif stop > shape:             # <<<<<<<<<<<<<<
27363  *                 stop = shape
27364  *         else:
27365  */
27366       __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
27367       if (__pyx_t_2) {
27368 
27369         /* "View.MemoryView":859
27370  *                     stop = 0
27371  *             elif stop > shape:
27372  *                 stop = shape             # <<<<<<<<<<<<<<
27373  *         else:
27374  *             if negative_step:
27375  */
27376         __pyx_v_stop = __pyx_v_shape;
27377 
27378         /* "View.MemoryView":858
27379  *                 if stop < 0:
27380  *                     stop = 0
27381  *             elif stop > shape:             # <<<<<<<<<<<<<<
27382  *                 stop = shape
27383  *         else:
27384  */
27385       }
27386       __pyx_L17:;
27387 
27388       /* "View.MemoryView":853
27389  *                 start = 0
27390  *
27391  *         if have_stop:             # <<<<<<<<<<<<<<
27392  *             if stop < 0:
27393  *                 stop += shape
27394  */
27395       goto __pyx_L16;
27396     }
27397 
27398     /* "View.MemoryView":861
27399  *                 stop = shape
27400  *         else:
27401  *             if negative_step:             # <<<<<<<<<<<<<<
27402  *                 stop = -1
27403  *             else:
27404  */
27405     /*else*/ {
27406       __pyx_t_2 = (__pyx_v_negative_step != 0);
27407       if (__pyx_t_2) {
27408 
27409         /* "View.MemoryView":862
27410  *         else:
27411  *             if negative_step:
27412  *                 stop = -1             # <<<<<<<<<<<<<<
27413  *             else:
27414  *                 stop = shape
27415  */
27416         __pyx_v_stop = -1L;
27417 
27418         /* "View.MemoryView":861
27419  *                 stop = shape
27420  *         else:
27421  *             if negative_step:             # <<<<<<<<<<<<<<
27422  *                 stop = -1
27423  *             else:
27424  */
27425         goto __pyx_L19;
27426       }
27427 
27428       /* "View.MemoryView":864
27429  *                 stop = -1
27430  *             else:
27431  *                 stop = shape             # <<<<<<<<<<<<<<
27432  *
27433  *         if not have_step:
27434  */
27435       /*else*/ {
27436         __pyx_v_stop = __pyx_v_shape;
27437       }
27438       __pyx_L19:;
27439     }
27440     __pyx_L16:;
27441 
27442     /* "View.MemoryView":866
27443  *                 stop = shape
27444  *
27445  *         if not have_step:             # <<<<<<<<<<<<<<
27446  *             step = 1
27447  *
27448  */
27449     __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
27450     if (__pyx_t_2) {
27451 
27452       /* "View.MemoryView":867
27453  *
27454  *         if not have_step:
27455  *             step = 1             # <<<<<<<<<<<<<<
27456  *
27457  *
27458  */
27459       __pyx_v_step = 1;
27460 
27461       /* "View.MemoryView":866
27462  *                 stop = shape
27463  *
27464  *         if not have_step:             # <<<<<<<<<<<<<<
27465  *             step = 1
27466  *
27467  */
27468     }
27469 
27470     /* "View.MemoryView":871
27471  *
27472  *         with cython.cdivision(True):
27473  *             new_shape = (stop - start) // step             # <<<<<<<<<<<<<<
27474  *
27475  *             if (stop - start) - step * new_shape:
27476  */
27477     __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
27478 
27479     /* "View.MemoryView":873
27480  *             new_shape = (stop - start) // step
27481  *
27482  *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
27483  *                 new_shape += 1
27484  *
27485  */
27486     __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
27487     if (__pyx_t_2) {
27488 
27489       /* "View.MemoryView":874
27490  *
27491  *             if (stop - start) - step * new_shape:
27492  *                 new_shape += 1             # <<<<<<<<<<<<<<
27493  *
27494  *         if new_shape < 0:
27495  */
27496       __pyx_v_new_shape = (__pyx_v_new_shape + 1);
27497 
27498       /* "View.MemoryView":873
27499  *             new_shape = (stop - start) // step
27500  *
27501  *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
27502  *                 new_shape += 1
27503  *
27504  */
27505     }
27506 
27507     /* "View.MemoryView":876
27508  *                 new_shape += 1
27509  *
27510  *         if new_shape < 0:             # <<<<<<<<<<<<<<
27511  *             new_shape = 0
27512  *
27513  */
27514     __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
27515     if (__pyx_t_2) {
27516 
27517       /* "View.MemoryView":877
27518  *
27519  *         if new_shape < 0:
27520  *             new_shape = 0             # <<<<<<<<<<<<<<
27521  *
27522  *
27523  */
27524       __pyx_v_new_shape = 0;
27525 
27526       /* "View.MemoryView":876
27527  *                 new_shape += 1
27528  *
27529  *         if new_shape < 0:             # <<<<<<<<<<<<<<
27530  *             new_shape = 0
27531  *
27532  */
27533     }
27534 
27535     /* "View.MemoryView":880
27536  *
27537  *
27538  *         dst.strides[new_ndim] = stride * step             # <<<<<<<<<<<<<<
27539  *         dst.shape[new_ndim] = new_shape
27540  *         dst.suboffsets[new_ndim] = suboffset
27541  */
27542     (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
27543 
27544     /* "View.MemoryView":881
27545  *
27546  *         dst.strides[new_ndim] = stride * step
27547  *         dst.shape[new_ndim] = new_shape             # <<<<<<<<<<<<<<
27548  *         dst.suboffsets[new_ndim] = suboffset
27549  *
27550  */
27551     (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
27552 
27553     /* "View.MemoryView":882
27554  *         dst.strides[new_ndim] = stride * step
27555  *         dst.shape[new_ndim] = new_shape
27556  *         dst.suboffsets[new_ndim] = suboffset             # <<<<<<<<<<<<<<
27557  *
27558  *
27559  */
27560     (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
27561   }
27562   __pyx_L3:;
27563 
27564   /* "View.MemoryView":885
27565  *
27566  *
27567  *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
27568  *         dst.data += start * stride
27569  *     else:
27570  */
27571   __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
27572   if (__pyx_t_2) {
27573 
27574     /* "View.MemoryView":886
27575  *
27576  *     if suboffset_dim[0] < 0:
27577  *         dst.data += start * stride             # <<<<<<<<<<<<<<
27578  *     else:
27579  *         dst.suboffsets[suboffset_dim[0]] += start * stride
27580  */
27581     __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
27582 
27583     /* "View.MemoryView":885
27584  *
27585  *
27586  *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
27587  *         dst.data += start * stride
27588  *     else:
27589  */
27590     goto __pyx_L23;
27591   }
27592 
27593   /* "View.MemoryView":888
27594  *         dst.data += start * stride
27595  *     else:
27596  *         dst.suboffsets[suboffset_dim[0]] += start * stride             # <<<<<<<<<<<<<<
27597  *
27598  *     if suboffset >= 0:
27599  */
27600   /*else*/ {
27601     __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
27602     (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
27603   }
27604   __pyx_L23:;
27605 
27606   /* "View.MemoryView":890
27607  *         dst.suboffsets[suboffset_dim[0]] += start * stride
27608  *
27609  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
27610  *         if not is_slice:
27611  *             if new_ndim == 0:
27612  */
27613   __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
27614   if (__pyx_t_2) {
27615 
27616     /* "View.MemoryView":891
27617  *
27618  *     if suboffset >= 0:
27619  *         if not is_slice:             # <<<<<<<<<<<<<<
27620  *             if new_ndim == 0:
27621  *                 dst.data = (<char **> dst.data)[0] + suboffset
27622  */
27623     __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
27624     if (__pyx_t_2) {
27625 
27626       /* "View.MemoryView":892
27627  *     if suboffset >= 0:
27628  *         if not is_slice:
27629  *             if new_ndim == 0:             # <<<<<<<<<<<<<<
27630  *                 dst.data = (<char **> dst.data)[0] + suboffset
27631  *             else:
27632  */
27633       __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
27634       if (__pyx_t_2) {
27635 
27636         /* "View.MemoryView":893
27637  *         if not is_slice:
27638  *             if new_ndim == 0:
27639  *                 dst.data = (<char **> dst.data)[0] + suboffset             # <<<<<<<<<<<<<<
27640  *             else:
27641  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
27642  */
27643         __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
27644 
27645         /* "View.MemoryView":892
27646  *     if suboffset >= 0:
27647  *         if not is_slice:
27648  *             if new_ndim == 0:             # <<<<<<<<<<<<<<
27649  *                 dst.data = (<char **> dst.data)[0] + suboffset
27650  *             else:
27651  */
27652         goto __pyx_L26;
27653       }
27654 
27655       /* "View.MemoryView":895
27656  *                 dst.data = (<char **> dst.data)[0] + suboffset
27657  *             else:
27658  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "             # <<<<<<<<<<<<<<
27659  *                                      "must be indexed and not sliced", dim)
27660  *         else:
27661  */
27662       /*else*/ {
27663 
27664         /* "View.MemoryView":896
27665  *             else:
27666  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
27667  *                                      "must be indexed and not sliced", dim)             # <<<<<<<<<<<<<<
27668  *         else:
27669  *             suboffset_dim[0] = new_ndim
27670  */
27671         __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, 895, __pyx_L1_error)
27672       }
27673       __pyx_L26:;
27674 
27675       /* "View.MemoryView":891
27676  *
27677  *     if suboffset >= 0:
27678  *         if not is_slice:             # <<<<<<<<<<<<<<
27679  *             if new_ndim == 0:
27680  *                 dst.data = (<char **> dst.data)[0] + suboffset
27681  */
27682       goto __pyx_L25;
27683     }
27684 
27685     /* "View.MemoryView":898
27686  *                                      "must be indexed and not sliced", dim)
27687  *         else:
27688  *             suboffset_dim[0] = new_ndim             # <<<<<<<<<<<<<<
27689  *
27690  *     return 0
27691  */
27692     /*else*/ {
27693       (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
27694     }
27695     __pyx_L25:;
27696 
27697     /* "View.MemoryView":890
27698  *         dst.suboffsets[suboffset_dim[0]] += start * stride
27699  *
27700  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
27701  *         if not is_slice:
27702  *             if new_ndim == 0:
27703  */
27704   }
27705 
27706   /* "View.MemoryView":900
27707  *             suboffset_dim[0] = new_ndim
27708  *
27709  *     return 0             # <<<<<<<<<<<<<<
27710  *
27711  *
27712  */
27713   __pyx_r = 0;
27714   goto __pyx_L0;
27715 
27716   /* "View.MemoryView":803
27717  *
27718  * @cname('__pyx_memoryview_slice_memviewslice')
27719  * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
27720  *         __Pyx_memviewslice *dst,
27721  *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
27722  */
27723 
27724   /* function exit code */
27725   __pyx_L1_error:;
27726   {
27727     #ifdef WITH_THREAD
27728     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
27729     #endif
27730     __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
27731     #ifdef WITH_THREAD
27732     __Pyx_PyGILState_Release(__pyx_gilstate_save);
27733     #endif
27734   }
27735   __pyx_r = -1;
27736   __pyx_L0:;
27737   return __pyx_r;
27738 }
27739 
27740 /* "View.MemoryView":906
27741  *
27742  * @cname('__pyx_pybuffer_index')
27743  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
27744  *                           Py_ssize_t dim) except NULL:
27745  *     cdef Py_ssize_t shape, stride, suboffset = -1
27746  */
27747 
__pyx_pybuffer_index(Py_buffer * __pyx_v_view,char * __pyx_v_bufp,Py_ssize_t __pyx_v_index,Py_ssize_t __pyx_v_dim)27748 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) {
27749   Py_ssize_t __pyx_v_shape;
27750   Py_ssize_t __pyx_v_stride;
27751   Py_ssize_t __pyx_v_suboffset;
27752   Py_ssize_t __pyx_v_itemsize;
27753   char *__pyx_v_resultp;
27754   char *__pyx_r;
27755   __Pyx_RefNannyDeclarations
27756   Py_ssize_t __pyx_t_1;
27757   int __pyx_t_2;
27758   PyObject *__pyx_t_3 = NULL;
27759   PyObject *__pyx_t_4 = NULL;
27760   __Pyx_RefNannySetupContext("pybuffer_index", 0);
27761 
27762   /* "View.MemoryView":908
27763  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
27764  *                           Py_ssize_t dim) except NULL:
27765  *     cdef Py_ssize_t shape, stride, suboffset = -1             # <<<<<<<<<<<<<<
27766  *     cdef Py_ssize_t itemsize = view.itemsize
27767  *     cdef char *resultp
27768  */
27769   __pyx_v_suboffset = -1L;
27770 
27771   /* "View.MemoryView":909
27772  *                           Py_ssize_t dim) except NULL:
27773  *     cdef Py_ssize_t shape, stride, suboffset = -1
27774  *     cdef Py_ssize_t itemsize = view.itemsize             # <<<<<<<<<<<<<<
27775  *     cdef char *resultp
27776  *
27777  */
27778   __pyx_t_1 = __pyx_v_view->itemsize;
27779   __pyx_v_itemsize = __pyx_t_1;
27780 
27781   /* "View.MemoryView":912
27782  *     cdef char *resultp
27783  *
27784  *     if view.ndim == 0:             # <<<<<<<<<<<<<<
27785  *         shape = view.len / itemsize
27786  *         stride = itemsize
27787  */
27788   __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
27789   if (__pyx_t_2) {
27790 
27791     /* "View.MemoryView":913
27792  *
27793  *     if view.ndim == 0:
27794  *         shape = view.len / itemsize             # <<<<<<<<<<<<<<
27795  *         stride = itemsize
27796  *     else:
27797  */
27798     if (unlikely(__pyx_v_itemsize == 0)) {
27799       PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
27800       __PYX_ERR(1, 913, __pyx_L1_error)
27801     }
27802     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))) {
27803       PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
27804       __PYX_ERR(1, 913, __pyx_L1_error)
27805     }
27806     __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
27807 
27808     /* "View.MemoryView":914
27809  *     if view.ndim == 0:
27810  *         shape = view.len / itemsize
27811  *         stride = itemsize             # <<<<<<<<<<<<<<
27812  *     else:
27813  *         shape = view.shape[dim]
27814  */
27815     __pyx_v_stride = __pyx_v_itemsize;
27816 
27817     /* "View.MemoryView":912
27818  *     cdef char *resultp
27819  *
27820  *     if view.ndim == 0:             # <<<<<<<<<<<<<<
27821  *         shape = view.len / itemsize
27822  *         stride = itemsize
27823  */
27824     goto __pyx_L3;
27825   }
27826 
27827   /* "View.MemoryView":916
27828  *         stride = itemsize
27829  *     else:
27830  *         shape = view.shape[dim]             # <<<<<<<<<<<<<<
27831  *         stride = view.strides[dim]
27832  *         if view.suboffsets != NULL:
27833  */
27834   /*else*/ {
27835     __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
27836 
27837     /* "View.MemoryView":917
27838  *     else:
27839  *         shape = view.shape[dim]
27840  *         stride = view.strides[dim]             # <<<<<<<<<<<<<<
27841  *         if view.suboffsets != NULL:
27842  *             suboffset = view.suboffsets[dim]
27843  */
27844     __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
27845 
27846     /* "View.MemoryView":918
27847  *         shape = view.shape[dim]
27848  *         stride = view.strides[dim]
27849  *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
27850  *             suboffset = view.suboffsets[dim]
27851  *
27852  */
27853     __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
27854     if (__pyx_t_2) {
27855 
27856       /* "View.MemoryView":919
27857  *         stride = view.strides[dim]
27858  *         if view.suboffsets != NULL:
27859  *             suboffset = view.suboffsets[dim]             # <<<<<<<<<<<<<<
27860  *
27861  *     if index < 0:
27862  */
27863       __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
27864 
27865       /* "View.MemoryView":918
27866  *         shape = view.shape[dim]
27867  *         stride = view.strides[dim]
27868  *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
27869  *             suboffset = view.suboffsets[dim]
27870  *
27871  */
27872     }
27873   }
27874   __pyx_L3:;
27875 
27876   /* "View.MemoryView":921
27877  *             suboffset = view.suboffsets[dim]
27878  *
27879  *     if index < 0:             # <<<<<<<<<<<<<<
27880  *         index += view.shape[dim]
27881  *         if index < 0:
27882  */
27883   __pyx_t_2 = ((__pyx_v_index < 0) != 0);
27884   if (__pyx_t_2) {
27885 
27886     /* "View.MemoryView":922
27887  *
27888  *     if index < 0:
27889  *         index += view.shape[dim]             # <<<<<<<<<<<<<<
27890  *         if index < 0:
27891  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
27892  */
27893     __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
27894 
27895     /* "View.MemoryView":923
27896  *     if index < 0:
27897  *         index += view.shape[dim]
27898  *         if index < 0:             # <<<<<<<<<<<<<<
27899  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
27900  *
27901  */
27902     __pyx_t_2 = ((__pyx_v_index < 0) != 0);
27903     if (unlikely(__pyx_t_2)) {
27904 
27905       /* "View.MemoryView":924
27906  *         index += view.shape[dim]
27907  *         if index < 0:
27908  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
27909  *
27910  *     if index >= shape:
27911  */
27912       __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 924, __pyx_L1_error)
27913       __Pyx_GOTREF(__pyx_t_3);
27914       __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, 924, __pyx_L1_error)
27915       __Pyx_GOTREF(__pyx_t_4);
27916       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27917       __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 924, __pyx_L1_error)
27918       __Pyx_GOTREF(__pyx_t_3);
27919       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27920       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
27921       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27922       __PYX_ERR(1, 924, __pyx_L1_error)
27923 
27924       /* "View.MemoryView":923
27925  *     if index < 0:
27926  *         index += view.shape[dim]
27927  *         if index < 0:             # <<<<<<<<<<<<<<
27928  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
27929  *
27930  */
27931     }
27932 
27933     /* "View.MemoryView":921
27934  *             suboffset = view.suboffsets[dim]
27935  *
27936  *     if index < 0:             # <<<<<<<<<<<<<<
27937  *         index += view.shape[dim]
27938  *         if index < 0:
27939  */
27940   }
27941 
27942   /* "View.MemoryView":926
27943  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
27944  *
27945  *     if index >= shape:             # <<<<<<<<<<<<<<
27946  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
27947  *
27948  */
27949   __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
27950   if (unlikely(__pyx_t_2)) {
27951 
27952     /* "View.MemoryView":927
27953  *
27954  *     if index >= shape:
27955  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
27956  *
27957  *     resultp = bufp + index * stride
27958  */
27959     __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 927, __pyx_L1_error)
27960     __Pyx_GOTREF(__pyx_t_3);
27961     __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, 927, __pyx_L1_error)
27962     __Pyx_GOTREF(__pyx_t_4);
27963     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27964     __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 927, __pyx_L1_error)
27965     __Pyx_GOTREF(__pyx_t_3);
27966     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27967     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
27968     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27969     __PYX_ERR(1, 927, __pyx_L1_error)
27970 
27971     /* "View.MemoryView":926
27972  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
27973  *
27974  *     if index >= shape:             # <<<<<<<<<<<<<<
27975  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
27976  *
27977  */
27978   }
27979 
27980   /* "View.MemoryView":929
27981  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
27982  *
27983  *     resultp = bufp + index * stride             # <<<<<<<<<<<<<<
27984  *     if suboffset >= 0:
27985  *         resultp = (<char **> resultp)[0] + suboffset
27986  */
27987   __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
27988 
27989   /* "View.MemoryView":930
27990  *
27991  *     resultp = bufp + index * stride
27992  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
27993  *         resultp = (<char **> resultp)[0] + suboffset
27994  *
27995  */
27996   __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
27997   if (__pyx_t_2) {
27998 
27999     /* "View.MemoryView":931
28000  *     resultp = bufp + index * stride
28001  *     if suboffset >= 0:
28002  *         resultp = (<char **> resultp)[0] + suboffset             # <<<<<<<<<<<<<<
28003  *
28004  *     return resultp
28005  */
28006     __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
28007 
28008     /* "View.MemoryView":930
28009  *
28010  *     resultp = bufp + index * stride
28011  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
28012  *         resultp = (<char **> resultp)[0] + suboffset
28013  *
28014  */
28015   }
28016 
28017   /* "View.MemoryView":933
28018  *         resultp = (<char **> resultp)[0] + suboffset
28019  *
28020  *     return resultp             # <<<<<<<<<<<<<<
28021  *
28022  *
28023  */
28024   __pyx_r = __pyx_v_resultp;
28025   goto __pyx_L0;
28026 
28027   /* "View.MemoryView":906
28028  *
28029  * @cname('__pyx_pybuffer_index')
28030  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
28031  *                           Py_ssize_t dim) except NULL:
28032  *     cdef Py_ssize_t shape, stride, suboffset = -1
28033  */
28034 
28035   /* function exit code */
28036   __pyx_L1_error:;
28037   __Pyx_XDECREF(__pyx_t_3);
28038   __Pyx_XDECREF(__pyx_t_4);
28039   __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
28040   __pyx_r = NULL;
28041   __pyx_L0:;
28042   __Pyx_RefNannyFinishContext();
28043   return __pyx_r;
28044 }
28045 
28046 /* "View.MemoryView":939
28047  *
28048  * @cname('__pyx_memslice_transpose')
28049  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
28050  *     cdef int ndim = memslice.memview.view.ndim
28051  *
28052  */
28053 
__pyx_memslice_transpose(__Pyx_memviewslice * __pyx_v_memslice)28054 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
28055   int __pyx_v_ndim;
28056   Py_ssize_t *__pyx_v_shape;
28057   Py_ssize_t *__pyx_v_strides;
28058   int __pyx_v_i;
28059   int __pyx_v_j;
28060   int __pyx_r;
28061   int __pyx_t_1;
28062   Py_ssize_t *__pyx_t_2;
28063   long __pyx_t_3;
28064   long __pyx_t_4;
28065   Py_ssize_t __pyx_t_5;
28066   Py_ssize_t __pyx_t_6;
28067   int __pyx_t_7;
28068   int __pyx_t_8;
28069   int __pyx_t_9;
28070 
28071   /* "View.MemoryView":940
28072  * @cname('__pyx_memslice_transpose')
28073  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
28074  *     cdef int ndim = memslice.memview.view.ndim             # <<<<<<<<<<<<<<
28075  *
28076  *     cdef Py_ssize_t *shape = memslice.shape
28077  */
28078   __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
28079   __pyx_v_ndim = __pyx_t_1;
28080 
28081   /* "View.MemoryView":942
28082  *     cdef int ndim = memslice.memview.view.ndim
28083  *
28084  *     cdef Py_ssize_t *shape = memslice.shape             # <<<<<<<<<<<<<<
28085  *     cdef Py_ssize_t *strides = memslice.strides
28086  *
28087  */
28088   __pyx_t_2 = __pyx_v_memslice->shape;
28089   __pyx_v_shape = __pyx_t_2;
28090 
28091   /* "View.MemoryView":943
28092  *
28093  *     cdef Py_ssize_t *shape = memslice.shape
28094  *     cdef Py_ssize_t *strides = memslice.strides             # <<<<<<<<<<<<<<
28095  *
28096  *
28097  */
28098   __pyx_t_2 = __pyx_v_memslice->strides;
28099   __pyx_v_strides = __pyx_t_2;
28100 
28101   /* "View.MemoryView":947
28102  *
28103  *     cdef int i, j
28104  *     for i in range(ndim / 2):             # <<<<<<<<<<<<<<
28105  *         j = ndim - 1 - i
28106  *         strides[i], strides[j] = strides[j], strides[i]
28107  */
28108   __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
28109   __pyx_t_4 = __pyx_t_3;
28110   for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
28111     __pyx_v_i = __pyx_t_1;
28112 
28113     /* "View.MemoryView":948
28114  *     cdef int i, j
28115  *     for i in range(ndim / 2):
28116  *         j = ndim - 1 - i             # <<<<<<<<<<<<<<
28117  *         strides[i], strides[j] = strides[j], strides[i]
28118  *         shape[i], shape[j] = shape[j], shape[i]
28119  */
28120     __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
28121 
28122     /* "View.MemoryView":949
28123  *     for i in range(ndim / 2):
28124  *         j = ndim - 1 - i
28125  *         strides[i], strides[j] = strides[j], strides[i]             # <<<<<<<<<<<<<<
28126  *         shape[i], shape[j] = shape[j], shape[i]
28127  *
28128  */
28129     __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
28130     __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
28131     (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
28132     (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
28133 
28134     /* "View.MemoryView":950
28135  *         j = ndim - 1 - i
28136  *         strides[i], strides[j] = strides[j], strides[i]
28137  *         shape[i], shape[j] = shape[j], shape[i]             # <<<<<<<<<<<<<<
28138  *
28139  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
28140  */
28141     __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
28142     __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
28143     (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
28144     (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
28145 
28146     /* "View.MemoryView":952
28147  *         shape[i], shape[j] = shape[j], shape[i]
28148  *
28149  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
28150  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
28151  *
28152  */
28153     __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
28154     if (!__pyx_t_8) {
28155     } else {
28156       __pyx_t_7 = __pyx_t_8;
28157       goto __pyx_L6_bool_binop_done;
28158     }
28159     __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
28160     __pyx_t_7 = __pyx_t_8;
28161     __pyx_L6_bool_binop_done:;
28162     if (__pyx_t_7) {
28163 
28164       /* "View.MemoryView":953
28165  *
28166  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
28167  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")             # <<<<<<<<<<<<<<
28168  *
28169  *     return 1
28170  */
28171       __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, 953, __pyx_L1_error)
28172 
28173       /* "View.MemoryView":952
28174  *         shape[i], shape[j] = shape[j], shape[i]
28175  *
28176  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
28177  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
28178  *
28179  */
28180     }
28181   }
28182 
28183   /* "View.MemoryView":955
28184  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
28185  *
28186  *     return 1             # <<<<<<<<<<<<<<
28187  *
28188  *
28189  */
28190   __pyx_r = 1;
28191   goto __pyx_L0;
28192 
28193   /* "View.MemoryView":939
28194  *
28195  * @cname('__pyx_memslice_transpose')
28196  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
28197  *     cdef int ndim = memslice.memview.view.ndim
28198  *
28199  */
28200 
28201   /* function exit code */
28202   __pyx_L1_error:;
28203   {
28204     #ifdef WITH_THREAD
28205     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
28206     #endif
28207     __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
28208     #ifdef WITH_THREAD
28209     __Pyx_PyGILState_Release(__pyx_gilstate_save);
28210     #endif
28211   }
28212   __pyx_r = 0;
28213   __pyx_L0:;
28214   return __pyx_r;
28215 }
28216 
28217 /* "View.MemoryView":972
28218  *     cdef int (*to_dtype_func)(char *, object) except 0
28219  *
28220  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
28221  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
28222  *
28223  */
28224 
28225 /* Python wrapper */
28226 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryviewslice___dealloc__(PyObject * __pyx_v_self)28227 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
28228   __Pyx_RefNannyDeclarations
28229   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
28230   __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
28231 
28232   /* function exit code */
28233   __Pyx_RefNannyFinishContext();
28234 }
28235 
__pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj * __pyx_v_self)28236 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
28237   __Pyx_RefNannyDeclarations
28238   __Pyx_RefNannySetupContext("__dealloc__", 0);
28239 
28240   /* "View.MemoryView":973
28241  *
28242  *     def __dealloc__(self):
28243  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)             # <<<<<<<<<<<<<<
28244  *
28245  *     cdef convert_item_to_object(self, char *itemp):
28246  */
28247   __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
28248 
28249   /* "View.MemoryView":972
28250  *     cdef int (*to_dtype_func)(char *, object) except 0
28251  *
28252  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
28253  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
28254  *
28255  */
28256 
28257   /* function exit code */
28258   __Pyx_RefNannyFinishContext();
28259 }
28260 
28261 /* "View.MemoryView":975
28262  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
28263  *
28264  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
28265  *         if self.to_object_func != NULL:
28266  *             return self.to_object_func(itemp)
28267  */
28268 
__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj * __pyx_v_self,char * __pyx_v_itemp)28269 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
28270   PyObject *__pyx_r = NULL;
28271   __Pyx_RefNannyDeclarations
28272   int __pyx_t_1;
28273   PyObject *__pyx_t_2 = NULL;
28274   __Pyx_RefNannySetupContext("convert_item_to_object", 0);
28275 
28276   /* "View.MemoryView":976
28277  *
28278  *     cdef convert_item_to_object(self, char *itemp):
28279  *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
28280  *             return self.to_object_func(itemp)
28281  *         else:
28282  */
28283   __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
28284   if (__pyx_t_1) {
28285 
28286     /* "View.MemoryView":977
28287  *     cdef convert_item_to_object(self, char *itemp):
28288  *         if self.to_object_func != NULL:
28289  *             return self.to_object_func(itemp)             # <<<<<<<<<<<<<<
28290  *         else:
28291  *             return memoryview.convert_item_to_object(self, itemp)
28292  */
28293     __Pyx_XDECREF(__pyx_r);
28294     __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 977, __pyx_L1_error)
28295     __Pyx_GOTREF(__pyx_t_2);
28296     __pyx_r = __pyx_t_2;
28297     __pyx_t_2 = 0;
28298     goto __pyx_L0;
28299 
28300     /* "View.MemoryView":976
28301  *
28302  *     cdef convert_item_to_object(self, char *itemp):
28303  *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
28304  *             return self.to_object_func(itemp)
28305  *         else:
28306  */
28307   }
28308 
28309   /* "View.MemoryView":979
28310  *             return self.to_object_func(itemp)
28311  *         else:
28312  *             return memoryview.convert_item_to_object(self, itemp)             # <<<<<<<<<<<<<<
28313  *
28314  *     cdef assign_item_from_object(self, char *itemp, object value):
28315  */
28316   /*else*/ {
28317     __Pyx_XDECREF(__pyx_r);
28318     __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, 979, __pyx_L1_error)
28319     __Pyx_GOTREF(__pyx_t_2);
28320     __pyx_r = __pyx_t_2;
28321     __pyx_t_2 = 0;
28322     goto __pyx_L0;
28323   }
28324 
28325   /* "View.MemoryView":975
28326  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
28327  *
28328  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
28329  *         if self.to_object_func != NULL:
28330  *             return self.to_object_func(itemp)
28331  */
28332 
28333   /* function exit code */
28334   __pyx_L1_error:;
28335   __Pyx_XDECREF(__pyx_t_2);
28336   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
28337   __pyx_r = 0;
28338   __pyx_L0:;
28339   __Pyx_XGIVEREF(__pyx_r);
28340   __Pyx_RefNannyFinishContext();
28341   return __pyx_r;
28342 }
28343 
28344 /* "View.MemoryView":981
28345  *             return memoryview.convert_item_to_object(self, itemp)
28346  *
28347  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
28348  *         if self.to_dtype_func != NULL:
28349  *             self.to_dtype_func(itemp, value)
28350  */
28351 
__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj * __pyx_v_self,char * __pyx_v_itemp,PyObject * __pyx_v_value)28352 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
28353   PyObject *__pyx_r = NULL;
28354   __Pyx_RefNannyDeclarations
28355   int __pyx_t_1;
28356   int __pyx_t_2;
28357   PyObject *__pyx_t_3 = NULL;
28358   __Pyx_RefNannySetupContext("assign_item_from_object", 0);
28359 
28360   /* "View.MemoryView":982
28361  *
28362  *     cdef assign_item_from_object(self, char *itemp, object value):
28363  *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
28364  *             self.to_dtype_func(itemp, value)
28365  *         else:
28366  */
28367   __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
28368   if (__pyx_t_1) {
28369 
28370     /* "View.MemoryView":983
28371  *     cdef assign_item_from_object(self, char *itemp, object value):
28372  *         if self.to_dtype_func != NULL:
28373  *             self.to_dtype_func(itemp, value)             # <<<<<<<<<<<<<<
28374  *         else:
28375  *             memoryview.assign_item_from_object(self, itemp, value)
28376  */
28377     __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, 983, __pyx_L1_error)
28378 
28379     /* "View.MemoryView":982
28380  *
28381  *     cdef assign_item_from_object(self, char *itemp, object value):
28382  *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
28383  *             self.to_dtype_func(itemp, value)
28384  *         else:
28385  */
28386     goto __pyx_L3;
28387   }
28388 
28389   /* "View.MemoryView":985
28390  *             self.to_dtype_func(itemp, value)
28391  *         else:
28392  *             memoryview.assign_item_from_object(self, itemp, value)             # <<<<<<<<<<<<<<
28393  *
28394  *     @property
28395  */
28396   /*else*/ {
28397     __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, 985, __pyx_L1_error)
28398     __Pyx_GOTREF(__pyx_t_3);
28399     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28400   }
28401   __pyx_L3:;
28402 
28403   /* "View.MemoryView":981
28404  *             return memoryview.convert_item_to_object(self, itemp)
28405  *
28406  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
28407  *         if self.to_dtype_func != NULL:
28408  *             self.to_dtype_func(itemp, value)
28409  */
28410 
28411   /* function exit code */
28412   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
28413   goto __pyx_L0;
28414   __pyx_L1_error:;
28415   __Pyx_XDECREF(__pyx_t_3);
28416   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
28417   __pyx_r = 0;
28418   __pyx_L0:;
28419   __Pyx_XGIVEREF(__pyx_r);
28420   __Pyx_RefNannyFinishContext();
28421   return __pyx_r;
28422 }
28423 
28424 /* "View.MemoryView":988
28425  *
28426  *     @property
28427  *     def base(self):             # <<<<<<<<<<<<<<
28428  *         return self.from_object
28429  *
28430  */
28431 
28432 /* Python wrapper */
28433 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)28434 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
28435   PyObject *__pyx_r = 0;
28436   __Pyx_RefNannyDeclarations
28437   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
28438   __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
28439 
28440   /* function exit code */
28441   __Pyx_RefNannyFinishContext();
28442   return __pyx_r;
28443 }
28444 
__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj * __pyx_v_self)28445 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
28446   PyObject *__pyx_r = NULL;
28447   __Pyx_RefNannyDeclarations
28448   __Pyx_RefNannySetupContext("__get__", 0);
28449 
28450   /* "View.MemoryView":989
28451  *     @property
28452  *     def base(self):
28453  *         return self.from_object             # <<<<<<<<<<<<<<
28454  *
28455  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
28456  */
28457   __Pyx_XDECREF(__pyx_r);
28458   __Pyx_INCREF(__pyx_v_self->from_object);
28459   __pyx_r = __pyx_v_self->from_object;
28460   goto __pyx_L0;
28461 
28462   /* "View.MemoryView":988
28463  *
28464  *     @property
28465  *     def base(self):             # <<<<<<<<<<<<<<
28466  *         return self.from_object
28467  *
28468  */
28469 
28470   /* function exit code */
28471   __pyx_L0:;
28472   __Pyx_XGIVEREF(__pyx_r);
28473   __Pyx_RefNannyFinishContext();
28474   return __pyx_r;
28475 }
28476 
28477 /* "(tree fragment)":1
28478  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
28479  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
28480  * def __setstate_cython__(self, __pyx_state):
28481  */
28482 
28483 /* Python wrapper */
28484 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)28485 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
28486   PyObject *__pyx_r = 0;
28487   __Pyx_RefNannyDeclarations
28488   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
28489   __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
28490 
28491   /* function exit code */
28492   __Pyx_RefNannyFinishContext();
28493   return __pyx_r;
28494 }
28495 
__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj * __pyx_v_self)28496 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
28497   PyObject *__pyx_r = NULL;
28498   __Pyx_RefNannyDeclarations
28499   PyObject *__pyx_t_1 = NULL;
28500   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
28501 
28502   /* "(tree fragment)":2
28503  * def __reduce_cython__(self):
28504  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
28505  * def __setstate_cython__(self, __pyx_state):
28506  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
28507  */
28508   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
28509   __Pyx_GOTREF(__pyx_t_1);
28510   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
28511   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28512   __PYX_ERR(1, 2, __pyx_L1_error)
28513 
28514   /* "(tree fragment)":1
28515  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
28516  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
28517  * def __setstate_cython__(self, __pyx_state):
28518  */
28519 
28520   /* function exit code */
28521   __pyx_L1_error:;
28522   __Pyx_XDECREF(__pyx_t_1);
28523   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
28524   __pyx_r = NULL;
28525   __Pyx_XGIVEREF(__pyx_r);
28526   __Pyx_RefNannyFinishContext();
28527   return __pyx_r;
28528 }
28529 
28530 /* "(tree fragment)":3
28531  * def __reduce_cython__(self):
28532  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
28533  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
28534  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
28535  */
28536 
28537 /* Python wrapper */
28538 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)28539 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
28540   PyObject *__pyx_r = 0;
28541   __Pyx_RefNannyDeclarations
28542   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
28543   __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
28544 
28545   /* function exit code */
28546   __Pyx_RefNannyFinishContext();
28547   return __pyx_r;
28548 }
28549 
__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)28550 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) {
28551   PyObject *__pyx_r = NULL;
28552   __Pyx_RefNannyDeclarations
28553   PyObject *__pyx_t_1 = NULL;
28554   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
28555 
28556   /* "(tree fragment)":4
28557  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
28558  * def __setstate_cython__(self, __pyx_state):
28559  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
28560  */
28561   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
28562   __Pyx_GOTREF(__pyx_t_1);
28563   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
28564   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28565   __PYX_ERR(1, 4, __pyx_L1_error)
28566 
28567   /* "(tree fragment)":3
28568  * def __reduce_cython__(self):
28569  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
28570  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
28571  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
28572  */
28573 
28574   /* function exit code */
28575   __pyx_L1_error:;
28576   __Pyx_XDECREF(__pyx_t_1);
28577   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
28578   __pyx_r = NULL;
28579   __Pyx_XGIVEREF(__pyx_r);
28580   __Pyx_RefNannyFinishContext();
28581   return __pyx_r;
28582 }
28583 
28584 /* "View.MemoryView":995
28585  *
28586  * @cname('__pyx_memoryview_fromslice')
28587  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
28588  *                           int ndim,
28589  *                           object (*to_object_func)(char *),
28590  */
28591 
__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)28592 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) {
28593   struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
28594   Py_ssize_t __pyx_v_suboffset;
28595   PyObject *__pyx_v_length = NULL;
28596   PyObject *__pyx_r = NULL;
28597   __Pyx_RefNannyDeclarations
28598   int __pyx_t_1;
28599   PyObject *__pyx_t_2 = NULL;
28600   PyObject *__pyx_t_3 = NULL;
28601   __Pyx_TypeInfo *__pyx_t_4;
28602   Py_buffer __pyx_t_5;
28603   Py_ssize_t *__pyx_t_6;
28604   Py_ssize_t *__pyx_t_7;
28605   Py_ssize_t *__pyx_t_8;
28606   Py_ssize_t __pyx_t_9;
28607   __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
28608 
28609   /* "View.MemoryView":1003
28610  *     cdef _memoryviewslice result
28611  *
28612  *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
28613  *         return None
28614  *
28615  */
28616   __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
28617   if (__pyx_t_1) {
28618 
28619     /* "View.MemoryView":1004
28620  *
28621  *     if <PyObject *> memviewslice.memview == Py_None:
28622  *         return None             # <<<<<<<<<<<<<<
28623  *
28624  *
28625  */
28626     __Pyx_XDECREF(__pyx_r);
28627     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
28628     goto __pyx_L0;
28629 
28630     /* "View.MemoryView":1003
28631  *     cdef _memoryviewslice result
28632  *
28633  *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
28634  *         return None
28635  *
28636  */
28637   }
28638 
28639   /* "View.MemoryView":1009
28640  *
28641  *
28642  *     result = _memoryviewslice(None, 0, dtype_is_object)             # <<<<<<<<<<<<<<
28643  *
28644  *     result.from_slice = memviewslice
28645  */
28646   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1009, __pyx_L1_error)
28647   __Pyx_GOTREF(__pyx_t_2);
28648   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1009, __pyx_L1_error)
28649   __Pyx_GOTREF(__pyx_t_3);
28650   __Pyx_INCREF(Py_None);
28651   __Pyx_GIVEREF(Py_None);
28652   PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
28653   __Pyx_INCREF(__pyx_int_0);
28654   __Pyx_GIVEREF(__pyx_int_0);
28655   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
28656   __Pyx_GIVEREF(__pyx_t_2);
28657   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
28658   __pyx_t_2 = 0;
28659   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1009, __pyx_L1_error)
28660   __Pyx_GOTREF(__pyx_t_2);
28661   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28662   __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
28663   __pyx_t_2 = 0;
28664 
28665   /* "View.MemoryView":1011
28666  *     result = _memoryviewslice(None, 0, dtype_is_object)
28667  *
28668  *     result.from_slice = memviewslice             # <<<<<<<<<<<<<<
28669  *     __PYX_INC_MEMVIEW(&memviewslice, 1)
28670  *
28671  */
28672   __pyx_v_result->from_slice = __pyx_v_memviewslice;
28673 
28674   /* "View.MemoryView":1012
28675  *
28676  *     result.from_slice = memviewslice
28677  *     __PYX_INC_MEMVIEW(&memviewslice, 1)             # <<<<<<<<<<<<<<
28678  *
28679  *     result.from_object = (<memoryview> memviewslice.memview).base
28680  */
28681   __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
28682 
28683   /* "View.MemoryView":1014
28684  *     __PYX_INC_MEMVIEW(&memviewslice, 1)
28685  *
28686  *     result.from_object = (<memoryview> memviewslice.memview).base             # <<<<<<<<<<<<<<
28687  *     result.typeinfo = memviewslice.memview.typeinfo
28688  *
28689  */
28690   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1014, __pyx_L1_error)
28691   __Pyx_GOTREF(__pyx_t_2);
28692   __Pyx_GIVEREF(__pyx_t_2);
28693   __Pyx_GOTREF(__pyx_v_result->from_object);
28694   __Pyx_DECREF(__pyx_v_result->from_object);
28695   __pyx_v_result->from_object = __pyx_t_2;
28696   __pyx_t_2 = 0;
28697 
28698   /* "View.MemoryView":1015
28699  *
28700  *     result.from_object = (<memoryview> memviewslice.memview).base
28701  *     result.typeinfo = memviewslice.memview.typeinfo             # <<<<<<<<<<<<<<
28702  *
28703  *     result.view = memviewslice.memview.view
28704  */
28705   __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
28706   __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
28707 
28708   /* "View.MemoryView":1017
28709  *     result.typeinfo = memviewslice.memview.typeinfo
28710  *
28711  *     result.view = memviewslice.memview.view             # <<<<<<<<<<<<<<
28712  *     result.view.buf = <void *> memviewslice.data
28713  *     result.view.ndim = ndim
28714  */
28715   __pyx_t_5 = __pyx_v_memviewslice.memview->view;
28716   __pyx_v_result->__pyx_base.view = __pyx_t_5;
28717 
28718   /* "View.MemoryView":1018
28719  *
28720  *     result.view = memviewslice.memview.view
28721  *     result.view.buf = <void *> memviewslice.data             # <<<<<<<<<<<<<<
28722  *     result.view.ndim = ndim
28723  *     (<__pyx_buffer *> &result.view).obj = Py_None
28724  */
28725   __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
28726 
28727   /* "View.MemoryView":1019
28728  *     result.view = memviewslice.memview.view
28729  *     result.view.buf = <void *> memviewslice.data
28730  *     result.view.ndim = ndim             # <<<<<<<<<<<<<<
28731  *     (<__pyx_buffer *> &result.view).obj = Py_None
28732  *     Py_INCREF(Py_None)
28733  */
28734   __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
28735 
28736   /* "View.MemoryView":1020
28737  *     result.view.buf = <void *> memviewslice.data
28738  *     result.view.ndim = ndim
28739  *     (<__pyx_buffer *> &result.view).obj = Py_None             # <<<<<<<<<<<<<<
28740  *     Py_INCREF(Py_None)
28741  *
28742  */
28743   ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
28744 
28745   /* "View.MemoryView":1021
28746  *     result.view.ndim = ndim
28747  *     (<__pyx_buffer *> &result.view).obj = Py_None
28748  *     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
28749  *
28750  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
28751  */
28752   Py_INCREF(Py_None);
28753 
28754   /* "View.MemoryView":1023
28755  *     Py_INCREF(Py_None)
28756  *
28757  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
28758  *         result.flags = PyBUF_RECORDS
28759  *     else:
28760  */
28761   __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
28762   if (__pyx_t_1) {
28763 
28764     /* "View.MemoryView":1024
28765  *
28766  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
28767  *         result.flags = PyBUF_RECORDS             # <<<<<<<<<<<<<<
28768  *     else:
28769  *         result.flags = PyBUF_RECORDS_RO
28770  */
28771     __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
28772 
28773     /* "View.MemoryView":1023
28774  *     Py_INCREF(Py_None)
28775  *
28776  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
28777  *         result.flags = PyBUF_RECORDS
28778  *     else:
28779  */
28780     goto __pyx_L4;
28781   }
28782 
28783   /* "View.MemoryView":1026
28784  *         result.flags = PyBUF_RECORDS
28785  *     else:
28786  *         result.flags = PyBUF_RECORDS_RO             # <<<<<<<<<<<<<<
28787  *
28788  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
28789  */
28790   /*else*/ {
28791     __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
28792   }
28793   __pyx_L4:;
28794 
28795   /* "View.MemoryView":1028
28796  *         result.flags = PyBUF_RECORDS_RO
28797  *
28798  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape             # <<<<<<<<<<<<<<
28799  *     result.view.strides = <Py_ssize_t *> result.from_slice.strides
28800  *
28801  */
28802   __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
28803 
28804   /* "View.MemoryView":1029
28805  *
28806  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
28807  *     result.view.strides = <Py_ssize_t *> result.from_slice.strides             # <<<<<<<<<<<<<<
28808  *
28809  *
28810  */
28811   __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
28812 
28813   /* "View.MemoryView":1032
28814  *
28815  *
28816  *     result.view.suboffsets = NULL             # <<<<<<<<<<<<<<
28817  *     for suboffset in result.from_slice.suboffsets[:ndim]:
28818  *         if suboffset >= 0:
28819  */
28820   __pyx_v_result->__pyx_base.view.suboffsets = NULL;
28821 
28822   /* "View.MemoryView":1033
28823  *
28824  *     result.view.suboffsets = NULL
28825  *     for suboffset in result.from_slice.suboffsets[:ndim]:             # <<<<<<<<<<<<<<
28826  *         if suboffset >= 0:
28827  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
28828  */
28829   __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
28830   for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
28831     __pyx_t_6 = __pyx_t_8;
28832     __pyx_v_suboffset = (__pyx_t_6[0]);
28833 
28834     /* "View.MemoryView":1034
28835  *     result.view.suboffsets = NULL
28836  *     for suboffset in result.from_slice.suboffsets[:ndim]:
28837  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
28838  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
28839  *             break
28840  */
28841     __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
28842     if (__pyx_t_1) {
28843 
28844       /* "View.MemoryView":1035
28845  *     for suboffset in result.from_slice.suboffsets[:ndim]:
28846  *         if suboffset >= 0:
28847  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets             # <<<<<<<<<<<<<<
28848  *             break
28849  *
28850  */
28851       __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
28852 
28853       /* "View.MemoryView":1036
28854  *         if suboffset >= 0:
28855  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
28856  *             break             # <<<<<<<<<<<<<<
28857  *
28858  *     result.view.len = result.view.itemsize
28859  */
28860       goto __pyx_L6_break;
28861 
28862       /* "View.MemoryView":1034
28863  *     result.view.suboffsets = NULL
28864  *     for suboffset in result.from_slice.suboffsets[:ndim]:
28865  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
28866  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
28867  *             break
28868  */
28869     }
28870   }
28871   __pyx_L6_break:;
28872 
28873   /* "View.MemoryView":1038
28874  *             break
28875  *
28876  *     result.view.len = result.view.itemsize             # <<<<<<<<<<<<<<
28877  *     for length in result.view.shape[:ndim]:
28878  *         result.view.len *= length
28879  */
28880   __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
28881   __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
28882 
28883   /* "View.MemoryView":1039
28884  *
28885  *     result.view.len = result.view.itemsize
28886  *     for length in result.view.shape[:ndim]:             # <<<<<<<<<<<<<<
28887  *         result.view.len *= length
28888  *
28889  */
28890   __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
28891   for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
28892     __pyx_t_6 = __pyx_t_8;
28893     __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1039, __pyx_L1_error)
28894     __Pyx_GOTREF(__pyx_t_2);
28895     __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
28896     __pyx_t_2 = 0;
28897 
28898     /* "View.MemoryView":1040
28899  *     result.view.len = result.view.itemsize
28900  *     for length in result.view.shape[:ndim]:
28901  *         result.view.len *= length             # <<<<<<<<<<<<<<
28902  *
28903  *     result.to_object_func = to_object_func
28904  */
28905     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1040, __pyx_L1_error)
28906     __Pyx_GOTREF(__pyx_t_2);
28907     __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1040, __pyx_L1_error)
28908     __Pyx_GOTREF(__pyx_t_3);
28909     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28910     __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1040, __pyx_L1_error)
28911     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28912     __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
28913   }
28914 
28915   /* "View.MemoryView":1042
28916  *         result.view.len *= length
28917  *
28918  *     result.to_object_func = to_object_func             # <<<<<<<<<<<<<<
28919  *     result.to_dtype_func = to_dtype_func
28920  *
28921  */
28922   __pyx_v_result->to_object_func = __pyx_v_to_object_func;
28923 
28924   /* "View.MemoryView":1043
28925  *
28926  *     result.to_object_func = to_object_func
28927  *     result.to_dtype_func = to_dtype_func             # <<<<<<<<<<<<<<
28928  *
28929  *     return result
28930  */
28931   __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
28932 
28933   /* "View.MemoryView":1045
28934  *     result.to_dtype_func = to_dtype_func
28935  *
28936  *     return result             # <<<<<<<<<<<<<<
28937  *
28938  * @cname('__pyx_memoryview_get_slice_from_memoryview')
28939  */
28940   __Pyx_XDECREF(__pyx_r);
28941   __Pyx_INCREF(((PyObject *)__pyx_v_result));
28942   __pyx_r = ((PyObject *)__pyx_v_result);
28943   goto __pyx_L0;
28944 
28945   /* "View.MemoryView":995
28946  *
28947  * @cname('__pyx_memoryview_fromslice')
28948  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
28949  *                           int ndim,
28950  *                           object (*to_object_func)(char *),
28951  */
28952 
28953   /* function exit code */
28954   __pyx_L1_error:;
28955   __Pyx_XDECREF(__pyx_t_2);
28956   __Pyx_XDECREF(__pyx_t_3);
28957   __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
28958   __pyx_r = 0;
28959   __pyx_L0:;
28960   __Pyx_XDECREF((PyObject *)__pyx_v_result);
28961   __Pyx_XDECREF(__pyx_v_length);
28962   __Pyx_XGIVEREF(__pyx_r);
28963   __Pyx_RefNannyFinishContext();
28964   return __pyx_r;
28965 }
28966 
28967 /* "View.MemoryView":1048
28968  *
28969  * @cname('__pyx_memoryview_get_slice_from_memoryview')
28970  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
28971  *                                                    __Pyx_memviewslice *mslice):
28972  *     cdef _memoryviewslice obj
28973  */
28974 
__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_mslice)28975 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
28976   struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
28977   __Pyx_memviewslice *__pyx_r;
28978   __Pyx_RefNannyDeclarations
28979   int __pyx_t_1;
28980   int __pyx_t_2;
28981   PyObject *__pyx_t_3 = NULL;
28982   __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
28983 
28984   /* "View.MemoryView":1051
28985  *                                                    __Pyx_memviewslice *mslice):
28986  *     cdef _memoryviewslice obj
28987  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
28988  *         obj = memview
28989  *         return &obj.from_slice
28990  */
28991   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
28992   __pyx_t_2 = (__pyx_t_1 != 0);
28993   if (__pyx_t_2) {
28994 
28995     /* "View.MemoryView":1052
28996  *     cdef _memoryviewslice obj
28997  *     if isinstance(memview, _memoryviewslice):
28998  *         obj = memview             # <<<<<<<<<<<<<<
28999  *         return &obj.from_slice
29000  *     else:
29001  */
29002     if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1052, __pyx_L1_error)
29003     __pyx_t_3 = ((PyObject *)__pyx_v_memview);
29004     __Pyx_INCREF(__pyx_t_3);
29005     __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
29006     __pyx_t_3 = 0;
29007 
29008     /* "View.MemoryView":1053
29009  *     if isinstance(memview, _memoryviewslice):
29010  *         obj = memview
29011  *         return &obj.from_slice             # <<<<<<<<<<<<<<
29012  *     else:
29013  *         slice_copy(memview, mslice)
29014  */
29015     __pyx_r = (&__pyx_v_obj->from_slice);
29016     goto __pyx_L0;
29017 
29018     /* "View.MemoryView":1051
29019  *                                                    __Pyx_memviewslice *mslice):
29020  *     cdef _memoryviewslice obj
29021  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
29022  *         obj = memview
29023  *         return &obj.from_slice
29024  */
29025   }
29026 
29027   /* "View.MemoryView":1055
29028  *         return &obj.from_slice
29029  *     else:
29030  *         slice_copy(memview, mslice)             # <<<<<<<<<<<<<<
29031  *         return mslice
29032  *
29033  */
29034   /*else*/ {
29035     __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
29036 
29037     /* "View.MemoryView":1056
29038  *     else:
29039  *         slice_copy(memview, mslice)
29040  *         return mslice             # <<<<<<<<<<<<<<
29041  *
29042  * @cname('__pyx_memoryview_slice_copy')
29043  */
29044     __pyx_r = __pyx_v_mslice;
29045     goto __pyx_L0;
29046   }
29047 
29048   /* "View.MemoryView":1048
29049  *
29050  * @cname('__pyx_memoryview_get_slice_from_memoryview')
29051  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
29052  *                                                    __Pyx_memviewslice *mslice):
29053  *     cdef _memoryviewslice obj
29054  */
29055 
29056   /* function exit code */
29057   __pyx_L1_error:;
29058   __Pyx_XDECREF(__pyx_t_3);
29059   __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
29060   __pyx_r = 0;
29061   __pyx_L0:;
29062   __Pyx_XDECREF((PyObject *)__pyx_v_obj);
29063   __Pyx_RefNannyFinishContext();
29064   return __pyx_r;
29065 }
29066 
29067 /* "View.MemoryView":1059
29068  *
29069  * @cname('__pyx_memoryview_slice_copy')
29070  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
29071  *     cdef int dim
29072  *     cdef (Py_ssize_t*) shape, strides, suboffsets
29073  */
29074 
__pyx_memoryview_slice_copy(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_dst)29075 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
29076   int __pyx_v_dim;
29077   Py_ssize_t *__pyx_v_shape;
29078   Py_ssize_t *__pyx_v_strides;
29079   Py_ssize_t *__pyx_v_suboffsets;
29080   __Pyx_RefNannyDeclarations
29081   Py_ssize_t *__pyx_t_1;
29082   int __pyx_t_2;
29083   int __pyx_t_3;
29084   int __pyx_t_4;
29085   Py_ssize_t __pyx_t_5;
29086   __Pyx_RefNannySetupContext("slice_copy", 0);
29087 
29088   /* "View.MemoryView":1063
29089  *     cdef (Py_ssize_t*) shape, strides, suboffsets
29090  *
29091  *     shape = memview.view.shape             # <<<<<<<<<<<<<<
29092  *     strides = memview.view.strides
29093  *     suboffsets = memview.view.suboffsets
29094  */
29095   __pyx_t_1 = __pyx_v_memview->view.shape;
29096   __pyx_v_shape = __pyx_t_1;
29097 
29098   /* "View.MemoryView":1064
29099  *
29100  *     shape = memview.view.shape
29101  *     strides = memview.view.strides             # <<<<<<<<<<<<<<
29102  *     suboffsets = memview.view.suboffsets
29103  *
29104  */
29105   __pyx_t_1 = __pyx_v_memview->view.strides;
29106   __pyx_v_strides = __pyx_t_1;
29107 
29108   /* "View.MemoryView":1065
29109  *     shape = memview.view.shape
29110  *     strides = memview.view.strides
29111  *     suboffsets = memview.view.suboffsets             # <<<<<<<<<<<<<<
29112  *
29113  *     dst.memview = <__pyx_memoryview *> memview
29114  */
29115   __pyx_t_1 = __pyx_v_memview->view.suboffsets;
29116   __pyx_v_suboffsets = __pyx_t_1;
29117 
29118   /* "View.MemoryView":1067
29119  *     suboffsets = memview.view.suboffsets
29120  *
29121  *     dst.memview = <__pyx_memoryview *> memview             # <<<<<<<<<<<<<<
29122  *     dst.data = <char *> memview.view.buf
29123  *
29124  */
29125   __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
29126 
29127   /* "View.MemoryView":1068
29128  *
29129  *     dst.memview = <__pyx_memoryview *> memview
29130  *     dst.data = <char *> memview.view.buf             # <<<<<<<<<<<<<<
29131  *
29132  *     for dim in range(memview.view.ndim):
29133  */
29134   __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
29135 
29136   /* "View.MemoryView":1070
29137  *     dst.data = <char *> memview.view.buf
29138  *
29139  *     for dim in range(memview.view.ndim):             # <<<<<<<<<<<<<<
29140  *         dst.shape[dim] = shape[dim]
29141  *         dst.strides[dim] = strides[dim]
29142  */
29143   __pyx_t_2 = __pyx_v_memview->view.ndim;
29144   __pyx_t_3 = __pyx_t_2;
29145   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
29146     __pyx_v_dim = __pyx_t_4;
29147 
29148     /* "View.MemoryView":1071
29149  *
29150  *     for dim in range(memview.view.ndim):
29151  *         dst.shape[dim] = shape[dim]             # <<<<<<<<<<<<<<
29152  *         dst.strides[dim] = strides[dim]
29153  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
29154  */
29155     (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
29156 
29157     /* "View.MemoryView":1072
29158  *     for dim in range(memview.view.ndim):
29159  *         dst.shape[dim] = shape[dim]
29160  *         dst.strides[dim] = strides[dim]             # <<<<<<<<<<<<<<
29161  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
29162  *
29163  */
29164     (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
29165 
29166     /* "View.MemoryView":1073
29167  *         dst.shape[dim] = shape[dim]
29168  *         dst.strides[dim] = strides[dim]
29169  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1             # <<<<<<<<<<<<<<
29170  *
29171  * @cname('__pyx_memoryview_copy_object')
29172  */
29173     if ((__pyx_v_suboffsets != 0)) {
29174       __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
29175     } else {
29176       __pyx_t_5 = -1L;
29177     }
29178     (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
29179   }
29180 
29181   /* "View.MemoryView":1059
29182  *
29183  * @cname('__pyx_memoryview_slice_copy')
29184  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
29185  *     cdef int dim
29186  *     cdef (Py_ssize_t*) shape, strides, suboffsets
29187  */
29188 
29189   /* function exit code */
29190   __Pyx_RefNannyFinishContext();
29191 }
29192 
29193 /* "View.MemoryView":1076
29194  *
29195  * @cname('__pyx_memoryview_copy_object')
29196  * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
29197  *     "Create a new memoryview object"
29198  *     cdef __Pyx_memviewslice memviewslice
29199  */
29200 
__pyx_memoryview_copy_object(struct __pyx_memoryview_obj * __pyx_v_memview)29201 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
29202   __Pyx_memviewslice __pyx_v_memviewslice;
29203   PyObject *__pyx_r = NULL;
29204   __Pyx_RefNannyDeclarations
29205   PyObject *__pyx_t_1 = NULL;
29206   __Pyx_RefNannySetupContext("memoryview_copy", 0);
29207 
29208   /* "View.MemoryView":1079
29209  *     "Create a new memoryview object"
29210  *     cdef __Pyx_memviewslice memviewslice
29211  *     slice_copy(memview, &memviewslice)             # <<<<<<<<<<<<<<
29212  *     return memoryview_copy_from_slice(memview, &memviewslice)
29213  *
29214  */
29215   __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
29216 
29217   /* "View.MemoryView":1080
29218  *     cdef __Pyx_memviewslice memviewslice
29219  *     slice_copy(memview, &memviewslice)
29220  *     return memoryview_copy_from_slice(memview, &memviewslice)             # <<<<<<<<<<<<<<
29221  *
29222  * @cname('__pyx_memoryview_copy_object_from_slice')
29223  */
29224   __Pyx_XDECREF(__pyx_r);
29225   __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1080, __pyx_L1_error)
29226   __Pyx_GOTREF(__pyx_t_1);
29227   __pyx_r = __pyx_t_1;
29228   __pyx_t_1 = 0;
29229   goto __pyx_L0;
29230 
29231   /* "View.MemoryView":1076
29232  *
29233  * @cname('__pyx_memoryview_copy_object')
29234  * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
29235  *     "Create a new memoryview object"
29236  *     cdef __Pyx_memviewslice memviewslice
29237  */
29238 
29239   /* function exit code */
29240   __pyx_L1_error:;
29241   __Pyx_XDECREF(__pyx_t_1);
29242   __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
29243   __pyx_r = 0;
29244   __pyx_L0:;
29245   __Pyx_XGIVEREF(__pyx_r);
29246   __Pyx_RefNannyFinishContext();
29247   return __pyx_r;
29248 }
29249 
29250 /* "View.MemoryView":1083
29251  *
29252  * @cname('__pyx_memoryview_copy_object_from_slice')
29253  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
29254  *     """
29255  *     Create a new memoryview object from a given memoryview object and slice.
29256  */
29257 
__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_memviewslice)29258 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
29259   PyObject *(*__pyx_v_to_object_func)(char *);
29260   int (*__pyx_v_to_dtype_func)(char *, PyObject *);
29261   PyObject *__pyx_r = NULL;
29262   __Pyx_RefNannyDeclarations
29263   int __pyx_t_1;
29264   int __pyx_t_2;
29265   PyObject *(*__pyx_t_3)(char *);
29266   int (*__pyx_t_4)(char *, PyObject *);
29267   PyObject *__pyx_t_5 = NULL;
29268   __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
29269 
29270   /* "View.MemoryView":1090
29271  *     cdef int (*to_dtype_func)(char *, object) except 0
29272  *
29273  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
29274  *         to_object_func = (<_memoryviewslice> memview).to_object_func
29275  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
29276  */
29277   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
29278   __pyx_t_2 = (__pyx_t_1 != 0);
29279   if (__pyx_t_2) {
29280 
29281     /* "View.MemoryView":1091
29282  *
29283  *     if isinstance(memview, _memoryviewslice):
29284  *         to_object_func = (<_memoryviewslice> memview).to_object_func             # <<<<<<<<<<<<<<
29285  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
29286  *     else:
29287  */
29288     __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
29289     __pyx_v_to_object_func = __pyx_t_3;
29290 
29291     /* "View.MemoryView":1092
29292  *     if isinstance(memview, _memoryviewslice):
29293  *         to_object_func = (<_memoryviewslice> memview).to_object_func
29294  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func             # <<<<<<<<<<<<<<
29295  *     else:
29296  *         to_object_func = NULL
29297  */
29298     __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
29299     __pyx_v_to_dtype_func = __pyx_t_4;
29300 
29301     /* "View.MemoryView":1090
29302  *     cdef int (*to_dtype_func)(char *, object) except 0
29303  *
29304  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
29305  *         to_object_func = (<_memoryviewslice> memview).to_object_func
29306  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
29307  */
29308     goto __pyx_L3;
29309   }
29310 
29311   /* "View.MemoryView":1094
29312  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
29313  *     else:
29314  *         to_object_func = NULL             # <<<<<<<<<<<<<<
29315  *         to_dtype_func = NULL
29316  *
29317  */
29318   /*else*/ {
29319     __pyx_v_to_object_func = NULL;
29320 
29321     /* "View.MemoryView":1095
29322  *     else:
29323  *         to_object_func = NULL
29324  *         to_dtype_func = NULL             # <<<<<<<<<<<<<<
29325  *
29326  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
29327  */
29328     __pyx_v_to_dtype_func = NULL;
29329   }
29330   __pyx_L3:;
29331 
29332   /* "View.MemoryView":1097
29333  *         to_dtype_func = NULL
29334  *
29335  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,             # <<<<<<<<<<<<<<
29336  *                                 to_object_func, to_dtype_func,
29337  *                                 memview.dtype_is_object)
29338  */
29339   __Pyx_XDECREF(__pyx_r);
29340 
29341   /* "View.MemoryView":1099
29342  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
29343  *                                 to_object_func, to_dtype_func,
29344  *                                 memview.dtype_is_object)             # <<<<<<<<<<<<<<
29345  *
29346  *
29347  */
29348   __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, 1097, __pyx_L1_error)
29349   __Pyx_GOTREF(__pyx_t_5);
29350   __pyx_r = __pyx_t_5;
29351   __pyx_t_5 = 0;
29352   goto __pyx_L0;
29353 
29354   /* "View.MemoryView":1083
29355  *
29356  * @cname('__pyx_memoryview_copy_object_from_slice')
29357  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
29358  *     """
29359  *     Create a new memoryview object from a given memoryview object and slice.
29360  */
29361 
29362   /* function exit code */
29363   __pyx_L1_error:;
29364   __Pyx_XDECREF(__pyx_t_5);
29365   __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
29366   __pyx_r = 0;
29367   __pyx_L0:;
29368   __Pyx_XGIVEREF(__pyx_r);
29369   __Pyx_RefNannyFinishContext();
29370   return __pyx_r;
29371 }
29372 
29373 /* "View.MemoryView":1105
29374  *
29375  *
29376  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
29377  *     if arg < 0:
29378  *         return -arg
29379  */
29380 
abs_py_ssize_t(Py_ssize_t __pyx_v_arg)29381 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
29382   Py_ssize_t __pyx_r;
29383   int __pyx_t_1;
29384 
29385   /* "View.MemoryView":1106
29386  *
29387  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
29388  *     if arg < 0:             # <<<<<<<<<<<<<<
29389  *         return -arg
29390  *     else:
29391  */
29392   __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
29393   if (__pyx_t_1) {
29394 
29395     /* "View.MemoryView":1107
29396  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
29397  *     if arg < 0:
29398  *         return -arg             # <<<<<<<<<<<<<<
29399  *     else:
29400  *         return arg
29401  */
29402     __pyx_r = (-__pyx_v_arg);
29403     goto __pyx_L0;
29404 
29405     /* "View.MemoryView":1106
29406  *
29407  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
29408  *     if arg < 0:             # <<<<<<<<<<<<<<
29409  *         return -arg
29410  *     else:
29411  */
29412   }
29413 
29414   /* "View.MemoryView":1109
29415  *         return -arg
29416  *     else:
29417  *         return arg             # <<<<<<<<<<<<<<
29418  *
29419  * @cname('__pyx_get_best_slice_order')
29420  */
29421   /*else*/ {
29422     __pyx_r = __pyx_v_arg;
29423     goto __pyx_L0;
29424   }
29425 
29426   /* "View.MemoryView":1105
29427  *
29428  *
29429  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
29430  *     if arg < 0:
29431  *         return -arg
29432  */
29433 
29434   /* function exit code */
29435   __pyx_L0:;
29436   return __pyx_r;
29437 }
29438 
29439 /* "View.MemoryView":1112
29440  *
29441  * @cname('__pyx_get_best_slice_order')
29442  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
29443  *     """
29444  *     Figure out the best memory access order for a given slice.
29445  */
29446 
__pyx_get_best_slice_order(__Pyx_memviewslice * __pyx_v_mslice,int __pyx_v_ndim)29447 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
29448   int __pyx_v_i;
29449   Py_ssize_t __pyx_v_c_stride;
29450   Py_ssize_t __pyx_v_f_stride;
29451   char __pyx_r;
29452   int __pyx_t_1;
29453   int __pyx_t_2;
29454   int __pyx_t_3;
29455   int __pyx_t_4;
29456 
29457   /* "View.MemoryView":1117
29458  *     """
29459  *     cdef int i
29460  *     cdef Py_ssize_t c_stride = 0             # <<<<<<<<<<<<<<
29461  *     cdef Py_ssize_t f_stride = 0
29462  *
29463  */
29464   __pyx_v_c_stride = 0;
29465 
29466   /* "View.MemoryView":1118
29467  *     cdef int i
29468  *     cdef Py_ssize_t c_stride = 0
29469  *     cdef Py_ssize_t f_stride = 0             # <<<<<<<<<<<<<<
29470  *
29471  *     for i in range(ndim - 1, -1, -1):
29472  */
29473   __pyx_v_f_stride = 0;
29474 
29475   /* "View.MemoryView":1120
29476  *     cdef Py_ssize_t f_stride = 0
29477  *
29478  *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
29479  *         if mslice.shape[i] > 1:
29480  *             c_stride = mslice.strides[i]
29481  */
29482   for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
29483     __pyx_v_i = __pyx_t_1;
29484 
29485     /* "View.MemoryView":1121
29486  *
29487  *     for i in range(ndim - 1, -1, -1):
29488  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
29489  *             c_stride = mslice.strides[i]
29490  *             break
29491  */
29492     __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
29493     if (__pyx_t_2) {
29494 
29495       /* "View.MemoryView":1122
29496  *     for i in range(ndim - 1, -1, -1):
29497  *         if mslice.shape[i] > 1:
29498  *             c_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
29499  *             break
29500  *
29501  */
29502       __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
29503 
29504       /* "View.MemoryView":1123
29505  *         if mslice.shape[i] > 1:
29506  *             c_stride = mslice.strides[i]
29507  *             break             # <<<<<<<<<<<<<<
29508  *
29509  *     for i in range(ndim):
29510  */
29511       goto __pyx_L4_break;
29512 
29513       /* "View.MemoryView":1121
29514  *
29515  *     for i in range(ndim - 1, -1, -1):
29516  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
29517  *             c_stride = mslice.strides[i]
29518  *             break
29519  */
29520     }
29521   }
29522   __pyx_L4_break:;
29523 
29524   /* "View.MemoryView":1125
29525  *             break
29526  *
29527  *     for i in range(ndim):             # <<<<<<<<<<<<<<
29528  *         if mslice.shape[i] > 1:
29529  *             f_stride = mslice.strides[i]
29530  */
29531   __pyx_t_1 = __pyx_v_ndim;
29532   __pyx_t_3 = __pyx_t_1;
29533   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
29534     __pyx_v_i = __pyx_t_4;
29535 
29536     /* "View.MemoryView":1126
29537  *
29538  *     for i in range(ndim):
29539  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
29540  *             f_stride = mslice.strides[i]
29541  *             break
29542  */
29543     __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
29544     if (__pyx_t_2) {
29545 
29546       /* "View.MemoryView":1127
29547  *     for i in range(ndim):
29548  *         if mslice.shape[i] > 1:
29549  *             f_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
29550  *             break
29551  *
29552  */
29553       __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
29554 
29555       /* "View.MemoryView":1128
29556  *         if mslice.shape[i] > 1:
29557  *             f_stride = mslice.strides[i]
29558  *             break             # <<<<<<<<<<<<<<
29559  *
29560  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
29561  */
29562       goto __pyx_L7_break;
29563 
29564       /* "View.MemoryView":1126
29565  *
29566  *     for i in range(ndim):
29567  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
29568  *             f_stride = mslice.strides[i]
29569  *             break
29570  */
29571     }
29572   }
29573   __pyx_L7_break:;
29574 
29575   /* "View.MemoryView":1130
29576  *             break
29577  *
29578  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
29579  *         return 'C'
29580  *     else:
29581  */
29582   __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
29583   if (__pyx_t_2) {
29584 
29585     /* "View.MemoryView":1131
29586  *
29587  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
29588  *         return 'C'             # <<<<<<<<<<<<<<
29589  *     else:
29590  *         return 'F'
29591  */
29592     __pyx_r = 'C';
29593     goto __pyx_L0;
29594 
29595     /* "View.MemoryView":1130
29596  *             break
29597  *
29598  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
29599  *         return 'C'
29600  *     else:
29601  */
29602   }
29603 
29604   /* "View.MemoryView":1133
29605  *         return 'C'
29606  *     else:
29607  *         return 'F'             # <<<<<<<<<<<<<<
29608  *
29609  * @cython.cdivision(True)
29610  */
29611   /*else*/ {
29612     __pyx_r = 'F';
29613     goto __pyx_L0;
29614   }
29615 
29616   /* "View.MemoryView":1112
29617  *
29618  * @cname('__pyx_get_best_slice_order')
29619  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
29620  *     """
29621  *     Figure out the best memory access order for a given slice.
29622  */
29623 
29624   /* function exit code */
29625   __pyx_L0:;
29626   return __pyx_r;
29627 }
29628 
29629 /* "View.MemoryView":1136
29630  *
29631  * @cython.cdivision(True)
29632  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
29633  *                                    char *dst_data, Py_ssize_t *dst_strides,
29634  *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
29635  */
29636 
_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)29637 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) {
29638   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
29639   CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
29640   Py_ssize_t __pyx_v_dst_extent;
29641   Py_ssize_t __pyx_v_src_stride;
29642   Py_ssize_t __pyx_v_dst_stride;
29643   int __pyx_t_1;
29644   int __pyx_t_2;
29645   int __pyx_t_3;
29646   Py_ssize_t __pyx_t_4;
29647   Py_ssize_t __pyx_t_5;
29648   Py_ssize_t __pyx_t_6;
29649 
29650   /* "View.MemoryView":1143
29651  *
29652  *     cdef Py_ssize_t i
29653  *     cdef Py_ssize_t src_extent = src_shape[0]             # <<<<<<<<<<<<<<
29654  *     cdef Py_ssize_t dst_extent = dst_shape[0]
29655  *     cdef Py_ssize_t src_stride = src_strides[0]
29656  */
29657   __pyx_v_src_extent = (__pyx_v_src_shape[0]);
29658 
29659   /* "View.MemoryView":1144
29660  *     cdef Py_ssize_t i
29661  *     cdef Py_ssize_t src_extent = src_shape[0]
29662  *     cdef Py_ssize_t dst_extent = dst_shape[0]             # <<<<<<<<<<<<<<
29663  *     cdef Py_ssize_t src_stride = src_strides[0]
29664  *     cdef Py_ssize_t dst_stride = dst_strides[0]
29665  */
29666   __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
29667 
29668   /* "View.MemoryView":1145
29669  *     cdef Py_ssize_t src_extent = src_shape[0]
29670  *     cdef Py_ssize_t dst_extent = dst_shape[0]
29671  *     cdef Py_ssize_t src_stride = src_strides[0]             # <<<<<<<<<<<<<<
29672  *     cdef Py_ssize_t dst_stride = dst_strides[0]
29673  *
29674  */
29675   __pyx_v_src_stride = (__pyx_v_src_strides[0]);
29676 
29677   /* "View.MemoryView":1146
29678  *     cdef Py_ssize_t dst_extent = dst_shape[0]
29679  *     cdef Py_ssize_t src_stride = src_strides[0]
29680  *     cdef Py_ssize_t dst_stride = dst_strides[0]             # <<<<<<<<<<<<<<
29681  *
29682  *     if ndim == 1:
29683  */
29684   __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
29685 
29686   /* "View.MemoryView":1148
29687  *     cdef Py_ssize_t dst_stride = dst_strides[0]
29688  *
29689  *     if ndim == 1:             # <<<<<<<<<<<<<<
29690  *        if (src_stride > 0 and dst_stride > 0 and
29691  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
29692  */
29693   __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
29694   if (__pyx_t_1) {
29695 
29696     /* "View.MemoryView":1149
29697  *
29698  *     if ndim == 1:
29699  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
29700  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
29701  *            memcpy(dst_data, src_data, itemsize * dst_extent)
29702  */
29703     __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
29704     if (__pyx_t_2) {
29705     } else {
29706       __pyx_t_1 = __pyx_t_2;
29707       goto __pyx_L5_bool_binop_done;
29708     }
29709     __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
29710     if (__pyx_t_2) {
29711     } else {
29712       __pyx_t_1 = __pyx_t_2;
29713       goto __pyx_L5_bool_binop_done;
29714     }
29715 
29716     /* "View.MemoryView":1150
29717  *     if ndim == 1:
29718  *        if (src_stride > 0 and dst_stride > 0 and
29719  *            <size_t> src_stride == itemsize == <size_t> dst_stride):             # <<<<<<<<<<<<<<
29720  *            memcpy(dst_data, src_data, itemsize * dst_extent)
29721  *        else:
29722  */
29723     __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
29724     if (__pyx_t_2) {
29725       __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
29726     }
29727     __pyx_t_3 = (__pyx_t_2 != 0);
29728     __pyx_t_1 = __pyx_t_3;
29729     __pyx_L5_bool_binop_done:;
29730 
29731     /* "View.MemoryView":1149
29732  *
29733  *     if ndim == 1:
29734  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
29735  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
29736  *            memcpy(dst_data, src_data, itemsize * dst_extent)
29737  */
29738     if (__pyx_t_1) {
29739 
29740       /* "View.MemoryView":1151
29741  *        if (src_stride > 0 and dst_stride > 0 and
29742  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
29743  *            memcpy(dst_data, src_data, itemsize * dst_extent)             # <<<<<<<<<<<<<<
29744  *        else:
29745  *            for i in range(dst_extent):
29746  */
29747       (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
29748 
29749       /* "View.MemoryView":1149
29750  *
29751  *     if ndim == 1:
29752  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
29753  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
29754  *            memcpy(dst_data, src_data, itemsize * dst_extent)
29755  */
29756       goto __pyx_L4;
29757     }
29758 
29759     /* "View.MemoryView":1153
29760  *            memcpy(dst_data, src_data, itemsize * dst_extent)
29761  *        else:
29762  *            for i in range(dst_extent):             # <<<<<<<<<<<<<<
29763  *                memcpy(dst_data, src_data, itemsize)
29764  *                src_data += src_stride
29765  */
29766     /*else*/ {
29767       __pyx_t_4 = __pyx_v_dst_extent;
29768       __pyx_t_5 = __pyx_t_4;
29769       for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
29770         __pyx_v_i = __pyx_t_6;
29771 
29772         /* "View.MemoryView":1154
29773  *        else:
29774  *            for i in range(dst_extent):
29775  *                memcpy(dst_data, src_data, itemsize)             # <<<<<<<<<<<<<<
29776  *                src_data += src_stride
29777  *                dst_data += dst_stride
29778  */
29779         (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
29780 
29781         /* "View.MemoryView":1155
29782  *            for i in range(dst_extent):
29783  *                memcpy(dst_data, src_data, itemsize)
29784  *                src_data += src_stride             # <<<<<<<<<<<<<<
29785  *                dst_data += dst_stride
29786  *     else:
29787  */
29788         __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
29789 
29790         /* "View.MemoryView":1156
29791  *                memcpy(dst_data, src_data, itemsize)
29792  *                src_data += src_stride
29793  *                dst_data += dst_stride             # <<<<<<<<<<<<<<
29794  *     else:
29795  *         for i in range(dst_extent):
29796  */
29797         __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
29798       }
29799     }
29800     __pyx_L4:;
29801 
29802     /* "View.MemoryView":1148
29803  *     cdef Py_ssize_t dst_stride = dst_strides[0]
29804  *
29805  *     if ndim == 1:             # <<<<<<<<<<<<<<
29806  *        if (src_stride > 0 and dst_stride > 0 and
29807  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
29808  */
29809     goto __pyx_L3;
29810   }
29811 
29812   /* "View.MemoryView":1158
29813  *                dst_data += dst_stride
29814  *     else:
29815  *         for i in range(dst_extent):             # <<<<<<<<<<<<<<
29816  *             _copy_strided_to_strided(src_data, src_strides + 1,
29817  *                                      dst_data, dst_strides + 1,
29818  */
29819   /*else*/ {
29820     __pyx_t_4 = __pyx_v_dst_extent;
29821     __pyx_t_5 = __pyx_t_4;
29822     for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
29823       __pyx_v_i = __pyx_t_6;
29824 
29825       /* "View.MemoryView":1159
29826  *     else:
29827  *         for i in range(dst_extent):
29828  *             _copy_strided_to_strided(src_data, src_strides + 1,             # <<<<<<<<<<<<<<
29829  *                                      dst_data, dst_strides + 1,
29830  *                                      src_shape + 1, dst_shape + 1,
29831  */
29832       _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);
29833 
29834       /* "View.MemoryView":1163
29835  *                                      src_shape + 1, dst_shape + 1,
29836  *                                      ndim - 1, itemsize)
29837  *             src_data += src_stride             # <<<<<<<<<<<<<<
29838  *             dst_data += dst_stride
29839  *
29840  */
29841       __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
29842 
29843       /* "View.MemoryView":1164
29844  *                                      ndim - 1, itemsize)
29845  *             src_data += src_stride
29846  *             dst_data += dst_stride             # <<<<<<<<<<<<<<
29847  *
29848  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
29849  */
29850       __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
29851     }
29852   }
29853   __pyx_L3:;
29854 
29855   /* "View.MemoryView":1136
29856  *
29857  * @cython.cdivision(True)
29858  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
29859  *                                    char *dst_data, Py_ssize_t *dst_strides,
29860  *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
29861  */
29862 
29863   /* function exit code */
29864 }
29865 
29866 /* "View.MemoryView":1166
29867  *             dst_data += dst_stride
29868  *
29869  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
29870  *                                   __Pyx_memviewslice *dst,
29871  *                                   int ndim, size_t itemsize) nogil:
29872  */
29873 
copy_strided_to_strided(__Pyx_memviewslice * __pyx_v_src,__Pyx_memviewslice * __pyx_v_dst,int __pyx_v_ndim,size_t __pyx_v_itemsize)29874 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) {
29875 
29876   /* "View.MemoryView":1169
29877  *                                   __Pyx_memviewslice *dst,
29878  *                                   int ndim, size_t itemsize) nogil:
29879  *     _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides,             # <<<<<<<<<<<<<<
29880  *                              src.shape, dst.shape, ndim, itemsize)
29881  *
29882  */
29883   _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);
29884 
29885   /* "View.MemoryView":1166
29886  *             dst_data += dst_stride
29887  *
29888  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
29889  *                                   __Pyx_memviewslice *dst,
29890  *                                   int ndim, size_t itemsize) nogil:
29891  */
29892 
29893   /* function exit code */
29894 }
29895 
29896 /* "View.MemoryView":1173
29897  *
29898  * @cname('__pyx_memoryview_slice_get_size')
29899  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
29900  *     "Return the size of the memory occupied by the slice in number of bytes"
29901  *     cdef int i
29902  */
29903 
__pyx_memoryview_slice_get_size(__Pyx_memviewslice * __pyx_v_src,int __pyx_v_ndim)29904 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
29905   int __pyx_v_i;
29906   Py_ssize_t __pyx_v_size;
29907   Py_ssize_t __pyx_r;
29908   Py_ssize_t __pyx_t_1;
29909   int __pyx_t_2;
29910   int __pyx_t_3;
29911   int __pyx_t_4;
29912 
29913   /* "View.MemoryView":1176
29914  *     "Return the size of the memory occupied by the slice in number of bytes"
29915  *     cdef int i
29916  *     cdef Py_ssize_t size = src.memview.view.itemsize             # <<<<<<<<<<<<<<
29917  *
29918  *     for i in range(ndim):
29919  */
29920   __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
29921   __pyx_v_size = __pyx_t_1;
29922 
29923   /* "View.MemoryView":1178
29924  *     cdef Py_ssize_t size = src.memview.view.itemsize
29925  *
29926  *     for i in range(ndim):             # <<<<<<<<<<<<<<
29927  *         size *= src.shape[i]
29928  *
29929  */
29930   __pyx_t_2 = __pyx_v_ndim;
29931   __pyx_t_3 = __pyx_t_2;
29932   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
29933     __pyx_v_i = __pyx_t_4;
29934 
29935     /* "View.MemoryView":1179
29936  *
29937  *     for i in range(ndim):
29938  *         size *= src.shape[i]             # <<<<<<<<<<<<<<
29939  *
29940  *     return size
29941  */
29942     __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
29943   }
29944 
29945   /* "View.MemoryView":1181
29946  *         size *= src.shape[i]
29947  *
29948  *     return size             # <<<<<<<<<<<<<<
29949  *
29950  * @cname('__pyx_fill_contig_strides_array')
29951  */
29952   __pyx_r = __pyx_v_size;
29953   goto __pyx_L0;
29954 
29955   /* "View.MemoryView":1173
29956  *
29957  * @cname('__pyx_memoryview_slice_get_size')
29958  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
29959  *     "Return the size of the memory occupied by the slice in number of bytes"
29960  *     cdef int i
29961  */
29962 
29963   /* function exit code */
29964   __pyx_L0:;
29965   return __pyx_r;
29966 }
29967 
29968 /* "View.MemoryView":1184
29969  *
29970  * @cname('__pyx_fill_contig_strides_array')
29971  * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
29972  *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
29973  *                 int ndim, char order) nogil:
29974  */
29975 
__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)29976 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) {
29977   int __pyx_v_idx;
29978   Py_ssize_t __pyx_r;
29979   int __pyx_t_1;
29980   int __pyx_t_2;
29981   int __pyx_t_3;
29982   int __pyx_t_4;
29983 
29984   /* "View.MemoryView":1193
29985  *     cdef int idx
29986  *
29987  *     if order == 'F':             # <<<<<<<<<<<<<<
29988  *         for idx in range(ndim):
29989  *             strides[idx] = stride
29990  */
29991   __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
29992   if (__pyx_t_1) {
29993 
29994     /* "View.MemoryView":1194
29995  *
29996  *     if order == 'F':
29997  *         for idx in range(ndim):             # <<<<<<<<<<<<<<
29998  *             strides[idx] = stride
29999  *             stride = stride * shape[idx]
30000  */
30001     __pyx_t_2 = __pyx_v_ndim;
30002     __pyx_t_3 = __pyx_t_2;
30003     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
30004       __pyx_v_idx = __pyx_t_4;
30005 
30006       /* "View.MemoryView":1195
30007  *     if order == 'F':
30008  *         for idx in range(ndim):
30009  *             strides[idx] = stride             # <<<<<<<<<<<<<<
30010  *             stride = stride * shape[idx]
30011  *     else:
30012  */
30013       (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
30014 
30015       /* "View.MemoryView":1196
30016  *         for idx in range(ndim):
30017  *             strides[idx] = stride
30018  *             stride = stride * shape[idx]             # <<<<<<<<<<<<<<
30019  *     else:
30020  *         for idx in range(ndim - 1, -1, -1):
30021  */
30022       __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
30023     }
30024 
30025     /* "View.MemoryView":1193
30026  *     cdef int idx
30027  *
30028  *     if order == 'F':             # <<<<<<<<<<<<<<
30029  *         for idx in range(ndim):
30030  *             strides[idx] = stride
30031  */
30032     goto __pyx_L3;
30033   }
30034 
30035   /* "View.MemoryView":1198
30036  *             stride = stride * shape[idx]
30037  *     else:
30038  *         for idx in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
30039  *             strides[idx] = stride
30040  *             stride = stride * shape[idx]
30041  */
30042   /*else*/ {
30043     for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
30044       __pyx_v_idx = __pyx_t_2;
30045 
30046       /* "View.MemoryView":1199
30047  *     else:
30048  *         for idx in range(ndim - 1, -1, -1):
30049  *             strides[idx] = stride             # <<<<<<<<<<<<<<
30050  *             stride = stride * shape[idx]
30051  *
30052  */
30053       (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
30054 
30055       /* "View.MemoryView":1200
30056  *         for idx in range(ndim - 1, -1, -1):
30057  *             strides[idx] = stride
30058  *             stride = stride * shape[idx]             # <<<<<<<<<<<<<<
30059  *
30060  *     return stride
30061  */
30062       __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
30063     }
30064   }
30065   __pyx_L3:;
30066 
30067   /* "View.MemoryView":1202
30068  *             stride = stride * shape[idx]
30069  *
30070  *     return stride             # <<<<<<<<<<<<<<
30071  *
30072  * @cname('__pyx_memoryview_copy_data_to_temp')
30073  */
30074   __pyx_r = __pyx_v_stride;
30075   goto __pyx_L0;
30076 
30077   /* "View.MemoryView":1184
30078  *
30079  * @cname('__pyx_fill_contig_strides_array')
30080  * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
30081  *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
30082  *                 int ndim, char order) nogil:
30083  */
30084 
30085   /* function exit code */
30086   __pyx_L0:;
30087   return __pyx_r;
30088 }
30089 
30090 /* "View.MemoryView":1205
30091  *
30092  * @cname('__pyx_memoryview_copy_data_to_temp')
30093  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
30094  *                              __Pyx_memviewslice *tmpslice,
30095  *                              char order,
30096  */
30097 
__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice * __pyx_v_src,__Pyx_memviewslice * __pyx_v_tmpslice,char __pyx_v_order,int __pyx_v_ndim)30098 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) {
30099   int __pyx_v_i;
30100   void *__pyx_v_result;
30101   size_t __pyx_v_itemsize;
30102   size_t __pyx_v_size;
30103   void *__pyx_r;
30104   Py_ssize_t __pyx_t_1;
30105   int __pyx_t_2;
30106   int __pyx_t_3;
30107   struct __pyx_memoryview_obj *__pyx_t_4;
30108   int __pyx_t_5;
30109   int __pyx_t_6;
30110 
30111   /* "View.MemoryView":1216
30112  *     cdef void *result
30113  *
30114  *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
30115  *     cdef size_t size = slice_get_size(src, ndim)
30116  *
30117  */
30118   __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
30119   __pyx_v_itemsize = __pyx_t_1;
30120 
30121   /* "View.MemoryView":1217
30122  *
30123  *     cdef size_t itemsize = src.memview.view.itemsize
30124  *     cdef size_t size = slice_get_size(src, ndim)             # <<<<<<<<<<<<<<
30125  *
30126  *     result = malloc(size)
30127  */
30128   __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
30129 
30130   /* "View.MemoryView":1219
30131  *     cdef size_t size = slice_get_size(src, ndim)
30132  *
30133  *     result = malloc(size)             # <<<<<<<<<<<<<<
30134  *     if not result:
30135  *         _err(MemoryError, NULL)
30136  */
30137   __pyx_v_result = malloc(__pyx_v_size);
30138 
30139   /* "View.MemoryView":1220
30140  *
30141  *     result = malloc(size)
30142  *     if not result:             # <<<<<<<<<<<<<<
30143  *         _err(MemoryError, NULL)
30144  *
30145  */
30146   __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
30147   if (__pyx_t_2) {
30148 
30149     /* "View.MemoryView":1221
30150  *     result = malloc(size)
30151  *     if not result:
30152  *         _err(MemoryError, NULL)             # <<<<<<<<<<<<<<
30153  *
30154  *
30155  */
30156     __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1221, __pyx_L1_error)
30157 
30158     /* "View.MemoryView":1220
30159  *
30160  *     result = malloc(size)
30161  *     if not result:             # <<<<<<<<<<<<<<
30162  *         _err(MemoryError, NULL)
30163  *
30164  */
30165   }
30166 
30167   /* "View.MemoryView":1224
30168  *
30169  *
30170  *     tmpslice.data = <char *> result             # <<<<<<<<<<<<<<
30171  *     tmpslice.memview = src.memview
30172  *     for i in range(ndim):
30173  */
30174   __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
30175 
30176   /* "View.MemoryView":1225
30177  *
30178  *     tmpslice.data = <char *> result
30179  *     tmpslice.memview = src.memview             # <<<<<<<<<<<<<<
30180  *     for i in range(ndim):
30181  *         tmpslice.shape[i] = src.shape[i]
30182  */
30183   __pyx_t_4 = __pyx_v_src->memview;
30184   __pyx_v_tmpslice->memview = __pyx_t_4;
30185 
30186   /* "View.MemoryView":1226
30187  *     tmpslice.data = <char *> result
30188  *     tmpslice.memview = src.memview
30189  *     for i in range(ndim):             # <<<<<<<<<<<<<<
30190  *         tmpslice.shape[i] = src.shape[i]
30191  *         tmpslice.suboffsets[i] = -1
30192  */
30193   __pyx_t_3 = __pyx_v_ndim;
30194   __pyx_t_5 = __pyx_t_3;
30195   for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
30196     __pyx_v_i = __pyx_t_6;
30197 
30198     /* "View.MemoryView":1227
30199  *     tmpslice.memview = src.memview
30200  *     for i in range(ndim):
30201  *         tmpslice.shape[i] = src.shape[i]             # <<<<<<<<<<<<<<
30202  *         tmpslice.suboffsets[i] = -1
30203  *
30204  */
30205     (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
30206 
30207     /* "View.MemoryView":1228
30208  *     for i in range(ndim):
30209  *         tmpslice.shape[i] = src.shape[i]
30210  *         tmpslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
30211  *
30212  *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
30213  */
30214     (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
30215   }
30216 
30217   /* "View.MemoryView":1230
30218  *         tmpslice.suboffsets[i] = -1
30219  *
30220  *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,             # <<<<<<<<<<<<<<
30221  *                               ndim, order)
30222  *
30223  */
30224   (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));
30225 
30226   /* "View.MemoryView":1234
30227  *
30228  *
30229  *     for i in range(ndim):             # <<<<<<<<<<<<<<
30230  *         if tmpslice.shape[i] == 1:
30231  *             tmpslice.strides[i] = 0
30232  */
30233   __pyx_t_3 = __pyx_v_ndim;
30234   __pyx_t_5 = __pyx_t_3;
30235   for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
30236     __pyx_v_i = __pyx_t_6;
30237 
30238     /* "View.MemoryView":1235
30239  *
30240  *     for i in range(ndim):
30241  *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
30242  *             tmpslice.strides[i] = 0
30243  *
30244  */
30245     __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
30246     if (__pyx_t_2) {
30247 
30248       /* "View.MemoryView":1236
30249  *     for i in range(ndim):
30250  *         if tmpslice.shape[i] == 1:
30251  *             tmpslice.strides[i] = 0             # <<<<<<<<<<<<<<
30252  *
30253  *     if slice_is_contig(src[0], order, ndim):
30254  */
30255       (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
30256 
30257       /* "View.MemoryView":1235
30258  *
30259  *     for i in range(ndim):
30260  *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
30261  *             tmpslice.strides[i] = 0
30262  *
30263  */
30264     }
30265   }
30266 
30267   /* "View.MemoryView":1238
30268  *             tmpslice.strides[i] = 0
30269  *
30270  *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
30271  *         memcpy(result, src.data, size)
30272  *     else:
30273  */
30274   __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
30275   if (__pyx_t_2) {
30276 
30277     /* "View.MemoryView":1239
30278  *
30279  *     if slice_is_contig(src[0], order, ndim):
30280  *         memcpy(result, src.data, size)             # <<<<<<<<<<<<<<
30281  *     else:
30282  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
30283  */
30284     (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
30285 
30286     /* "View.MemoryView":1238
30287  *             tmpslice.strides[i] = 0
30288  *
30289  *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
30290  *         memcpy(result, src.data, size)
30291  *     else:
30292  */
30293     goto __pyx_L9;
30294   }
30295 
30296   /* "View.MemoryView":1241
30297  *         memcpy(result, src.data, size)
30298  *     else:
30299  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)             # <<<<<<<<<<<<<<
30300  *
30301  *     return result
30302  */
30303   /*else*/ {
30304     copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
30305   }
30306   __pyx_L9:;
30307 
30308   /* "View.MemoryView":1243
30309  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
30310  *
30311  *     return result             # <<<<<<<<<<<<<<
30312  *
30313  *
30314  */
30315   __pyx_r = __pyx_v_result;
30316   goto __pyx_L0;
30317 
30318   /* "View.MemoryView":1205
30319  *
30320  * @cname('__pyx_memoryview_copy_data_to_temp')
30321  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
30322  *                              __Pyx_memviewslice *tmpslice,
30323  *                              char order,
30324  */
30325 
30326   /* function exit code */
30327   __pyx_L1_error:;
30328   {
30329     #ifdef WITH_THREAD
30330     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
30331     #endif
30332     __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
30333     #ifdef WITH_THREAD
30334     __Pyx_PyGILState_Release(__pyx_gilstate_save);
30335     #endif
30336   }
30337   __pyx_r = NULL;
30338   __pyx_L0:;
30339   return __pyx_r;
30340 }
30341 
30342 /* "View.MemoryView":1248
30343  *
30344  * @cname('__pyx_memoryview_err_extents')
30345  * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
30346  *                              Py_ssize_t extent2) except -1 with gil:
30347  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
30348  */
30349 
__pyx_memoryview_err_extents(int __pyx_v_i,Py_ssize_t __pyx_v_extent1,Py_ssize_t __pyx_v_extent2)30350 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
30351   int __pyx_r;
30352   __Pyx_RefNannyDeclarations
30353   PyObject *__pyx_t_1 = NULL;
30354   PyObject *__pyx_t_2 = NULL;
30355   PyObject *__pyx_t_3 = NULL;
30356   PyObject *__pyx_t_4 = NULL;
30357   #ifdef WITH_THREAD
30358   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
30359   #endif
30360   __Pyx_RefNannySetupContext("_err_extents", 0);
30361 
30362   /* "View.MemoryView":1251
30363  *                              Py_ssize_t extent2) except -1 with gil:
30364  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
30365  *                                                         (i, extent1, extent2))             # <<<<<<<<<<<<<<
30366  *
30367  * @cname('__pyx_memoryview_err_dim')
30368  */
30369   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1251, __pyx_L1_error)
30370   __Pyx_GOTREF(__pyx_t_1);
30371   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1251, __pyx_L1_error)
30372   __Pyx_GOTREF(__pyx_t_2);
30373   __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1251, __pyx_L1_error)
30374   __Pyx_GOTREF(__pyx_t_3);
30375   __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1251, __pyx_L1_error)
30376   __Pyx_GOTREF(__pyx_t_4);
30377   __Pyx_GIVEREF(__pyx_t_1);
30378   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
30379   __Pyx_GIVEREF(__pyx_t_2);
30380   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
30381   __Pyx_GIVEREF(__pyx_t_3);
30382   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
30383   __pyx_t_1 = 0;
30384   __pyx_t_2 = 0;
30385   __pyx_t_3 = 0;
30386 
30387   /* "View.MemoryView":1250
30388  * cdef int _err_extents(int i, Py_ssize_t extent1,
30389  *                              Py_ssize_t extent2) except -1 with gil:
30390  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %             # <<<<<<<<<<<<<<
30391  *                                                         (i, extent1, extent2))
30392  *
30393  */
30394   __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, 1250, __pyx_L1_error)
30395   __Pyx_GOTREF(__pyx_t_3);
30396   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
30397   __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1250, __pyx_L1_error)
30398   __Pyx_GOTREF(__pyx_t_4);
30399   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
30400   __Pyx_Raise(__pyx_t_4, 0, 0, 0);
30401   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
30402   __PYX_ERR(1, 1250, __pyx_L1_error)
30403 
30404   /* "View.MemoryView":1248
30405  *
30406  * @cname('__pyx_memoryview_err_extents')
30407  * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
30408  *                              Py_ssize_t extent2) except -1 with gil:
30409  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
30410  */
30411 
30412   /* function exit code */
30413   __pyx_L1_error:;
30414   __Pyx_XDECREF(__pyx_t_1);
30415   __Pyx_XDECREF(__pyx_t_2);
30416   __Pyx_XDECREF(__pyx_t_3);
30417   __Pyx_XDECREF(__pyx_t_4);
30418   __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
30419   __pyx_r = -1;
30420   __Pyx_RefNannyFinishContext();
30421   #ifdef WITH_THREAD
30422   __Pyx_PyGILState_Release(__pyx_gilstate_save);
30423   #endif
30424   return __pyx_r;
30425 }
30426 
30427 /* "View.MemoryView":1254
30428  *
30429  * @cname('__pyx_memoryview_err_dim')
30430  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
30431  *     raise error(msg.decode('ascii') % dim)
30432  *
30433  */
30434 
__pyx_memoryview_err_dim(PyObject * __pyx_v_error,char * __pyx_v_msg,int __pyx_v_dim)30435 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
30436   int __pyx_r;
30437   __Pyx_RefNannyDeclarations
30438   PyObject *__pyx_t_1 = NULL;
30439   PyObject *__pyx_t_2 = NULL;
30440   PyObject *__pyx_t_3 = NULL;
30441   PyObject *__pyx_t_4 = NULL;
30442   #ifdef WITH_THREAD
30443   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
30444   #endif
30445   __Pyx_RefNannySetupContext("_err_dim", 0);
30446   __Pyx_INCREF(__pyx_v_error);
30447 
30448   /* "View.MemoryView":1255
30449  * @cname('__pyx_memoryview_err_dim')
30450  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
30451  *     raise error(msg.decode('ascii') % dim)             # <<<<<<<<<<<<<<
30452  *
30453  * @cname('__pyx_memoryview_err')
30454  */
30455   __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, 1255, __pyx_L1_error)
30456   __Pyx_GOTREF(__pyx_t_2);
30457   __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1255, __pyx_L1_error)
30458   __Pyx_GOTREF(__pyx_t_3);
30459   __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1255, __pyx_L1_error)
30460   __Pyx_GOTREF(__pyx_t_4);
30461   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30462   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
30463   __Pyx_INCREF(__pyx_v_error);
30464   __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
30465   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
30466     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
30467     if (likely(__pyx_t_2)) {
30468       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
30469       __Pyx_INCREF(__pyx_t_2);
30470       __Pyx_INCREF(function);
30471       __Pyx_DECREF_SET(__pyx_t_3, function);
30472     }
30473   }
30474   __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);
30475   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
30476   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
30477   if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1255, __pyx_L1_error)
30478   __Pyx_GOTREF(__pyx_t_1);
30479   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
30480   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
30481   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30482   __PYX_ERR(1, 1255, __pyx_L1_error)
30483 
30484   /* "View.MemoryView":1254
30485  *
30486  * @cname('__pyx_memoryview_err_dim')
30487  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
30488  *     raise error(msg.decode('ascii') % dim)
30489  *
30490  */
30491 
30492   /* function exit code */
30493   __pyx_L1_error:;
30494   __Pyx_XDECREF(__pyx_t_1);
30495   __Pyx_XDECREF(__pyx_t_2);
30496   __Pyx_XDECREF(__pyx_t_3);
30497   __Pyx_XDECREF(__pyx_t_4);
30498   __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
30499   __pyx_r = -1;
30500   __Pyx_XDECREF(__pyx_v_error);
30501   __Pyx_RefNannyFinishContext();
30502   #ifdef WITH_THREAD
30503   __Pyx_PyGILState_Release(__pyx_gilstate_save);
30504   #endif
30505   return __pyx_r;
30506 }
30507 
30508 /* "View.MemoryView":1258
30509  *
30510  * @cname('__pyx_memoryview_err')
30511  * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
30512  *     if msg != NULL:
30513  *         raise error(msg.decode('ascii'))
30514  */
30515 
__pyx_memoryview_err(PyObject * __pyx_v_error,char * __pyx_v_msg)30516 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
30517   int __pyx_r;
30518   __Pyx_RefNannyDeclarations
30519   int __pyx_t_1;
30520   PyObject *__pyx_t_2 = NULL;
30521   PyObject *__pyx_t_3 = NULL;
30522   PyObject *__pyx_t_4 = NULL;
30523   PyObject *__pyx_t_5 = NULL;
30524   #ifdef WITH_THREAD
30525   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
30526   #endif
30527   __Pyx_RefNannySetupContext("_err", 0);
30528   __Pyx_INCREF(__pyx_v_error);
30529 
30530   /* "View.MemoryView":1259
30531  * @cname('__pyx_memoryview_err')
30532  * cdef int _err(object error, char *msg) except -1 with gil:
30533  *     if msg != NULL:             # <<<<<<<<<<<<<<
30534  *         raise error(msg.decode('ascii'))
30535  *     else:
30536  */
30537   __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
30538   if (unlikely(__pyx_t_1)) {
30539 
30540     /* "View.MemoryView":1260
30541  * cdef int _err(object error, char *msg) except -1 with gil:
30542  *     if msg != NULL:
30543  *         raise error(msg.decode('ascii'))             # <<<<<<<<<<<<<<
30544  *     else:
30545  *         raise error
30546  */
30547     __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, 1260, __pyx_L1_error)
30548     __Pyx_GOTREF(__pyx_t_3);
30549     __Pyx_INCREF(__pyx_v_error);
30550     __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
30551     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
30552       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
30553       if (likely(__pyx_t_5)) {
30554         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
30555         __Pyx_INCREF(__pyx_t_5);
30556         __Pyx_INCREF(function);
30557         __Pyx_DECREF_SET(__pyx_t_4, function);
30558       }
30559     }
30560     __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);
30561     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
30562     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
30563     if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1260, __pyx_L1_error)
30564     __Pyx_GOTREF(__pyx_t_2);
30565     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
30566     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
30567     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30568     __PYX_ERR(1, 1260, __pyx_L1_error)
30569 
30570     /* "View.MemoryView":1259
30571  * @cname('__pyx_memoryview_err')
30572  * cdef int _err(object error, char *msg) except -1 with gil:
30573  *     if msg != NULL:             # <<<<<<<<<<<<<<
30574  *         raise error(msg.decode('ascii'))
30575  *     else:
30576  */
30577   }
30578 
30579   /* "View.MemoryView":1262
30580  *         raise error(msg.decode('ascii'))
30581  *     else:
30582  *         raise error             # <<<<<<<<<<<<<<
30583  *
30584  * @cname('__pyx_memoryview_copy_contents')
30585  */
30586   /*else*/ {
30587     __Pyx_Raise(__pyx_v_error, 0, 0, 0);
30588     __PYX_ERR(1, 1262, __pyx_L1_error)
30589   }
30590 
30591   /* "View.MemoryView":1258
30592  *
30593  * @cname('__pyx_memoryview_err')
30594  * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
30595  *     if msg != NULL:
30596  *         raise error(msg.decode('ascii'))
30597  */
30598 
30599   /* function exit code */
30600   __pyx_L1_error:;
30601   __Pyx_XDECREF(__pyx_t_2);
30602   __Pyx_XDECREF(__pyx_t_3);
30603   __Pyx_XDECREF(__pyx_t_4);
30604   __Pyx_XDECREF(__pyx_t_5);
30605   __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
30606   __pyx_r = -1;
30607   __Pyx_XDECREF(__pyx_v_error);
30608   __Pyx_RefNannyFinishContext();
30609   #ifdef WITH_THREAD
30610   __Pyx_PyGILState_Release(__pyx_gilstate_save);
30611   #endif
30612   return __pyx_r;
30613 }
30614 
30615 /* "View.MemoryView":1265
30616  *
30617  * @cname('__pyx_memoryview_copy_contents')
30618  * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
30619  *                                   __Pyx_memviewslice dst,
30620  *                                   int src_ndim, int dst_ndim,
30621  */
30622 
__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)30623 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) {
30624   void *__pyx_v_tmpdata;
30625   size_t __pyx_v_itemsize;
30626   int __pyx_v_i;
30627   char __pyx_v_order;
30628   int __pyx_v_broadcasting;
30629   int __pyx_v_direct_copy;
30630   __Pyx_memviewslice __pyx_v_tmp;
30631   int __pyx_v_ndim;
30632   int __pyx_r;
30633   Py_ssize_t __pyx_t_1;
30634   int __pyx_t_2;
30635   int __pyx_t_3;
30636   int __pyx_t_4;
30637   int __pyx_t_5;
30638   int __pyx_t_6;
30639   void *__pyx_t_7;
30640   int __pyx_t_8;
30641 
30642   /* "View.MemoryView":1273
30643  *     Check for overlapping memory and verify the shapes.
30644  *     """
30645  *     cdef void *tmpdata = NULL             # <<<<<<<<<<<<<<
30646  *     cdef size_t itemsize = src.memview.view.itemsize
30647  *     cdef int i
30648  */
30649   __pyx_v_tmpdata = NULL;
30650 
30651   /* "View.MemoryView":1274
30652  *     """
30653  *     cdef void *tmpdata = NULL
30654  *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
30655  *     cdef int i
30656  *     cdef char order = get_best_order(&src, src_ndim)
30657  */
30658   __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
30659   __pyx_v_itemsize = __pyx_t_1;
30660 
30661   /* "View.MemoryView":1276
30662  *     cdef size_t itemsize = src.memview.view.itemsize
30663  *     cdef int i
30664  *     cdef char order = get_best_order(&src, src_ndim)             # <<<<<<<<<<<<<<
30665  *     cdef bint broadcasting = False
30666  *     cdef bint direct_copy = False
30667  */
30668   __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
30669 
30670   /* "View.MemoryView":1277
30671  *     cdef int i
30672  *     cdef char order = get_best_order(&src, src_ndim)
30673  *     cdef bint broadcasting = False             # <<<<<<<<<<<<<<
30674  *     cdef bint direct_copy = False
30675  *     cdef __Pyx_memviewslice tmp
30676  */
30677   __pyx_v_broadcasting = 0;
30678 
30679   /* "View.MemoryView":1278
30680  *     cdef char order = get_best_order(&src, src_ndim)
30681  *     cdef bint broadcasting = False
30682  *     cdef bint direct_copy = False             # <<<<<<<<<<<<<<
30683  *     cdef __Pyx_memviewslice tmp
30684  *
30685  */
30686   __pyx_v_direct_copy = 0;
30687 
30688   /* "View.MemoryView":1281
30689  *     cdef __Pyx_memviewslice tmp
30690  *
30691  *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
30692  *         broadcast_leading(&src, src_ndim, dst_ndim)
30693  *     elif dst_ndim < src_ndim:
30694  */
30695   __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
30696   if (__pyx_t_2) {
30697 
30698     /* "View.MemoryView":1282
30699  *
30700  *     if src_ndim < dst_ndim:
30701  *         broadcast_leading(&src, src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
30702  *     elif dst_ndim < src_ndim:
30703  *         broadcast_leading(&dst, dst_ndim, src_ndim)
30704  */
30705     __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
30706 
30707     /* "View.MemoryView":1281
30708  *     cdef __Pyx_memviewslice tmp
30709  *
30710  *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
30711  *         broadcast_leading(&src, src_ndim, dst_ndim)
30712  *     elif dst_ndim < src_ndim:
30713  */
30714     goto __pyx_L3;
30715   }
30716 
30717   /* "View.MemoryView":1283
30718  *     if src_ndim < dst_ndim:
30719  *         broadcast_leading(&src, src_ndim, dst_ndim)
30720  *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
30721  *         broadcast_leading(&dst, dst_ndim, src_ndim)
30722  *
30723  */
30724   __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
30725   if (__pyx_t_2) {
30726 
30727     /* "View.MemoryView":1284
30728  *         broadcast_leading(&src, src_ndim, dst_ndim)
30729  *     elif dst_ndim < src_ndim:
30730  *         broadcast_leading(&dst, dst_ndim, src_ndim)             # <<<<<<<<<<<<<<
30731  *
30732  *     cdef int ndim = max(src_ndim, dst_ndim)
30733  */
30734     __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
30735 
30736     /* "View.MemoryView":1283
30737  *     if src_ndim < dst_ndim:
30738  *         broadcast_leading(&src, src_ndim, dst_ndim)
30739  *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
30740  *         broadcast_leading(&dst, dst_ndim, src_ndim)
30741  *
30742  */
30743   }
30744   __pyx_L3:;
30745 
30746   /* "View.MemoryView":1286
30747  *         broadcast_leading(&dst, dst_ndim, src_ndim)
30748  *
30749  *     cdef int ndim = max(src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
30750  *
30751  *     for i in range(ndim):
30752  */
30753   __pyx_t_3 = __pyx_v_dst_ndim;
30754   __pyx_t_4 = __pyx_v_src_ndim;
30755   if (((__pyx_t_3 > __pyx_t_4) != 0)) {
30756     __pyx_t_5 = __pyx_t_3;
30757   } else {
30758     __pyx_t_5 = __pyx_t_4;
30759   }
30760   __pyx_v_ndim = __pyx_t_5;
30761 
30762   /* "View.MemoryView":1288
30763  *     cdef int ndim = max(src_ndim, dst_ndim)
30764  *
30765  *     for i in range(ndim):             # <<<<<<<<<<<<<<
30766  *         if src.shape[i] != dst.shape[i]:
30767  *             if src.shape[i] == 1:
30768  */
30769   __pyx_t_5 = __pyx_v_ndim;
30770   __pyx_t_3 = __pyx_t_5;
30771   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
30772     __pyx_v_i = __pyx_t_4;
30773 
30774     /* "View.MemoryView":1289
30775  *
30776  *     for i in range(ndim):
30777  *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
30778  *             if src.shape[i] == 1:
30779  *                 broadcasting = True
30780  */
30781     __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
30782     if (__pyx_t_2) {
30783 
30784       /* "View.MemoryView":1290
30785  *     for i in range(ndim):
30786  *         if src.shape[i] != dst.shape[i]:
30787  *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
30788  *                 broadcasting = True
30789  *                 src.strides[i] = 0
30790  */
30791       __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
30792       if (__pyx_t_2) {
30793 
30794         /* "View.MemoryView":1291
30795  *         if src.shape[i] != dst.shape[i]:
30796  *             if src.shape[i] == 1:
30797  *                 broadcasting = True             # <<<<<<<<<<<<<<
30798  *                 src.strides[i] = 0
30799  *             else:
30800  */
30801         __pyx_v_broadcasting = 1;
30802 
30803         /* "View.MemoryView":1292
30804  *             if src.shape[i] == 1:
30805  *                 broadcasting = True
30806  *                 src.strides[i] = 0             # <<<<<<<<<<<<<<
30807  *             else:
30808  *                 _err_extents(i, dst.shape[i], src.shape[i])
30809  */
30810         (__pyx_v_src.strides[__pyx_v_i]) = 0;
30811 
30812         /* "View.MemoryView":1290
30813  *     for i in range(ndim):
30814  *         if src.shape[i] != dst.shape[i]:
30815  *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
30816  *                 broadcasting = True
30817  *                 src.strides[i] = 0
30818  */
30819         goto __pyx_L7;
30820       }
30821 
30822       /* "View.MemoryView":1294
30823  *                 src.strides[i] = 0
30824  *             else:
30825  *                 _err_extents(i, dst.shape[i], src.shape[i])             # <<<<<<<<<<<<<<
30826  *
30827  *         if src.suboffsets[i] >= 0:
30828  */
30829       /*else*/ {
30830         __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, 1294, __pyx_L1_error)
30831       }
30832       __pyx_L7:;
30833 
30834       /* "View.MemoryView":1289
30835  *
30836  *     for i in range(ndim):
30837  *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
30838  *             if src.shape[i] == 1:
30839  *                 broadcasting = True
30840  */
30841     }
30842 
30843     /* "View.MemoryView":1296
30844  *                 _err_extents(i, dst.shape[i], src.shape[i])
30845  *
30846  *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
30847  *             _err_dim(ValueError, "Dimension %d is not direct", i)
30848  *
30849  */
30850     __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
30851     if (__pyx_t_2) {
30852 
30853       /* "View.MemoryView":1297
30854  *
30855  *         if src.suboffsets[i] >= 0:
30856  *             _err_dim(ValueError, "Dimension %d is not direct", i)             # <<<<<<<<<<<<<<
30857  *
30858  *     if slices_overlap(&src, &dst, ndim, itemsize):
30859  */
30860       __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, 1297, __pyx_L1_error)
30861 
30862       /* "View.MemoryView":1296
30863  *                 _err_extents(i, dst.shape[i], src.shape[i])
30864  *
30865  *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
30866  *             _err_dim(ValueError, "Dimension %d is not direct", i)
30867  *
30868  */
30869     }
30870   }
30871 
30872   /* "View.MemoryView":1299
30873  *             _err_dim(ValueError, "Dimension %d is not direct", i)
30874  *
30875  *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
30876  *
30877  *         if not slice_is_contig(src, order, ndim):
30878  */
30879   __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
30880   if (__pyx_t_2) {
30881 
30882     /* "View.MemoryView":1301
30883  *     if slices_overlap(&src, &dst, ndim, itemsize):
30884  *
30885  *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
30886  *             order = get_best_order(&dst, ndim)
30887  *
30888  */
30889     __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
30890     if (__pyx_t_2) {
30891 
30892       /* "View.MemoryView":1302
30893  *
30894  *         if not slice_is_contig(src, order, ndim):
30895  *             order = get_best_order(&dst, ndim)             # <<<<<<<<<<<<<<
30896  *
30897  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
30898  */
30899       __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
30900 
30901       /* "View.MemoryView":1301
30902  *     if slices_overlap(&src, &dst, ndim, itemsize):
30903  *
30904  *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
30905  *             order = get_best_order(&dst, ndim)
30906  *
30907  */
30908     }
30909 
30910     /* "View.MemoryView":1304
30911  *             order = get_best_order(&dst, ndim)
30912  *
30913  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)             # <<<<<<<<<<<<<<
30914  *         src = tmp
30915  *
30916  */
30917     __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, 1304, __pyx_L1_error)
30918     __pyx_v_tmpdata = __pyx_t_7;
30919 
30920     /* "View.MemoryView":1305
30921  *
30922  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
30923  *         src = tmp             # <<<<<<<<<<<<<<
30924  *
30925  *     if not broadcasting:
30926  */
30927     __pyx_v_src = __pyx_v_tmp;
30928 
30929     /* "View.MemoryView":1299
30930  *             _err_dim(ValueError, "Dimension %d is not direct", i)
30931  *
30932  *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
30933  *
30934  *         if not slice_is_contig(src, order, ndim):
30935  */
30936   }
30937 
30938   /* "View.MemoryView":1307
30939  *         src = tmp
30940  *
30941  *     if not broadcasting:             # <<<<<<<<<<<<<<
30942  *
30943  *
30944  */
30945   __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
30946   if (__pyx_t_2) {
30947 
30948     /* "View.MemoryView":1310
30949  *
30950  *
30951  *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
30952  *             direct_copy = slice_is_contig(dst, 'C', ndim)
30953  *         elif slice_is_contig(src, 'F', ndim):
30954  */
30955     __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
30956     if (__pyx_t_2) {
30957 
30958       /* "View.MemoryView":1311
30959  *
30960  *         if slice_is_contig(src, 'C', ndim):
30961  *             direct_copy = slice_is_contig(dst, 'C', ndim)             # <<<<<<<<<<<<<<
30962  *         elif slice_is_contig(src, 'F', ndim):
30963  *             direct_copy = slice_is_contig(dst, 'F', ndim)
30964  */
30965       __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
30966 
30967       /* "View.MemoryView":1310
30968  *
30969  *
30970  *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
30971  *             direct_copy = slice_is_contig(dst, 'C', ndim)
30972  *         elif slice_is_contig(src, 'F', ndim):
30973  */
30974       goto __pyx_L12;
30975     }
30976 
30977     /* "View.MemoryView":1312
30978  *         if slice_is_contig(src, 'C', ndim):
30979  *             direct_copy = slice_is_contig(dst, 'C', ndim)
30980  *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
30981  *             direct_copy = slice_is_contig(dst, 'F', ndim)
30982  *
30983  */
30984     __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
30985     if (__pyx_t_2) {
30986 
30987       /* "View.MemoryView":1313
30988  *             direct_copy = slice_is_contig(dst, 'C', ndim)
30989  *         elif slice_is_contig(src, 'F', ndim):
30990  *             direct_copy = slice_is_contig(dst, 'F', ndim)             # <<<<<<<<<<<<<<
30991  *
30992  *         if direct_copy:
30993  */
30994       __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
30995 
30996       /* "View.MemoryView":1312
30997  *         if slice_is_contig(src, 'C', ndim):
30998  *             direct_copy = slice_is_contig(dst, 'C', ndim)
30999  *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
31000  *             direct_copy = slice_is_contig(dst, 'F', ndim)
31001  *
31002  */
31003     }
31004     __pyx_L12:;
31005 
31006     /* "View.MemoryView":1315
31007  *             direct_copy = slice_is_contig(dst, 'F', ndim)
31008  *
31009  *         if direct_copy:             # <<<<<<<<<<<<<<
31010  *
31011  *             refcount_copying(&dst, dtype_is_object, ndim, False)
31012  */
31013     __pyx_t_2 = (__pyx_v_direct_copy != 0);
31014     if (__pyx_t_2) {
31015 
31016       /* "View.MemoryView":1317
31017  *         if direct_copy:
31018  *
31019  *             refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
31020  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
31021  *             refcount_copying(&dst, dtype_is_object, ndim, True)
31022  */
31023       __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
31024 
31025       /* "View.MemoryView":1318
31026  *
31027  *             refcount_copying(&dst, dtype_is_object, ndim, False)
31028  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))             # <<<<<<<<<<<<<<
31029  *             refcount_copying(&dst, dtype_is_object, ndim, True)
31030  *             free(tmpdata)
31031  */
31032       (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
31033 
31034       /* "View.MemoryView":1319
31035  *             refcount_copying(&dst, dtype_is_object, ndim, False)
31036  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
31037  *             refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
31038  *             free(tmpdata)
31039  *             return 0
31040  */
31041       __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
31042 
31043       /* "View.MemoryView":1320
31044  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
31045  *             refcount_copying(&dst, dtype_is_object, ndim, True)
31046  *             free(tmpdata)             # <<<<<<<<<<<<<<
31047  *             return 0
31048  *
31049  */
31050       free(__pyx_v_tmpdata);
31051 
31052       /* "View.MemoryView":1321
31053  *             refcount_copying(&dst, dtype_is_object, ndim, True)
31054  *             free(tmpdata)
31055  *             return 0             # <<<<<<<<<<<<<<
31056  *
31057  *     if order == 'F' == get_best_order(&dst, ndim):
31058  */
31059       __pyx_r = 0;
31060       goto __pyx_L0;
31061 
31062       /* "View.MemoryView":1315
31063  *             direct_copy = slice_is_contig(dst, 'F', ndim)
31064  *
31065  *         if direct_copy:             # <<<<<<<<<<<<<<
31066  *
31067  *             refcount_copying(&dst, dtype_is_object, ndim, False)
31068  */
31069     }
31070 
31071     /* "View.MemoryView":1307
31072  *         src = tmp
31073  *
31074  *     if not broadcasting:             # <<<<<<<<<<<<<<
31075  *
31076  *
31077  */
31078   }
31079 
31080   /* "View.MemoryView":1323
31081  *             return 0
31082  *
31083  *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
31084  *
31085  *
31086  */
31087   __pyx_t_2 = (__pyx_v_order == 'F');
31088   if (__pyx_t_2) {
31089     __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
31090   }
31091   __pyx_t_8 = (__pyx_t_2 != 0);
31092   if (__pyx_t_8) {
31093 
31094     /* "View.MemoryView":1326
31095  *
31096  *
31097  *         transpose_memslice(&src)             # <<<<<<<<<<<<<<
31098  *         transpose_memslice(&dst)
31099  *
31100  */
31101     __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1326, __pyx_L1_error)
31102 
31103     /* "View.MemoryView":1327
31104  *
31105  *         transpose_memslice(&src)
31106  *         transpose_memslice(&dst)             # <<<<<<<<<<<<<<
31107  *
31108  *     refcount_copying(&dst, dtype_is_object, ndim, False)
31109  */
31110     __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1327, __pyx_L1_error)
31111 
31112     /* "View.MemoryView":1323
31113  *             return 0
31114  *
31115  *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
31116  *
31117  *
31118  */
31119   }
31120 
31121   /* "View.MemoryView":1329
31122  *         transpose_memslice(&dst)
31123  *
31124  *     refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
31125  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
31126  *     refcount_copying(&dst, dtype_is_object, ndim, True)
31127  */
31128   __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
31129 
31130   /* "View.MemoryView":1330
31131  *
31132  *     refcount_copying(&dst, dtype_is_object, ndim, False)
31133  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)             # <<<<<<<<<<<<<<
31134  *     refcount_copying(&dst, dtype_is_object, ndim, True)
31135  *
31136  */
31137   copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
31138 
31139   /* "View.MemoryView":1331
31140  *     refcount_copying(&dst, dtype_is_object, ndim, False)
31141  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
31142  *     refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
31143  *
31144  *     free(tmpdata)
31145  */
31146   __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
31147 
31148   /* "View.MemoryView":1333
31149  *     refcount_copying(&dst, dtype_is_object, ndim, True)
31150  *
31151  *     free(tmpdata)             # <<<<<<<<<<<<<<
31152  *     return 0
31153  *
31154  */
31155   free(__pyx_v_tmpdata);
31156 
31157   /* "View.MemoryView":1334
31158  *
31159  *     free(tmpdata)
31160  *     return 0             # <<<<<<<<<<<<<<
31161  *
31162  * @cname('__pyx_memoryview_broadcast_leading')
31163  */
31164   __pyx_r = 0;
31165   goto __pyx_L0;
31166 
31167   /* "View.MemoryView":1265
31168  *
31169  * @cname('__pyx_memoryview_copy_contents')
31170  * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
31171  *                                   __Pyx_memviewslice dst,
31172  *                                   int src_ndim, int dst_ndim,
31173  */
31174 
31175   /* function exit code */
31176   __pyx_L1_error:;
31177   {
31178     #ifdef WITH_THREAD
31179     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
31180     #endif
31181     __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
31182     #ifdef WITH_THREAD
31183     __Pyx_PyGILState_Release(__pyx_gilstate_save);
31184     #endif
31185   }
31186   __pyx_r = -1;
31187   __pyx_L0:;
31188   return __pyx_r;
31189 }
31190 
31191 /* "View.MemoryView":1337
31192  *
31193  * @cname('__pyx_memoryview_broadcast_leading')
31194  * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
31195  *                             int ndim,
31196  *                             int ndim_other) nogil:
31197  */
31198 
__pyx_memoryview_broadcast_leading(__Pyx_memviewslice * __pyx_v_mslice,int __pyx_v_ndim,int __pyx_v_ndim_other)31199 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
31200   int __pyx_v_i;
31201   int __pyx_v_offset;
31202   int __pyx_t_1;
31203   int __pyx_t_2;
31204   int __pyx_t_3;
31205 
31206   /* "View.MemoryView":1341
31207  *                             int ndim_other) nogil:
31208  *     cdef int i
31209  *     cdef int offset = ndim_other - ndim             # <<<<<<<<<<<<<<
31210  *
31211  *     for i in range(ndim - 1, -1, -1):
31212  */
31213   __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
31214 
31215   /* "View.MemoryView":1343
31216  *     cdef int offset = ndim_other - ndim
31217  *
31218  *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
31219  *         mslice.shape[i + offset] = mslice.shape[i]
31220  *         mslice.strides[i + offset] = mslice.strides[i]
31221  */
31222   for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
31223     __pyx_v_i = __pyx_t_1;
31224 
31225     /* "View.MemoryView":1344
31226  *
31227  *     for i in range(ndim - 1, -1, -1):
31228  *         mslice.shape[i + offset] = mslice.shape[i]             # <<<<<<<<<<<<<<
31229  *         mslice.strides[i + offset] = mslice.strides[i]
31230  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
31231  */
31232     (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
31233 
31234     /* "View.MemoryView":1345
31235  *     for i in range(ndim - 1, -1, -1):
31236  *         mslice.shape[i + offset] = mslice.shape[i]
31237  *         mslice.strides[i + offset] = mslice.strides[i]             # <<<<<<<<<<<<<<
31238  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
31239  *
31240  */
31241     (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
31242 
31243     /* "View.MemoryView":1346
31244  *         mslice.shape[i + offset] = mslice.shape[i]
31245  *         mslice.strides[i + offset] = mslice.strides[i]
31246  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]             # <<<<<<<<<<<<<<
31247  *
31248  *     for i in range(offset):
31249  */
31250     (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
31251   }
31252 
31253   /* "View.MemoryView":1348
31254  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
31255  *
31256  *     for i in range(offset):             # <<<<<<<<<<<<<<
31257  *         mslice.shape[i] = 1
31258  *         mslice.strides[i] = mslice.strides[0]
31259  */
31260   __pyx_t_1 = __pyx_v_offset;
31261   __pyx_t_2 = __pyx_t_1;
31262   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
31263     __pyx_v_i = __pyx_t_3;
31264 
31265     /* "View.MemoryView":1349
31266  *
31267  *     for i in range(offset):
31268  *         mslice.shape[i] = 1             # <<<<<<<<<<<<<<
31269  *         mslice.strides[i] = mslice.strides[0]
31270  *         mslice.suboffsets[i] = -1
31271  */
31272     (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
31273 
31274     /* "View.MemoryView":1350
31275  *     for i in range(offset):
31276  *         mslice.shape[i] = 1
31277  *         mslice.strides[i] = mslice.strides[0]             # <<<<<<<<<<<<<<
31278  *         mslice.suboffsets[i] = -1
31279  *
31280  */
31281     (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
31282 
31283     /* "View.MemoryView":1351
31284  *         mslice.shape[i] = 1
31285  *         mslice.strides[i] = mslice.strides[0]
31286  *         mslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
31287  *
31288  *
31289  */
31290     (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
31291   }
31292 
31293   /* "View.MemoryView":1337
31294  *
31295  * @cname('__pyx_memoryview_broadcast_leading')
31296  * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
31297  *                             int ndim,
31298  *                             int ndim_other) nogil:
31299  */
31300 
31301   /* function exit code */
31302 }
31303 
31304 /* "View.MemoryView":1359
31305  *
31306  * @cname('__pyx_memoryview_refcount_copying')
31307  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
31308  *                            int ndim, bint inc) nogil:
31309  *
31310  */
31311 
__pyx_memoryview_refcount_copying(__Pyx_memviewslice * __pyx_v_dst,int __pyx_v_dtype_is_object,int __pyx_v_ndim,int __pyx_v_inc)31312 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) {
31313   int __pyx_t_1;
31314 
31315   /* "View.MemoryView":1363
31316  *
31317  *
31318  *     if dtype_is_object:             # <<<<<<<<<<<<<<
31319  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
31320  *                                            dst.strides, ndim, inc)
31321  */
31322   __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
31323   if (__pyx_t_1) {
31324 
31325     /* "View.MemoryView":1364
31326  *
31327  *     if dtype_is_object:
31328  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,             # <<<<<<<<<<<<<<
31329  *                                            dst.strides, ndim, inc)
31330  *
31331  */
31332     __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);
31333 
31334     /* "View.MemoryView":1363
31335  *
31336  *
31337  *     if dtype_is_object:             # <<<<<<<<<<<<<<
31338  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
31339  *                                            dst.strides, ndim, inc)
31340  */
31341   }
31342 
31343   /* "View.MemoryView":1359
31344  *
31345  * @cname('__pyx_memoryview_refcount_copying')
31346  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
31347  *                            int ndim, bint inc) nogil:
31348  *
31349  */
31350 
31351   /* function exit code */
31352 }
31353 
31354 /* "View.MemoryView":1368
31355  *
31356  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
31357  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
31358  *                                              Py_ssize_t *strides, int ndim,
31359  *                                              bint inc) with gil:
31360  */
31361 
__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)31362 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) {
31363   __Pyx_RefNannyDeclarations
31364   #ifdef WITH_THREAD
31365   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
31366   #endif
31367   __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
31368 
31369   /* "View.MemoryView":1371
31370  *                                              Py_ssize_t *strides, int ndim,
31371  *                                              bint inc) with gil:
31372  *     refcount_objects_in_slice(data, shape, strides, ndim, inc)             # <<<<<<<<<<<<<<
31373  *
31374  * @cname('__pyx_memoryview_refcount_objects_in_slice')
31375  */
31376   __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
31377 
31378   /* "View.MemoryView":1368
31379  *
31380  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
31381  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
31382  *                                              Py_ssize_t *strides, int ndim,
31383  *                                              bint inc) with gil:
31384  */
31385 
31386   /* function exit code */
31387   __Pyx_RefNannyFinishContext();
31388   #ifdef WITH_THREAD
31389   __Pyx_PyGILState_Release(__pyx_gilstate_save);
31390   #endif
31391 }
31392 
31393 /* "View.MemoryView":1374
31394  *
31395  * @cname('__pyx_memoryview_refcount_objects_in_slice')
31396  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
31397  *                                     Py_ssize_t *strides, int ndim, bint inc):
31398  *     cdef Py_ssize_t i
31399  */
31400 
__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)31401 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) {
31402   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
31403   __Pyx_RefNannyDeclarations
31404   Py_ssize_t __pyx_t_1;
31405   Py_ssize_t __pyx_t_2;
31406   Py_ssize_t __pyx_t_3;
31407   int __pyx_t_4;
31408   __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
31409 
31410   /* "View.MemoryView":1378
31411  *     cdef Py_ssize_t i
31412  *
31413  *     for i in range(shape[0]):             # <<<<<<<<<<<<<<
31414  *         if ndim == 1:
31415  *             if inc:
31416  */
31417   __pyx_t_1 = (__pyx_v_shape[0]);
31418   __pyx_t_2 = __pyx_t_1;
31419   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
31420     __pyx_v_i = __pyx_t_3;
31421 
31422     /* "View.MemoryView":1379
31423  *
31424  *     for i in range(shape[0]):
31425  *         if ndim == 1:             # <<<<<<<<<<<<<<
31426  *             if inc:
31427  *                 Py_INCREF((<PyObject **> data)[0])
31428  */
31429     __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
31430     if (__pyx_t_4) {
31431 
31432       /* "View.MemoryView":1380
31433  *     for i in range(shape[0]):
31434  *         if ndim == 1:
31435  *             if inc:             # <<<<<<<<<<<<<<
31436  *                 Py_INCREF((<PyObject **> data)[0])
31437  *             else:
31438  */
31439       __pyx_t_4 = (__pyx_v_inc != 0);
31440       if (__pyx_t_4) {
31441 
31442         /* "View.MemoryView":1381
31443  *         if ndim == 1:
31444  *             if inc:
31445  *                 Py_INCREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
31446  *             else:
31447  *                 Py_DECREF((<PyObject **> data)[0])
31448  */
31449         Py_INCREF((((PyObject **)__pyx_v_data)[0]));
31450 
31451         /* "View.MemoryView":1380
31452  *     for i in range(shape[0]):
31453  *         if ndim == 1:
31454  *             if inc:             # <<<<<<<<<<<<<<
31455  *                 Py_INCREF((<PyObject **> data)[0])
31456  *             else:
31457  */
31458         goto __pyx_L6;
31459       }
31460 
31461       /* "View.MemoryView":1383
31462  *                 Py_INCREF((<PyObject **> data)[0])
31463  *             else:
31464  *                 Py_DECREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
31465  *         else:
31466  *             refcount_objects_in_slice(data, shape + 1, strides + 1,
31467  */
31468       /*else*/ {
31469         Py_DECREF((((PyObject **)__pyx_v_data)[0]));
31470       }
31471       __pyx_L6:;
31472 
31473       /* "View.MemoryView":1379
31474  *
31475  *     for i in range(shape[0]):
31476  *         if ndim == 1:             # <<<<<<<<<<<<<<
31477  *             if inc:
31478  *                 Py_INCREF((<PyObject **> data)[0])
31479  */
31480       goto __pyx_L5;
31481     }
31482 
31483     /* "View.MemoryView":1385
31484  *                 Py_DECREF((<PyObject **> data)[0])
31485  *         else:
31486  *             refcount_objects_in_slice(data, shape + 1, strides + 1,             # <<<<<<<<<<<<<<
31487  *                                       ndim - 1, inc)
31488  *
31489  */
31490     /*else*/ {
31491 
31492       /* "View.MemoryView":1386
31493  *         else:
31494  *             refcount_objects_in_slice(data, shape + 1, strides + 1,
31495  *                                       ndim - 1, inc)             # <<<<<<<<<<<<<<
31496  *
31497  *         data += strides[0]
31498  */
31499       __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
31500     }
31501     __pyx_L5:;
31502 
31503     /* "View.MemoryView":1388
31504  *                                       ndim - 1, inc)
31505  *
31506  *         data += strides[0]             # <<<<<<<<<<<<<<
31507  *
31508  *
31509  */
31510     __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
31511   }
31512 
31513   /* "View.MemoryView":1374
31514  *
31515  * @cname('__pyx_memoryview_refcount_objects_in_slice')
31516  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
31517  *                                     Py_ssize_t *strides, int ndim, bint inc):
31518  *     cdef Py_ssize_t i
31519  */
31520 
31521   /* function exit code */
31522   __Pyx_RefNannyFinishContext();
31523 }
31524 
31525 /* "View.MemoryView":1394
31526  *
31527  * @cname('__pyx_memoryview_slice_assign_scalar')
31528  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
31529  *                               size_t itemsize, void *item,
31530  *                               bint dtype_is_object) nogil:
31531  */
31532 
__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)31533 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) {
31534 
31535   /* "View.MemoryView":1397
31536  *                               size_t itemsize, void *item,
31537  *                               bint dtype_is_object) nogil:
31538  *     refcount_copying(dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
31539  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
31540  *                          itemsize, item)
31541  */
31542   __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
31543 
31544   /* "View.MemoryView":1398
31545  *                               bint dtype_is_object) nogil:
31546  *     refcount_copying(dst, dtype_is_object, ndim, False)
31547  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,             # <<<<<<<<<<<<<<
31548  *                          itemsize, item)
31549  *     refcount_copying(dst, dtype_is_object, ndim, True)
31550  */
31551   __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);
31552 
31553   /* "View.MemoryView":1400
31554  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
31555  *                          itemsize, item)
31556  *     refcount_copying(dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
31557  *
31558  *
31559  */
31560   __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
31561 
31562   /* "View.MemoryView":1394
31563  *
31564  * @cname('__pyx_memoryview_slice_assign_scalar')
31565  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
31566  *                               size_t itemsize, void *item,
31567  *                               bint dtype_is_object) nogil:
31568  */
31569 
31570   /* function exit code */
31571 }
31572 
31573 /* "View.MemoryView":1404
31574  *
31575  * @cname('__pyx_memoryview__slice_assign_scalar')
31576  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
31577  *                               Py_ssize_t *strides, int ndim,
31578  *                               size_t itemsize, void *item) nogil:
31579  */
31580 
__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)31581 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) {
31582   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
31583   Py_ssize_t __pyx_v_stride;
31584   Py_ssize_t __pyx_v_extent;
31585   int __pyx_t_1;
31586   Py_ssize_t __pyx_t_2;
31587   Py_ssize_t __pyx_t_3;
31588   Py_ssize_t __pyx_t_4;
31589 
31590   /* "View.MemoryView":1408
31591  *                               size_t itemsize, void *item) nogil:
31592  *     cdef Py_ssize_t i
31593  *     cdef Py_ssize_t stride = strides[0]             # <<<<<<<<<<<<<<
31594  *     cdef Py_ssize_t extent = shape[0]
31595  *
31596  */
31597   __pyx_v_stride = (__pyx_v_strides[0]);
31598 
31599   /* "View.MemoryView":1409
31600  *     cdef Py_ssize_t i
31601  *     cdef Py_ssize_t stride = strides[0]
31602  *     cdef Py_ssize_t extent = shape[0]             # <<<<<<<<<<<<<<
31603  *
31604  *     if ndim == 1:
31605  */
31606   __pyx_v_extent = (__pyx_v_shape[0]);
31607 
31608   /* "View.MemoryView":1411
31609  *     cdef Py_ssize_t extent = shape[0]
31610  *
31611  *     if ndim == 1:             # <<<<<<<<<<<<<<
31612  *         for i in range(extent):
31613  *             memcpy(data, item, itemsize)
31614  */
31615   __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
31616   if (__pyx_t_1) {
31617 
31618     /* "View.MemoryView":1412
31619  *
31620  *     if ndim == 1:
31621  *         for i in range(extent):             # <<<<<<<<<<<<<<
31622  *             memcpy(data, item, itemsize)
31623  *             data += stride
31624  */
31625     __pyx_t_2 = __pyx_v_extent;
31626     __pyx_t_3 = __pyx_t_2;
31627     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
31628       __pyx_v_i = __pyx_t_4;
31629 
31630       /* "View.MemoryView":1413
31631  *     if ndim == 1:
31632  *         for i in range(extent):
31633  *             memcpy(data, item, itemsize)             # <<<<<<<<<<<<<<
31634  *             data += stride
31635  *     else:
31636  */
31637       (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
31638 
31639       /* "View.MemoryView":1414
31640  *         for i in range(extent):
31641  *             memcpy(data, item, itemsize)
31642  *             data += stride             # <<<<<<<<<<<<<<
31643  *     else:
31644  *         for i in range(extent):
31645  */
31646       __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
31647     }
31648 
31649     /* "View.MemoryView":1411
31650  *     cdef Py_ssize_t extent = shape[0]
31651  *
31652  *     if ndim == 1:             # <<<<<<<<<<<<<<
31653  *         for i in range(extent):
31654  *             memcpy(data, item, itemsize)
31655  */
31656     goto __pyx_L3;
31657   }
31658 
31659   /* "View.MemoryView":1416
31660  *             data += stride
31661  *     else:
31662  *         for i in range(extent):             # <<<<<<<<<<<<<<
31663  *             _slice_assign_scalar(data, shape + 1, strides + 1,
31664  *                                 ndim - 1, itemsize, item)
31665  */
31666   /*else*/ {
31667     __pyx_t_2 = __pyx_v_extent;
31668     __pyx_t_3 = __pyx_t_2;
31669     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
31670       __pyx_v_i = __pyx_t_4;
31671 
31672       /* "View.MemoryView":1417
31673  *     else:
31674  *         for i in range(extent):
31675  *             _slice_assign_scalar(data, shape + 1, strides + 1,             # <<<<<<<<<<<<<<
31676  *                                 ndim - 1, itemsize, item)
31677  *             data += stride
31678  */
31679       __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);
31680 
31681       /* "View.MemoryView":1419
31682  *             _slice_assign_scalar(data, shape + 1, strides + 1,
31683  *                                 ndim - 1, itemsize, item)
31684  *             data += stride             # <<<<<<<<<<<<<<
31685  *
31686  *
31687  */
31688       __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
31689     }
31690   }
31691   __pyx_L3:;
31692 
31693   /* "View.MemoryView":1404
31694  *
31695  * @cname('__pyx_memoryview__slice_assign_scalar')
31696  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
31697  *                               Py_ssize_t *strides, int ndim,
31698  *                               size_t itemsize, void *item) nogil:
31699  */
31700 
31701   /* function exit code */
31702 }
31703 
31704 /* "(tree fragment)":1
31705  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
31706  *     cdef object __pyx_PickleError
31707  *     cdef object __pyx_result
31708  */
31709 
31710 /* Python wrapper */
31711 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
31712 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)31713 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
31714   PyObject *__pyx_v___pyx_type = 0;
31715   long __pyx_v___pyx_checksum;
31716   PyObject *__pyx_v___pyx_state = 0;
31717   PyObject *__pyx_r = 0;
31718   __Pyx_RefNannyDeclarations
31719   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
31720   {
31721     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
31722     PyObject* values[3] = {0,0,0};
31723     if (unlikely(__pyx_kwds)) {
31724       Py_ssize_t kw_args;
31725       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
31726       switch (pos_args) {
31727         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
31728         CYTHON_FALLTHROUGH;
31729         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
31730         CYTHON_FALLTHROUGH;
31731         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
31732         CYTHON_FALLTHROUGH;
31733         case  0: break;
31734         default: goto __pyx_L5_argtuple_error;
31735       }
31736       kw_args = PyDict_Size(__pyx_kwds);
31737       switch (pos_args) {
31738         case  0:
31739         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
31740         else goto __pyx_L5_argtuple_error;
31741         CYTHON_FALLTHROUGH;
31742         case  1:
31743         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
31744         else {
31745           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
31746         }
31747         CYTHON_FALLTHROUGH;
31748         case  2:
31749         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
31750         else {
31751           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
31752         }
31753       }
31754       if (unlikely(kw_args > 0)) {
31755         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
31756       }
31757     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
31758       goto __pyx_L5_argtuple_error;
31759     } else {
31760       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
31761       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
31762       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
31763     }
31764     __pyx_v___pyx_type = values[0];
31765     __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)
31766     __pyx_v___pyx_state = values[2];
31767   }
31768   goto __pyx_L4_argument_unpacking_done;
31769   __pyx_L5_argtuple_error:;
31770   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
31771   __pyx_L3_error:;
31772   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
31773   __Pyx_RefNannyFinishContext();
31774   return NULL;
31775   __pyx_L4_argument_unpacking_done:;
31776   __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
31777 
31778   /* function exit code */
31779   __Pyx_RefNannyFinishContext();
31780   return __pyx_r;
31781 }
31782 
__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)31783 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) {
31784   PyObject *__pyx_v___pyx_PickleError = 0;
31785   PyObject *__pyx_v___pyx_result = 0;
31786   PyObject *__pyx_r = NULL;
31787   __Pyx_RefNannyDeclarations
31788   int __pyx_t_1;
31789   PyObject *__pyx_t_2 = NULL;
31790   PyObject *__pyx_t_3 = NULL;
31791   PyObject *__pyx_t_4 = NULL;
31792   PyObject *__pyx_t_5 = NULL;
31793   int __pyx_t_6;
31794   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
31795 
31796   /* "(tree fragment)":4
31797  *     cdef object __pyx_PickleError
31798  *     cdef object __pyx_result
31799  *     if __pyx_checksum != 0xb068931:             # <<<<<<<<<<<<<<
31800  *         from pickle import PickleError as __pyx_PickleError
31801  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
31802  */
31803   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
31804   if (__pyx_t_1) {
31805 
31806     /* "(tree fragment)":5
31807  *     cdef object __pyx_result
31808  *     if __pyx_checksum != 0xb068931:
31809  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
31810  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
31811  *     __pyx_result = Enum.__new__(__pyx_type)
31812  */
31813     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
31814     __Pyx_GOTREF(__pyx_t_2);
31815     __Pyx_INCREF(__pyx_n_s_PickleError);
31816     __Pyx_GIVEREF(__pyx_n_s_PickleError);
31817     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
31818     __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)
31819     __Pyx_GOTREF(__pyx_t_3);
31820     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
31821     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
31822     __Pyx_GOTREF(__pyx_t_2);
31823     __Pyx_INCREF(__pyx_t_2);
31824     __pyx_v___pyx_PickleError = __pyx_t_2;
31825     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
31826     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
31827 
31828     /* "(tree fragment)":6
31829  *     if __pyx_checksum != 0xb068931:
31830  *         from pickle import PickleError as __pyx_PickleError
31831  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)             # <<<<<<<<<<<<<<
31832  *     __pyx_result = Enum.__new__(__pyx_type)
31833  *     if __pyx_state is not None:
31834  */
31835     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
31836     __Pyx_GOTREF(__pyx_t_2);
31837     __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)
31838     __Pyx_GOTREF(__pyx_t_4);
31839     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
31840     __Pyx_INCREF(__pyx_v___pyx_PickleError);
31841     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
31842     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
31843       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
31844       if (likely(__pyx_t_5)) {
31845         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
31846         __Pyx_INCREF(__pyx_t_5);
31847         __Pyx_INCREF(function);
31848         __Pyx_DECREF_SET(__pyx_t_2, function);
31849       }
31850     }
31851     __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);
31852     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
31853     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
31854     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
31855     __Pyx_GOTREF(__pyx_t_3);
31856     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
31857     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
31858     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
31859     __PYX_ERR(1, 6, __pyx_L1_error)
31860 
31861     /* "(tree fragment)":4
31862  *     cdef object __pyx_PickleError
31863  *     cdef object __pyx_result
31864  *     if __pyx_checksum != 0xb068931:             # <<<<<<<<<<<<<<
31865  *         from pickle import PickleError as __pyx_PickleError
31866  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
31867  */
31868   }
31869 
31870   /* "(tree fragment)":7
31871  *         from pickle import PickleError as __pyx_PickleError
31872  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
31873  *     __pyx_result = Enum.__new__(__pyx_type)             # <<<<<<<<<<<<<<
31874  *     if __pyx_state is not None:
31875  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
31876  */
31877   __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)
31878   __Pyx_GOTREF(__pyx_t_2);
31879   __pyx_t_4 = NULL;
31880   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
31881     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
31882     if (likely(__pyx_t_4)) {
31883       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
31884       __Pyx_INCREF(__pyx_t_4);
31885       __Pyx_INCREF(function);
31886       __Pyx_DECREF_SET(__pyx_t_2, function);
31887     }
31888   }
31889   __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);
31890   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
31891   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
31892   __Pyx_GOTREF(__pyx_t_3);
31893   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
31894   __pyx_v___pyx_result = __pyx_t_3;
31895   __pyx_t_3 = 0;
31896 
31897   /* "(tree fragment)":8
31898  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
31899  *     __pyx_result = Enum.__new__(__pyx_type)
31900  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
31901  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
31902  *     return __pyx_result
31903  */
31904   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
31905   __pyx_t_6 = (__pyx_t_1 != 0);
31906   if (__pyx_t_6) {
31907 
31908     /* "(tree fragment)":9
31909  *     __pyx_result = Enum.__new__(__pyx_type)
31910  *     if __pyx_state is not None:
31911  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
31912  *     return __pyx_result
31913  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
31914  */
31915     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)
31916     __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)
31917     __Pyx_GOTREF(__pyx_t_3);
31918     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
31919 
31920     /* "(tree fragment)":8
31921  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
31922  *     __pyx_result = Enum.__new__(__pyx_type)
31923  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
31924  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
31925  *     return __pyx_result
31926  */
31927   }
31928 
31929   /* "(tree fragment)":10
31930  *     if __pyx_state is not None:
31931  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
31932  *     return __pyx_result             # <<<<<<<<<<<<<<
31933  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
31934  *     __pyx_result.name = __pyx_state[0]
31935  */
31936   __Pyx_XDECREF(__pyx_r);
31937   __Pyx_INCREF(__pyx_v___pyx_result);
31938   __pyx_r = __pyx_v___pyx_result;
31939   goto __pyx_L0;
31940 
31941   /* "(tree fragment)":1
31942  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
31943  *     cdef object __pyx_PickleError
31944  *     cdef object __pyx_result
31945  */
31946 
31947   /* function exit code */
31948   __pyx_L1_error:;
31949   __Pyx_XDECREF(__pyx_t_2);
31950   __Pyx_XDECREF(__pyx_t_3);
31951   __Pyx_XDECREF(__pyx_t_4);
31952   __Pyx_XDECREF(__pyx_t_5);
31953   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
31954   __pyx_r = NULL;
31955   __pyx_L0:;
31956   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
31957   __Pyx_XDECREF(__pyx_v___pyx_result);
31958   __Pyx_XGIVEREF(__pyx_r);
31959   __Pyx_RefNannyFinishContext();
31960   return __pyx_r;
31961 }
31962 
31963 /* "(tree fragment)":11
31964  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
31965  *     return __pyx_result
31966  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
31967  *     __pyx_result.name = __pyx_state[0]
31968  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
31969  */
31970 
__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)31971 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
31972   PyObject *__pyx_r = NULL;
31973   __Pyx_RefNannyDeclarations
31974   PyObject *__pyx_t_1 = NULL;
31975   int __pyx_t_2;
31976   Py_ssize_t __pyx_t_3;
31977   int __pyx_t_4;
31978   int __pyx_t_5;
31979   PyObject *__pyx_t_6 = NULL;
31980   PyObject *__pyx_t_7 = NULL;
31981   PyObject *__pyx_t_8 = NULL;
31982   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
31983 
31984   /* "(tree fragment)":12
31985  *     return __pyx_result
31986  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
31987  *     __pyx_result.name = __pyx_state[0]             # <<<<<<<<<<<<<<
31988  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
31989  *         __pyx_result.__dict__.update(__pyx_state[1])
31990  */
31991   if (unlikely(__pyx_v___pyx_state == Py_None)) {
31992     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
31993     __PYX_ERR(1, 12, __pyx_L1_error)
31994   }
31995   __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)
31996   __Pyx_GOTREF(__pyx_t_1);
31997   __Pyx_GIVEREF(__pyx_t_1);
31998   __Pyx_GOTREF(__pyx_v___pyx_result->name);
31999   __Pyx_DECREF(__pyx_v___pyx_result->name);
32000   __pyx_v___pyx_result->name = __pyx_t_1;
32001   __pyx_t_1 = 0;
32002 
32003   /* "(tree fragment)":13
32004  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
32005  *     __pyx_result.name = __pyx_state[0]
32006  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
32007  *         __pyx_result.__dict__.update(__pyx_state[1])
32008  */
32009   if (unlikely(__pyx_v___pyx_state == Py_None)) {
32010     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
32011     __PYX_ERR(1, 13, __pyx_L1_error)
32012   }
32013   __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)
32014   __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
32015   if (__pyx_t_4) {
32016   } else {
32017     __pyx_t_2 = __pyx_t_4;
32018     goto __pyx_L4_bool_binop_done;
32019   }
32020   __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)
32021   __pyx_t_5 = (__pyx_t_4 != 0);
32022   __pyx_t_2 = __pyx_t_5;
32023   __pyx_L4_bool_binop_done:;
32024   if (__pyx_t_2) {
32025 
32026     /* "(tree fragment)":14
32027  *     __pyx_result.name = __pyx_state[0]
32028  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
32029  *         __pyx_result.__dict__.update(__pyx_state[1])             # <<<<<<<<<<<<<<
32030  */
32031     __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)
32032     __Pyx_GOTREF(__pyx_t_6);
32033     __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)
32034     __Pyx_GOTREF(__pyx_t_7);
32035     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
32036     if (unlikely(__pyx_v___pyx_state == Py_None)) {
32037       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
32038       __PYX_ERR(1, 14, __pyx_L1_error)
32039     }
32040     __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)
32041     __Pyx_GOTREF(__pyx_t_6);
32042     __pyx_t_8 = NULL;
32043     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
32044       __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
32045       if (likely(__pyx_t_8)) {
32046         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
32047         __Pyx_INCREF(__pyx_t_8);
32048         __Pyx_INCREF(function);
32049         __Pyx_DECREF_SET(__pyx_t_7, function);
32050       }
32051     }
32052     __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);
32053     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
32054     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
32055     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
32056     __Pyx_GOTREF(__pyx_t_1);
32057     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
32058     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32059 
32060     /* "(tree fragment)":13
32061  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
32062  *     __pyx_result.name = __pyx_state[0]
32063  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
32064  *         __pyx_result.__dict__.update(__pyx_state[1])
32065  */
32066   }
32067 
32068   /* "(tree fragment)":11
32069  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
32070  *     return __pyx_result
32071  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
32072  *     __pyx_result.name = __pyx_state[0]
32073  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
32074  */
32075 
32076   /* function exit code */
32077   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
32078   goto __pyx_L0;
32079   __pyx_L1_error:;
32080   __Pyx_XDECREF(__pyx_t_1);
32081   __Pyx_XDECREF(__pyx_t_6);
32082   __Pyx_XDECREF(__pyx_t_7);
32083   __Pyx_XDECREF(__pyx_t_8);
32084   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
32085   __pyx_r = 0;
32086   __pyx_L0:;
32087   __Pyx_XGIVEREF(__pyx_r);
32088   __Pyx_RefNannyFinishContext();
32089   return __pyx_r;
32090 }
32091 static struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation __pyx_vtable_2yt_8geometry_15particle_smooth_ParticleSmoothOperation;
32092 
__pyx_tp_new_2yt_8geometry_15particle_smooth_ParticleSmoothOperation(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)32093 static PyObject *__pyx_tp_new_2yt_8geometry_15particle_smooth_ParticleSmoothOperation(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
32094   struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *p;
32095   PyObject *o;
32096   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
32097     o = (*t->tp_alloc)(t, 0);
32098   } else {
32099     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
32100   }
32101   if (unlikely(!o)) return 0;
32102   p = ((struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)o);
32103   p->__pyx_vtab = __pyx_vtabptr_2yt_8geometry_15particle_smooth_ParticleSmoothOperation;
32104   p->nvals = Py_None; Py_INCREF(Py_None);
32105   return o;
32106 }
32107 
__pyx_tp_dealloc_2yt_8geometry_15particle_smooth_ParticleSmoothOperation(PyObject * o)32108 static void __pyx_tp_dealloc_2yt_8geometry_15particle_smooth_ParticleSmoothOperation(PyObject *o) {
32109   struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *p = (struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)o;
32110   #if CYTHON_USE_TP_FINALIZE
32111   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
32112     if (PyObject_CallFinalizerFromDealloc(o)) return;
32113   }
32114   #endif
32115   PyObject_GC_UnTrack(o);
32116   Py_CLEAR(p->nvals);
32117   (*Py_TYPE(o)->tp_free)(o);
32118 }
32119 
__pyx_tp_traverse_2yt_8geometry_15particle_smooth_ParticleSmoothOperation(PyObject * o,visitproc v,void * a)32120 static int __pyx_tp_traverse_2yt_8geometry_15particle_smooth_ParticleSmoothOperation(PyObject *o, visitproc v, void *a) {
32121   int e;
32122   struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *p = (struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)o;
32123   if (p->nvals) {
32124     e = (*v)(p->nvals, a); if (e) return e;
32125   }
32126   return 0;
32127 }
32128 
__pyx_tp_clear_2yt_8geometry_15particle_smooth_ParticleSmoothOperation(PyObject * o)32129 static int __pyx_tp_clear_2yt_8geometry_15particle_smooth_ParticleSmoothOperation(PyObject *o) {
32130   PyObject* tmp;
32131   struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *p = (struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)o;
32132   tmp = ((PyObject*)p->nvals);
32133   p->nvals = Py_None; Py_INCREF(Py_None);
32134   Py_XDECREF(tmp);
32135   return 0;
32136 }
32137 
__pyx_getprop_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_nvals(PyObject * o,CYTHON_UNUSED void * x)32138 static PyObject *__pyx_getprop_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_nvals(PyObject *o, CYTHON_UNUSED void *x) {
32139   return __pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals_1__get__(o);
32140 }
32141 
__pyx_setprop_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_nvals(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)32142 static int __pyx_setprop_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_nvals(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
32143   if (v) {
32144     return __pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals_3__set__(o, v);
32145   }
32146   else {
32147     return __pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals_5__del__(o);
32148   }
32149 }
32150 
32151 static PyMethodDef __pyx_methods_2yt_8geometry_15particle_smooth_ParticleSmoothOperation[] = {
32152   {"initialize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_3initialize, METH_VARARGS|METH_KEYWORDS, 0},
32153   {"finalize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5finalize, METH_VARARGS|METH_KEYWORDS, 0},
32154   {"process_octree", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_7process_octree, METH_VARARGS|METH_KEYWORDS, 0},
32155   {"process_particles", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_9process_particles, METH_VARARGS|METH_KEYWORDS, 0},
32156   {"process_grid", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_11process_grid, METH_VARARGS|METH_KEYWORDS, 0},
32157   {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_13__reduce_cython__, METH_NOARGS, 0},
32158   {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_15__setstate_cython__, METH_O, 0},
32159   {0, 0, 0, 0}
32160 };
32161 
32162 static struct PyGetSetDef __pyx_getsets_2yt_8geometry_15particle_smooth_ParticleSmoothOperation[] = {
32163   {(char *)"nvals", __pyx_getprop_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_nvals, __pyx_setprop_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_nvals, (char *)0, 0},
32164   {0, 0, 0, 0, 0}
32165 };
32166 
32167 static PyTypeObject __pyx_type_2yt_8geometry_15particle_smooth_ParticleSmoothOperation = {
32168   PyVarObject_HEAD_INIT(0, 0)
32169   "yt.geometry.particle_smooth.ParticleSmoothOperation", /*tp_name*/
32170   sizeof(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation), /*tp_basicsize*/
32171   0, /*tp_itemsize*/
32172   __pyx_tp_dealloc_2yt_8geometry_15particle_smooth_ParticleSmoothOperation, /*tp_dealloc*/
32173   0, /*tp_print*/
32174   0, /*tp_getattr*/
32175   0, /*tp_setattr*/
32176   #if PY_MAJOR_VERSION < 3
32177   0, /*tp_compare*/
32178   #endif
32179   #if PY_MAJOR_VERSION >= 3
32180   0, /*tp_as_async*/
32181   #endif
32182   0, /*tp_repr*/
32183   0, /*tp_as_number*/
32184   0, /*tp_as_sequence*/
32185   0, /*tp_as_mapping*/
32186   0, /*tp_hash*/
32187   0, /*tp_call*/
32188   0, /*tp_str*/
32189   0, /*tp_getattro*/
32190   0, /*tp_setattro*/
32191   0, /*tp_as_buffer*/
32192   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
32193   0, /*tp_doc*/
32194   __pyx_tp_traverse_2yt_8geometry_15particle_smooth_ParticleSmoothOperation, /*tp_traverse*/
32195   __pyx_tp_clear_2yt_8geometry_15particle_smooth_ParticleSmoothOperation, /*tp_clear*/
32196   0, /*tp_richcompare*/
32197   0, /*tp_weaklistoffset*/
32198   0, /*tp_iter*/
32199   0, /*tp_iternext*/
32200   __pyx_methods_2yt_8geometry_15particle_smooth_ParticleSmoothOperation, /*tp_methods*/
32201   0, /*tp_members*/
32202   __pyx_getsets_2yt_8geometry_15particle_smooth_ParticleSmoothOperation, /*tp_getset*/
32203   0, /*tp_base*/
32204   0, /*tp_dict*/
32205   0, /*tp_descr_get*/
32206   0, /*tp_descr_set*/
32207   0, /*tp_dictoffset*/
32208   __pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_1__init__, /*tp_init*/
32209   0, /*tp_alloc*/
32210   __pyx_tp_new_2yt_8geometry_15particle_smooth_ParticleSmoothOperation, /*tp_new*/
32211   0, /*tp_free*/
32212   0, /*tp_is_gc*/
32213   0, /*tp_bases*/
32214   0, /*tp_mro*/
32215   0, /*tp_cache*/
32216   0, /*tp_subclasses*/
32217   0, /*tp_weaklist*/
32218   0, /*tp_del*/
32219   0, /*tp_version_tag*/
32220   #if PY_VERSION_HEX >= 0x030400a1
32221   0, /*tp_finalize*/
32222   #endif
32223   #if PY_VERSION_HEX >= 0x030800b1
32224   0, /*tp_vectorcall*/
32225   #endif
32226 };
32227 static struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth __pyx_vtable_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth;
32228 
__pyx_tp_new_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth(PyTypeObject * t,PyObject * a,PyObject * k)32229 static PyObject *__pyx_tp_new_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth(PyTypeObject *t, PyObject *a, PyObject *k) {
32230   struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *p;
32231   PyObject *o = __pyx_tp_new_2yt_8geometry_15particle_smooth_ParticleSmoothOperation(t, a, k);
32232   if (unlikely(!o)) return 0;
32233   p = ((struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *)o);
32234   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation*)__pyx_vtabptr_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth;
32235   p->vals = Py_None; Py_INCREF(Py_None);
32236   return o;
32237 }
32238 
__pyx_tp_dealloc_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth(PyObject * o)32239 static void __pyx_tp_dealloc_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth(PyObject *o) {
32240   struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *p = (struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *)o;
32241   #if CYTHON_USE_TP_FINALIZE
32242   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
32243     if (PyObject_CallFinalizerFromDealloc(o)) return;
32244   }
32245   #endif
32246   PyObject_GC_UnTrack(o);
32247   Py_CLEAR(p->vals);
32248   PyObject_GC_Track(o);
32249   __pyx_tp_dealloc_2yt_8geometry_15particle_smooth_ParticleSmoothOperation(o);
32250 }
32251 
__pyx_tp_traverse_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth(PyObject * o,visitproc v,void * a)32252 static int __pyx_tp_traverse_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth(PyObject *o, visitproc v, void *a) {
32253   int e;
32254   struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *p = (struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *)o;
32255   e = __pyx_tp_traverse_2yt_8geometry_15particle_smooth_ParticleSmoothOperation(o, v, a); if (e) return e;
32256   if (p->vals) {
32257     e = (*v)(p->vals, a); if (e) return e;
32258   }
32259   return 0;
32260 }
32261 
__pyx_tp_clear_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth(PyObject * o)32262 static int __pyx_tp_clear_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth(PyObject *o) {
32263   PyObject* tmp;
32264   struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *p = (struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *)o;
32265   __pyx_tp_clear_2yt_8geometry_15particle_smooth_ParticleSmoothOperation(o);
32266   tmp = ((PyObject*)p->vals);
32267   p->vals = Py_None; Py_INCREF(Py_None);
32268   Py_XDECREF(tmp);
32269   return 0;
32270 }
32271 
__pyx_getprop_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_vals(PyObject * o,CYTHON_UNUSED void * x)32272 static PyObject *__pyx_getprop_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_vals(PyObject *o, CYTHON_UNUSED void *x) {
32273   return __pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals_1__get__(o);
32274 }
32275 
__pyx_setprop_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_vals(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)32276 static int __pyx_setprop_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_vals(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
32277   if (v) {
32278     return __pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals_3__set__(o, v);
32279   }
32280   else {
32281     return __pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals_5__del__(o);
32282   }
32283 }
32284 
32285 static PyMethodDef __pyx_methods_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth[] = {
32286   {"initialize", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_1initialize, METH_NOARGS, 0},
32287   {"finalize", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_3finalize, METH_NOARGS, 0},
32288   {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_5__reduce_cython__, METH_NOARGS, 0},
32289   {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_7__setstate_cython__, METH_O, 0},
32290   {0, 0, 0, 0}
32291 };
32292 
32293 static struct PyGetSetDef __pyx_getsets_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth[] = {
32294   {(char *)"vals", __pyx_getprop_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_vals, __pyx_setprop_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_vals, (char *)0, 0},
32295   {0, 0, 0, 0, 0}
32296 };
32297 
32298 static PyTypeObject __pyx_type_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth = {
32299   PyVarObject_HEAD_INIT(0, 0)
32300   "yt.geometry.particle_smooth.VolumeWeightedSmooth", /*tp_name*/
32301   sizeof(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth), /*tp_basicsize*/
32302   0, /*tp_itemsize*/
32303   __pyx_tp_dealloc_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth, /*tp_dealloc*/
32304   0, /*tp_print*/
32305   0, /*tp_getattr*/
32306   0, /*tp_setattr*/
32307   #if PY_MAJOR_VERSION < 3
32308   0, /*tp_compare*/
32309   #endif
32310   #if PY_MAJOR_VERSION >= 3
32311   0, /*tp_as_async*/
32312   #endif
32313   0, /*tp_repr*/
32314   0, /*tp_as_number*/
32315   0, /*tp_as_sequence*/
32316   0, /*tp_as_mapping*/
32317   0, /*tp_hash*/
32318   0, /*tp_call*/
32319   0, /*tp_str*/
32320   0, /*tp_getattro*/
32321   0, /*tp_setattro*/
32322   0, /*tp_as_buffer*/
32323   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
32324   0, /*tp_doc*/
32325   __pyx_tp_traverse_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth, /*tp_traverse*/
32326   __pyx_tp_clear_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth, /*tp_clear*/
32327   0, /*tp_richcompare*/
32328   0, /*tp_weaklistoffset*/
32329   0, /*tp_iter*/
32330   0, /*tp_iternext*/
32331   __pyx_methods_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth, /*tp_methods*/
32332   0, /*tp_members*/
32333   __pyx_getsets_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth, /*tp_getset*/
32334   0, /*tp_base*/
32335   0, /*tp_dict*/
32336   0, /*tp_descr_get*/
32337   0, /*tp_descr_set*/
32338   0, /*tp_dictoffset*/
32339   #if CYTHON_COMPILING_IN_PYPY
32340   __pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_1__init__, /*tp_init*/
32341   #else
32342   0, /*tp_init*/
32343   #endif
32344   0, /*tp_alloc*/
32345   __pyx_tp_new_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth, /*tp_new*/
32346   0, /*tp_free*/
32347   0, /*tp_is_gc*/
32348   0, /*tp_bases*/
32349   0, /*tp_mro*/
32350   0, /*tp_cache*/
32351   0, /*tp_subclasses*/
32352   0, /*tp_weaklist*/
32353   0, /*tp_del*/
32354   0, /*tp_version_tag*/
32355   #if PY_VERSION_HEX >= 0x030400a1
32356   0, /*tp_finalize*/
32357   #endif
32358   #if PY_VERSION_HEX >= 0x030800b1
32359   0, /*tp_vectorcall*/
32360   #endif
32361 };
32362 static struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_NearestNeighborSmooth __pyx_vtable_2yt_8geometry_15particle_smooth_NearestNeighborSmooth;
32363 
__pyx_tp_new_2yt_8geometry_15particle_smooth_NearestNeighborSmooth(PyTypeObject * t,PyObject * a,PyObject * k)32364 static PyObject *__pyx_tp_new_2yt_8geometry_15particle_smooth_NearestNeighborSmooth(PyTypeObject *t, PyObject *a, PyObject *k) {
32365   struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *p;
32366   PyObject *o = __pyx_tp_new_2yt_8geometry_15particle_smooth_ParticleSmoothOperation(t, a, k);
32367   if (unlikely(!o)) return 0;
32368   p = ((struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *)o);
32369   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation*)__pyx_vtabptr_2yt_8geometry_15particle_smooth_NearestNeighborSmooth;
32370   p->vals = Py_None; Py_INCREF(Py_None);
32371   return o;
32372 }
32373 
__pyx_tp_dealloc_2yt_8geometry_15particle_smooth_NearestNeighborSmooth(PyObject * o)32374 static void __pyx_tp_dealloc_2yt_8geometry_15particle_smooth_NearestNeighborSmooth(PyObject *o) {
32375   struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *p = (struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *)o;
32376   #if CYTHON_USE_TP_FINALIZE
32377   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
32378     if (PyObject_CallFinalizerFromDealloc(o)) return;
32379   }
32380   #endif
32381   PyObject_GC_UnTrack(o);
32382   Py_CLEAR(p->vals);
32383   PyObject_GC_Track(o);
32384   __pyx_tp_dealloc_2yt_8geometry_15particle_smooth_ParticleSmoothOperation(o);
32385 }
32386 
__pyx_tp_traverse_2yt_8geometry_15particle_smooth_NearestNeighborSmooth(PyObject * o,visitproc v,void * a)32387 static int __pyx_tp_traverse_2yt_8geometry_15particle_smooth_NearestNeighborSmooth(PyObject *o, visitproc v, void *a) {
32388   int e;
32389   struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *p = (struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *)o;
32390   e = __pyx_tp_traverse_2yt_8geometry_15particle_smooth_ParticleSmoothOperation(o, v, a); if (e) return e;
32391   if (p->vals) {
32392     e = (*v)(p->vals, a); if (e) return e;
32393   }
32394   return 0;
32395 }
32396 
__pyx_tp_clear_2yt_8geometry_15particle_smooth_NearestNeighborSmooth(PyObject * o)32397 static int __pyx_tp_clear_2yt_8geometry_15particle_smooth_NearestNeighborSmooth(PyObject *o) {
32398   PyObject* tmp;
32399   struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *p = (struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *)o;
32400   __pyx_tp_clear_2yt_8geometry_15particle_smooth_ParticleSmoothOperation(o);
32401   tmp = ((PyObject*)p->vals);
32402   p->vals = Py_None; Py_INCREF(Py_None);
32403   Py_XDECREF(tmp);
32404   return 0;
32405 }
32406 
__pyx_getprop_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_vals(PyObject * o,CYTHON_UNUSED void * x)32407 static PyObject *__pyx_getprop_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_vals(PyObject *o, CYTHON_UNUSED void *x) {
32408   return __pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals_1__get__(o);
32409 }
32410 
__pyx_setprop_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_vals(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)32411 static int __pyx_setprop_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_vals(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
32412   if (v) {
32413     return __pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals_3__set__(o, v);
32414   }
32415   else {
32416     return __pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals_5__del__(o);
32417   }
32418 }
32419 
32420 static PyMethodDef __pyx_methods_2yt_8geometry_15particle_smooth_NearestNeighborSmooth[] = {
32421   {"initialize", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_1initialize, METH_NOARGS, 0},
32422   {"finalize", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_3finalize, METH_NOARGS, 0},
32423   {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_5__reduce_cython__, METH_NOARGS, 0},
32424   {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_7__setstate_cython__, METH_O, 0},
32425   {0, 0, 0, 0}
32426 };
32427 
32428 static struct PyGetSetDef __pyx_getsets_2yt_8geometry_15particle_smooth_NearestNeighborSmooth[] = {
32429   {(char *)"vals", __pyx_getprop_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_vals, __pyx_setprop_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_vals, (char *)0, 0},
32430   {0, 0, 0, 0, 0}
32431 };
32432 
32433 static PyTypeObject __pyx_type_2yt_8geometry_15particle_smooth_NearestNeighborSmooth = {
32434   PyVarObject_HEAD_INIT(0, 0)
32435   "yt.geometry.particle_smooth.NearestNeighborSmooth", /*tp_name*/
32436   sizeof(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth), /*tp_basicsize*/
32437   0, /*tp_itemsize*/
32438   __pyx_tp_dealloc_2yt_8geometry_15particle_smooth_NearestNeighborSmooth, /*tp_dealloc*/
32439   0, /*tp_print*/
32440   0, /*tp_getattr*/
32441   0, /*tp_setattr*/
32442   #if PY_MAJOR_VERSION < 3
32443   0, /*tp_compare*/
32444   #endif
32445   #if PY_MAJOR_VERSION >= 3
32446   0, /*tp_as_async*/
32447   #endif
32448   0, /*tp_repr*/
32449   0, /*tp_as_number*/
32450   0, /*tp_as_sequence*/
32451   0, /*tp_as_mapping*/
32452   0, /*tp_hash*/
32453   0, /*tp_call*/
32454   0, /*tp_str*/
32455   0, /*tp_getattro*/
32456   0, /*tp_setattro*/
32457   0, /*tp_as_buffer*/
32458   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
32459   0, /*tp_doc*/
32460   __pyx_tp_traverse_2yt_8geometry_15particle_smooth_NearestNeighborSmooth, /*tp_traverse*/
32461   __pyx_tp_clear_2yt_8geometry_15particle_smooth_NearestNeighborSmooth, /*tp_clear*/
32462   0, /*tp_richcompare*/
32463   0, /*tp_weaklistoffset*/
32464   0, /*tp_iter*/
32465   0, /*tp_iternext*/
32466   __pyx_methods_2yt_8geometry_15particle_smooth_NearestNeighborSmooth, /*tp_methods*/
32467   0, /*tp_members*/
32468   __pyx_getsets_2yt_8geometry_15particle_smooth_NearestNeighborSmooth, /*tp_getset*/
32469   0, /*tp_base*/
32470   0, /*tp_dict*/
32471   0, /*tp_descr_get*/
32472   0, /*tp_descr_set*/
32473   0, /*tp_dictoffset*/
32474   #if CYTHON_COMPILING_IN_PYPY
32475   __pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_1__init__, /*tp_init*/
32476   #else
32477   0, /*tp_init*/
32478   #endif
32479   0, /*tp_alloc*/
32480   __pyx_tp_new_2yt_8geometry_15particle_smooth_NearestNeighborSmooth, /*tp_new*/
32481   0, /*tp_free*/
32482   0, /*tp_is_gc*/
32483   0, /*tp_bases*/
32484   0, /*tp_mro*/
32485   0, /*tp_cache*/
32486   0, /*tp_subclasses*/
32487   0, /*tp_weaklist*/
32488   0, /*tp_del*/
32489   0, /*tp_version_tag*/
32490   #if PY_VERSION_HEX >= 0x030400a1
32491   0, /*tp_finalize*/
32492   #endif
32493   #if PY_VERSION_HEX >= 0x030800b1
32494   0, /*tp_vectorcall*/
32495   #endif
32496 };
32497 static struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth __pyx_vtable_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth;
32498 
__pyx_tp_new_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth(PyTypeObject * t,PyObject * a,PyObject * k)32499 static PyObject *__pyx_tp_new_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth(PyTypeObject *t, PyObject *a, PyObject *k) {
32500   struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *p;
32501   PyObject *o = __pyx_tp_new_2yt_8geometry_15particle_smooth_ParticleSmoothOperation(t, a, k);
32502   if (unlikely(!o)) return 0;
32503   p = ((struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *)o);
32504   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation*)__pyx_vtabptr_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth;
32505   p->vals = Py_None; Py_INCREF(Py_None);
32506   return o;
32507 }
32508 
__pyx_tp_dealloc_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth(PyObject * o)32509 static void __pyx_tp_dealloc_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth(PyObject *o) {
32510   struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *p = (struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *)o;
32511   #if CYTHON_USE_TP_FINALIZE
32512   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
32513     if (PyObject_CallFinalizerFromDealloc(o)) return;
32514   }
32515   #endif
32516   PyObject_GC_UnTrack(o);
32517   Py_CLEAR(p->vals);
32518   PyObject_GC_Track(o);
32519   __pyx_tp_dealloc_2yt_8geometry_15particle_smooth_ParticleSmoothOperation(o);
32520 }
32521 
__pyx_tp_traverse_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth(PyObject * o,visitproc v,void * a)32522 static int __pyx_tp_traverse_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth(PyObject *o, visitproc v, void *a) {
32523   int e;
32524   struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *p = (struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *)o;
32525   e = __pyx_tp_traverse_2yt_8geometry_15particle_smooth_ParticleSmoothOperation(o, v, a); if (e) return e;
32526   if (p->vals) {
32527     e = (*v)(p->vals, a); if (e) return e;
32528   }
32529   return 0;
32530 }
32531 
__pyx_tp_clear_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth(PyObject * o)32532 static int __pyx_tp_clear_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth(PyObject *o) {
32533   PyObject* tmp;
32534   struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *p = (struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *)o;
32535   __pyx_tp_clear_2yt_8geometry_15particle_smooth_ParticleSmoothOperation(o);
32536   tmp = ((PyObject*)p->vals);
32537   p->vals = Py_None; Py_INCREF(Py_None);
32538   Py_XDECREF(tmp);
32539   return 0;
32540 }
32541 
__pyx_getprop_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_p2(PyObject * o,CYTHON_UNUSED void * x)32542 static PyObject *__pyx_getprop_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_p2(PyObject *o, CYTHON_UNUSED void *x) {
32543   return __pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_2p2_1__get__(o);
32544 }
32545 
__pyx_setprop_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_p2(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)32546 static int __pyx_setprop_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_p2(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
32547   if (v) {
32548     return __pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_2p2_3__set__(o, v);
32549   }
32550   else {
32551     PyErr_SetString(PyExc_NotImplementedError, "__del__");
32552     return -1;
32553   }
32554 }
32555 
__pyx_getprop_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_vals(PyObject * o,CYTHON_UNUSED void * x)32556 static PyObject *__pyx_getprop_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_vals(PyObject *o, CYTHON_UNUSED void *x) {
32557   return __pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals_1__get__(o);
32558 }
32559 
__pyx_setprop_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_vals(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)32560 static int __pyx_setprop_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_vals(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
32561   if (v) {
32562     return __pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals_3__set__(o, v);
32563   }
32564   else {
32565     return __pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals_5__del__(o);
32566   }
32567 }
32568 
32569 static PyMethodDef __pyx_methods_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth[] = {
32570   {"initialize", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_1initialize, METH_NOARGS, 0},
32571   {"finalize", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_3finalize, METH_NOARGS, 0},
32572   {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_5__reduce_cython__, METH_NOARGS, 0},
32573   {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_7__setstate_cython__, METH_O, 0},
32574   {0, 0, 0, 0}
32575 };
32576 
32577 static struct PyGetSetDef __pyx_getsets_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth[] = {
32578   {(char *)"p2", __pyx_getprop_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_p2, __pyx_setprop_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_p2, (char *)0, 0},
32579   {(char *)"vals", __pyx_getprop_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_vals, __pyx_setprop_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_vals, (char *)0, 0},
32580   {0, 0, 0, 0, 0}
32581 };
32582 
32583 static PyTypeObject __pyx_type_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth = {
32584   PyVarObject_HEAD_INIT(0, 0)
32585   "yt.geometry.particle_smooth.IDWInterpolationSmooth", /*tp_name*/
32586   sizeof(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth), /*tp_basicsize*/
32587   0, /*tp_itemsize*/
32588   __pyx_tp_dealloc_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth, /*tp_dealloc*/
32589   0, /*tp_print*/
32590   0, /*tp_getattr*/
32591   0, /*tp_setattr*/
32592   #if PY_MAJOR_VERSION < 3
32593   0, /*tp_compare*/
32594   #endif
32595   #if PY_MAJOR_VERSION >= 3
32596   0, /*tp_as_async*/
32597   #endif
32598   0, /*tp_repr*/
32599   0, /*tp_as_number*/
32600   0, /*tp_as_sequence*/
32601   0, /*tp_as_mapping*/
32602   0, /*tp_hash*/
32603   0, /*tp_call*/
32604   0, /*tp_str*/
32605   0, /*tp_getattro*/
32606   0, /*tp_setattro*/
32607   0, /*tp_as_buffer*/
32608   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
32609   0, /*tp_doc*/
32610   __pyx_tp_traverse_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth, /*tp_traverse*/
32611   __pyx_tp_clear_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth, /*tp_clear*/
32612   0, /*tp_richcompare*/
32613   0, /*tp_weaklistoffset*/
32614   0, /*tp_iter*/
32615   0, /*tp_iternext*/
32616   __pyx_methods_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth, /*tp_methods*/
32617   0, /*tp_members*/
32618   __pyx_getsets_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth, /*tp_getset*/
32619   0, /*tp_base*/
32620   0, /*tp_dict*/
32621   0, /*tp_descr_get*/
32622   0, /*tp_descr_set*/
32623   0, /*tp_dictoffset*/
32624   #if CYTHON_COMPILING_IN_PYPY
32625   __pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_1__init__, /*tp_init*/
32626   #else
32627   0, /*tp_init*/
32628   #endif
32629   0, /*tp_alloc*/
32630   __pyx_tp_new_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth, /*tp_new*/
32631   0, /*tp_free*/
32632   0, /*tp_is_gc*/
32633   0, /*tp_bases*/
32634   0, /*tp_mro*/
32635   0, /*tp_cache*/
32636   0, /*tp_subclasses*/
32637   0, /*tp_weaklist*/
32638   0, /*tp_del*/
32639   0, /*tp_version_tag*/
32640   #if PY_VERSION_HEX >= 0x030400a1
32641   0, /*tp_finalize*/
32642   #endif
32643   #if PY_VERSION_HEX >= 0x030800b1
32644   0, /*tp_vectorcall*/
32645   #endif
32646 };
32647 static struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth __pyx_vtable_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth;
32648 
__pyx_tp_new_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth(PyTypeObject * t,PyObject * a,PyObject * k)32649 static PyObject *__pyx_tp_new_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth(PyTypeObject *t, PyObject *a, PyObject *k) {
32650   struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *p;
32651   PyObject *o = __pyx_tp_new_2yt_8geometry_15particle_smooth_ParticleSmoothOperation(t, a, k);
32652   if (unlikely(!o)) return 0;
32653   p = ((struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *)o);
32654   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation*)__pyx_vtabptr_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth;
32655   return o;
32656 }
32657 
32658 static PyMethodDef __pyx_methods_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth[] = {
32659   {"initialize", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_1initialize, METH_NOARGS, 0},
32660   {"finalize", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_3finalize, METH_NOARGS, 0},
32661   {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_5__reduce_cython__, METH_NOARGS, 0},
32662   {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_7__setstate_cython__, METH_O, 0},
32663   {0, 0, 0, 0}
32664 };
32665 
32666 static PyTypeObject __pyx_type_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth = {
32667   PyVarObject_HEAD_INIT(0, 0)
32668   "yt.geometry.particle_smooth.NthNeighborDistanceSmooth", /*tp_name*/
32669   sizeof(struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth), /*tp_basicsize*/
32670   0, /*tp_itemsize*/
32671   __pyx_tp_dealloc_2yt_8geometry_15particle_smooth_ParticleSmoothOperation, /*tp_dealloc*/
32672   0, /*tp_print*/
32673   0, /*tp_getattr*/
32674   0, /*tp_setattr*/
32675   #if PY_MAJOR_VERSION < 3
32676   0, /*tp_compare*/
32677   #endif
32678   #if PY_MAJOR_VERSION >= 3
32679   0, /*tp_as_async*/
32680   #endif
32681   0, /*tp_repr*/
32682   0, /*tp_as_number*/
32683   0, /*tp_as_sequence*/
32684   0, /*tp_as_mapping*/
32685   0, /*tp_hash*/
32686   0, /*tp_call*/
32687   0, /*tp_str*/
32688   0, /*tp_getattro*/
32689   0, /*tp_setattro*/
32690   0, /*tp_as_buffer*/
32691   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
32692   0, /*tp_doc*/
32693   __pyx_tp_traverse_2yt_8geometry_15particle_smooth_ParticleSmoothOperation, /*tp_traverse*/
32694   __pyx_tp_clear_2yt_8geometry_15particle_smooth_ParticleSmoothOperation, /*tp_clear*/
32695   0, /*tp_richcompare*/
32696   0, /*tp_weaklistoffset*/
32697   0, /*tp_iter*/
32698   0, /*tp_iternext*/
32699   __pyx_methods_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth, /*tp_methods*/
32700   0, /*tp_members*/
32701   0, /*tp_getset*/
32702   0, /*tp_base*/
32703   0, /*tp_dict*/
32704   0, /*tp_descr_get*/
32705   0, /*tp_descr_set*/
32706   0, /*tp_dictoffset*/
32707   #if CYTHON_COMPILING_IN_PYPY
32708   __pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_1__init__, /*tp_init*/
32709   #else
32710   0, /*tp_init*/
32711   #endif
32712   0, /*tp_alloc*/
32713   __pyx_tp_new_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth, /*tp_new*/
32714   0, /*tp_free*/
32715   0, /*tp_is_gc*/
32716   0, /*tp_bases*/
32717   0, /*tp_mro*/
32718   0, /*tp_cache*/
32719   0, /*tp_subclasses*/
32720   0, /*tp_weaklist*/
32721   0, /*tp_del*/
32722   0, /*tp_version_tag*/
32723   #if PY_VERSION_HEX >= 0x030400a1
32724   0, /*tp_finalize*/
32725   #endif
32726   #if PY_VERSION_HEX >= 0x030800b1
32727   0, /*tp_vectorcall*/
32728   #endif
32729 };
32730 static struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate __pyx_vtable_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate;
32731 
__pyx_tp_new_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate(PyTypeObject * t,PyObject * a,PyObject * k)32732 static PyObject *__pyx_tp_new_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate(PyTypeObject *t, PyObject *a, PyObject *k) {
32733   struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *p;
32734   PyObject *o = __pyx_tp_new_2yt_8geometry_15particle_smooth_ParticleSmoothOperation(t, a, k);
32735   if (unlikely(!o)) return 0;
32736   p = ((struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *)o);
32737   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation*)__pyx_vtabptr_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate;
32738   return o;
32739 }
32740 
32741 static PyMethodDef __pyx_methods_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate[] = {
32742   {"initialize", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_1initialize, METH_NOARGS, 0},
32743   {"finalize", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_3finalize, METH_NOARGS, 0},
32744   {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_5__reduce_cython__, METH_NOARGS, 0},
32745   {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_7__setstate_cython__, METH_O, 0},
32746   {0, 0, 0, 0}
32747 };
32748 
32749 static PyTypeObject __pyx_type_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate = {
32750   PyVarObject_HEAD_INIT(0, 0)
32751   "yt.geometry.particle_smooth.SmoothedDensityEstimate", /*tp_name*/
32752   sizeof(struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate), /*tp_basicsize*/
32753   0, /*tp_itemsize*/
32754   __pyx_tp_dealloc_2yt_8geometry_15particle_smooth_ParticleSmoothOperation, /*tp_dealloc*/
32755   0, /*tp_print*/
32756   0, /*tp_getattr*/
32757   0, /*tp_setattr*/
32758   #if PY_MAJOR_VERSION < 3
32759   0, /*tp_compare*/
32760   #endif
32761   #if PY_MAJOR_VERSION >= 3
32762   0, /*tp_as_async*/
32763   #endif
32764   0, /*tp_repr*/
32765   0, /*tp_as_number*/
32766   0, /*tp_as_sequence*/
32767   0, /*tp_as_mapping*/
32768   0, /*tp_hash*/
32769   0, /*tp_call*/
32770   0, /*tp_str*/
32771   0, /*tp_getattro*/
32772   0, /*tp_setattro*/
32773   0, /*tp_as_buffer*/
32774   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
32775   0, /*tp_doc*/
32776   __pyx_tp_traverse_2yt_8geometry_15particle_smooth_ParticleSmoothOperation, /*tp_traverse*/
32777   __pyx_tp_clear_2yt_8geometry_15particle_smooth_ParticleSmoothOperation, /*tp_clear*/
32778   0, /*tp_richcompare*/
32779   0, /*tp_weaklistoffset*/
32780   0, /*tp_iter*/
32781   0, /*tp_iternext*/
32782   __pyx_methods_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate, /*tp_methods*/
32783   0, /*tp_members*/
32784   0, /*tp_getset*/
32785   0, /*tp_base*/
32786   0, /*tp_dict*/
32787   0, /*tp_descr_get*/
32788   0, /*tp_descr_set*/
32789   0, /*tp_dictoffset*/
32790   #if CYTHON_COMPILING_IN_PYPY
32791   __pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_1__init__, /*tp_init*/
32792   #else
32793   0, /*tp_init*/
32794   #endif
32795   0, /*tp_alloc*/
32796   __pyx_tp_new_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate, /*tp_new*/
32797   0, /*tp_free*/
32798   0, /*tp_is_gc*/
32799   0, /*tp_bases*/
32800   0, /*tp_mro*/
32801   0, /*tp_cache*/
32802   0, /*tp_subclasses*/
32803   0, /*tp_weaklist*/
32804   0, /*tp_del*/
32805   0, /*tp_version_tag*/
32806   #if PY_VERSION_HEX >= 0x030400a1
32807   0, /*tp_finalize*/
32808   #endif
32809   #if PY_VERSION_HEX >= 0x030800b1
32810   0, /*tp_vectorcall*/
32811   #endif
32812 };
32813 static struct __pyx_vtabstruct_array __pyx_vtable_array;
32814 
__pyx_tp_new_array(PyTypeObject * t,PyObject * a,PyObject * k)32815 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
32816   struct __pyx_array_obj *p;
32817   PyObject *o;
32818   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
32819     o = (*t->tp_alloc)(t, 0);
32820   } else {
32821     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
32822   }
32823   if (unlikely(!o)) return 0;
32824   p = ((struct __pyx_array_obj *)o);
32825   p->__pyx_vtab = __pyx_vtabptr_array;
32826   p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
32827   p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
32828   if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
32829   return o;
32830   bad:
32831   Py_DECREF(o); o = 0;
32832   return NULL;
32833 }
32834 
__pyx_tp_dealloc_array(PyObject * o)32835 static void __pyx_tp_dealloc_array(PyObject *o) {
32836   struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
32837   #if CYTHON_USE_TP_FINALIZE
32838   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))) {
32839     if (PyObject_CallFinalizerFromDealloc(o)) return;
32840   }
32841   #endif
32842   {
32843     PyObject *etype, *eval, *etb;
32844     PyErr_Fetch(&etype, &eval, &etb);
32845     ++Py_REFCNT(o);
32846     __pyx_array___dealloc__(o);
32847     --Py_REFCNT(o);
32848     PyErr_Restore(etype, eval, etb);
32849   }
32850   Py_CLEAR(p->mode);
32851   Py_CLEAR(p->_format);
32852   (*Py_TYPE(o)->tp_free)(o);
32853 }
__pyx_sq_item_array(PyObject * o,Py_ssize_t i)32854 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
32855   PyObject *r;
32856   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
32857   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
32858   Py_DECREF(x);
32859   return r;
32860 }
32861 
__pyx_mp_ass_subscript_array(PyObject * o,PyObject * i,PyObject * v)32862 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
32863   if (v) {
32864     return __pyx_array___setitem__(o, i, v);
32865   }
32866   else {
32867     PyErr_Format(PyExc_NotImplementedError,
32868       "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
32869     return -1;
32870   }
32871 }
32872 
__pyx_tp_getattro_array(PyObject * o,PyObject * n)32873 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
32874   PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
32875   if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
32876     PyErr_Clear();
32877     v = __pyx_array___getattr__(o, n);
32878   }
32879   return v;
32880 }
32881 
__pyx_getprop___pyx_array_memview(PyObject * o,CYTHON_UNUSED void * x)32882 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
32883   return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
32884 }
32885 
32886 static PyMethodDef __pyx_methods_array[] = {
32887   {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
32888   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
32889   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
32890   {0, 0, 0, 0}
32891 };
32892 
32893 static struct PyGetSetDef __pyx_getsets_array[] = {
32894   {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
32895   {0, 0, 0, 0, 0}
32896 };
32897 
32898 static PySequenceMethods __pyx_tp_as_sequence_array = {
32899   __pyx_array___len__, /*sq_length*/
32900   0, /*sq_concat*/
32901   0, /*sq_repeat*/
32902   __pyx_sq_item_array, /*sq_item*/
32903   0, /*sq_slice*/
32904   0, /*sq_ass_item*/
32905   0, /*sq_ass_slice*/
32906   0, /*sq_contains*/
32907   0, /*sq_inplace_concat*/
32908   0, /*sq_inplace_repeat*/
32909 };
32910 
32911 static PyMappingMethods __pyx_tp_as_mapping_array = {
32912   __pyx_array___len__, /*mp_length*/
32913   __pyx_array___getitem__, /*mp_subscript*/
32914   __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
32915 };
32916 
32917 static PyBufferProcs __pyx_tp_as_buffer_array = {
32918   #if PY_MAJOR_VERSION < 3
32919   0, /*bf_getreadbuffer*/
32920   #endif
32921   #if PY_MAJOR_VERSION < 3
32922   0, /*bf_getwritebuffer*/
32923   #endif
32924   #if PY_MAJOR_VERSION < 3
32925   0, /*bf_getsegcount*/
32926   #endif
32927   #if PY_MAJOR_VERSION < 3
32928   0, /*bf_getcharbuffer*/
32929   #endif
32930   __pyx_array_getbuffer, /*bf_getbuffer*/
32931   0, /*bf_releasebuffer*/
32932 };
32933 
32934 static PyTypeObject __pyx_type___pyx_array = {
32935   PyVarObject_HEAD_INIT(0, 0)
32936   "yt.geometry.particle_smooth.array", /*tp_name*/
32937   sizeof(struct __pyx_array_obj), /*tp_basicsize*/
32938   0, /*tp_itemsize*/
32939   __pyx_tp_dealloc_array, /*tp_dealloc*/
32940   0, /*tp_print*/
32941   0, /*tp_getattr*/
32942   0, /*tp_setattr*/
32943   #if PY_MAJOR_VERSION < 3
32944   0, /*tp_compare*/
32945   #endif
32946   #if PY_MAJOR_VERSION >= 3
32947   0, /*tp_as_async*/
32948   #endif
32949   0, /*tp_repr*/
32950   0, /*tp_as_number*/
32951   &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
32952   &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
32953   0, /*tp_hash*/
32954   0, /*tp_call*/
32955   0, /*tp_str*/
32956   __pyx_tp_getattro_array, /*tp_getattro*/
32957   0, /*tp_setattro*/
32958   &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
32959   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
32960   0, /*tp_doc*/
32961   0, /*tp_traverse*/
32962   0, /*tp_clear*/
32963   0, /*tp_richcompare*/
32964   0, /*tp_weaklistoffset*/
32965   0, /*tp_iter*/
32966   0, /*tp_iternext*/
32967   __pyx_methods_array, /*tp_methods*/
32968   0, /*tp_members*/
32969   __pyx_getsets_array, /*tp_getset*/
32970   0, /*tp_base*/
32971   0, /*tp_dict*/
32972   0, /*tp_descr_get*/
32973   0, /*tp_descr_set*/
32974   0, /*tp_dictoffset*/
32975   0, /*tp_init*/
32976   0, /*tp_alloc*/
32977   __pyx_tp_new_array, /*tp_new*/
32978   0, /*tp_free*/
32979   0, /*tp_is_gc*/
32980   0, /*tp_bases*/
32981   0, /*tp_mro*/
32982   0, /*tp_cache*/
32983   0, /*tp_subclasses*/
32984   0, /*tp_weaklist*/
32985   0, /*tp_del*/
32986   0, /*tp_version_tag*/
32987   #if PY_VERSION_HEX >= 0x030400a1
32988   0, /*tp_finalize*/
32989   #endif
32990   #if PY_VERSION_HEX >= 0x030800b1
32991   0, /*tp_vectorcall*/
32992   #endif
32993 };
32994 
__pyx_tp_new_Enum(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)32995 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
32996   struct __pyx_MemviewEnum_obj *p;
32997   PyObject *o;
32998   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
32999     o = (*t->tp_alloc)(t, 0);
33000   } else {
33001     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
33002   }
33003   if (unlikely(!o)) return 0;
33004   p = ((struct __pyx_MemviewEnum_obj *)o);
33005   p->name = Py_None; Py_INCREF(Py_None);
33006   return o;
33007 }
33008 
__pyx_tp_dealloc_Enum(PyObject * o)33009 static void __pyx_tp_dealloc_Enum(PyObject *o) {
33010   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
33011   #if CYTHON_USE_TP_FINALIZE
33012   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
33013     if (PyObject_CallFinalizerFromDealloc(o)) return;
33014   }
33015   #endif
33016   PyObject_GC_UnTrack(o);
33017   Py_CLEAR(p->name);
33018   (*Py_TYPE(o)->tp_free)(o);
33019 }
33020 
__pyx_tp_traverse_Enum(PyObject * o,visitproc v,void * a)33021 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
33022   int e;
33023   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
33024   if (p->name) {
33025     e = (*v)(p->name, a); if (e) return e;
33026   }
33027   return 0;
33028 }
33029 
__pyx_tp_clear_Enum(PyObject * o)33030 static int __pyx_tp_clear_Enum(PyObject *o) {
33031   PyObject* tmp;
33032   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
33033   tmp = ((PyObject*)p->name);
33034   p->name = Py_None; Py_INCREF(Py_None);
33035   Py_XDECREF(tmp);
33036   return 0;
33037 }
33038 
33039 static PyMethodDef __pyx_methods_Enum[] = {
33040   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
33041   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
33042   {0, 0, 0, 0}
33043 };
33044 
33045 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
33046   PyVarObject_HEAD_INIT(0, 0)
33047   "yt.geometry.particle_smooth.Enum", /*tp_name*/
33048   sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
33049   0, /*tp_itemsize*/
33050   __pyx_tp_dealloc_Enum, /*tp_dealloc*/
33051   0, /*tp_print*/
33052   0, /*tp_getattr*/
33053   0, /*tp_setattr*/
33054   #if PY_MAJOR_VERSION < 3
33055   0, /*tp_compare*/
33056   #endif
33057   #if PY_MAJOR_VERSION >= 3
33058   0, /*tp_as_async*/
33059   #endif
33060   __pyx_MemviewEnum___repr__, /*tp_repr*/
33061   0, /*tp_as_number*/
33062   0, /*tp_as_sequence*/
33063   0, /*tp_as_mapping*/
33064   0, /*tp_hash*/
33065   0, /*tp_call*/
33066   0, /*tp_str*/
33067   0, /*tp_getattro*/
33068   0, /*tp_setattro*/
33069   0, /*tp_as_buffer*/
33070   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
33071   0, /*tp_doc*/
33072   __pyx_tp_traverse_Enum, /*tp_traverse*/
33073   __pyx_tp_clear_Enum, /*tp_clear*/
33074   0, /*tp_richcompare*/
33075   0, /*tp_weaklistoffset*/
33076   0, /*tp_iter*/
33077   0, /*tp_iternext*/
33078   __pyx_methods_Enum, /*tp_methods*/
33079   0, /*tp_members*/
33080   0, /*tp_getset*/
33081   0, /*tp_base*/
33082   0, /*tp_dict*/
33083   0, /*tp_descr_get*/
33084   0, /*tp_descr_set*/
33085   0, /*tp_dictoffset*/
33086   __pyx_MemviewEnum___init__, /*tp_init*/
33087   0, /*tp_alloc*/
33088   __pyx_tp_new_Enum, /*tp_new*/
33089   0, /*tp_free*/
33090   0, /*tp_is_gc*/
33091   0, /*tp_bases*/
33092   0, /*tp_mro*/
33093   0, /*tp_cache*/
33094   0, /*tp_subclasses*/
33095   0, /*tp_weaklist*/
33096   0, /*tp_del*/
33097   0, /*tp_version_tag*/
33098   #if PY_VERSION_HEX >= 0x030400a1
33099   0, /*tp_finalize*/
33100   #endif
33101   #if PY_VERSION_HEX >= 0x030800b1
33102   0, /*tp_vectorcall*/
33103   #endif
33104 };
33105 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
33106 
__pyx_tp_new_memoryview(PyTypeObject * t,PyObject * a,PyObject * k)33107 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
33108   struct __pyx_memoryview_obj *p;
33109   PyObject *o;
33110   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
33111     o = (*t->tp_alloc)(t, 0);
33112   } else {
33113     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
33114   }
33115   if (unlikely(!o)) return 0;
33116   p = ((struct __pyx_memoryview_obj *)o);
33117   p->__pyx_vtab = __pyx_vtabptr_memoryview;
33118   p->obj = Py_None; Py_INCREF(Py_None);
33119   p->_size = Py_None; Py_INCREF(Py_None);
33120   p->_array_interface = Py_None; Py_INCREF(Py_None);
33121   p->view.obj = NULL;
33122   if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
33123   return o;
33124   bad:
33125   Py_DECREF(o); o = 0;
33126   return NULL;
33127 }
33128 
__pyx_tp_dealloc_memoryview(PyObject * o)33129 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
33130   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
33131   #if CYTHON_USE_TP_FINALIZE
33132   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
33133     if (PyObject_CallFinalizerFromDealloc(o)) return;
33134   }
33135   #endif
33136   PyObject_GC_UnTrack(o);
33137   {
33138     PyObject *etype, *eval, *etb;
33139     PyErr_Fetch(&etype, &eval, &etb);
33140     ++Py_REFCNT(o);
33141     __pyx_memoryview___dealloc__(o);
33142     --Py_REFCNT(o);
33143     PyErr_Restore(etype, eval, etb);
33144   }
33145   Py_CLEAR(p->obj);
33146   Py_CLEAR(p->_size);
33147   Py_CLEAR(p->_array_interface);
33148   (*Py_TYPE(o)->tp_free)(o);
33149 }
33150 
__pyx_tp_traverse_memoryview(PyObject * o,visitproc v,void * a)33151 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
33152   int e;
33153   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
33154   if (p->obj) {
33155     e = (*v)(p->obj, a); if (e) return e;
33156   }
33157   if (p->_size) {
33158     e = (*v)(p->_size, a); if (e) return e;
33159   }
33160   if (p->_array_interface) {
33161     e = (*v)(p->_array_interface, a); if (e) return e;
33162   }
33163   if (p->view.obj) {
33164     e = (*v)(p->view.obj, a); if (e) return e;
33165   }
33166   return 0;
33167 }
33168 
__pyx_tp_clear_memoryview(PyObject * o)33169 static int __pyx_tp_clear_memoryview(PyObject *o) {
33170   PyObject* tmp;
33171   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
33172   tmp = ((PyObject*)p->obj);
33173   p->obj = Py_None; Py_INCREF(Py_None);
33174   Py_XDECREF(tmp);
33175   tmp = ((PyObject*)p->_size);
33176   p->_size = Py_None; Py_INCREF(Py_None);
33177   Py_XDECREF(tmp);
33178   tmp = ((PyObject*)p->_array_interface);
33179   p->_array_interface = Py_None; Py_INCREF(Py_None);
33180   Py_XDECREF(tmp);
33181   Py_CLEAR(p->view.obj);
33182   return 0;
33183 }
__pyx_sq_item_memoryview(PyObject * o,Py_ssize_t i)33184 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
33185   PyObject *r;
33186   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
33187   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
33188   Py_DECREF(x);
33189   return r;
33190 }
33191 
__pyx_mp_ass_subscript_memoryview(PyObject * o,PyObject * i,PyObject * v)33192 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
33193   if (v) {
33194     return __pyx_memoryview___setitem__(o, i, v);
33195   }
33196   else {
33197     PyErr_Format(PyExc_NotImplementedError,
33198       "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
33199     return -1;
33200   }
33201 }
33202 
__pyx_getprop___pyx_memoryview_T(PyObject * o,CYTHON_UNUSED void * x)33203 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
33204   return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
33205 }
33206 
__pyx_getprop___pyx_memoryview_base(PyObject * o,CYTHON_UNUSED void * x)33207 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
33208   return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
33209 }
33210 
__pyx_getprop___pyx_memoryview_shape(PyObject * o,CYTHON_UNUSED void * x)33211 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
33212   return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
33213 }
33214 
__pyx_getprop___pyx_memoryview_strides(PyObject * o,CYTHON_UNUSED void * x)33215 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
33216   return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
33217 }
33218 
__pyx_getprop___pyx_memoryview_suboffsets(PyObject * o,CYTHON_UNUSED void * x)33219 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
33220   return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
33221 }
33222 
__pyx_getprop___pyx_memoryview_ndim(PyObject * o,CYTHON_UNUSED void * x)33223 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
33224   return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
33225 }
33226 
__pyx_getprop___pyx_memoryview_itemsize(PyObject * o,CYTHON_UNUSED void * x)33227 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
33228   return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
33229 }
33230 
__pyx_getprop___pyx_memoryview_nbytes(PyObject * o,CYTHON_UNUSED void * x)33231 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
33232   return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
33233 }
33234 
__pyx_getprop___pyx_memoryview_size(PyObject * o,CYTHON_UNUSED void * x)33235 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
33236   return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
33237 }
33238 
33239 static PyMethodDef __pyx_methods_memoryview[] = {
33240   {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
33241   {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
33242   {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
33243   {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
33244   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
33245   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
33246   {0, 0, 0, 0}
33247 };
33248 
33249 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
33250   {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
33251   {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
33252   {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
33253   {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
33254   {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
33255   {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
33256   {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
33257   {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
33258   {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
33259   {0, 0, 0, 0, 0}
33260 };
33261 
33262 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
33263   __pyx_memoryview___len__, /*sq_length*/
33264   0, /*sq_concat*/
33265   0, /*sq_repeat*/
33266   __pyx_sq_item_memoryview, /*sq_item*/
33267   0, /*sq_slice*/
33268   0, /*sq_ass_item*/
33269   0, /*sq_ass_slice*/
33270   0, /*sq_contains*/
33271   0, /*sq_inplace_concat*/
33272   0, /*sq_inplace_repeat*/
33273 };
33274 
33275 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
33276   __pyx_memoryview___len__, /*mp_length*/
33277   __pyx_memoryview___getitem__, /*mp_subscript*/
33278   __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
33279 };
33280 
33281 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
33282   #if PY_MAJOR_VERSION < 3
33283   0, /*bf_getreadbuffer*/
33284   #endif
33285   #if PY_MAJOR_VERSION < 3
33286   0, /*bf_getwritebuffer*/
33287   #endif
33288   #if PY_MAJOR_VERSION < 3
33289   0, /*bf_getsegcount*/
33290   #endif
33291   #if PY_MAJOR_VERSION < 3
33292   0, /*bf_getcharbuffer*/
33293   #endif
33294   __pyx_memoryview_getbuffer, /*bf_getbuffer*/
33295   0, /*bf_releasebuffer*/
33296 };
33297 
33298 static PyTypeObject __pyx_type___pyx_memoryview = {
33299   PyVarObject_HEAD_INIT(0, 0)
33300   "yt.geometry.particle_smooth.memoryview", /*tp_name*/
33301   sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
33302   0, /*tp_itemsize*/
33303   __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
33304   0, /*tp_print*/
33305   0, /*tp_getattr*/
33306   0, /*tp_setattr*/
33307   #if PY_MAJOR_VERSION < 3
33308   0, /*tp_compare*/
33309   #endif
33310   #if PY_MAJOR_VERSION >= 3
33311   0, /*tp_as_async*/
33312   #endif
33313   __pyx_memoryview___repr__, /*tp_repr*/
33314   0, /*tp_as_number*/
33315   &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
33316   &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
33317   0, /*tp_hash*/
33318   0, /*tp_call*/
33319   __pyx_memoryview___str__, /*tp_str*/
33320   0, /*tp_getattro*/
33321   0, /*tp_setattro*/
33322   &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
33323   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
33324   0, /*tp_doc*/
33325   __pyx_tp_traverse_memoryview, /*tp_traverse*/
33326   __pyx_tp_clear_memoryview, /*tp_clear*/
33327   0, /*tp_richcompare*/
33328   0, /*tp_weaklistoffset*/
33329   0, /*tp_iter*/
33330   0, /*tp_iternext*/
33331   __pyx_methods_memoryview, /*tp_methods*/
33332   0, /*tp_members*/
33333   __pyx_getsets_memoryview, /*tp_getset*/
33334   0, /*tp_base*/
33335   0, /*tp_dict*/
33336   0, /*tp_descr_get*/
33337   0, /*tp_descr_set*/
33338   0, /*tp_dictoffset*/
33339   0, /*tp_init*/
33340   0, /*tp_alloc*/
33341   __pyx_tp_new_memoryview, /*tp_new*/
33342   0, /*tp_free*/
33343   0, /*tp_is_gc*/
33344   0, /*tp_bases*/
33345   0, /*tp_mro*/
33346   0, /*tp_cache*/
33347   0, /*tp_subclasses*/
33348   0, /*tp_weaklist*/
33349   0, /*tp_del*/
33350   0, /*tp_version_tag*/
33351   #if PY_VERSION_HEX >= 0x030400a1
33352   0, /*tp_finalize*/
33353   #endif
33354   #if PY_VERSION_HEX >= 0x030800b1
33355   0, /*tp_vectorcall*/
33356   #endif
33357 };
33358 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
33359 
__pyx_tp_new__memoryviewslice(PyTypeObject * t,PyObject * a,PyObject * k)33360 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
33361   struct __pyx_memoryviewslice_obj *p;
33362   PyObject *o = __pyx_tp_new_memoryview(t, a, k);
33363   if (unlikely(!o)) return 0;
33364   p = ((struct __pyx_memoryviewslice_obj *)o);
33365   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
33366   p->from_object = Py_None; Py_INCREF(Py_None);
33367   p->from_slice.memview = NULL;
33368   return o;
33369 }
33370 
__pyx_tp_dealloc__memoryviewslice(PyObject * o)33371 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
33372   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
33373   #if CYTHON_USE_TP_FINALIZE
33374   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
33375     if (PyObject_CallFinalizerFromDealloc(o)) return;
33376   }
33377   #endif
33378   PyObject_GC_UnTrack(o);
33379   {
33380     PyObject *etype, *eval, *etb;
33381     PyErr_Fetch(&etype, &eval, &etb);
33382     ++Py_REFCNT(o);
33383     __pyx_memoryviewslice___dealloc__(o);
33384     --Py_REFCNT(o);
33385     PyErr_Restore(etype, eval, etb);
33386   }
33387   Py_CLEAR(p->from_object);
33388   PyObject_GC_Track(o);
33389   __pyx_tp_dealloc_memoryview(o);
33390 }
33391 
__pyx_tp_traverse__memoryviewslice(PyObject * o,visitproc v,void * a)33392 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
33393   int e;
33394   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
33395   e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
33396   if (p->from_object) {
33397     e = (*v)(p->from_object, a); if (e) return e;
33398   }
33399   return 0;
33400 }
33401 
__pyx_tp_clear__memoryviewslice(PyObject * o)33402 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
33403   PyObject* tmp;
33404   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
33405   __pyx_tp_clear_memoryview(o);
33406   tmp = ((PyObject*)p->from_object);
33407   p->from_object = Py_None; Py_INCREF(Py_None);
33408   Py_XDECREF(tmp);
33409   __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
33410   return 0;
33411 }
33412 
__pyx_getprop___pyx_memoryviewslice_base(PyObject * o,CYTHON_UNUSED void * x)33413 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
33414   return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
33415 }
33416 
33417 static PyMethodDef __pyx_methods__memoryviewslice[] = {
33418   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
33419   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
33420   {0, 0, 0, 0}
33421 };
33422 
33423 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
33424   {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
33425   {0, 0, 0, 0, 0}
33426 };
33427 
33428 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
33429   PyVarObject_HEAD_INIT(0, 0)
33430   "yt.geometry.particle_smooth._memoryviewslice", /*tp_name*/
33431   sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
33432   0, /*tp_itemsize*/
33433   __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
33434   0, /*tp_print*/
33435   0, /*tp_getattr*/
33436   0, /*tp_setattr*/
33437   #if PY_MAJOR_VERSION < 3
33438   0, /*tp_compare*/
33439   #endif
33440   #if PY_MAJOR_VERSION >= 3
33441   0, /*tp_as_async*/
33442   #endif
33443   #if CYTHON_COMPILING_IN_PYPY
33444   __pyx_memoryview___repr__, /*tp_repr*/
33445   #else
33446   0, /*tp_repr*/
33447   #endif
33448   0, /*tp_as_number*/
33449   0, /*tp_as_sequence*/
33450   0, /*tp_as_mapping*/
33451   0, /*tp_hash*/
33452   0, /*tp_call*/
33453   #if CYTHON_COMPILING_IN_PYPY
33454   __pyx_memoryview___str__, /*tp_str*/
33455   #else
33456   0, /*tp_str*/
33457   #endif
33458   0, /*tp_getattro*/
33459   0, /*tp_setattro*/
33460   0, /*tp_as_buffer*/
33461   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
33462   "Internal class for passing memoryview slices to Python", /*tp_doc*/
33463   __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
33464   __pyx_tp_clear__memoryviewslice, /*tp_clear*/
33465   0, /*tp_richcompare*/
33466   0, /*tp_weaklistoffset*/
33467   0, /*tp_iter*/
33468   0, /*tp_iternext*/
33469   __pyx_methods__memoryviewslice, /*tp_methods*/
33470   0, /*tp_members*/
33471   __pyx_getsets__memoryviewslice, /*tp_getset*/
33472   0, /*tp_base*/
33473   0, /*tp_dict*/
33474   0, /*tp_descr_get*/
33475   0, /*tp_descr_set*/
33476   0, /*tp_dictoffset*/
33477   0, /*tp_init*/
33478   0, /*tp_alloc*/
33479   __pyx_tp_new__memoryviewslice, /*tp_new*/
33480   0, /*tp_free*/
33481   0, /*tp_is_gc*/
33482   0, /*tp_bases*/
33483   0, /*tp_mro*/
33484   0, /*tp_cache*/
33485   0, /*tp_subclasses*/
33486   0, /*tp_weaklist*/
33487   0, /*tp_del*/
33488   0, /*tp_version_tag*/
33489   #if PY_VERSION_HEX >= 0x030400a1
33490   0, /*tp_finalize*/
33491   #endif
33492   #if PY_VERSION_HEX >= 0x030800b1
33493   0, /*tp_vectorcall*/
33494   #endif
33495 };
33496 
33497 static PyMethodDef __pyx_methods[] = {
33498   {0, 0, 0, 0}
33499 };
33500 
33501 #if PY_MAJOR_VERSION >= 3
33502 #if CYTHON_PEP489_MULTI_PHASE_INIT
33503 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
33504 static int __pyx_pymod_exec_particle_smooth(PyObject* module); /*proto*/
33505 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
33506   {Py_mod_create, (void*)__pyx_pymod_create},
33507   {Py_mod_exec, (void*)__pyx_pymod_exec_particle_smooth},
33508   {0, NULL}
33509 };
33510 #endif
33511 
33512 static struct PyModuleDef __pyx_moduledef = {
33513     PyModuleDef_HEAD_INIT,
33514     "particle_smooth",
33515     __pyx_k_Particle_smoothing_in_cells, /* m_doc */
33516   #if CYTHON_PEP489_MULTI_PHASE_INIT
33517     0, /* m_size */
33518   #else
33519     -1, /* m_size */
33520   #endif
33521     __pyx_methods /* m_methods */,
33522   #if CYTHON_PEP489_MULTI_PHASE_INIT
33523     __pyx_moduledef_slots, /* m_slots */
33524   #else
33525     NULL, /* m_reload */
33526   #endif
33527     NULL, /* m_traverse */
33528     NULL, /* m_clear */
33529     NULL /* m_free */
33530 };
33531 #endif
33532 #ifndef CYTHON_SMALL_CODE
33533 #if defined(__clang__)
33534     #define CYTHON_SMALL_CODE
33535 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
33536     #define CYTHON_SMALL_CODE __attribute__((cold))
33537 #else
33538     #define CYTHON_SMALL_CODE
33539 #endif
33540 #endif
33541 
33542 static __Pyx_StringTabEntry __pyx_string_tab[] = {
33543   {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
33544   {&__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},
33545   {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1},
33546   {&__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},
33547   {&__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},
33548   {&__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},
33549   {&__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},
33550   {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
33551   {&__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},
33552   {&__pyx_n_s_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 0, 1, 1},
33553   {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
33554   {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
33555   {&__pyx_n_s_IDWInterpolationSmooth, __pyx_k_IDWInterpolationSmooth, sizeof(__pyx_k_IDWInterpolationSmooth), 0, 0, 1, 1},
33556   {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
33557   {&__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},
33558   {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
33559   {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
33560   {&__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},
33561   {&__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},
33562   {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
33563   {&__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},
33564   {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
33565   {&__pyx_n_s_NearestNeighborSmooth, __pyx_k_NearestNeighborSmooth, sizeof(__pyx_k_NearestNeighborSmooth), 0, 0, 1, 1},
33566   {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
33567   {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
33568   {&__pyx_n_s_NthNeighborDistanceSmooth, __pyx_k_NthNeighborDistanceSmooth, sizeof(__pyx_k_NthNeighborDistanceSmooth), 0, 0, 1, 1},
33569   {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
33570   {&__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},
33571   {&__pyx_n_s_ParticleSmoothOperation, __pyx_k_ParticleSmoothOperation, sizeof(__pyx_k_ParticleSmoothOperation), 0, 0, 1, 1},
33572   {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
33573   {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
33574   {&__pyx_kp_s_SOMETHING_WRONG, __pyx_k_SOMETHING_WRONG, sizeof(__pyx_k_SOMETHING_WRONG), 0, 0, 1, 0},
33575   {&__pyx_n_s_SmoothedDensityEstimate, __pyx_k_SmoothedDensityEstimate, sizeof(__pyx_k_SmoothedDensityEstimate), 0, 0, 1, 1},
33576   {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
33577   {&__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},
33578   {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
33579   {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
33580   {&__pyx_n_s_VolumeWeightedSmooth, __pyx_k_VolumeWeightedSmooth, sizeof(__pyx_k_VolumeWeightedSmooth), 0, 0, 1, 1},
33581   {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
33582   {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
33583   {&__pyx_n_s_argsort, __pyx_k_argsort, sizeof(__pyx_k_argsort), 0, 0, 1, 1},
33584   {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1},
33585   {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
33586   {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
33587   {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
33588   {&__pyx_n_s_cartesian, __pyx_k_cartesian, sizeof(__pyx_k_cartesian), 0, 0, 1, 1},
33589   {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
33590   {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
33591   {&__pyx_n_s_code_length, __pyx_k_code_length, sizeof(__pyx_k_code_length), 0, 0, 1, 1},
33592   {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
33593   {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
33594   {&__pyx_n_s_convert_to_units, __pyx_k_convert_to_units, sizeof(__pyx_k_convert_to_units), 0, 0, 1, 1},
33595   {&__pyx_n_s_cos, __pyx_k_cos, sizeof(__pyx_k_cos), 0, 0, 1, 1},
33596   {&__pyx_n_s_cubic, __pyx_k_cubic, sizeof(__pyx_k_cubic), 0, 0, 1, 1},
33597   {&__pyx_n_s_density_smooth, __pyx_k_density_smooth, sizeof(__pyx_k_density_smooth), 0, 0, 1, 1},
33598   {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
33599   {&__pyx_n_s_domain_id, __pyx_k_domain_id, sizeof(__pyx_k_domain_id), 0, 0, 1, 1},
33600   {&__pyx_n_s_domain_offset, __pyx_k_domain_offset, sizeof(__pyx_k_domain_offset), 0, 0, 1, 1},
33601   {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
33602   {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
33603   {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
33604   {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
33605   {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
33606   {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
33607   {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
33608   {&__pyx_n_s_fields, __pyx_k_fields, sizeof(__pyx_k_fields), 0, 0, 1, 1},
33609   {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
33610   {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
33611   {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
33612   {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
33613   {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
33614   {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
33615   {&__pyx_n_s_geometry, __pyx_k_geometry, sizeof(__pyx_k_geometry), 0, 0, 1, 1},
33616   {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
33617   {&__pyx_n_s_gobj, __pyx_k_gobj, sizeof(__pyx_k_gobj), 0, 0, 1, 1},
33618   {&__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},
33619   {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
33620   {&__pyx_n_s_idw_smooth, __pyx_k_idw_smooth, sizeof(__pyx_k_idw_smooth), 0, 0, 1, 1},
33621   {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
33622   {&__pyx_n_s_index_fields, __pyx_k_index_fields, sizeof(__pyx_k_index_fields), 0, 0, 1, 1},
33623   {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1},
33624   {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
33625   {&__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},
33626   {&__pyx_n_s_kernel_name, __pyx_k_kernel_name, sizeof(__pyx_k_kernel_name), 0, 0, 1, 1},
33627   {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
33628   {&__pyx_n_s_max_neighbors, __pyx_k_max_neighbors, sizeof(__pyx_k_max_neighbors), 0, 0, 1, 1},
33629   {&__pyx_n_s_mdom_ind, __pyx_k_mdom_ind, sizeof(__pyx_k_mdom_ind), 0, 0, 1, 1},
33630   {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
33631   {&__pyx_n_s_mesh_octree, __pyx_k_mesh_octree, sizeof(__pyx_k_mesh_octree), 0, 0, 1, 1},
33632   {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
33633   {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
33634   {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
33635   {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
33636   {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
33637   {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
33638   {&__pyx_n_s_nearest_smooth, __pyx_k_nearest_smooth, sizeof(__pyx_k_nearest_smooth), 0, 0, 1, 1},
33639   {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
33640   {&__pyx_n_s_nfields, __pyx_k_nfields, sizeof(__pyx_k_nfields), 0, 0, 1, 1},
33641   {&__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},
33642   {&__pyx_n_s_none, __pyx_k_none, sizeof(__pyx_k_none), 0, 0, 1, 1},
33643   {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
33644   {&__pyx_n_s_nth_neighbor_smooth, __pyx_k_nth_neighbor_smooth, sizeof(__pyx_k_nth_neighbor_smooth), 0, 0, 1, 1},
33645   {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
33646   {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
33647   {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
33648   {&__pyx_n_s_nvals, __pyx_k_nvals, sizeof(__pyx_k_nvals), 0, 0, 1, 1},
33649   {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
33650   {&__pyx_n_s_oct_positions, __pyx_k_oct_positions, sizeof(__pyx_k_oct_positions), 0, 0, 1, 1},
33651   {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1},
33652   {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
33653   {&__pyx_n_s_particle_octree, __pyx_k_particle_octree, sizeof(__pyx_k_particle_octree), 0, 0, 1, 1},
33654   {&__pyx_n_s_pdom_ind, __pyx_k_pdom_ind, sizeof(__pyx_k_pdom_ind), 0, 0, 1, 1},
33655   {&__pyx_n_s_periodicity, __pyx_k_periodicity, sizeof(__pyx_k_periodicity), 0, 0, 1, 1},
33656   {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
33657   {&__pyx_n_s_positions, __pyx_k_positions, sizeof(__pyx_k_positions), 0, 0, 1, 1},
33658   {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
33659   {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
33660   {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
33661   {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
33662   {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
33663   {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
33664   {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
33665   {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
33666   {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
33667   {&__pyx_n_s_quartic, __pyx_k_quartic, sizeof(__pyx_k_quartic), 0, 0, 1, 1},
33668   {&__pyx_n_s_quintic, __pyx_k_quintic, sizeof(__pyx_k_quintic), 0, 0, 1, 1},
33669   {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
33670   {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
33671   {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
33672   {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
33673   {&__pyx_kp_s_self_fp_self_pos_setup_self_sph, __pyx_k_self_fp_self_pos_setup_self_sph, sizeof(__pyx_k_self_fp_self_pos_setup_self_sph), 0, 0, 1, 0},
33674   {&__pyx_kp_s_self_pos_setup_self_sph_kernel_c, __pyx_k_self_pos_setup_self_sph_kernel_c, sizeof(__pyx_k_self_pos_setup_self_sph_kernel_c), 0, 0, 1, 0},
33675   {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
33676   {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
33677   {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
33678   {&__pyx_n_s_sin, __pyx_k_sin, sizeof(__pyx_k_sin), 0, 0, 1, 1},
33679   {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
33680   {&__pyx_n_s_spherical, __pyx_k_spherical, sizeof(__pyx_k_spherical), 0, 0, 1, 1},
33681   {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
33682   {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
33683   {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
33684   {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
33685   {&__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},
33686   {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
33687   {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
33688   {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
33689   {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
33690   {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1},
33691   {&__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},
33692   {&__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},
33693   {&__pyx_n_s_units, __pyx_k_units, sizeof(__pyx_k_units), 0, 0, 1, 1},
33694   {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
33695   {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
33696   {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
33697   {&__pyx_n_s_volume_weighted_smooth, __pyx_k_volume_weighted_smooth, sizeof(__pyx_k_volume_weighted_smooth), 0, 0, 1, 1},
33698   {&__pyx_n_s_wendland2, __pyx_k_wendland2, sizeof(__pyx_k_wendland2), 0, 0, 1, 1},
33699   {&__pyx_n_s_wendland4, __pyx_k_wendland4, sizeof(__pyx_k_wendland4), 0, 0, 1, 1},
33700   {&__pyx_n_s_wendland6, __pyx_k_wendland6, sizeof(__pyx_k_wendland6), 0, 0, 1, 1},
33701   {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
33702   {&__pyx_n_s_zeros_like, __pyx_k_zeros_like, sizeof(__pyx_k_zeros_like), 0, 0, 1, 1},
33703   {0, 0, 0, 0, 0, 0, 0}
33704 };
__Pyx_InitCachedBuiltins(void)33705 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
33706   __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 44, __pyx_L1_error)
33707   __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 149, __pyx_L1_error)
33708   __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
33709   __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 592, __pyx_L1_error)
33710   __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 272, __pyx_L1_error)
33711   __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1038, __pyx_L1_error)
33712   __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
33713   __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
33714   __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 400, __pyx_L1_error)
33715   __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 609, __pyx_L1_error)
33716   __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 828, __pyx_L1_error)
33717   return 0;
33718   __pyx_L1_error:;
33719   return -1;
33720 }
33721 
__Pyx_InitCachedConstants(void)33722 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
33723   __Pyx_RefNannyDeclarations
33724   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
33725 
33726   /* "yt/geometry/particle_smooth.pyx":59
33727  *                      fields = None, int domain_id = -1,
33728  *                      int domain_offset = 0,
33729  *                      periodicity = (True, True, True),             # <<<<<<<<<<<<<<
33730  *                      index_fields = None,
33731  *                      OctreeContainer particle_octree = None,
33732  */
33733   __pyx_tuple_ = PyTuple_Pack(3, Py_True, Py_True, Py_True); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 59, __pyx_L1_error)
33734   __Pyx_GOTREF(__pyx_tuple_);
33735   __Pyx_GIVEREF(__pyx_tuple_);
33736 
33737   /* "yt/geometry/particle_smooth.pyx":127
33738  *             cart_positions[:,2] = positions[:,0] * \
33739  *                                   np.cos(positions[:,1])
33740  *             periodicity = (False, False, False)             # <<<<<<<<<<<<<<
33741  *         else:
33742  *             raise NotImplementedError
33743  */
33744   __pyx_tuple__3 = PyTuple_Pack(3, Py_False, Py_False, Py_False); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 127, __pyx_L1_error)
33745   __Pyx_GOTREF(__pyx_tuple__3);
33746   __Pyx_GIVEREF(__pyx_tuple__3);
33747 
33748   /* "yt/geometry/particle_smooth.pyx":269
33749  *             cart_positions = np.empty((positions.shape[0], 3), dtype="float64")
33750  *
33751  *             cart_positions[:,0] = positions[:,0] * \             # <<<<<<<<<<<<<<
33752  *                                   np.sin(positions[:,1]) * \
33753  *                                   np.cos(positions[:,2])
33754  */
33755   __pyx_slice__4 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__4)) __PYX_ERR(0, 269, __pyx_L1_error)
33756   __Pyx_GOTREF(__pyx_slice__4);
33757   __Pyx_GIVEREF(__pyx_slice__4);
33758   __pyx_tuple__5 = PyTuple_Pack(2, __pyx_slice__4, __pyx_int_0); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 269, __pyx_L1_error)
33759   __Pyx_GOTREF(__pyx_tuple__5);
33760   __Pyx_GIVEREF(__pyx_tuple__5);
33761 
33762   /* "yt/geometry/particle_smooth.pyx":270
33763  *
33764  *             cart_positions[:,0] = positions[:,0] * \
33765  *                                   np.sin(positions[:,1]) * \             # <<<<<<<<<<<<<<
33766  *                                   np.cos(positions[:,2])
33767  *             cart_positions[:,1] = positions[:,0] * \
33768  */
33769   __pyx_tuple__6 = PyTuple_Pack(2, __pyx_slice__4, __pyx_int_1); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 270, __pyx_L1_error)
33770   __Pyx_GOTREF(__pyx_tuple__6);
33771   __Pyx_GIVEREF(__pyx_tuple__6);
33772 
33773   /* "yt/geometry/particle_smooth.pyx":271
33774  *             cart_positions[:,0] = positions[:,0] * \
33775  *                                   np.sin(positions[:,1]) * \
33776  *                                   np.cos(positions[:,2])             # <<<<<<<<<<<<<<
33777  *             cart_positions[:,1] = positions[:,0] * \
33778  *                                   np.sin(positions[:,1]) * \
33779  */
33780   __pyx_tuple__7 = PyTuple_Pack(2, __pyx_slice__4, __pyx_int_2); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 271, __pyx_L1_error)
33781   __Pyx_GOTREF(__pyx_tuple__7);
33782   __Pyx_GIVEREF(__pyx_tuple__7);
33783 
33784   /* "(tree fragment)":2
33785  * def __reduce_cython__(self):
33786  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
33787  * def __setstate_cython__(self, __pyx_state):
33788  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
33789  */
33790   __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_self_pos_setup_self_sph_kernel_c); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 2, __pyx_L1_error)
33791   __Pyx_GOTREF(__pyx_tuple__8);
33792   __Pyx_GIVEREF(__pyx_tuple__8);
33793 
33794   /* "(tree fragment)":4
33795  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
33796  * def __setstate_cython__(self, __pyx_state):
33797  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
33798  */
33799   __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_self_pos_setup_self_sph_kernel_c); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 4, __pyx_L1_error)
33800   __Pyx_GOTREF(__pyx_tuple__9);
33801   __Pyx_GIVEREF(__pyx_tuple__9);
33802 
33803   /* "(tree fragment)":2
33804  * def __reduce_cython__(self):
33805  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
33806  * def __setstate_cython__(self, __pyx_state):
33807  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
33808  */
33809   __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_self_fp_self_pos_setup_self_sph); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 2, __pyx_L1_error)
33810   __Pyx_GOTREF(__pyx_tuple__10);
33811   __Pyx_GIVEREF(__pyx_tuple__10);
33812 
33813   /* "(tree fragment)":4
33814  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
33815  * def __setstate_cython__(self, __pyx_state):
33816  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
33817  */
33818   __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_self_fp_self_pos_setup_self_sph); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 4, __pyx_L1_error)
33819   __Pyx_GOTREF(__pyx_tuple__11);
33820   __Pyx_GIVEREF(__pyx_tuple__11);
33821 
33822   /* "(tree fragment)":2
33823  * def __reduce_cython__(self):
33824  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
33825  * def __setstate_cython__(self, __pyx_state):
33826  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
33827  */
33828   __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_self_fp_self_pos_setup_self_sph); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 2, __pyx_L1_error)
33829   __Pyx_GOTREF(__pyx_tuple__12);
33830   __Pyx_GIVEREF(__pyx_tuple__12);
33831 
33832   /* "(tree fragment)":4
33833  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
33834  * def __setstate_cython__(self, __pyx_state):
33835  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
33836  */
33837   __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_self_fp_self_pos_setup_self_sph); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 4, __pyx_L1_error)
33838   __Pyx_GOTREF(__pyx_tuple__13);
33839   __Pyx_GIVEREF(__pyx_tuple__13);
33840 
33841   /* "(tree fragment)":2
33842  * def __reduce_cython__(self):
33843  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
33844  * def __setstate_cython__(self, __pyx_state):
33845  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
33846  */
33847   __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_self_fp_self_pos_setup_self_sph); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 2, __pyx_L1_error)
33848   __Pyx_GOTREF(__pyx_tuple__14);
33849   __Pyx_GIVEREF(__pyx_tuple__14);
33850 
33851   /* "(tree fragment)":4
33852  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
33853  * def __setstate_cython__(self, __pyx_state):
33854  *     raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
33855  */
33856   __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_self_fp_self_pos_setup_self_sph); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 4, __pyx_L1_error)
33857   __Pyx_GOTREF(__pyx_tuple__15);
33858   __Pyx_GIVEREF(__pyx_tuple__15);
33859 
33860   /* "(tree fragment)":2
33861  * def __reduce_cython__(self):
33862  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
33863  * def __setstate_cython__(self, __pyx_state):
33864  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
33865  */
33866   __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_self_pos_setup_self_sph_kernel_c); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 2, __pyx_L1_error)
33867   __Pyx_GOTREF(__pyx_tuple__16);
33868   __Pyx_GIVEREF(__pyx_tuple__16);
33869 
33870   /* "(tree fragment)":4
33871  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
33872  * def __setstate_cython__(self, __pyx_state):
33873  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
33874  */
33875   __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_self_pos_setup_self_sph_kernel_c); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 4, __pyx_L1_error)
33876   __Pyx_GOTREF(__pyx_tuple__17);
33877   __Pyx_GIVEREF(__pyx_tuple__17);
33878 
33879   /* "(tree fragment)":2
33880  * def __reduce_cython__(self):
33881  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
33882  * def __setstate_cython__(self, __pyx_state):
33883  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
33884  */
33885   __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_self_pos_setup_self_sph_kernel_c); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 2, __pyx_L1_error)
33886   __Pyx_GOTREF(__pyx_tuple__18);
33887   __Pyx_GIVEREF(__pyx_tuple__18);
33888 
33889   /* "(tree fragment)":4
33890  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")
33891  * def __setstate_cython__(self, __pyx_state):
33892  *     raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
33893  */
33894   __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_self_pos_setup_self_sph_kernel_c); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 4, __pyx_L1_error)
33895   __Pyx_GOTREF(__pyx_tuple__19);
33896   __Pyx_GIVEREF(__pyx_tuple__19);
33897 
33898   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272
33899  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
33900  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
33901  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
33902  *
33903  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
33904  */
33905   __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 272, __pyx_L1_error)
33906   __Pyx_GOTREF(__pyx_tuple__20);
33907   __Pyx_GIVEREF(__pyx_tuple__20);
33908 
33909   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276
33910  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
33911  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
33912  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
33913  *
33914  *             info.buf = PyArray_DATA(self)
33915  */
33916   __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 276, __pyx_L1_error)
33917   __Pyx_GOTREF(__pyx_tuple__21);
33918   __Pyx_GIVEREF(__pyx_tuple__21);
33919 
33920   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306
33921  *                 if ((descr.byteorder == c'>' and little_endian) or
33922  *                     (descr.byteorder == c'<' and not little_endian)):
33923  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
33924  *                 if   t == NPY_BYTE:        f = "b"
33925  *                 elif t == NPY_UBYTE:       f = "B"
33926  */
33927   __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 306, __pyx_L1_error)
33928   __Pyx_GOTREF(__pyx_tuple__22);
33929   __Pyx_GIVEREF(__pyx_tuple__22);
33930 
33931   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856
33932  *
33933  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
33934  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
33935  *
33936  *         if ((child.byteorder == c'>' and little_endian) or
33937  */
33938   __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 856, __pyx_L1_error)
33939   __Pyx_GOTREF(__pyx_tuple__23);
33940   __Pyx_GIVEREF(__pyx_tuple__23);
33941 
33942   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880
33943  *             t = child.type_num
33944  *             if end - f < 5:
33945  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
33946  *
33947  *             # Until ticket #99 is fixed, use integers to avoid warnings
33948  */
33949   __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 880, __pyx_L1_error)
33950   __Pyx_GOTREF(__pyx_tuple__24);
33951   __Pyx_GIVEREF(__pyx_tuple__24);
33952 
33953   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038
33954  *         _import_array()
33955  *     except Exception:
33956  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
33957  *
33958  * cdef inline int import_umath() except -1:
33959  */
33960   __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 1038, __pyx_L1_error)
33961   __Pyx_GOTREF(__pyx_tuple__25);
33962   __Pyx_GIVEREF(__pyx_tuple__25);
33963 
33964   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044
33965  *         _import_umath()
33966  *     except Exception:
33967  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
33968  *
33969  * cdef inline int import_ufunc() except -1:
33970  */
33971   __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 1044, __pyx_L1_error)
33972   __Pyx_GOTREF(__pyx_tuple__26);
33973   __Pyx_GIVEREF(__pyx_tuple__26);
33974 
33975   /* "View.MemoryView":133
33976  *
33977  *         if not self.ndim:
33978  *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
33979  *
33980  *         if itemsize <= 0:
33981  */
33982   __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 133, __pyx_L1_error)
33983   __Pyx_GOTREF(__pyx_tuple__27);
33984   __Pyx_GIVEREF(__pyx_tuple__27);
33985 
33986   /* "View.MemoryView":136
33987  *
33988  *         if itemsize <= 0:
33989  *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
33990  *
33991  *         if not isinstance(format, bytes):
33992  */
33993   __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 136, __pyx_L1_error)
33994   __Pyx_GOTREF(__pyx_tuple__28);
33995   __Pyx_GIVEREF(__pyx_tuple__28);
33996 
33997   /* "View.MemoryView":148
33998  *
33999  *         if not self._shape:
34000  *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
34001  *
34002  *
34003  */
34004   __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 148, __pyx_L1_error)
34005   __Pyx_GOTREF(__pyx_tuple__29);
34006   __Pyx_GIVEREF(__pyx_tuple__29);
34007 
34008   /* "View.MemoryView":176
34009  *             self.data = <char *>malloc(self.len)
34010  *             if not self.data:
34011  *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
34012  *
34013  *             if self.dtype_is_object:
34014  */
34015   __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 176, __pyx_L1_error)
34016   __Pyx_GOTREF(__pyx_tuple__30);
34017   __Pyx_GIVEREF(__pyx_tuple__30);
34018 
34019   /* "View.MemoryView":192
34020  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
34021  *         if not (flags & bufmode):
34022  *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
34023  *         info.buf = self.data
34024  *         info.len = self.len
34025  */
34026   __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 192, __pyx_L1_error)
34027   __Pyx_GOTREF(__pyx_tuple__31);
34028   __Pyx_GIVEREF(__pyx_tuple__31);
34029 
34030   /* "(tree fragment)":2
34031  * def __reduce_cython__(self):
34032  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
34033  * def __setstate_cython__(self, __pyx_state):
34034  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
34035  */
34036   __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 2, __pyx_L1_error)
34037   __Pyx_GOTREF(__pyx_tuple__32);
34038   __Pyx_GIVEREF(__pyx_tuple__32);
34039 
34040   /* "(tree fragment)":4
34041  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
34042  * def __setstate_cython__(self, __pyx_state):
34043  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
34044  */
34045   __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 4, __pyx_L1_error)
34046   __Pyx_GOTREF(__pyx_tuple__33);
34047   __Pyx_GIVEREF(__pyx_tuple__33);
34048 
34049   /* "View.MemoryView":414
34050  *     def __setitem__(memoryview self, object index, object value):
34051  *         if self.view.readonly:
34052  *             raise TypeError("Cannot assign to read-only memoryview")             # <<<<<<<<<<<<<<
34053  *
34054  *         have_slices, index = _unellipsify(index, self.view.ndim)
34055  */
34056   __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 414, __pyx_L1_error)
34057   __Pyx_GOTREF(__pyx_tuple__34);
34058   __Pyx_GIVEREF(__pyx_tuple__34);
34059 
34060   /* "View.MemoryView":491
34061  *             result = struct.unpack(self.view.format, bytesitem)
34062  *         except struct.error:
34063  *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
34064  *         else:
34065  *             if len(self.view.format) == 1:
34066  */
34067   __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 491, __pyx_L1_error)
34068   __Pyx_GOTREF(__pyx_tuple__35);
34069   __Pyx_GIVEREF(__pyx_tuple__35);
34070 
34071   /* "View.MemoryView":516
34072  *     def __getbuffer__(self, Py_buffer *info, int flags):
34073  *         if flags & PyBUF_WRITABLE and self.view.readonly:
34074  *             raise ValueError("Cannot create writable memory view from read-only memoryview")             # <<<<<<<<<<<<<<
34075  *
34076  *         if flags & PyBUF_ND:
34077  */
34078   __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 516, __pyx_L1_error)
34079   __Pyx_GOTREF(__pyx_tuple__36);
34080   __Pyx_GIVEREF(__pyx_tuple__36);
34081 
34082   /* "View.MemoryView":566
34083  *         if self.view.strides == NULL:
34084  *
34085  *             raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
34086  *
34087  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
34088  */
34089   __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 566, __pyx_L1_error)
34090   __Pyx_GOTREF(__pyx_tuple__37);
34091   __Pyx_GIVEREF(__pyx_tuple__37);
34092 
34093   /* "View.MemoryView":573
34094  *     def suboffsets(self):
34095  *         if self.view.suboffsets == NULL:
34096  *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
34097  *
34098  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
34099  */
34100   __pyx_tuple__38 = PyTuple_New(1); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 573, __pyx_L1_error)
34101   __Pyx_GOTREF(__pyx_tuple__38);
34102   __Pyx_INCREF(__pyx_int_neg_1);
34103   __Pyx_GIVEREF(__pyx_int_neg_1);
34104   PyTuple_SET_ITEM(__pyx_tuple__38, 0, __pyx_int_neg_1);
34105   __Pyx_GIVEREF(__pyx_tuple__38);
34106 
34107   /* "(tree fragment)":2
34108  * def __reduce_cython__(self):
34109  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
34110  * def __setstate_cython__(self, __pyx_state):
34111  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
34112  */
34113   __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 2, __pyx_L1_error)
34114   __Pyx_GOTREF(__pyx_tuple__39);
34115   __Pyx_GIVEREF(__pyx_tuple__39);
34116 
34117   /* "(tree fragment)":4
34118  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
34119  * def __setstate_cython__(self, __pyx_state):
34120  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
34121  */
34122   __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(1, 4, __pyx_L1_error)
34123   __Pyx_GOTREF(__pyx_tuple__40);
34124   __Pyx_GIVEREF(__pyx_tuple__40);
34125 
34126   /* "View.MemoryView":699
34127  *     for suboffset in suboffsets[:ndim]:
34128  *         if suboffset >= 0:
34129  *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
34130  *
34131  *
34132  */
34133   __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(1, 699, __pyx_L1_error)
34134   __Pyx_GOTREF(__pyx_tuple__41);
34135   __Pyx_GIVEREF(__pyx_tuple__41);
34136 
34137   /* "(tree fragment)":2
34138  * def __reduce_cython__(self):
34139  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
34140  * def __setstate_cython__(self, __pyx_state):
34141  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
34142  */
34143   __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(1, 2, __pyx_L1_error)
34144   __Pyx_GOTREF(__pyx_tuple__42);
34145   __Pyx_GIVEREF(__pyx_tuple__42);
34146 
34147   /* "(tree fragment)":4
34148  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
34149  * def __setstate_cython__(self, __pyx_state):
34150  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
34151  */
34152   __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(1, 4, __pyx_L1_error)
34153   __Pyx_GOTREF(__pyx_tuple__43);
34154   __Pyx_GIVEREF(__pyx_tuple__43);
34155 
34156   /* "View.MemoryView":286
34157  *         return self.name
34158  *
34159  * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
34160  * cdef strided = Enum("<strided and direct>") # default
34161  * cdef indirect = Enum("<strided and indirect>")
34162  */
34163   __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(1, 286, __pyx_L1_error)
34164   __Pyx_GOTREF(__pyx_tuple__44);
34165   __Pyx_GIVEREF(__pyx_tuple__44);
34166 
34167   /* "View.MemoryView":287
34168  *
34169  * cdef generic = Enum("<strided and direct or indirect>")
34170  * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
34171  * cdef indirect = Enum("<strided and indirect>")
34172  *
34173  */
34174   __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 287, __pyx_L1_error)
34175   __Pyx_GOTREF(__pyx_tuple__45);
34176   __Pyx_GIVEREF(__pyx_tuple__45);
34177 
34178   /* "View.MemoryView":288
34179  * cdef generic = Enum("<strided and direct or indirect>")
34180  * cdef strided = Enum("<strided and direct>") # default
34181  * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
34182  *
34183  *
34184  */
34185   __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 288, __pyx_L1_error)
34186   __Pyx_GOTREF(__pyx_tuple__46);
34187   __Pyx_GIVEREF(__pyx_tuple__46);
34188 
34189   /* "View.MemoryView":291
34190  *
34191  *
34192  * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
34193  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
34194  *
34195  */
34196   __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 291, __pyx_L1_error)
34197   __Pyx_GOTREF(__pyx_tuple__47);
34198   __Pyx_GIVEREF(__pyx_tuple__47);
34199 
34200   /* "View.MemoryView":292
34201  *
34202  * cdef contiguous = Enum("<contiguous and direct>")
34203  * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
34204  *
34205  *
34206  */
34207   __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 292, __pyx_L1_error)
34208   __Pyx_GOTREF(__pyx_tuple__48);
34209   __Pyx_GIVEREF(__pyx_tuple__48);
34210 
34211   /* "(tree fragment)":1
34212  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
34213  *     cdef object __pyx_PickleError
34214  *     cdef object __pyx_result
34215  */
34216   __pyx_tuple__49 = 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__49)) __PYX_ERR(1, 1, __pyx_L1_error)
34217   __Pyx_GOTREF(__pyx_tuple__49);
34218   __Pyx_GIVEREF(__pyx_tuple__49);
34219   __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(1, 1, __pyx_L1_error)
34220   __Pyx_RefNannyFinishContext();
34221   return 0;
34222   __pyx_L1_error:;
34223   __Pyx_RefNannyFinishContext();
34224   return -1;
34225 }
34226 
__Pyx_InitGlobals(void)34227 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
34228   if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
34229   __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
34230   __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
34231   __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
34232   __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
34233   __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
34234   __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
34235   return 0;
34236   __pyx_L1_error:;
34237   return -1;
34238 }
34239 
34240 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
34241 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
34242 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
34243 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
34244 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
34245 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
34246 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
34247 
__Pyx_modinit_global_init_code(void)34248 static int __Pyx_modinit_global_init_code(void) {
34249   __Pyx_RefNannyDeclarations
34250   __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
34251   /*--- Global init code ---*/
34252   generic = Py_None; Py_INCREF(Py_None);
34253   strided = Py_None; Py_INCREF(Py_None);
34254   indirect = Py_None; Py_INCREF(Py_None);
34255   contiguous = Py_None; Py_INCREF(Py_None);
34256   indirect_contiguous = Py_None; Py_INCREF(Py_None);
34257   __Pyx_RefNannyFinishContext();
34258   return 0;
34259 }
34260 
__Pyx_modinit_variable_export_code(void)34261 static int __Pyx_modinit_variable_export_code(void) {
34262   __Pyx_RefNannyDeclarations
34263   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
34264   /*--- Variable export code ---*/
34265   __Pyx_RefNannyFinishContext();
34266   return 0;
34267 }
34268 
__Pyx_modinit_function_export_code(void)34269 static int __Pyx_modinit_function_export_code(void) {
34270   __Pyx_RefNannyDeclarations
34271   __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
34272   /*--- Function export code ---*/
34273   __Pyx_RefNannyFinishContext();
34274   return 0;
34275 }
34276 
__Pyx_modinit_type_init_code(void)34277 static int __Pyx_modinit_type_init_code(void) {
34278   __Pyx_RefNannyDeclarations
34279   __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
34280   /*--- Type init code ---*/
34281   __pyx_vtabptr_2yt_8geometry_15particle_smooth_ParticleSmoothOperation = &__pyx_vtable_2yt_8geometry_15particle_smooth_ParticleSmoothOperation;
34282   __pyx_vtable_2yt_8geometry_15particle_smooth_ParticleSmoothOperation.neighbor_process = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_float64_t **, __Pyx_memviewslice, __pyx_t_5numpy_int64_t **, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t **, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_int64_t, int *, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *))__pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_process;
34283   __pyx_vtable_2yt_8geometry_15particle_smooth_ParticleSmoothOperation.neighbor_search = (int (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_float64_t *, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_int64_t **, int *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, struct __pyx_opt_args_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_search *__pyx_optional_args))__pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_search;
34284   __pyx_vtable_2yt_8geometry_15particle_smooth_ParticleSmoothOperation.neighbor_process_particle = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_float64_t **, __Pyx_memviewslice, __pyx_t_5numpy_int64_t **, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t **, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_int64_t, int *, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *))__pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_process_particle;
34285   __pyx_vtable_2yt_8geometry_15particle_smooth_ParticleSmoothOperation.neighbor_find = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *))__pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_find;
34286   __pyx_vtable_2yt_8geometry_15particle_smooth_ParticleSmoothOperation.process = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, int, int, int, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t **, __pyx_t_5numpy_float64_t **, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *))__pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_process;
34287   if (PyType_Ready(&__pyx_type_2yt_8geometry_15particle_smooth_ParticleSmoothOperation) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
34288   #if PY_VERSION_HEX < 0x030800B1
34289   __pyx_type_2yt_8geometry_15particle_smooth_ParticleSmoothOperation.tp_print = 0;
34290   #endif
34291   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2yt_8geometry_15particle_smooth_ParticleSmoothOperation.tp_dictoffset && __pyx_type_2yt_8geometry_15particle_smooth_ParticleSmoothOperation.tp_getattro == PyObject_GenericGetAttr)) {
34292     __pyx_type_2yt_8geometry_15particle_smooth_ParticleSmoothOperation.tp_getattro = __Pyx_PyObject_GenericGetAttr;
34293   }
34294   if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_15particle_smooth_ParticleSmoothOperation.tp_dict, __pyx_vtabptr_2yt_8geometry_15particle_smooth_ParticleSmoothOperation) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
34295   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ParticleSmoothOperation, (PyObject *)&__pyx_type_2yt_8geometry_15particle_smooth_ParticleSmoothOperation) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
34296   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_15particle_smooth_ParticleSmoothOperation) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
34297   __pyx_ptype_2yt_8geometry_15particle_smooth_ParticleSmoothOperation = &__pyx_type_2yt_8geometry_15particle_smooth_ParticleSmoothOperation;
34298   __pyx_vtabptr_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth = &__pyx_vtable_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth;
34299   __pyx_vtable_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth.__pyx_base = *__pyx_vtabptr_2yt_8geometry_15particle_smooth_ParticleSmoothOperation;
34300   __pyx_vtable_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth.__pyx_base.process = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, int, int, int, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t **, __pyx_t_5numpy_float64_t **, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *))__pyx_f_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_process;
34301   __pyx_type_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth.tp_base = __pyx_ptype_2yt_8geometry_15particle_smooth_ParticleSmoothOperation;
34302   if (PyType_Ready(&__pyx_type_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth) < 0) __PYX_ERR(0, 577, __pyx_L1_error)
34303   #if PY_VERSION_HEX < 0x030800B1
34304   __pyx_type_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth.tp_print = 0;
34305   #endif
34306   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth.tp_dictoffset && __pyx_type_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth.tp_getattro == PyObject_GenericGetAttr)) {
34307     __pyx_type_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth.tp_getattro = __Pyx_PyObject_GenericGetAttr;
34308   }
34309   if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth.tp_dict, __pyx_vtabptr_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth) < 0) __PYX_ERR(0, 577, __pyx_L1_error)
34310   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_VolumeWeightedSmooth, (PyObject *)&__pyx_type_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth) < 0) __PYX_ERR(0, 577, __pyx_L1_error)
34311   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth) < 0) __PYX_ERR(0, 577, __pyx_L1_error)
34312   __pyx_ptype_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth = &__pyx_type_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth;
34313   __pyx_vtabptr_2yt_8geometry_15particle_smooth_NearestNeighborSmooth = &__pyx_vtable_2yt_8geometry_15particle_smooth_NearestNeighborSmooth;
34314   __pyx_vtable_2yt_8geometry_15particle_smooth_NearestNeighborSmooth.__pyx_base = *__pyx_vtabptr_2yt_8geometry_15particle_smooth_ParticleSmoothOperation;
34315   __pyx_vtable_2yt_8geometry_15particle_smooth_NearestNeighborSmooth.__pyx_base.process = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, int, int, int, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t **, __pyx_t_5numpy_float64_t **, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *))__pyx_f_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_process;
34316   __pyx_type_2yt_8geometry_15particle_smooth_NearestNeighborSmooth.tp_base = __pyx_ptype_2yt_8geometry_15particle_smooth_ParticleSmoothOperation;
34317   if (PyType_Ready(&__pyx_type_2yt_8geometry_15particle_smooth_NearestNeighborSmooth) < 0) __PYX_ERR(0, 654, __pyx_L1_error)
34318   #if PY_VERSION_HEX < 0x030800B1
34319   __pyx_type_2yt_8geometry_15particle_smooth_NearestNeighborSmooth.tp_print = 0;
34320   #endif
34321   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2yt_8geometry_15particle_smooth_NearestNeighborSmooth.tp_dictoffset && __pyx_type_2yt_8geometry_15particle_smooth_NearestNeighborSmooth.tp_getattro == PyObject_GenericGetAttr)) {
34322     __pyx_type_2yt_8geometry_15particle_smooth_NearestNeighborSmooth.tp_getattro = __Pyx_PyObject_GenericGetAttr;
34323   }
34324   if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_15particle_smooth_NearestNeighborSmooth.tp_dict, __pyx_vtabptr_2yt_8geometry_15particle_smooth_NearestNeighborSmooth) < 0) __PYX_ERR(0, 654, __pyx_L1_error)
34325   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NearestNeighborSmooth, (PyObject *)&__pyx_type_2yt_8geometry_15particle_smooth_NearestNeighborSmooth) < 0) __PYX_ERR(0, 654, __pyx_L1_error)
34326   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_15particle_smooth_NearestNeighborSmooth) < 0) __PYX_ERR(0, 654, __pyx_L1_error)
34327   __pyx_ptype_2yt_8geometry_15particle_smooth_NearestNeighborSmooth = &__pyx_type_2yt_8geometry_15particle_smooth_NearestNeighborSmooth;
34328   __pyx_vtabptr_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth = &__pyx_vtable_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth;
34329   __pyx_vtable_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth.__pyx_base = *__pyx_vtabptr_2yt_8geometry_15particle_smooth_ParticleSmoothOperation;
34330   __pyx_vtable_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth.__pyx_base.process = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, int, int, int, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t **, __pyx_t_5numpy_float64_t **, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *))__pyx_f_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_process;
34331   __pyx_type_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth.tp_base = __pyx_ptype_2yt_8geometry_15particle_smooth_ParticleSmoothOperation;
34332   if (PyType_Ready(&__pyx_type_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth) < 0) __PYX_ERR(0, 686, __pyx_L1_error)
34333   #if PY_VERSION_HEX < 0x030800B1
34334   __pyx_type_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth.tp_print = 0;
34335   #endif
34336   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth.tp_dictoffset && __pyx_type_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth.tp_getattro == PyObject_GenericGetAttr)) {
34337     __pyx_type_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth.tp_getattro = __Pyx_PyObject_GenericGetAttr;
34338   }
34339   if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth.tp_dict, __pyx_vtabptr_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth) < 0) __PYX_ERR(0, 686, __pyx_L1_error)
34340   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_IDWInterpolationSmooth, (PyObject *)&__pyx_type_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth) < 0) __PYX_ERR(0, 686, __pyx_L1_error)
34341   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth) < 0) __PYX_ERR(0, 686, __pyx_L1_error)
34342   __pyx_ptype_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth = &__pyx_type_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth;
34343   __pyx_vtabptr_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth = &__pyx_vtable_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth;
34344   __pyx_vtable_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth.__pyx_base = *__pyx_vtabptr_2yt_8geometry_15particle_smooth_ParticleSmoothOperation;
34345   __pyx_vtable_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth.__pyx_base.process = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, int, int, int, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t **, __pyx_t_5numpy_float64_t **, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *))__pyx_f_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_process;
34346   __pyx_type_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth.tp_base = __pyx_ptype_2yt_8geometry_15particle_smooth_ParticleSmoothOperation;
34347   if (PyType_Ready(&__pyx_type_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth) < 0) __PYX_ERR(0, 729, __pyx_L1_error)
34348   #if PY_VERSION_HEX < 0x030800B1
34349   __pyx_type_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth.tp_print = 0;
34350   #endif
34351   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth.tp_dictoffset && __pyx_type_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth.tp_getattro == PyObject_GenericGetAttr)) {
34352     __pyx_type_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth.tp_getattro = __Pyx_PyObject_GenericGetAttr;
34353   }
34354   if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth.tp_dict, __pyx_vtabptr_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth) < 0) __PYX_ERR(0, 729, __pyx_L1_error)
34355   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NthNeighborDistanceSmooth, (PyObject *)&__pyx_type_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth) < 0) __PYX_ERR(0, 729, __pyx_L1_error)
34356   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth) < 0) __PYX_ERR(0, 729, __pyx_L1_error)
34357   __pyx_ptype_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth = &__pyx_type_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth;
34358   __pyx_vtabptr_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate = &__pyx_vtable_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate;
34359   __pyx_vtable_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate.__pyx_base = *__pyx_vtabptr_2yt_8geometry_15particle_smooth_ParticleSmoothOperation;
34360   __pyx_vtable_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate.__pyx_base.process = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, int, int, int, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t **, __pyx_t_5numpy_float64_t **, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *))__pyx_f_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_process;
34361   __pyx_type_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate.tp_base = __pyx_ptype_2yt_8geometry_15particle_smooth_ParticleSmoothOperation;
34362   if (PyType_Ready(&__pyx_type_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate) < 0) __PYX_ERR(0, 751, __pyx_L1_error)
34363   #if PY_VERSION_HEX < 0x030800B1
34364   __pyx_type_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate.tp_print = 0;
34365   #endif
34366   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate.tp_dictoffset && __pyx_type_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate.tp_getattro == PyObject_GenericGetAttr)) {
34367     __pyx_type_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate.tp_getattro = __Pyx_PyObject_GenericGetAttr;
34368   }
34369   if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate.tp_dict, __pyx_vtabptr_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate) < 0) __PYX_ERR(0, 751, __pyx_L1_error)
34370   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SmoothedDensityEstimate, (PyObject *)&__pyx_type_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate) < 0) __PYX_ERR(0, 751, __pyx_L1_error)
34371   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate) < 0) __PYX_ERR(0, 751, __pyx_L1_error)
34372   __pyx_ptype_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate = &__pyx_type_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate;
34373   __pyx_vtabptr_array = &__pyx_vtable_array;
34374   __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
34375   if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
34376   #if PY_VERSION_HEX < 0x030800B1
34377   __pyx_type___pyx_array.tp_print = 0;
34378   #endif
34379   if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
34380   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
34381   __pyx_array_type = &__pyx_type___pyx_array;
34382   if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
34383   #if PY_VERSION_HEX < 0x030800B1
34384   __pyx_type___pyx_MemviewEnum.tp_print = 0;
34385   #endif
34386   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
34387     __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
34388   }
34389   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
34390   __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
34391   __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
34392   __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
34393   __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
34394   __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
34395   __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
34396   __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
34397   __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
34398   __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
34399   if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
34400   #if PY_VERSION_HEX < 0x030800B1
34401   __pyx_type___pyx_memoryview.tp_print = 0;
34402   #endif
34403   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
34404     __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
34405   }
34406   if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
34407   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
34408   __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
34409   __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
34410   __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
34411   __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
34412   __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
34413   __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
34414   if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 961, __pyx_L1_error)
34415   #if PY_VERSION_HEX < 0x030800B1
34416   __pyx_type___pyx_memoryviewslice.tp_print = 0;
34417   #endif
34418   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
34419     __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
34420   }
34421   if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 961, __pyx_L1_error)
34422   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 961, __pyx_L1_error)
34423   __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
34424   __Pyx_RefNannyFinishContext();
34425   return 0;
34426   __pyx_L1_error:;
34427   __Pyx_RefNannyFinishContext();
34428   return -1;
34429 }
34430 
__Pyx_modinit_type_import_code(void)34431 static int __Pyx_modinit_type_import_code(void) {
34432   __Pyx_RefNannyDeclarations
34433   PyObject *__pyx_t_1 = NULL;
34434   __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
34435   /*--- Type import code ---*/
34436   __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 9, __pyx_L1_error)
34437   __Pyx_GOTREF(__pyx_t_1);
34438   __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
34439   #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
34440   sizeof(PyTypeObject),
34441   #else
34442   sizeof(PyHeapTypeObject),
34443   #endif
34444   __Pyx_ImportType_CheckSize_Warn);
34445    if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(6, 9, __pyx_L1_error)
34446   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34447   __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 206, __pyx_L1_error)
34448   __Pyx_GOTREF(__pyx_t_1);
34449   __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
34450    if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 206, __pyx_L1_error)
34451   __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
34452    if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 229, __pyx_L1_error)
34453   __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
34454    if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 233, __pyx_L1_error)
34455   __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
34456    if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 242, __pyx_L1_error)
34457   __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
34458    if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 918, __pyx_L1_error)
34459   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34460   __pyx_t_1 = PyImport_ImportModule("yt.geometry.oct_visitors"); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 33, __pyx_L1_error)
34461   __Pyx_GOTREF(__pyx_t_1);
34462   __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "OctVisitor", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor), __Pyx_ImportType_CheckSize_Warn);
34463    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor) __PYX_ERR(7, 33, __pyx_L1_error)
34464   __pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor)) __PYX_ERR(7, 33, __pyx_L1_error)
34465   __pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "CountTotalOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts), __Pyx_ImportType_CheckSize_Warn);
34466    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts) __PYX_ERR(7, 59, __pyx_L1_error)
34467   __pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountTotalOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalOcts)) __PYX_ERR(7, 59, __pyx_L1_error)
34468   __pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalCells = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "CountTotalCells", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells), __Pyx_ImportType_CheckSize_Warn);
34469    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalCells) __PYX_ERR(7, 62, __pyx_L1_error)
34470   __pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalCells = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountTotalCells*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalCells->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalCells)) __PYX_ERR(7, 62, __pyx_L1_error)
34471   __pyx_ptype_2yt_8geometry_12oct_visitors_MarkOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "MarkOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts), __Pyx_ImportType_CheckSize_Warn);
34472    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_MarkOcts) __PYX_ERR(7, 65, __pyx_L1_error)
34473   __pyx_vtabptr_2yt_8geometry_12oct_visitors_MarkOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MarkOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_MarkOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_MarkOcts)) __PYX_ERR(7, 65, __pyx_L1_error)
34474   __pyx_ptype_2yt_8geometry_12oct_visitors_MaskOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "MaskOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts), __Pyx_ImportType_CheckSize_Warn);
34475    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_MaskOcts) __PYX_ERR(7, 69, __pyx_L1_error)
34476   __pyx_vtabptr_2yt_8geometry_12oct_visitors_MaskOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MaskOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_MaskOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_MaskOcts)) __PYX_ERR(7, 69, __pyx_L1_error)
34477   __pyx_ptype_2yt_8geometry_12oct_visitors_IndexOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "IndexOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts), __Pyx_ImportType_CheckSize_Warn);
34478    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_IndexOcts) __PYX_ERR(7, 72, __pyx_L1_error)
34479   __pyx_vtabptr_2yt_8geometry_12oct_visitors_IndexOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IndexOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_IndexOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_IndexOcts)) __PYX_ERR(7, 72, __pyx_L1_error)
34480   __pyx_ptype_2yt_8geometry_12oct_visitors_MaskedIndexOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "MaskedIndexOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskedIndexOcts), __Pyx_ImportType_CheckSize_Warn);
34481    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_MaskedIndexOcts) __PYX_ERR(7, 75, __pyx_L1_error)
34482   __pyx_vtabptr_2yt_8geometry_12oct_visitors_MaskedIndexOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MaskedIndexOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_MaskedIndexOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_MaskedIndexOcts)) __PYX_ERR(7, 75, __pyx_L1_error)
34483   __pyx_ptype_2yt_8geometry_12oct_visitors_IndexMaskMapOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "IndexMaskMapOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexMaskMapOcts), __Pyx_ImportType_CheckSize_Warn);
34484    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_IndexMaskMapOcts) __PYX_ERR(7, 79, __pyx_L1_error)
34485   __pyx_vtabptr_2yt_8geometry_12oct_visitors_IndexMaskMapOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IndexMaskMapOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_IndexMaskMapOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_IndexMaskMapOcts)) __PYX_ERR(7, 79, __pyx_L1_error)
34486   __pyx_ptype_2yt_8geometry_12oct_visitors_ICoordsOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "ICoordsOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts), __Pyx_ImportType_CheckSize_Warn);
34487    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_ICoordsOcts) __PYX_ERR(7, 85, __pyx_L1_error)
34488   __pyx_vtabptr_2yt_8geometry_12oct_visitors_ICoordsOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_ICoordsOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_ICoordsOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_ICoordsOcts)) __PYX_ERR(7, 85, __pyx_L1_error)
34489   __pyx_ptype_2yt_8geometry_12oct_visitors_IResOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "IResOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts), __Pyx_ImportType_CheckSize_Warn);
34490    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_IResOcts) __PYX_ERR(7, 88, __pyx_L1_error)
34491   __pyx_vtabptr_2yt_8geometry_12oct_visitors_IResOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IResOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_IResOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_IResOcts)) __PYX_ERR(7, 88, __pyx_L1_error)
34492   __pyx_ptype_2yt_8geometry_12oct_visitors_FCoordsOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "FCoordsOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts), __Pyx_ImportType_CheckSize_Warn);
34493    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_FCoordsOcts) __PYX_ERR(7, 91, __pyx_L1_error)
34494   __pyx_vtabptr_2yt_8geometry_12oct_visitors_FCoordsOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FCoordsOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_FCoordsOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_FCoordsOcts)) __PYX_ERR(7, 91, __pyx_L1_error)
34495   __pyx_ptype_2yt_8geometry_12oct_visitors_FWidthOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "FWidthOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts), __Pyx_ImportType_CheckSize_Warn);
34496    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_FWidthOcts) __PYX_ERR(7, 94, __pyx_L1_error)
34497   __pyx_vtabptr_2yt_8geometry_12oct_visitors_FWidthOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FWidthOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_FWidthOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_FWidthOcts)) __PYX_ERR(7, 94, __pyx_L1_error)
34498   __pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayI64 = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "CopyArrayI64", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64), __Pyx_ImportType_CheckSize_Warn);
34499    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayI64) __PYX_ERR(7, 97, __pyx_L1_error)
34500   __pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayI64 = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyArrayI64*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayI64->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayI64)) __PYX_ERR(7, 97, __pyx_L1_error)
34501   __pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayF64 = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "CopyArrayF64", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64), __Pyx_ImportType_CheckSize_Warn);
34502    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayF64) __PYX_ERR(7, 101, __pyx_L1_error)
34503   __pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayF64 = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyArrayF64*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayF64->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayF64)) __PYX_ERR(7, 101, __pyx_L1_error)
34504   __pyx_ptype_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8 = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "CopyFileIndArrayI8", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8), __Pyx_ImportType_CheckSize_Warn);
34505    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8) __PYX_ERR(7, 105, __pyx_L1_error)
34506   __pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8 = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8)) __PYX_ERR(7, 105, __pyx_L1_error)
34507   __pyx_ptype_2yt_8geometry_12oct_visitors_IdentifyOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "IdentifyOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts), __Pyx_ImportType_CheckSize_Warn);
34508    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_IdentifyOcts) __PYX_ERR(7, 110, __pyx_L1_error)
34509   __pyx_vtabptr_2yt_8geometry_12oct_visitors_IdentifyOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IdentifyOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_IdentifyOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_IdentifyOcts)) __PYX_ERR(7, 110, __pyx_L1_error)
34510   __pyx_ptype_2yt_8geometry_12oct_visitors_AssignDomainInd = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "AssignDomainInd", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd), __Pyx_ImportType_CheckSize_Warn);
34511    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_AssignDomainInd) __PYX_ERR(7, 113, __pyx_L1_error)
34512   __pyx_vtabptr_2yt_8geometry_12oct_visitors_AssignDomainInd = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_AssignDomainInd*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_AssignDomainInd->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_AssignDomainInd)) __PYX_ERR(7, 113, __pyx_L1_error)
34513   __pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesO = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "FillFileIndicesO", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO), __Pyx_ImportType_CheckSize_Warn);
34514    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesO) __PYX_ERR(7, 116, __pyx_L1_error)
34515   __pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesO = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FillFileIndicesO*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesO->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesO)) __PYX_ERR(7, 116, __pyx_L1_error)
34516   __pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesR = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "FillFileIndicesR", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR), __Pyx_ImportType_CheckSize_Warn);
34517    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesR) __PYX_ERR(7, 121, __pyx_L1_error)
34518   __pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesR = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FillFileIndicesR*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesR->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesR)) __PYX_ERR(7, 121, __pyx_L1_error)
34519   __pyx_ptype_2yt_8geometry_12oct_visitors_CountByDomain = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "CountByDomain", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain), __Pyx_ImportType_CheckSize_Warn);
34520    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_CountByDomain) __PYX_ERR(7, 126, __pyx_L1_error)
34521   __pyx_vtabptr_2yt_8geometry_12oct_visitors_CountByDomain = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountByDomain*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_CountByDomain->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountByDomain)) __PYX_ERR(7, 126, __pyx_L1_error)
34522   __pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "StoreOctree", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree), __Pyx_ImportType_CheckSize_Warn);
34523    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree) __PYX_ERR(7, 129, __pyx_L1_error)
34524   __pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreOctree*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree)) __PYX_ERR(7, 129, __pyx_L1_error)
34525   __pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "LoadOctree", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree), __Pyx_ImportType_CheckSize_Warn);
34526    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree) __PYX_ERR(7, 132, __pyx_L1_error)
34527   __pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree)) __PYX_ERR(7, 132, __pyx_L1_error)
34528   __pyx_ptype_2yt_8geometry_12oct_visitors_MortonIndexOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "MortonIndexOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_MortonIndexOcts), __Pyx_ImportType_CheckSize_Warn);
34529    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_MortonIndexOcts) __PYX_ERR(7, 138, __pyx_L1_error)
34530   __pyx_vtabptr_2yt_8geometry_12oct_visitors_MortonIndexOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MortonIndexOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_MortonIndexOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_MortonIndexOcts)) __PYX_ERR(7, 138, __pyx_L1_error)
34531   __pyx_ptype_2yt_8geometry_12oct_visitors_StoreIndex = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "StoreIndex", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreIndex), __Pyx_ImportType_CheckSize_Warn);
34532    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_StoreIndex) __PYX_ERR(7, 149, __pyx_L1_error)
34533   __pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreIndex = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreIndex*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_StoreIndex->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreIndex)) __PYX_ERR(7, 149, __pyx_L1_error)
34534   __pyx_ptype_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "BaseNeighbourVisitor", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor), __Pyx_ImportType_CheckSize_Warn);
34535    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor) __PYX_ERR(7, 153, __pyx_L1_error)
34536   __pyx_vtabptr_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor)) __PYX_ERR(7, 153, __pyx_L1_error)
34537   __pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "NeighbourCellIndexVisitor", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor), __Pyx_ImportType_CheckSize_Warn);
34538    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor) __PYX_ERR(7, 169, __pyx_L1_error)
34539   __pyx_vtabptr_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor)) __PYX_ERR(7, 169, __pyx_L1_error)
34540   __pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellVisitor = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "NeighbourCellVisitor", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_NeighbourCellVisitor), __Pyx_ImportType_CheckSize_Warn);
34541    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellVisitor) __PYX_ERR(7, 173, __pyx_L1_error)
34542   __pyx_vtabptr_2yt_8geometry_12oct_visitors_NeighbourCellVisitor = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_NeighbourCellVisitor*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellVisitor->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_NeighbourCellVisitor)) __PYX_ERR(7, 173, __pyx_L1_error)
34543   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34544   __pyx_t_1 = PyImport_ImportModule("yt.geometry.selection_routines"); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 24, __pyx_L1_error)
34545   __Pyx_GOTREF(__pyx_t_1);
34546   __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = __Pyx_ImportType(__pyx_t_1, "yt.geometry.selection_routines", "SelectorObject", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject), __Pyx_ImportType_CheckSize_Warn);
34547    if (!__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject) __PYX_ERR(8, 24, __pyx_L1_error)
34548   __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(8, 24, __pyx_L1_error)
34549   __pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = __Pyx_ImportType(__pyx_t_1, "yt.geometry.selection_routines", "AlwaysSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector), __Pyx_ImportType_CheckSize_Warn);
34550    if (!__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector) __PYX_ERR(8, 70, __pyx_L1_error)
34551   __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(8, 70, __pyx_L1_error)
34552   __pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = __Pyx_ImportType(__pyx_t_1, "yt.geometry.selection_routines", "OctreeSubsetSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector), __Pyx_ImportType_CheckSize_Warn);
34553    if (!__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector) __PYX_ERR(8, 73, __pyx_L1_error)
34554   __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(8, 73, __pyx_L1_error)
34555   __pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = __Pyx_ImportType(__pyx_t_1, "yt.geometry.selection_routines", "BooleanSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector), __Pyx_ImportType_CheckSize_Warn);
34556    if (!__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector) __PYX_ERR(8, 77, __pyx_L1_error)
34557   __pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector)) __PYX_ERR(8, 77, __pyx_L1_error)
34558   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34559   __pyx_t_1 = PyImport_ImportModule("yt.utilities.lib.allocation_container"); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 20, __pyx_L1_error)
34560   __Pyx_GOTREF(__pyx_t_1);
34561   __pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = __Pyx_ImportType(__pyx_t_1, "yt.utilities.lib.allocation_container", "ObjectPool", sizeof(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool), __Pyx_ImportType_CheckSize_Warn);
34562    if (!__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool) __PYX_ERR(9, 20, __pyx_L1_error)
34563   __pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool = (struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool)) __PYX_ERR(9, 20, __pyx_L1_error)
34564   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34565   __pyx_t_1 = PyImport_ImportModule("yt.geometry.oct_container"); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 47, __pyx_L1_error)
34566   __Pyx_GOTREF(__pyx_t_1);
34567   __pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_container", "OctObjectPool", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool), __Pyx_ImportType_CheckSize_Warn);
34568    if (!__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool) __PYX_ERR(10, 47, __pyx_L1_error)
34569   __pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool)) __PYX_ERR(10, 47, __pyx_L1_error)
34570   __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_container", "OctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer), __Pyx_ImportType_CheckSize_Warn);
34571    if (!__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer) __PYX_ERR(10, 55, __pyx_L1_error)
34572   __pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(10, 55, __pyx_L1_error)
34573   __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_container", "SparseOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer), __Pyx_ImportType_CheckSize_Warn);
34574    if (!__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer) __PYX_ERR(10, 85, __pyx_L1_error)
34575   __pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(10, 85, __pyx_L1_error)
34576   __pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_container", "RAMSESOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer), __Pyx_ImportType_CheckSize_Warn);
34577    if (!__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer) __PYX_ERR(10, 93, __pyx_L1_error)
34578   __pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(10, 93, __pyx_L1_error)
34579   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34580   __pyx_t_1 = PyImport_ImportModule("yt.utilities.lib.distance_queue"); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 35, __pyx_L1_error)
34581   __Pyx_GOTREF(__pyx_t_1);
34582   __pyx_ptype_2yt_9utilities_3lib_14distance_queue_PriorityQueue = __Pyx_ImportType(__pyx_t_1, "yt.utilities.lib.distance_queue", "PriorityQueue", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue), __Pyx_ImportType_CheckSize_Warn);
34583    if (!__pyx_ptype_2yt_9utilities_3lib_14distance_queue_PriorityQueue) __PYX_ERR(11, 35, __pyx_L1_error)
34584   __pyx_vtabptr_2yt_9utilities_3lib_14distance_queue_PriorityQueue = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_PriorityQueue*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14distance_queue_PriorityQueue->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14distance_queue_PriorityQueue)) __PYX_ERR(11, 35, __pyx_L1_error)
34585   __pyx_ptype_2yt_9utilities_3lib_14distance_queue_DistanceQueue = __Pyx_ImportType(__pyx_t_1, "yt.utilities.lib.distance_queue", "DistanceQueue", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue), __Pyx_ImportType_CheckSize_Warn);
34586    if (!__pyx_ptype_2yt_9utilities_3lib_14distance_queue_DistanceQueue) __PYX_ERR(11, 42, __pyx_L1_error)
34587   __pyx_vtabptr_2yt_9utilities_3lib_14distance_queue_DistanceQueue = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_DistanceQueue*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14distance_queue_DistanceQueue->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14distance_queue_DistanceQueue)) __PYX_ERR(11, 42, __pyx_L1_error)
34588   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34589   __pyx_t_1 = PyImport_ImportModule("yt.geometry.particle_deposit"); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 139, __pyx_L1_error)
34590   __Pyx_GOTREF(__pyx_t_1);
34591   __pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation = __Pyx_ImportType(__pyx_t_1, "yt.geometry.particle_deposit", "ParticleDepositOperation", sizeof(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation), __Pyx_ImportType_CheckSize_Warn);
34592    if (!__pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation) __PYX_ERR(5, 139, __pyx_L1_error)
34593   __pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation = (struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_ParticleDepositOperation*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation)) __PYX_ERR(5, 139, __pyx_L1_error)
34594   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34595   __Pyx_RefNannyFinishContext();
34596   return 0;
34597   __pyx_L1_error:;
34598   __Pyx_XDECREF(__pyx_t_1);
34599   __Pyx_RefNannyFinishContext();
34600   return -1;
34601 }
34602 
__Pyx_modinit_variable_import_code(void)34603 static int __Pyx_modinit_variable_import_code(void) {
34604   __Pyx_RefNannyDeclarations
34605   PyObject *__pyx_t_1 = NULL;
34606   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
34607   /*--- Variable import code ---*/
34608   __pyx_t_1 = PyImport_ImportModule("yt.geometry.oct_container"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
34609   if (__Pyx_ImportVoidPtr(__pyx_t_1, "ORDER_MAX", (void **)&__pyx_vp_2yt_8geometry_13oct_container_ORDER_MAX, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34610   Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34611   __Pyx_RefNannyFinishContext();
34612   return 0;
34613   __pyx_L1_error:;
34614   __Pyx_XDECREF(__pyx_t_1);
34615   __Pyx_RefNannyFinishContext();
34616   return -1;
34617 }
34618 
__Pyx_modinit_function_import_code(void)34619 static int __Pyx_modinit_function_import_code(void) {
34620   __Pyx_RefNannyDeclarations
34621   PyObject *__pyx_t_1 = NULL;
34622   PyObject *__pyx_t_2 = NULL;
34623   __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
34624   /*--- Function import code ---*/
34625   __pyx_t_1 = PyImport_ImportModule("yt.geometry.grid_visitors"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
34626   if (__Pyx_ImportFunction(__pyx_t_1, "check_child_masked", (void (**)(void))&__pyx_f_2yt_8geometry_13grid_visitors_check_child_masked, "__pyx_t_5numpy_uint8_t (struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34627   Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34628   __pyx_t_2 = PyImport_ImportModule("yt.utilities.lib.distance_queue"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error)
34629   if (__Pyx_ImportFunction(__pyx_t_2, "Neighbor_compare", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_14distance_queue_Neighbor_compare, "int (void *, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34630   if (__Pyx_ImportFunction(__pyx_t_2, "r2dist", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_14distance_queue_r2dist, "__pyx_t_5numpy_float64_t (__pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, int *, __pyx_t_5numpy_float64_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34631   Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34632   __Pyx_RefNannyFinishContext();
34633   return 0;
34634   __pyx_L1_error:;
34635   __Pyx_XDECREF(__pyx_t_1);
34636   __Pyx_XDECREF(__pyx_t_2);
34637   __Pyx_RefNannyFinishContext();
34638   return -1;
34639 }
34640 
34641 
34642 #if PY_MAJOR_VERSION < 3
34643 #ifdef CYTHON_NO_PYINIT_EXPORT
34644 #define __Pyx_PyMODINIT_FUNC void
34645 #else
34646 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
34647 #endif
34648 #else
34649 #ifdef CYTHON_NO_PYINIT_EXPORT
34650 #define __Pyx_PyMODINIT_FUNC PyObject *
34651 #else
34652 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
34653 #endif
34654 #endif
34655 
34656 
34657 #if PY_MAJOR_VERSION < 3
34658 __Pyx_PyMODINIT_FUNC initparticle_smooth(void) CYTHON_SMALL_CODE; /*proto*/
initparticle_smooth(void)34659 __Pyx_PyMODINIT_FUNC initparticle_smooth(void)
34660 #else
34661 __Pyx_PyMODINIT_FUNC PyInit_particle_smooth(void) CYTHON_SMALL_CODE; /*proto*/
34662 __Pyx_PyMODINIT_FUNC PyInit_particle_smooth(void)
34663 #if CYTHON_PEP489_MULTI_PHASE_INIT
34664 {
34665   return PyModuleDef_Init(&__pyx_moduledef);
34666 }
34667 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
34668     #if PY_VERSION_HEX >= 0x030700A1
34669     static PY_INT64_T main_interpreter_id = -1;
34670     PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
34671     if (main_interpreter_id == -1) {
34672         main_interpreter_id = current_id;
34673         return (unlikely(current_id == -1)) ? -1 : 0;
34674     } else if (unlikely(main_interpreter_id != current_id))
34675     #else
34676     static PyInterpreterState *main_interpreter = NULL;
34677     PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
34678     if (!main_interpreter) {
34679         main_interpreter = current_interpreter;
34680     } else if (unlikely(main_interpreter != current_interpreter))
34681     #endif
34682     {
34683         PyErr_SetString(
34684             PyExc_ImportError,
34685             "Interpreter change detected - this module can only be loaded into one interpreter per process.");
34686         return -1;
34687     }
34688     return 0;
34689 }
34690 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) {
34691     PyObject *value = PyObject_GetAttrString(spec, from_name);
34692     int result = 0;
34693     if (likely(value)) {
34694         if (allow_none || value != Py_None) {
34695             result = PyDict_SetItemString(moddict, to_name, value);
34696         }
34697         Py_DECREF(value);
34698     } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
34699         PyErr_Clear();
34700     } else {
34701         result = -1;
34702     }
34703     return result;
34704 }
34705 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
34706     PyObject *module = NULL, *moddict, *modname;
34707     if (__Pyx_check_single_interpreter())
34708         return NULL;
34709     if (__pyx_m)
34710         return __Pyx_NewRef(__pyx_m);
34711     modname = PyObject_GetAttrString(spec, "name");
34712     if (unlikely(!modname)) goto bad;
34713     module = PyModule_NewObject(modname);
34714     Py_DECREF(modname);
34715     if (unlikely(!module)) goto bad;
34716     moddict = PyModule_GetDict(module);
34717     if (unlikely(!moddict)) goto bad;
34718     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
34719     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
34720     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
34721     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
34722     return module;
34723 bad:
34724     Py_XDECREF(module);
34725     return NULL;
34726 }
34727 
34728 
34729 static CYTHON_SMALL_CODE int __pyx_pymod_exec_particle_smooth(PyObject *__pyx_pyinit_module)
34730 #endif
34731 #endif
34732 {
34733   PyObject *__pyx_t_1 = NULL;
34734   __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
34735   static PyThread_type_lock __pyx_t_3[8];
34736   __Pyx_RefNannyDeclarations
34737   #if CYTHON_PEP489_MULTI_PHASE_INIT
34738   if (__pyx_m) {
34739     if (__pyx_m == __pyx_pyinit_module) return 0;
34740     PyErr_SetString(PyExc_RuntimeError, "Module 'particle_smooth' has already been imported. Re-initialisation is not supported.");
34741     return -1;
34742   }
34743   #elif PY_MAJOR_VERSION >= 3
34744   if (__pyx_m) return __Pyx_NewRef(__pyx_m);
34745   #endif
34746   #if CYTHON_REFNANNY
34747 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
34748 if (!__Pyx_RefNanny) {
34749   PyErr_Clear();
34750   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
34751   if (!__Pyx_RefNanny)
34752       Py_FatalError("failed to import 'refnanny' module");
34753 }
34754 #endif
34755   __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_particle_smooth(void)", 0);
34756   if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34757   #ifdef __Pxy_PyFrame_Initialize_Offsets
34758   __Pxy_PyFrame_Initialize_Offsets();
34759   #endif
34760   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
34761   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
34762   __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
34763   #ifdef __Pyx_CyFunction_USED
34764   if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34765   #endif
34766   #ifdef __Pyx_FusedFunction_USED
34767   if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34768   #endif
34769   #ifdef __Pyx_Coroutine_USED
34770   if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34771   #endif
34772   #ifdef __Pyx_Generator_USED
34773   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34774   #endif
34775   #ifdef __Pyx_AsyncGen_USED
34776   if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34777   #endif
34778   #ifdef __Pyx_StopAsyncIteration_USED
34779   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34780   #endif
34781   /*--- Library function declarations ---*/
34782   /*--- Threads initialization code ---*/
34783   #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
34784   #ifdef WITH_THREAD /* Python build with threading support? */
34785   PyEval_InitThreads();
34786   #endif
34787   #endif
34788   /*--- Module creation code ---*/
34789   #if CYTHON_PEP489_MULTI_PHASE_INIT
34790   __pyx_m = __pyx_pyinit_module;
34791   Py_INCREF(__pyx_m);
34792   #else
34793   #if PY_MAJOR_VERSION < 3
34794   __pyx_m = Py_InitModule4("particle_smooth", __pyx_methods, __pyx_k_Particle_smoothing_in_cells, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
34795   #else
34796   __pyx_m = PyModule_Create(&__pyx_moduledef);
34797   #endif
34798   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
34799   #endif
34800   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
34801   Py_INCREF(__pyx_d);
34802   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
34803   Py_INCREF(__pyx_b);
34804   __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
34805   Py_INCREF(__pyx_cython_runtime);
34806   if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
34807   /*--- Initialize various global constants etc. ---*/
34808   if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34809   #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
34810   if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34811   #endif
34812   if (__pyx_module_is_main_yt__geometry__particle_smooth) {
34813     if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34814   }
34815   #if PY_MAJOR_VERSION >= 3
34816   {
34817     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
34818     if (!PyDict_GetItemString(modules, "yt.geometry.particle_smooth")) {
34819       if (unlikely(PyDict_SetItemString(modules, "yt.geometry.particle_smooth", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
34820     }
34821   }
34822   #endif
34823   /*--- Builtin init code ---*/
34824   if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
34825   /*--- Constants init code ---*/
34826   if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
34827   /*--- Global type/function init code ---*/
34828   (void)__Pyx_modinit_global_init_code();
34829   (void)__Pyx_modinit_variable_export_code();
34830   (void)__Pyx_modinit_function_export_code();
34831   if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
34832   if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
34833   if (unlikely(__Pyx_modinit_variable_import_code() != 0)) goto __pyx_L1_error;
34834   if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error;
34835   /*--- Execution code ---*/
34836   #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
34837   if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34838   #endif
34839 
34840   /* "yt/geometry/particle_smooth.pyx":14
34841  * cimport numpy as np
34842  *
34843  * import numpy as np             # <<<<<<<<<<<<<<
34844  *
34845  * cimport cython
34846  */
34847   __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
34848   __Pyx_GOTREF(__pyx_t_1);
34849   if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
34850   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34851 
34852   /* "yt/geometry/particle_smooth.pyx":62
34853  *                      index_fields = None,
34854  *                      OctreeContainer particle_octree = None,
34855  *                      np.int64_t [:] pdom_ind = None,             # <<<<<<<<<<<<<<
34856  *                      geometry = "cartesian"):
34857  *         # This will be a several-step operation.
34858  */
34859   __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 62, __pyx_L1_error)
34860   __pyx_k__2 = __pyx_t_2;
34861   __pyx_t_2.memview = NULL;
34862   __pyx_t_2.data = NULL;
34863 
34864   /* "yt/geometry/particle_smooth.pyx":652
34865  *         return
34866  *
34867  * volume_weighted_smooth = VolumeWeightedSmooth             # <<<<<<<<<<<<<<
34868  *
34869  * cdef class NearestNeighborSmooth(ParticleSmoothOperation):
34870  */
34871   if (PyDict_SetItem(__pyx_d, __pyx_n_s_volume_weighted_smooth, ((PyObject *)__pyx_ptype_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth)) < 0) __PYX_ERR(0, 652, __pyx_L1_error)
34872 
34873   /* "yt/geometry/particle_smooth.pyx":684
34874  *         return
34875  *
34876  * nearest_smooth = NearestNeighborSmooth             # <<<<<<<<<<<<<<
34877  *
34878  * cdef class IDWInterpolationSmooth(ParticleSmoothOperation):
34879  */
34880   if (PyDict_SetItem(__pyx_d, __pyx_n_s_nearest_smooth, ((PyObject *)__pyx_ptype_2yt_8geometry_15particle_smooth_NearestNeighborSmooth)) < 0) __PYX_ERR(0, 684, __pyx_L1_error)
34881 
34882   /* "yt/geometry/particle_smooth.pyx":727
34883  *         return
34884  *
34885  * idw_smooth = IDWInterpolationSmooth             # <<<<<<<<<<<<<<
34886  *
34887  * cdef class NthNeighborDistanceSmooth(ParticleSmoothOperation):
34888  */
34889   if (PyDict_SetItem(__pyx_d, __pyx_n_s_idw_smooth, ((PyObject *)__pyx_ptype_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth)) < 0) __PYX_ERR(0, 727, __pyx_L1_error)
34890 
34891   /* "yt/geometry/particle_smooth.pyx":749
34892  *         fields[0][offset] = max_r
34893  *
34894  * nth_neighbor_smooth = NthNeighborDistanceSmooth             # <<<<<<<<<<<<<<
34895  *
34896  * cdef class SmoothedDensityEstimate(ParticleSmoothOperation):
34897  */
34898   if (PyDict_SetItem(__pyx_d, __pyx_n_s_nth_neighbor_smooth, ((PyObject *)__pyx_ptype_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth)) < 0) __PYX_ERR(0, 749, __pyx_L1_error)
34899 
34900   /* "yt/geometry/particle_smooth.pyx":779
34901  *         fields[1][offset] = dens/weight
34902  *
34903  * density_smooth = SmoothedDensityEstimate             # <<<<<<<<<<<<<<
34904  */
34905   if (PyDict_SetItem(__pyx_d, __pyx_n_s_density_smooth, ((PyObject *)__pyx_ptype_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate)) < 0) __PYX_ERR(0, 779, __pyx_L1_error)
34906 
34907   /* "yt/geometry/particle_smooth.pyx":1
34908  * # distutils: include_dirs = LIB_DIR             # <<<<<<<<<<<<<<
34909  * # distutils: libraries = STD_LIBS
34910  * """
34911  */
34912   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
34913   __Pyx_GOTREF(__pyx_t_1);
34914   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34915   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34916 
34917   /* "View.MemoryView":209
34918  *         info.obj = self
34919  *
34920  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
34921  *
34922  *     def __dealloc__(array self):
34923  */
34924   __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error)
34925   __Pyx_GOTREF(__pyx_t_1);
34926   if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
34927   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34928   PyType_Modified(__pyx_array_type);
34929 
34930   /* "View.MemoryView":286
34931  *         return self.name
34932  *
34933  * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
34934  * cdef strided = Enum("<strided and direct>") # default
34935  * cdef indirect = Enum("<strided and indirect>")
34936  */
34937   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
34938   __Pyx_GOTREF(__pyx_t_1);
34939   __Pyx_XGOTREF(generic);
34940   __Pyx_DECREF_SET(generic, __pyx_t_1);
34941   __Pyx_GIVEREF(__pyx_t_1);
34942   __pyx_t_1 = 0;
34943 
34944   /* "View.MemoryView":287
34945  *
34946  * cdef generic = Enum("<strided and direct or indirect>")
34947  * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
34948  * cdef indirect = Enum("<strided and indirect>")
34949  *
34950  */
34951   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
34952   __Pyx_GOTREF(__pyx_t_1);
34953   __Pyx_XGOTREF(strided);
34954   __Pyx_DECREF_SET(strided, __pyx_t_1);
34955   __Pyx_GIVEREF(__pyx_t_1);
34956   __pyx_t_1 = 0;
34957 
34958   /* "View.MemoryView":288
34959  * cdef generic = Enum("<strided and direct or indirect>")
34960  * cdef strided = Enum("<strided and direct>") # default
34961  * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
34962  *
34963  *
34964  */
34965   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
34966   __Pyx_GOTREF(__pyx_t_1);
34967   __Pyx_XGOTREF(indirect);
34968   __Pyx_DECREF_SET(indirect, __pyx_t_1);
34969   __Pyx_GIVEREF(__pyx_t_1);
34970   __pyx_t_1 = 0;
34971 
34972   /* "View.MemoryView":291
34973  *
34974  *
34975  * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
34976  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
34977  *
34978  */
34979   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
34980   __Pyx_GOTREF(__pyx_t_1);
34981   __Pyx_XGOTREF(contiguous);
34982   __Pyx_DECREF_SET(contiguous, __pyx_t_1);
34983   __Pyx_GIVEREF(__pyx_t_1);
34984   __pyx_t_1 = 0;
34985 
34986   /* "View.MemoryView":292
34987  *
34988  * cdef contiguous = Enum("<contiguous and direct>")
34989  * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
34990  *
34991  *
34992  */
34993   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
34994   __Pyx_GOTREF(__pyx_t_1);
34995   __Pyx_XGOTREF(indirect_contiguous);
34996   __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
34997   __Pyx_GIVEREF(__pyx_t_1);
34998   __pyx_t_1 = 0;
34999 
35000   /* "View.MemoryView":316
35001  *
35002  * DEF THREAD_LOCKS_PREALLOCATED = 8
35003  * cdef int __pyx_memoryview_thread_locks_used = 0             # <<<<<<<<<<<<<<
35004  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
35005  *     PyThread_allocate_lock(),
35006  */
35007   __pyx_memoryview_thread_locks_used = 0;
35008 
35009   /* "View.MemoryView":317
35010  * DEF THREAD_LOCKS_PREALLOCATED = 8
35011  * cdef int __pyx_memoryview_thread_locks_used = 0
35012  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [             # <<<<<<<<<<<<<<
35013  *     PyThread_allocate_lock(),
35014  *     PyThread_allocate_lock(),
35015  */
35016   __pyx_t_3[0] = PyThread_allocate_lock();
35017   __pyx_t_3[1] = PyThread_allocate_lock();
35018   __pyx_t_3[2] = PyThread_allocate_lock();
35019   __pyx_t_3[3] = PyThread_allocate_lock();
35020   __pyx_t_3[4] = PyThread_allocate_lock();
35021   __pyx_t_3[5] = PyThread_allocate_lock();
35022   __pyx_t_3[6] = PyThread_allocate_lock();
35023   __pyx_t_3[7] = PyThread_allocate_lock();
35024   memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
35025 
35026   /* "View.MemoryView":545
35027  *         info.obj = self
35028  *
35029  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
35030  *
35031  *
35032  */
35033   __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 545, __pyx_L1_error)
35034   __Pyx_GOTREF(__pyx_t_1);
35035   if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 545, __pyx_L1_error)
35036   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
35037   PyType_Modified(__pyx_memoryview_type);
35038 
35039   /* "View.MemoryView":991
35040  *         return self.from_object
35041  *
35042  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
35043  *
35044  *
35045  */
35046   __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 991, __pyx_L1_error)
35047   __Pyx_GOTREF(__pyx_t_1);
35048   if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 991, __pyx_L1_error)
35049   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
35050   PyType_Modified(__pyx_memoryviewslice_type);
35051 
35052   /* "(tree fragment)":1
35053  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
35054  *     cdef object __pyx_PickleError
35055  *     cdef object __pyx_result
35056  */
35057   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
35058   __Pyx_GOTREF(__pyx_t_1);
35059   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
35060   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
35061 
35062   /* "(tree fragment)":11
35063  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
35064  *     return __pyx_result
35065  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
35066  *     __pyx_result.name = __pyx_state[0]
35067  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
35068  */
35069 
35070   /*--- Wrapped vars code ---*/
35071 
35072   goto __pyx_L0;
35073   __pyx_L1_error:;
35074   __Pyx_XDECREF(__pyx_t_1);
35075   __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
35076   if (__pyx_m) {
35077     if (__pyx_d) {
35078       __Pyx_AddTraceback("init yt.geometry.particle_smooth", __pyx_clineno, __pyx_lineno, __pyx_filename);
35079     }
35080     Py_CLEAR(__pyx_m);
35081   } else if (!PyErr_Occurred()) {
35082     PyErr_SetString(PyExc_ImportError, "init yt.geometry.particle_smooth");
35083   }
35084   __pyx_L0:;
35085   __Pyx_RefNannyFinishContext();
35086   #if CYTHON_PEP489_MULTI_PHASE_INIT
35087   return (__pyx_m != NULL) ? 0 : -1;
35088   #elif PY_MAJOR_VERSION >= 3
35089   return __pyx_m;
35090   #else
35091   return;
35092   #endif
35093 }
35094 
35095 /* --- Runtime support code --- */
35096 /* Refnanny */
35097 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)35098 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
35099     PyObject *m = NULL, *p = NULL;
35100     void *r = NULL;
35101     m = PyImport_ImportModule(modname);
35102     if (!m) goto end;
35103     p = PyObject_GetAttrString(m, "RefNannyAPI");
35104     if (!p) goto end;
35105     r = PyLong_AsVoidPtr(p);
35106 end:
35107     Py_XDECREF(p);
35108     Py_XDECREF(m);
35109     return (__Pyx_RefNannyAPIStruct *)r;
35110 }
35111 #endif
35112 
35113 /* PyObjectGetAttrStr */
35114 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)35115 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
35116     PyTypeObject* tp = Py_TYPE(obj);
35117     if (likely(tp->tp_getattro))
35118         return tp->tp_getattro(obj, attr_name);
35119 #if PY_MAJOR_VERSION < 3
35120     if (likely(tp->tp_getattr))
35121         return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
35122 #endif
35123     return PyObject_GetAttr(obj, attr_name);
35124 }
35125 #endif
35126 
35127 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)35128 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
35129     PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
35130     if (unlikely(!result)) {
35131         PyErr_Format(PyExc_NameError,
35132 #if PY_MAJOR_VERSION >= 3
35133             "name '%U' is not defined", name);
35134 #else
35135             "name '%.200s' is not defined", PyString_AS_STRING(name));
35136 #endif
35137     }
35138     return result;
35139 }
35140 
35141 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)35142 static void __Pyx_RaiseArgtupleInvalid(
35143     const char* func_name,
35144     int exact,
35145     Py_ssize_t num_min,
35146     Py_ssize_t num_max,
35147     Py_ssize_t num_found)
35148 {
35149     Py_ssize_t num_expected;
35150     const char *more_or_less;
35151     if (num_found < num_min) {
35152         num_expected = num_min;
35153         more_or_less = "at least";
35154     } else {
35155         num_expected = num_max;
35156         more_or_less = "at most";
35157     }
35158     if (exact) {
35159         more_or_less = "exactly";
35160     }
35161     PyErr_Format(PyExc_TypeError,
35162                  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
35163                  func_name, more_or_less, num_expected,
35164                  (num_expected == 1) ? "" : "s", num_found);
35165 }
35166 
35167 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)35168 static void __Pyx_RaiseDoubleKeywordsError(
35169     const char* func_name,
35170     PyObject* kw_name)
35171 {
35172     PyErr_Format(PyExc_TypeError,
35173         #if PY_MAJOR_VERSION >= 3
35174         "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
35175         #else
35176         "%s() got multiple values for keyword argument '%s'", func_name,
35177         PyString_AsString(kw_name));
35178         #endif
35179 }
35180 
35181 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)35182 static int __Pyx_ParseOptionalKeywords(
35183     PyObject *kwds,
35184     PyObject **argnames[],
35185     PyObject *kwds2,
35186     PyObject *values[],
35187     Py_ssize_t num_pos_args,
35188     const char* function_name)
35189 {
35190     PyObject *key = 0, *value = 0;
35191     Py_ssize_t pos = 0;
35192     PyObject*** name;
35193     PyObject*** first_kw_arg = argnames + num_pos_args;
35194     while (PyDict_Next(kwds, &pos, &key, &value)) {
35195         name = first_kw_arg;
35196         while (*name && (**name != key)) name++;
35197         if (*name) {
35198             values[name-argnames] = value;
35199             continue;
35200         }
35201         name = first_kw_arg;
35202         #if PY_MAJOR_VERSION < 3
35203         if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
35204             while (*name) {
35205                 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
35206                         && _PyString_Eq(**name, key)) {
35207                     values[name-argnames] = value;
35208                     break;
35209                 }
35210                 name++;
35211             }
35212             if (*name) continue;
35213             else {
35214                 PyObject*** argname = argnames;
35215                 while (argname != first_kw_arg) {
35216                     if ((**argname == key) || (
35217                             (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
35218                              && _PyString_Eq(**argname, key))) {
35219                         goto arg_passed_twice;
35220                     }
35221                     argname++;
35222                 }
35223             }
35224         } else
35225         #endif
35226         if (likely(PyUnicode_Check(key))) {
35227             while (*name) {
35228                 int cmp = (**name == key) ? 0 :
35229                 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
35230                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
35231                 #endif
35232                     PyUnicode_Compare(**name, key);
35233                 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
35234                 if (cmp == 0) {
35235                     values[name-argnames] = value;
35236                     break;
35237                 }
35238                 name++;
35239             }
35240             if (*name) continue;
35241             else {
35242                 PyObject*** argname = argnames;
35243                 while (argname != first_kw_arg) {
35244                     int cmp = (**argname == key) ? 0 :
35245                     #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
35246                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
35247                     #endif
35248                         PyUnicode_Compare(**argname, key);
35249                     if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
35250                     if (cmp == 0) goto arg_passed_twice;
35251                     argname++;
35252                 }
35253             }
35254         } else
35255             goto invalid_keyword_type;
35256         if (kwds2) {
35257             if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
35258         } else {
35259             goto invalid_keyword;
35260         }
35261     }
35262     return 0;
35263 arg_passed_twice:
35264     __Pyx_RaiseDoubleKeywordsError(function_name, key);
35265     goto bad;
35266 invalid_keyword_type:
35267     PyErr_Format(PyExc_TypeError,
35268         "%.200s() keywords must be strings", function_name);
35269     goto bad;
35270 invalid_keyword:
35271     PyErr_Format(PyExc_TypeError,
35272     #if PY_MAJOR_VERSION < 3
35273         "%.200s() got an unexpected keyword argument '%.200s'",
35274         function_name, PyString_AsString(key));
35275     #else
35276         "%s() got an unexpected keyword argument '%U'",
35277         function_name, key);
35278     #endif
35279 bad:
35280     return -1;
35281 }
35282 
35283 /* KeywordStringCheck */
__Pyx_CheckKeywordStrings(PyObject * kwdict,const char * function_name,int kw_allowed)35284 static int __Pyx_CheckKeywordStrings(
35285     PyObject *kwdict,
35286     const char* function_name,
35287     int kw_allowed)
35288 {
35289     PyObject* key = 0;
35290     Py_ssize_t pos = 0;
35291 #if CYTHON_COMPILING_IN_PYPY
35292     if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
35293         goto invalid_keyword;
35294     return 1;
35295 #else
35296     while (PyDict_Next(kwdict, &pos, &key, 0)) {
35297         #if PY_MAJOR_VERSION < 3
35298         if (unlikely(!PyString_Check(key)))
35299         #endif
35300             if (unlikely(!PyUnicode_Check(key)))
35301                 goto invalid_keyword_type;
35302     }
35303     if ((!kw_allowed) && unlikely(key))
35304         goto invalid_keyword;
35305     return 1;
35306 invalid_keyword_type:
35307     PyErr_Format(PyExc_TypeError,
35308         "%.200s() keywords must be strings", function_name);
35309     return 0;
35310 #endif
35311 invalid_keyword:
35312     PyErr_Format(PyExc_TypeError,
35313     #if PY_MAJOR_VERSION < 3
35314         "%.200s() got an unexpected keyword argument '%.200s'",
35315         function_name, PyString_AsString(key));
35316     #else
35317         "%s() got an unexpected keyword argument '%U'",
35318         function_name, key);
35319     #endif
35320     return 0;
35321 }
35322 
35323 /* PyErrFetchRestore */
35324 #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)35325 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
35326     PyObject *tmp_type, *tmp_value, *tmp_tb;
35327     tmp_type = tstate->curexc_type;
35328     tmp_value = tstate->curexc_value;
35329     tmp_tb = tstate->curexc_traceback;
35330     tstate->curexc_type = type;
35331     tstate->curexc_value = value;
35332     tstate->curexc_traceback = tb;
35333     Py_XDECREF(tmp_type);
35334     Py_XDECREF(tmp_value);
35335     Py_XDECREF(tmp_tb);
35336 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)35337 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
35338     *type = tstate->curexc_type;
35339     *value = tstate->curexc_value;
35340     *tb = tstate->curexc_traceback;
35341     tstate->curexc_type = 0;
35342     tstate->curexc_value = 0;
35343     tstate->curexc_traceback = 0;
35344 }
35345 #endif
35346 
35347 /* RaiseException */
35348 #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)35349 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
35350                         CYTHON_UNUSED PyObject *cause) {
35351     __Pyx_PyThreadState_declare
35352     Py_XINCREF(type);
35353     if (!value || value == Py_None)
35354         value = NULL;
35355     else
35356         Py_INCREF(value);
35357     if (!tb || tb == Py_None)
35358         tb = NULL;
35359     else {
35360         Py_INCREF(tb);
35361         if (!PyTraceBack_Check(tb)) {
35362             PyErr_SetString(PyExc_TypeError,
35363                 "raise: arg 3 must be a traceback or None");
35364             goto raise_error;
35365         }
35366     }
35367     if (PyType_Check(type)) {
35368 #if CYTHON_COMPILING_IN_PYPY
35369         if (!value) {
35370             Py_INCREF(Py_None);
35371             value = Py_None;
35372         }
35373 #endif
35374         PyErr_NormalizeException(&type, &value, &tb);
35375     } else {
35376         if (value) {
35377             PyErr_SetString(PyExc_TypeError,
35378                 "instance exception may not have a separate value");
35379             goto raise_error;
35380         }
35381         value = type;
35382         type = (PyObject*) Py_TYPE(type);
35383         Py_INCREF(type);
35384         if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
35385             PyErr_SetString(PyExc_TypeError,
35386                 "raise: exception class must be a subclass of BaseException");
35387             goto raise_error;
35388         }
35389     }
35390     __Pyx_PyThreadState_assign
35391     __Pyx_ErrRestore(type, value, tb);
35392     return;
35393 raise_error:
35394     Py_XDECREF(value);
35395     Py_XDECREF(type);
35396     Py_XDECREF(tb);
35397     return;
35398 }
35399 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)35400 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
35401     PyObject* owned_instance = NULL;
35402     if (tb == Py_None) {
35403         tb = 0;
35404     } else if (tb && !PyTraceBack_Check(tb)) {
35405         PyErr_SetString(PyExc_TypeError,
35406             "raise: arg 3 must be a traceback or None");
35407         goto bad;
35408     }
35409     if (value == Py_None)
35410         value = 0;
35411     if (PyExceptionInstance_Check(type)) {
35412         if (value) {
35413             PyErr_SetString(PyExc_TypeError,
35414                 "instance exception may not have a separate value");
35415             goto bad;
35416         }
35417         value = type;
35418         type = (PyObject*) Py_TYPE(value);
35419     } else if (PyExceptionClass_Check(type)) {
35420         PyObject *instance_class = NULL;
35421         if (value && PyExceptionInstance_Check(value)) {
35422             instance_class = (PyObject*) Py_TYPE(value);
35423             if (instance_class != type) {
35424                 int is_subclass = PyObject_IsSubclass(instance_class, type);
35425                 if (!is_subclass) {
35426                     instance_class = NULL;
35427                 } else if (unlikely(is_subclass == -1)) {
35428                     goto bad;
35429                 } else {
35430                     type = instance_class;
35431                 }
35432             }
35433         }
35434         if (!instance_class) {
35435             PyObject *args;
35436             if (!value)
35437                 args = PyTuple_New(0);
35438             else if (PyTuple_Check(value)) {
35439                 Py_INCREF(value);
35440                 args = value;
35441             } else
35442                 args = PyTuple_Pack(1, value);
35443             if (!args)
35444                 goto bad;
35445             owned_instance = PyObject_Call(type, args, NULL);
35446             Py_DECREF(args);
35447             if (!owned_instance)
35448                 goto bad;
35449             value = owned_instance;
35450             if (!PyExceptionInstance_Check(value)) {
35451                 PyErr_Format(PyExc_TypeError,
35452                              "calling %R should have returned an instance of "
35453                              "BaseException, not %R",
35454                              type, Py_TYPE(value));
35455                 goto bad;
35456             }
35457         }
35458     } else {
35459         PyErr_SetString(PyExc_TypeError,
35460             "raise: exception class must be a subclass of BaseException");
35461         goto bad;
35462     }
35463     if (cause) {
35464         PyObject *fixed_cause;
35465         if (cause == Py_None) {
35466             fixed_cause = NULL;
35467         } else if (PyExceptionClass_Check(cause)) {
35468             fixed_cause = PyObject_CallObject(cause, NULL);
35469             if (fixed_cause == NULL)
35470                 goto bad;
35471         } else if (PyExceptionInstance_Check(cause)) {
35472             fixed_cause = cause;
35473             Py_INCREF(fixed_cause);
35474         } else {
35475             PyErr_SetString(PyExc_TypeError,
35476                             "exception causes must derive from "
35477                             "BaseException");
35478             goto bad;
35479         }
35480         PyException_SetCause(value, fixed_cause);
35481     }
35482     PyErr_SetObject(type, value);
35483     if (tb) {
35484 #if CYTHON_COMPILING_IN_PYPY
35485         PyObject *tmp_type, *tmp_value, *tmp_tb;
35486         PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
35487         Py_INCREF(tb);
35488         PyErr_Restore(tmp_type, tmp_value, tb);
35489         Py_XDECREF(tmp_tb);
35490 #else
35491         PyThreadState *tstate = __Pyx_PyThreadState_Current;
35492         PyObject* tmp_tb = tstate->curexc_traceback;
35493         if (tb != tmp_tb) {
35494             Py_INCREF(tb);
35495             tstate->curexc_traceback = tb;
35496             Py_XDECREF(tmp_tb);
35497         }
35498 #endif
35499     }
35500 bad:
35501     Py_XDECREF(owned_instance);
35502     return;
35503 }
35504 #endif
35505 
35506 /* MemviewSliceInit */
35507 static int
__Pyx_init_memviewslice(struct __pyx_memoryview_obj * memview,int ndim,__Pyx_memviewslice * memviewslice,int memview_is_new_reference)35508 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
35509                         int ndim,
35510                         __Pyx_memviewslice *memviewslice,
35511                         int memview_is_new_reference)
35512 {
35513     __Pyx_RefNannyDeclarations
35514     int i, retval=-1;
35515     Py_buffer *buf = &memview->view;
35516     __Pyx_RefNannySetupContext("init_memviewslice", 0);
35517     if (memviewslice->memview || memviewslice->data) {
35518         PyErr_SetString(PyExc_ValueError,
35519             "memviewslice is already initialized!");
35520         goto fail;
35521     }
35522     if (buf->strides) {
35523         for (i = 0; i < ndim; i++) {
35524             memviewslice->strides[i] = buf->strides[i];
35525         }
35526     } else {
35527         Py_ssize_t stride = buf->itemsize;
35528         for (i = ndim - 1; i >= 0; i--) {
35529             memviewslice->strides[i] = stride;
35530             stride *= buf->shape[i];
35531         }
35532     }
35533     for (i = 0; i < ndim; i++) {
35534         memviewslice->shape[i]   = buf->shape[i];
35535         if (buf->suboffsets) {
35536             memviewslice->suboffsets[i] = buf->suboffsets[i];
35537         } else {
35538             memviewslice->suboffsets[i] = -1;
35539         }
35540     }
35541     memviewslice->memview = memview;
35542     memviewslice->data = (char *)buf->buf;
35543     if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
35544         Py_INCREF(memview);
35545     }
35546     retval = 0;
35547     goto no_fail;
35548 fail:
35549     memviewslice->memview = 0;
35550     memviewslice->data = 0;
35551     retval = -1;
35552 no_fail:
35553     __Pyx_RefNannyFinishContext();
35554     return retval;
35555 }
35556 #ifndef Py_NO_RETURN
35557 #define Py_NO_RETURN
35558 #endif
__pyx_fatalerror(const char * fmt,...)35559 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
35560     va_list vargs;
35561     char msg[200];
35562 #ifdef HAVE_STDARG_PROTOTYPES
35563     va_start(vargs, fmt);
35564 #else
35565     va_start(vargs);
35566 #endif
35567     vsnprintf(msg, 200, fmt, vargs);
35568     va_end(vargs);
35569     Py_FatalError(msg);
35570 }
35571 static CYTHON_INLINE int
__pyx_add_acquisition_count_locked(__pyx_atomic_int * acquisition_count,PyThread_type_lock lock)35572 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
35573                                    PyThread_type_lock lock)
35574 {
35575     int result;
35576     PyThread_acquire_lock(lock, 1);
35577     result = (*acquisition_count)++;
35578     PyThread_release_lock(lock);
35579     return result;
35580 }
35581 static CYTHON_INLINE int
__pyx_sub_acquisition_count_locked(__pyx_atomic_int * acquisition_count,PyThread_type_lock lock)35582 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
35583                                    PyThread_type_lock lock)
35584 {
35585     int result;
35586     PyThread_acquire_lock(lock, 1);
35587     result = (*acquisition_count)--;
35588     PyThread_release_lock(lock);
35589     return result;
35590 }
35591 static CYTHON_INLINE void
__Pyx_INC_MEMVIEW(__Pyx_memviewslice * memslice,int have_gil,int lineno)35592 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
35593 {
35594     int first_time;
35595     struct __pyx_memoryview_obj *memview = memslice->memview;
35596     if (!memview || (PyObject *) memview == Py_None)
35597         return;
35598     if (__pyx_get_slice_count(memview) < 0)
35599         __pyx_fatalerror("Acquisition count is %d (line %d)",
35600                          __pyx_get_slice_count(memview), lineno);
35601     first_time = __pyx_add_acquisition_count(memview) == 0;
35602     if (first_time) {
35603         if (have_gil) {
35604             Py_INCREF((PyObject *) memview);
35605         } else {
35606             PyGILState_STATE _gilstate = PyGILState_Ensure();
35607             Py_INCREF((PyObject *) memview);
35608             PyGILState_Release(_gilstate);
35609         }
35610     }
35611 }
__Pyx_XDEC_MEMVIEW(__Pyx_memviewslice * memslice,int have_gil,int lineno)35612 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
35613                                              int have_gil, int lineno) {
35614     int last_time;
35615     struct __pyx_memoryview_obj *memview = memslice->memview;
35616     if (!memview ) {
35617         return;
35618     } else if ((PyObject *) memview == Py_None) {
35619         memslice->memview = NULL;
35620         return;
35621     }
35622     if (__pyx_get_slice_count(memview) <= 0)
35623         __pyx_fatalerror("Acquisition count is %d (line %d)",
35624                          __pyx_get_slice_count(memview), lineno);
35625     last_time = __pyx_sub_acquisition_count(memview) == 1;
35626     memslice->data = NULL;
35627     if (last_time) {
35628         if (have_gil) {
35629             Py_CLEAR(memslice->memview);
35630         } else {
35631             PyGILState_STATE _gilstate = PyGILState_Ensure();
35632             Py_CLEAR(memslice->memview);
35633             PyGILState_Release(_gilstate);
35634         }
35635     } else {
35636         memslice->memview = NULL;
35637     }
35638 }
35639 
35640 /* ArgTypeTest */
__Pyx__ArgTypeTest(PyObject * obj,PyTypeObject * type,const char * name,int exact)35641 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
35642 {
35643     if (unlikely(!type)) {
35644         PyErr_SetString(PyExc_SystemError, "Missing type object");
35645         return 0;
35646     }
35647     else if (exact) {
35648         #if PY_MAJOR_VERSION == 2
35649         if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
35650         #endif
35651     }
35652     else {
35653         if (likely(__Pyx_TypeCheck(obj, type))) return 1;
35654     }
35655     PyErr_Format(PyExc_TypeError,
35656         "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
35657         name, type->tp_name, Py_TYPE(obj)->tp_name);
35658     return 0;
35659 }
35660 
35661 /* BytesEquals */
__Pyx_PyBytes_Equals(PyObject * s1,PyObject * s2,int equals)35662 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
35663 #if CYTHON_COMPILING_IN_PYPY
35664     return PyObject_RichCompareBool(s1, s2, equals);
35665 #else
35666     if (s1 == s2) {
35667         return (equals == Py_EQ);
35668     } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
35669         const char *ps1, *ps2;
35670         Py_ssize_t length = PyBytes_GET_SIZE(s1);
35671         if (length != PyBytes_GET_SIZE(s2))
35672             return (equals == Py_NE);
35673         ps1 = PyBytes_AS_STRING(s1);
35674         ps2 = PyBytes_AS_STRING(s2);
35675         if (ps1[0] != ps2[0]) {
35676             return (equals == Py_NE);
35677         } else if (length == 1) {
35678             return (equals == Py_EQ);
35679         } else {
35680             int result;
35681 #if CYTHON_USE_UNICODE_INTERNALS
35682             Py_hash_t hash1, hash2;
35683             hash1 = ((PyBytesObject*)s1)->ob_shash;
35684             hash2 = ((PyBytesObject*)s2)->ob_shash;
35685             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
35686                 return (equals == Py_NE);
35687             }
35688 #endif
35689             result = memcmp(ps1, ps2, (size_t)length);
35690             return (equals == Py_EQ) ? (result == 0) : (result != 0);
35691         }
35692     } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
35693         return (equals == Py_NE);
35694     } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
35695         return (equals == Py_NE);
35696     } else {
35697         int result;
35698         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
35699         if (!py_result)
35700             return -1;
35701         result = __Pyx_PyObject_IsTrue(py_result);
35702         Py_DECREF(py_result);
35703         return result;
35704     }
35705 #endif
35706 }
35707 
35708 /* UnicodeEquals */
__Pyx_PyUnicode_Equals(PyObject * s1,PyObject * s2,int equals)35709 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
35710 #if CYTHON_COMPILING_IN_PYPY
35711     return PyObject_RichCompareBool(s1, s2, equals);
35712 #else
35713 #if PY_MAJOR_VERSION < 3
35714     PyObject* owned_ref = NULL;
35715 #endif
35716     int s1_is_unicode, s2_is_unicode;
35717     if (s1 == s2) {
35718         goto return_eq;
35719     }
35720     s1_is_unicode = PyUnicode_CheckExact(s1);
35721     s2_is_unicode = PyUnicode_CheckExact(s2);
35722 #if PY_MAJOR_VERSION < 3
35723     if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
35724         owned_ref = PyUnicode_FromObject(s2);
35725         if (unlikely(!owned_ref))
35726             return -1;
35727         s2 = owned_ref;
35728         s2_is_unicode = 1;
35729     } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
35730         owned_ref = PyUnicode_FromObject(s1);
35731         if (unlikely(!owned_ref))
35732             return -1;
35733         s1 = owned_ref;
35734         s1_is_unicode = 1;
35735     } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
35736         return __Pyx_PyBytes_Equals(s1, s2, equals);
35737     }
35738 #endif
35739     if (s1_is_unicode & s2_is_unicode) {
35740         Py_ssize_t length;
35741         int kind;
35742         void *data1, *data2;
35743         if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
35744             return -1;
35745         length = __Pyx_PyUnicode_GET_LENGTH(s1);
35746         if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
35747             goto return_ne;
35748         }
35749 #if CYTHON_USE_UNICODE_INTERNALS
35750         {
35751             Py_hash_t hash1, hash2;
35752         #if CYTHON_PEP393_ENABLED
35753             hash1 = ((PyASCIIObject*)s1)->hash;
35754             hash2 = ((PyASCIIObject*)s2)->hash;
35755         #else
35756             hash1 = ((PyUnicodeObject*)s1)->hash;
35757             hash2 = ((PyUnicodeObject*)s2)->hash;
35758         #endif
35759             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
35760                 goto return_ne;
35761             }
35762         }
35763 #endif
35764         kind = __Pyx_PyUnicode_KIND(s1);
35765         if (kind != __Pyx_PyUnicode_KIND(s2)) {
35766             goto return_ne;
35767         }
35768         data1 = __Pyx_PyUnicode_DATA(s1);
35769         data2 = __Pyx_PyUnicode_DATA(s2);
35770         if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
35771             goto return_ne;
35772         } else if (length == 1) {
35773             goto return_eq;
35774         } else {
35775             int result = memcmp(data1, data2, (size_t)(length * kind));
35776             #if PY_MAJOR_VERSION < 3
35777             Py_XDECREF(owned_ref);
35778             #endif
35779             return (equals == Py_EQ) ? (result == 0) : (result != 0);
35780         }
35781     } else if ((s1 == Py_None) & s2_is_unicode) {
35782         goto return_ne;
35783     } else if ((s2 == Py_None) & s1_is_unicode) {
35784         goto return_ne;
35785     } else {
35786         int result;
35787         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
35788         #if PY_MAJOR_VERSION < 3
35789         Py_XDECREF(owned_ref);
35790         #endif
35791         if (!py_result)
35792             return -1;
35793         result = __Pyx_PyObject_IsTrue(py_result);
35794         Py_DECREF(py_result);
35795         return result;
35796     }
35797 return_eq:
35798     #if PY_MAJOR_VERSION < 3
35799     Py_XDECREF(owned_ref);
35800     #endif
35801     return (equals == Py_EQ);
35802 return_ne:
35803     #if PY_MAJOR_VERSION < 3
35804     Py_XDECREF(owned_ref);
35805     #endif
35806     return (equals == Py_NE);
35807 #endif
35808 }
35809 
35810 /* PyDictVersioning */
35811 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)35812 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
35813     PyObject *dict = Py_TYPE(obj)->tp_dict;
35814     return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
35815 }
__Pyx_get_object_dict_version(PyObject * obj)35816 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
35817     PyObject **dictptr = NULL;
35818     Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
35819     if (offset) {
35820 #if CYTHON_COMPILING_IN_CPYTHON
35821         dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
35822 #else
35823         dictptr = _PyObject_GetDictPtr(obj);
35824 #endif
35825     }
35826     return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
35827 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)35828 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
35829     PyObject *dict = Py_TYPE(obj)->tp_dict;
35830     if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
35831         return 0;
35832     return obj_dict_version == __Pyx_get_object_dict_version(obj);
35833 }
35834 #endif
35835 
35836 /* GetModuleGlobalName */
35837 #if CYTHON_USE_DICT_VERSIONS
__Pyx__GetModuleGlobalName(PyObject * name,PY_UINT64_T * dict_version,PyObject ** dict_cached_value)35838 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
35839 #else
35840 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
35841 #endif
35842 {
35843     PyObject *result;
35844 #if !CYTHON_AVOID_BORROWED_REFS
35845 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
35846     result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
35847     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
35848     if (likely(result)) {
35849         return __Pyx_NewRef(result);
35850     } else if (unlikely(PyErr_Occurred())) {
35851         return NULL;
35852     }
35853 #else
35854     result = PyDict_GetItem(__pyx_d, name);
35855     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
35856     if (likely(result)) {
35857         return __Pyx_NewRef(result);
35858     }
35859 #endif
35860 #else
35861     result = PyObject_GetItem(__pyx_d, name);
35862     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
35863     if (likely(result)) {
35864         return __Pyx_NewRef(result);
35865     }
35866     PyErr_Clear();
35867 #endif
35868     return __Pyx_GetBuiltinName(name);
35869 }
35870 
35871 /* PyObjectCall */
35872 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)35873 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
35874     PyObject *result;
35875     ternaryfunc call = func->ob_type->tp_call;
35876     if (unlikely(!call))
35877         return PyObject_Call(func, arg, kw);
35878     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
35879         return NULL;
35880     result = (*call)(func, arg, kw);
35881     Py_LeaveRecursiveCall();
35882     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
35883         PyErr_SetString(
35884             PyExc_SystemError,
35885             "NULL result without error in PyObject_Call");
35886     }
35887     return result;
35888 }
35889 #endif
35890 
35891 /* PyCFunctionFastCall */
35892 #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)35893 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
35894     PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
35895     PyCFunction meth = PyCFunction_GET_FUNCTION(func);
35896     PyObject *self = PyCFunction_GET_SELF(func);
35897     int flags = PyCFunction_GET_FLAGS(func);
35898     assert(PyCFunction_Check(func));
35899     assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
35900     assert(nargs >= 0);
35901     assert(nargs == 0 || args != NULL);
35902     /* _PyCFunction_FastCallDict() must not be called with an exception set,
35903        because it may clear it (directly or indirectly) and so the
35904        caller loses its exception */
35905     assert(!PyErr_Occurred());
35906     if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
35907         return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
35908     } else {
35909         return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
35910     }
35911 }
35912 #endif
35913 
35914 /* PyFunctionFastCall */
35915 #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)35916 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
35917                                                PyObject *globals) {
35918     PyFrameObject *f;
35919     PyThreadState *tstate = __Pyx_PyThreadState_Current;
35920     PyObject **fastlocals;
35921     Py_ssize_t i;
35922     PyObject *result;
35923     assert(globals != NULL);
35924     /* XXX Perhaps we should create a specialized
35925        PyFrame_New() that doesn't take locals, but does
35926        take builtins without sanity checking them.
35927        */
35928     assert(tstate != NULL);
35929     f = PyFrame_New(tstate, co, globals, NULL);
35930     if (f == NULL) {
35931         return NULL;
35932     }
35933     fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
35934     for (i = 0; i < na; i++) {
35935         Py_INCREF(*args);
35936         fastlocals[i] = *args++;
35937     }
35938     result = PyEval_EvalFrameEx(f,0);
35939     ++tstate->recursion_depth;
35940     Py_DECREF(f);
35941     --tstate->recursion_depth;
35942     return result;
35943 }
35944 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)35945 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
35946     PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
35947     PyObject *globals = PyFunction_GET_GLOBALS(func);
35948     PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
35949     PyObject *closure;
35950 #if PY_MAJOR_VERSION >= 3
35951     PyObject *kwdefs;
35952 #endif
35953     PyObject *kwtuple, **k;
35954     PyObject **d;
35955     Py_ssize_t nd;
35956     Py_ssize_t nk;
35957     PyObject *result;
35958     assert(kwargs == NULL || PyDict_Check(kwargs));
35959     nk = kwargs ? PyDict_Size(kwargs) : 0;
35960     if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
35961         return NULL;
35962     }
35963     if (
35964 #if PY_MAJOR_VERSION >= 3
35965             co->co_kwonlyargcount == 0 &&
35966 #endif
35967             likely(kwargs == NULL || nk == 0) &&
35968             co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
35969         if (argdefs == NULL && co->co_argcount == nargs) {
35970             result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
35971             goto done;
35972         }
35973         else if (nargs == 0 && argdefs != NULL
35974                  && co->co_argcount == Py_SIZE(argdefs)) {
35975             /* function called with no arguments, but all parameters have
35976                a default value: use default values as arguments .*/
35977             args = &PyTuple_GET_ITEM(argdefs, 0);
35978             result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
35979             goto done;
35980         }
35981     }
35982     if (kwargs != NULL) {
35983         Py_ssize_t pos, i;
35984         kwtuple = PyTuple_New(2 * nk);
35985         if (kwtuple == NULL) {
35986             result = NULL;
35987             goto done;
35988         }
35989         k = &PyTuple_GET_ITEM(kwtuple, 0);
35990         pos = i = 0;
35991         while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
35992             Py_INCREF(k[i]);
35993             Py_INCREF(k[i+1]);
35994             i += 2;
35995         }
35996         nk = i / 2;
35997     }
35998     else {
35999         kwtuple = NULL;
36000         k = NULL;
36001     }
36002     closure = PyFunction_GET_CLOSURE(func);
36003 #if PY_MAJOR_VERSION >= 3
36004     kwdefs = PyFunction_GET_KW_DEFAULTS(func);
36005 #endif
36006     if (argdefs != NULL) {
36007         d = &PyTuple_GET_ITEM(argdefs, 0);
36008         nd = Py_SIZE(argdefs);
36009     }
36010     else {
36011         d = NULL;
36012         nd = 0;
36013     }
36014 #if PY_MAJOR_VERSION >= 3
36015     result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
36016                                args, (int)nargs,
36017                                k, (int)nk,
36018                                d, (int)nd, kwdefs, closure);
36019 #else
36020     result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
36021                                args, (int)nargs,
36022                                k, (int)nk,
36023                                d, (int)nd, closure);
36024 #endif
36025     Py_XDECREF(kwtuple);
36026 done:
36027     Py_LeaveRecursiveCall();
36028     return result;
36029 }
36030 #endif
36031 #endif
36032 
36033 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)36034 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
36035     PyObject *args, *result = NULL;
36036     #if CYTHON_FAST_PYCALL
36037     if (PyFunction_Check(function)) {
36038         PyObject *args[2] = {arg1, arg2};
36039         return __Pyx_PyFunction_FastCall(function, args, 2);
36040     }
36041     #endif
36042     #if CYTHON_FAST_PYCCALL
36043     if (__Pyx_PyFastCFunction_Check(function)) {
36044         PyObject *args[2] = {arg1, arg2};
36045         return __Pyx_PyCFunction_FastCall(function, args, 2);
36046     }
36047     #endif
36048     args = PyTuple_New(2);
36049     if (unlikely(!args)) goto done;
36050     Py_INCREF(arg1);
36051     PyTuple_SET_ITEM(args, 0, arg1);
36052     Py_INCREF(arg2);
36053     PyTuple_SET_ITEM(args, 1, arg2);
36054     Py_INCREF(function);
36055     result = __Pyx_PyObject_Call(function, args, NULL);
36056     Py_DECREF(args);
36057     Py_DECREF(function);
36058 done:
36059     return result;
36060 }
36061 
36062 /* PyObjectCallMethO */
36063 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)36064 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
36065     PyObject *self, *result;
36066     PyCFunction cfunc;
36067     cfunc = PyCFunction_GET_FUNCTION(func);
36068     self = PyCFunction_GET_SELF(func);
36069     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
36070         return NULL;
36071     result = cfunc(self, arg);
36072     Py_LeaveRecursiveCall();
36073     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
36074         PyErr_SetString(
36075             PyExc_SystemError,
36076             "NULL result without error in PyObject_Call");
36077     }
36078     return result;
36079 }
36080 #endif
36081 
36082 /* PyObjectCallOneArg */
36083 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)36084 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
36085     PyObject *result;
36086     PyObject *args = PyTuple_New(1);
36087     if (unlikely(!args)) return NULL;
36088     Py_INCREF(arg);
36089     PyTuple_SET_ITEM(args, 0, arg);
36090     result = __Pyx_PyObject_Call(func, args, NULL);
36091     Py_DECREF(args);
36092     return result;
36093 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)36094 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
36095 #if CYTHON_FAST_PYCALL
36096     if (PyFunction_Check(func)) {
36097         return __Pyx_PyFunction_FastCall(func, &arg, 1);
36098     }
36099 #endif
36100     if (likely(PyCFunction_Check(func))) {
36101         if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
36102             return __Pyx_PyObject_CallMethO(func, arg);
36103 #if CYTHON_FAST_PYCCALL
36104         } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
36105             return __Pyx_PyCFunction_FastCall(func, &arg, 1);
36106 #endif
36107         }
36108     }
36109     return __Pyx__PyObject_CallOneArg(func, arg);
36110 }
36111 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)36112 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
36113     PyObject *result;
36114     PyObject *args = PyTuple_Pack(1, arg);
36115     if (unlikely(!args)) return NULL;
36116     result = __Pyx_PyObject_Call(func, args, NULL);
36117     Py_DECREF(args);
36118     return result;
36119 }
36120 #endif
36121 
36122 /* PyIntBinop */
36123 #if !CYTHON_COMPILING_IN_PYPY
__Pyx_PyInt_SubtractObjC(PyObject * op1,PyObject * op2,CYTHON_UNUSED long intval,int inplace,int zerodivision_check)36124 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
36125     (void)inplace;
36126     (void)zerodivision_check;
36127     #if PY_MAJOR_VERSION < 3
36128     if (likely(PyInt_CheckExact(op1))) {
36129         const long b = intval;
36130         long x;
36131         long a = PyInt_AS_LONG(op1);
36132             x = (long)((unsigned long)a - b);
36133             if (likely((x^a) >= 0 || (x^~b) >= 0))
36134                 return PyInt_FromLong(x);
36135             return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
36136     }
36137     #endif
36138     #if CYTHON_USE_PYLONG_INTERNALS
36139     if (likely(PyLong_CheckExact(op1))) {
36140         const long b = intval;
36141         long a, x;
36142 #ifdef HAVE_LONG_LONG
36143         const PY_LONG_LONG llb = intval;
36144         PY_LONG_LONG lla, llx;
36145 #endif
36146         const digit* digits = ((PyLongObject*)op1)->ob_digit;
36147         const Py_ssize_t size = Py_SIZE(op1);
36148         if (likely(__Pyx_sst_abs(size) <= 1)) {
36149             a = likely(size) ? digits[0] : 0;
36150             if (size == -1) a = -a;
36151         } else {
36152             switch (size) {
36153                 case -2:
36154                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
36155                         a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
36156                         break;
36157 #ifdef HAVE_LONG_LONG
36158                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
36159                         lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
36160                         goto long_long;
36161 #endif
36162                     }
36163                     CYTHON_FALLTHROUGH;
36164                 case 2:
36165                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
36166                         a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
36167                         break;
36168 #ifdef HAVE_LONG_LONG
36169                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
36170                         lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
36171                         goto long_long;
36172 #endif
36173                     }
36174                     CYTHON_FALLTHROUGH;
36175                 case -3:
36176                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
36177                         a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
36178                         break;
36179 #ifdef HAVE_LONG_LONG
36180                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
36181                         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]));
36182                         goto long_long;
36183 #endif
36184                     }
36185                     CYTHON_FALLTHROUGH;
36186                 case 3:
36187                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
36188                         a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
36189                         break;
36190 #ifdef HAVE_LONG_LONG
36191                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
36192                         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]));
36193                         goto long_long;
36194 #endif
36195                     }
36196                     CYTHON_FALLTHROUGH;
36197                 case -4:
36198                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
36199                         a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
36200                         break;
36201 #ifdef HAVE_LONG_LONG
36202                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
36203                         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]));
36204                         goto long_long;
36205 #endif
36206                     }
36207                     CYTHON_FALLTHROUGH;
36208                 case 4:
36209                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
36210                         a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
36211                         break;
36212 #ifdef HAVE_LONG_LONG
36213                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
36214                         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]));
36215                         goto long_long;
36216 #endif
36217                     }
36218                     CYTHON_FALLTHROUGH;
36219                 default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
36220             }
36221         }
36222                 x = a - b;
36223             return PyLong_FromLong(x);
36224 #ifdef HAVE_LONG_LONG
36225         long_long:
36226                 llx = lla - llb;
36227             return PyLong_FromLongLong(llx);
36228 #endif
36229 
36230 
36231     }
36232     #endif
36233     if (PyFloat_CheckExact(op1)) {
36234         const long b = intval;
36235         double a = PyFloat_AS_DOUBLE(op1);
36236             double result;
36237             PyFPE_START_PROTECT("subtract", return NULL)
36238             result = ((double)a) - (double)b;
36239             PyFPE_END_PROTECT(result)
36240             return PyFloat_FromDouble(result);
36241     }
36242     return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
36243 }
36244 #endif
36245 
36246 /* GetItemInt */
__Pyx_GetItemInt_Generic(PyObject * o,PyObject * j)36247 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
36248     PyObject *r;
36249     if (!j) return NULL;
36250     r = PyObject_GetItem(o, j);
36251     Py_DECREF(j);
36252     return r;
36253 }
__Pyx_GetItemInt_List_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)36254 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
36255                                                               CYTHON_NCP_UNUSED int wraparound,
36256                                                               CYTHON_NCP_UNUSED int boundscheck) {
36257 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
36258     Py_ssize_t wrapped_i = i;
36259     if (wraparound & unlikely(i < 0)) {
36260         wrapped_i += PyList_GET_SIZE(o);
36261     }
36262     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
36263         PyObject *r = PyList_GET_ITEM(o, wrapped_i);
36264         Py_INCREF(r);
36265         return r;
36266     }
36267     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
36268 #else
36269     return PySequence_GetItem(o, i);
36270 #endif
36271 }
__Pyx_GetItemInt_Tuple_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)36272 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
36273                                                               CYTHON_NCP_UNUSED int wraparound,
36274                                                               CYTHON_NCP_UNUSED int boundscheck) {
36275 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
36276     Py_ssize_t wrapped_i = i;
36277     if (wraparound & unlikely(i < 0)) {
36278         wrapped_i += PyTuple_GET_SIZE(o);
36279     }
36280     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
36281         PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
36282         Py_INCREF(r);
36283         return r;
36284     }
36285     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
36286 #else
36287     return PySequence_GetItem(o, i);
36288 #endif
36289 }
__Pyx_GetItemInt_Fast(PyObject * o,Py_ssize_t i,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)36290 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
36291                                                      CYTHON_NCP_UNUSED int wraparound,
36292                                                      CYTHON_NCP_UNUSED int boundscheck) {
36293 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
36294     if (is_list || PyList_CheckExact(o)) {
36295         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
36296         if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
36297             PyObject *r = PyList_GET_ITEM(o, n);
36298             Py_INCREF(r);
36299             return r;
36300         }
36301     }
36302     else if (PyTuple_CheckExact(o)) {
36303         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
36304         if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
36305             PyObject *r = PyTuple_GET_ITEM(o, n);
36306             Py_INCREF(r);
36307             return r;
36308         }
36309     } else {
36310         PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
36311         if (likely(m && m->sq_item)) {
36312             if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
36313                 Py_ssize_t l = m->sq_length(o);
36314                 if (likely(l >= 0)) {
36315                     i += l;
36316                 } else {
36317                     if (!PyErr_ExceptionMatches(PyExc_OverflowError))
36318                         return NULL;
36319                     PyErr_Clear();
36320                 }
36321             }
36322             return m->sq_item(o, i);
36323         }
36324     }
36325 #else
36326     if (is_list || PySequence_Check(o)) {
36327         return PySequence_GetItem(o, i);
36328     }
36329 #endif
36330     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
36331 }
36332 
36333 /* ExtTypeTest */
__Pyx_TypeTest(PyObject * obj,PyTypeObject * type)36334 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
36335     if (unlikely(!type)) {
36336         PyErr_SetString(PyExc_SystemError, "Missing type object");
36337         return 0;
36338     }
36339     if (likely(__Pyx_TypeCheck(obj, type)))
36340         return 1;
36341     PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
36342                  Py_TYPE(obj)->tp_name, type->tp_name);
36343     return 0;
36344 }
36345 
36346 /* IsLittleEndian */
__Pyx_Is_Little_Endian(void)36347 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
36348 {
36349   union {
36350     uint32_t u32;
36351     uint8_t u8[4];
36352   } S;
36353   S.u32 = 0x01020304;
36354   return S.u8[0] == 4;
36355 }
36356 
36357 /* BufferFormatCheck */
__Pyx_BufFmt_Init(__Pyx_BufFmt_Context * ctx,__Pyx_BufFmt_StackElem * stack,__Pyx_TypeInfo * type)36358 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
36359                               __Pyx_BufFmt_StackElem* stack,
36360                               __Pyx_TypeInfo* type) {
36361   stack[0].field = &ctx->root;
36362   stack[0].parent_offset = 0;
36363   ctx->root.type = type;
36364   ctx->root.name = "buffer dtype";
36365   ctx->root.offset = 0;
36366   ctx->head = stack;
36367   ctx->head->field = &ctx->root;
36368   ctx->fmt_offset = 0;
36369   ctx->head->parent_offset = 0;
36370   ctx->new_packmode = '@';
36371   ctx->enc_packmode = '@';
36372   ctx->new_count = 1;
36373   ctx->enc_count = 0;
36374   ctx->enc_type = 0;
36375   ctx->is_complex = 0;
36376   ctx->is_valid_array = 0;
36377   ctx->struct_alignment = 0;
36378   while (type->typegroup == 'S') {
36379     ++ctx->head;
36380     ctx->head->field = type->fields;
36381     ctx->head->parent_offset = 0;
36382     type = type->fields->type;
36383   }
36384 }
__Pyx_BufFmt_ParseNumber(const char ** ts)36385 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
36386     int count;
36387     const char* t = *ts;
36388     if (*t < '0' || *t > '9') {
36389       return -1;
36390     } else {
36391         count = *t++ - '0';
36392         while (*t >= '0' && *t <= '9') {
36393             count *= 10;
36394             count += *t++ - '0';
36395         }
36396     }
36397     *ts = t;
36398     return count;
36399 }
__Pyx_BufFmt_ExpectNumber(const char ** ts)36400 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
36401     int number = __Pyx_BufFmt_ParseNumber(ts);
36402     if (number == -1)
36403         PyErr_Format(PyExc_ValueError,\
36404                      "Does not understand character buffer dtype format string ('%c')", **ts);
36405     return number;
36406 }
__Pyx_BufFmt_RaiseUnexpectedChar(char ch)36407 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
36408   PyErr_Format(PyExc_ValueError,
36409                "Unexpected format string character: '%c'", ch);
36410 }
__Pyx_BufFmt_DescribeTypeChar(char ch,int is_complex)36411 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
36412   switch (ch) {
36413     case 'c': return "'char'";
36414     case 'b': return "'signed char'";
36415     case 'B': return "'unsigned char'";
36416     case 'h': return "'short'";
36417     case 'H': return "'unsigned short'";
36418     case 'i': return "'int'";
36419     case 'I': return "'unsigned int'";
36420     case 'l': return "'long'";
36421     case 'L': return "'unsigned long'";
36422     case 'q': return "'long long'";
36423     case 'Q': return "'unsigned long long'";
36424     case 'f': return (is_complex ? "'complex float'" : "'float'");
36425     case 'd': return (is_complex ? "'complex double'" : "'double'");
36426     case 'g': return (is_complex ? "'complex long double'" : "'long double'");
36427     case 'T': return "a struct";
36428     case 'O': return "Python object";
36429     case 'P': return "a pointer";
36430     case 's': case 'p': return "a string";
36431     case 0: return "end";
36432     default: return "unparseable format string";
36433   }
36434 }
__Pyx_BufFmt_TypeCharToStandardSize(char ch,int is_complex)36435 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
36436   switch (ch) {
36437     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
36438     case 'h': case 'H': return 2;
36439     case 'i': case 'I': case 'l': case 'L': return 4;
36440     case 'q': case 'Q': return 8;
36441     case 'f': return (is_complex ? 8 : 4);
36442     case 'd': return (is_complex ? 16 : 8);
36443     case 'g': {
36444       PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
36445       return 0;
36446     }
36447     case 'O': case 'P': return sizeof(void*);
36448     default:
36449       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36450       return 0;
36451     }
36452 }
__Pyx_BufFmt_TypeCharToNativeSize(char ch,int is_complex)36453 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
36454   switch (ch) {
36455     case 'c': case 'b': case 'B': case 's': case 'p': return 1;
36456     case 'h': case 'H': return sizeof(short);
36457     case 'i': case 'I': return sizeof(int);
36458     case 'l': case 'L': return sizeof(long);
36459     #ifdef HAVE_LONG_LONG
36460     case 'q': case 'Q': return sizeof(PY_LONG_LONG);
36461     #endif
36462     case 'f': return sizeof(float) * (is_complex ? 2 : 1);
36463     case 'd': return sizeof(double) * (is_complex ? 2 : 1);
36464     case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
36465     case 'O': case 'P': return sizeof(void*);
36466     default: {
36467       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36468       return 0;
36469     }
36470   }
36471 }
36472 typedef struct { char c; short x; } __Pyx_st_short;
36473 typedef struct { char c; int x; } __Pyx_st_int;
36474 typedef struct { char c; long x; } __Pyx_st_long;
36475 typedef struct { char c; float x; } __Pyx_st_float;
36476 typedef struct { char c; double x; } __Pyx_st_double;
36477 typedef struct { char c; long double x; } __Pyx_st_longdouble;
36478 typedef struct { char c; void *x; } __Pyx_st_void_p;
36479 #ifdef HAVE_LONG_LONG
36480 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
36481 #endif
__Pyx_BufFmt_TypeCharToAlignment(char ch,CYTHON_UNUSED int is_complex)36482 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
36483   switch (ch) {
36484     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
36485     case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
36486     case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
36487     case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
36488 #ifdef HAVE_LONG_LONG
36489     case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
36490 #endif
36491     case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
36492     case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
36493     case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
36494     case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
36495     default:
36496       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36497       return 0;
36498     }
36499 }
36500 /* These are for computing the padding at the end of the struct to align
36501    on the first member of the struct. This will probably the same as above,
36502    but we don't have any guarantees.
36503  */
36504 typedef struct { short x; char c; } __Pyx_pad_short;
36505 typedef struct { int x; char c; } __Pyx_pad_int;
36506 typedef struct { long x; char c; } __Pyx_pad_long;
36507 typedef struct { float x; char c; } __Pyx_pad_float;
36508 typedef struct { double x; char c; } __Pyx_pad_double;
36509 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
36510 typedef struct { void *x; char c; } __Pyx_pad_void_p;
36511 #ifdef HAVE_LONG_LONG
36512 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
36513 #endif
__Pyx_BufFmt_TypeCharToPadding(char ch,CYTHON_UNUSED int is_complex)36514 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
36515   switch (ch) {
36516     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
36517     case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
36518     case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
36519     case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
36520 #ifdef HAVE_LONG_LONG
36521     case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
36522 #endif
36523     case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
36524     case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
36525     case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
36526     case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
36527     default:
36528       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36529       return 0;
36530     }
36531 }
__Pyx_BufFmt_TypeCharToGroup(char ch,int is_complex)36532 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
36533   switch (ch) {
36534     case 'c':
36535         return 'H';
36536     case 'b': case 'h': case 'i':
36537     case 'l': case 'q': case 's': case 'p':
36538         return 'I';
36539     case 'B': case 'H': case 'I': case 'L': case 'Q':
36540         return 'U';
36541     case 'f': case 'd': case 'g':
36542         return (is_complex ? 'C' : 'R');
36543     case 'O':
36544         return 'O';
36545     case 'P':
36546         return 'P';
36547     default: {
36548       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36549       return 0;
36550     }
36551   }
36552 }
__Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context * ctx)36553 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
36554   if (ctx->head == NULL || ctx->head->field == &ctx->root) {
36555     const char* expected;
36556     const char* quote;
36557     if (ctx->head == NULL) {
36558       expected = "end";
36559       quote = "";
36560     } else {
36561       expected = ctx->head->field->type->name;
36562       quote = "'";
36563     }
36564     PyErr_Format(PyExc_ValueError,
36565                  "Buffer dtype mismatch, expected %s%s%s but got %s",
36566                  quote, expected, quote,
36567                  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
36568   } else {
36569     __Pyx_StructField* field = ctx->head->field;
36570     __Pyx_StructField* parent = (ctx->head - 1)->field;
36571     PyErr_Format(PyExc_ValueError,
36572                  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
36573                  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
36574                  parent->type->name, field->name);
36575   }
36576 }
__Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context * ctx)36577 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
36578   char group;
36579   size_t size, offset, arraysize = 1;
36580   if (ctx->enc_type == 0) return 0;
36581   if (ctx->head->field->type->arraysize[0]) {
36582     int i, ndim = 0;
36583     if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
36584         ctx->is_valid_array = ctx->head->field->type->ndim == 1;
36585         ndim = 1;
36586         if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
36587             PyErr_Format(PyExc_ValueError,
36588                          "Expected a dimension of size %zu, got %zu",
36589                          ctx->head->field->type->arraysize[0], ctx->enc_count);
36590             return -1;
36591         }
36592     }
36593     if (!ctx->is_valid_array) {
36594       PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
36595                    ctx->head->field->type->ndim, ndim);
36596       return -1;
36597     }
36598     for (i = 0; i < ctx->head->field->type->ndim; i++) {
36599       arraysize *= ctx->head->field->type->arraysize[i];
36600     }
36601     ctx->is_valid_array = 0;
36602     ctx->enc_count = 1;
36603   }
36604   group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
36605   do {
36606     __Pyx_StructField* field = ctx->head->field;
36607     __Pyx_TypeInfo* type = field->type;
36608     if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
36609       size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
36610     } else {
36611       size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
36612     }
36613     if (ctx->enc_packmode == '@') {
36614       size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
36615       size_t align_mod_offset;
36616       if (align_at == 0) return -1;
36617       align_mod_offset = ctx->fmt_offset % align_at;
36618       if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
36619       if (ctx->struct_alignment == 0)
36620           ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
36621                                                                  ctx->is_complex);
36622     }
36623     if (type->size != size || type->typegroup != group) {
36624       if (type->typegroup == 'C' && type->fields != NULL) {
36625         size_t parent_offset = ctx->head->parent_offset + field->offset;
36626         ++ctx->head;
36627         ctx->head->field = type->fields;
36628         ctx->head->parent_offset = parent_offset;
36629         continue;
36630       }
36631       if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
36632       } else {
36633           __Pyx_BufFmt_RaiseExpected(ctx);
36634           return -1;
36635       }
36636     }
36637     offset = ctx->head->parent_offset + field->offset;
36638     if (ctx->fmt_offset != offset) {
36639       PyErr_Format(PyExc_ValueError,
36640                    "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
36641                    (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
36642       return -1;
36643     }
36644     ctx->fmt_offset += size;
36645     if (arraysize)
36646       ctx->fmt_offset += (arraysize - 1) * size;
36647     --ctx->enc_count;
36648     while (1) {
36649       if (field == &ctx->root) {
36650         ctx->head = NULL;
36651         if (ctx->enc_count != 0) {
36652           __Pyx_BufFmt_RaiseExpected(ctx);
36653           return -1;
36654         }
36655         break;
36656       }
36657       ctx->head->field = ++field;
36658       if (field->type == NULL) {
36659         --ctx->head;
36660         field = ctx->head->field;
36661         continue;
36662       } else if (field->type->typegroup == 'S') {
36663         size_t parent_offset = ctx->head->parent_offset + field->offset;
36664         if (field->type->fields->type == NULL) continue;
36665         field = field->type->fields;
36666         ++ctx->head;
36667         ctx->head->field = field;
36668         ctx->head->parent_offset = parent_offset;
36669         break;
36670       } else {
36671         break;
36672       }
36673     }
36674   } while (ctx->enc_count);
36675   ctx->enc_type = 0;
36676   ctx->is_complex = 0;
36677   return 0;
36678 }
36679 static PyObject *
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context * ctx,const char ** tsp)36680 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
36681 {
36682     const char *ts = *tsp;
36683     int i = 0, number;
36684     int ndim = ctx->head->field->type->ndim;
36685 ;
36686     ++ts;
36687     if (ctx->new_count != 1) {
36688         PyErr_SetString(PyExc_ValueError,
36689                         "Cannot handle repeated arrays in format string");
36690         return NULL;
36691     }
36692     if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
36693     while (*ts && *ts != ')') {
36694         switch (*ts) {
36695             case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
36696             default:  break;
36697         }
36698         number = __Pyx_BufFmt_ExpectNumber(&ts);
36699         if (number == -1) return NULL;
36700         if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
36701             return PyErr_Format(PyExc_ValueError,
36702                         "Expected a dimension of size %zu, got %d",
36703                         ctx->head->field->type->arraysize[i], number);
36704         if (*ts != ',' && *ts != ')')
36705             return PyErr_Format(PyExc_ValueError,
36706                                 "Expected a comma in format string, got '%c'", *ts);
36707         if (*ts == ',') ts++;
36708         i++;
36709     }
36710     if (i != ndim)
36711         return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
36712                             ctx->head->field->type->ndim, i);
36713     if (!*ts) {
36714         PyErr_SetString(PyExc_ValueError,
36715                         "Unexpected end of format string, expected ')'");
36716         return NULL;
36717     }
36718     ctx->is_valid_array = 1;
36719     ctx->new_count = 1;
36720     *tsp = ++ts;
36721     return Py_None;
36722 }
__Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context * ctx,const char * ts)36723 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
36724   int got_Z = 0;
36725   while (1) {
36726     switch(*ts) {
36727       case 0:
36728         if (ctx->enc_type != 0 && ctx->head == NULL) {
36729           __Pyx_BufFmt_RaiseExpected(ctx);
36730           return NULL;
36731         }
36732         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
36733         if (ctx->head != NULL) {
36734           __Pyx_BufFmt_RaiseExpected(ctx);
36735           return NULL;
36736         }
36737         return ts;
36738       case ' ':
36739       case '\r':
36740       case '\n':
36741         ++ts;
36742         break;
36743       case '<':
36744         if (!__Pyx_Is_Little_Endian()) {
36745           PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
36746           return NULL;
36747         }
36748         ctx->new_packmode = '=';
36749         ++ts;
36750         break;
36751       case '>':
36752       case '!':
36753         if (__Pyx_Is_Little_Endian()) {
36754           PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
36755           return NULL;
36756         }
36757         ctx->new_packmode = '=';
36758         ++ts;
36759         break;
36760       case '=':
36761       case '@':
36762       case '^':
36763         ctx->new_packmode = *ts++;
36764         break;
36765       case 'T':
36766         {
36767           const char* ts_after_sub;
36768           size_t i, struct_count = ctx->new_count;
36769           size_t struct_alignment = ctx->struct_alignment;
36770           ctx->new_count = 1;
36771           ++ts;
36772           if (*ts != '{') {
36773             PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
36774             return NULL;
36775           }
36776           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
36777           ctx->enc_type = 0;
36778           ctx->enc_count = 0;
36779           ctx->struct_alignment = 0;
36780           ++ts;
36781           ts_after_sub = ts;
36782           for (i = 0; i != struct_count; ++i) {
36783             ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
36784             if (!ts_after_sub) return NULL;
36785           }
36786           ts = ts_after_sub;
36787           if (struct_alignment) ctx->struct_alignment = struct_alignment;
36788         }
36789         break;
36790       case '}':
36791         {
36792           size_t alignment = ctx->struct_alignment;
36793           ++ts;
36794           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
36795           ctx->enc_type = 0;
36796           if (alignment && ctx->fmt_offset % alignment) {
36797             ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
36798           }
36799         }
36800         return ts;
36801       case 'x':
36802         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
36803         ctx->fmt_offset += ctx->new_count;
36804         ctx->new_count = 1;
36805         ctx->enc_count = 0;
36806         ctx->enc_type = 0;
36807         ctx->enc_packmode = ctx->new_packmode;
36808         ++ts;
36809         break;
36810       case 'Z':
36811         got_Z = 1;
36812         ++ts;
36813         if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
36814           __Pyx_BufFmt_RaiseUnexpectedChar('Z');
36815           return NULL;
36816         }
36817         CYTHON_FALLTHROUGH;
36818       case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
36819       case 'l': case 'L': case 'q': case 'Q':
36820       case 'f': case 'd': case 'g':
36821       case 'O': case 'p':
36822         if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
36823             ctx->enc_packmode == ctx->new_packmode) {
36824           ctx->enc_count += ctx->new_count;
36825           ctx->new_count = 1;
36826           got_Z = 0;
36827           ++ts;
36828           break;
36829         }
36830         CYTHON_FALLTHROUGH;
36831       case 's':
36832         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
36833         ctx->enc_count = ctx->new_count;
36834         ctx->enc_packmode = ctx->new_packmode;
36835         ctx->enc_type = *ts;
36836         ctx->is_complex = got_Z;
36837         ++ts;
36838         ctx->new_count = 1;
36839         got_Z = 0;
36840         break;
36841       case ':':
36842         ++ts;
36843         while(*ts != ':') ++ts;
36844         ++ts;
36845         break;
36846       case '(':
36847         if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
36848         break;
36849       default:
36850         {
36851           int number = __Pyx_BufFmt_ExpectNumber(&ts);
36852           if (number == -1) return NULL;
36853           ctx->new_count = (size_t)number;
36854         }
36855     }
36856   }
36857 }
36858 
36859 /* BufferGetAndValidate */
__Pyx_SafeReleaseBuffer(Py_buffer * info)36860   static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
36861   if (unlikely(info->buf == NULL)) return;
36862   if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
36863   __Pyx_ReleaseBuffer(info);
36864 }
__Pyx_ZeroBuffer(Py_buffer * buf)36865 static void __Pyx_ZeroBuffer(Py_buffer* buf) {
36866   buf->buf = NULL;
36867   buf->obj = NULL;
36868   buf->strides = __Pyx_zeros;
36869   buf->shape = __Pyx_zeros;
36870   buf->suboffsets = __Pyx_minusones;
36871 }
__Pyx__GetBufferAndValidate(Py_buffer * buf,PyObject * obj,__Pyx_TypeInfo * dtype,int flags,int nd,int cast,__Pyx_BufFmt_StackElem * stack)36872 static int __Pyx__GetBufferAndValidate(
36873         Py_buffer* buf, PyObject* obj,  __Pyx_TypeInfo* dtype, int flags,
36874         int nd, int cast, __Pyx_BufFmt_StackElem* stack)
36875 {
36876   buf->buf = NULL;
36877   if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
36878     __Pyx_ZeroBuffer(buf);
36879     return -1;
36880   }
36881   if (unlikely(buf->ndim != nd)) {
36882     PyErr_Format(PyExc_ValueError,
36883                  "Buffer has wrong number of dimensions (expected %d, got %d)",
36884                  nd, buf->ndim);
36885     goto fail;
36886   }
36887   if (!cast) {
36888     __Pyx_BufFmt_Context ctx;
36889     __Pyx_BufFmt_Init(&ctx, stack, dtype);
36890     if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
36891   }
36892   if (unlikely((size_t)buf->itemsize != dtype->size)) {
36893     PyErr_Format(PyExc_ValueError,
36894       "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
36895       buf->itemsize, (buf->itemsize > 1) ? "s" : "",
36896       dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
36897     goto fail;
36898   }
36899   if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
36900   return 0;
36901 fail:;
36902   __Pyx_SafeReleaseBuffer(buf);
36903   return -1;
36904 }
36905 
36906 /* BufferFallbackError */
__Pyx_RaiseBufferFallbackError(void)36907   static void __Pyx_RaiseBufferFallbackError(void) {
36908   PyErr_SetString(PyExc_ValueError,
36909      "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
36910 }
36911 
36912 /* ObjectGetItem */
36913   #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetIndex(PyObject * obj,PyObject * index)36914 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
36915     PyObject *runerr;
36916     Py_ssize_t key_value;
36917     PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
36918     if (unlikely(!(m && m->sq_item))) {
36919         PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
36920         return NULL;
36921     }
36922     key_value = __Pyx_PyIndex_AsSsize_t(index);
36923     if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
36924         return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
36925     }
36926     if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
36927         PyErr_Clear();
36928         PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
36929     }
36930     return NULL;
36931 }
__Pyx_PyObject_GetItem(PyObject * obj,PyObject * key)36932 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
36933     PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
36934     if (likely(m && m->mp_subscript)) {
36935         return m->mp_subscript(obj, key);
36936     }
36937     return __Pyx_PyObject_GetIndex(obj, key);
36938 }
36939 #endif
36940 
36941 /* 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)36942   static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
36943                                   CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
36944                                   int full_traceback, CYTHON_UNUSED int nogil) {
36945     PyObject *old_exc, *old_val, *old_tb;
36946     PyObject *ctx;
36947     __Pyx_PyThreadState_declare
36948 #ifdef WITH_THREAD
36949     PyGILState_STATE state;
36950     if (nogil)
36951         state = PyGILState_Ensure();
36952 #ifdef _MSC_VER
36953     else state = (PyGILState_STATE)-1;
36954 #endif
36955 #endif
36956     __Pyx_PyThreadState_assign
36957     __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
36958     if (full_traceback) {
36959         Py_XINCREF(old_exc);
36960         Py_XINCREF(old_val);
36961         Py_XINCREF(old_tb);
36962         __Pyx_ErrRestore(old_exc, old_val, old_tb);
36963         PyErr_PrintEx(1);
36964     }
36965     #if PY_MAJOR_VERSION < 3
36966     ctx = PyString_FromString(name);
36967     #else
36968     ctx = PyUnicode_FromString(name);
36969     #endif
36970     __Pyx_ErrRestore(old_exc, old_val, old_tb);
36971     if (!ctx) {
36972         PyErr_WriteUnraisable(Py_None);
36973     } else {
36974         PyErr_WriteUnraisable(ctx);
36975         Py_DECREF(ctx);
36976     }
36977 #ifdef WITH_THREAD
36978     if (nogil)
36979         PyGILState_Release(state);
36980 #endif
36981 }
36982 
36983 /* PyObjectGetMethod */
__Pyx_PyObject_GetMethod(PyObject * obj,PyObject * name,PyObject ** method)36984   static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
36985     PyObject *attr;
36986 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
36987     PyTypeObject *tp = Py_TYPE(obj);
36988     PyObject *descr;
36989     descrgetfunc f = NULL;
36990     PyObject **dictptr, *dict;
36991     int meth_found = 0;
36992     assert (*method == NULL);
36993     if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
36994         attr = __Pyx_PyObject_GetAttrStr(obj, name);
36995         goto try_unpack;
36996     }
36997     if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
36998         return 0;
36999     }
37000     descr = _PyType_Lookup(tp, name);
37001     if (likely(descr != NULL)) {
37002         Py_INCREF(descr);
37003 #if PY_MAJOR_VERSION >= 3
37004         #ifdef __Pyx_CyFunction_USED
37005         if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
37006         #else
37007         if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
37008         #endif
37009 #else
37010         #ifdef __Pyx_CyFunction_USED
37011         if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
37012         #else
37013         if (likely(PyFunction_Check(descr)))
37014         #endif
37015 #endif
37016         {
37017             meth_found = 1;
37018         } else {
37019             f = Py_TYPE(descr)->tp_descr_get;
37020             if (f != NULL && PyDescr_IsData(descr)) {
37021                 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
37022                 Py_DECREF(descr);
37023                 goto try_unpack;
37024             }
37025         }
37026     }
37027     dictptr = _PyObject_GetDictPtr(obj);
37028     if (dictptr != NULL && (dict = *dictptr) != NULL) {
37029         Py_INCREF(dict);
37030         attr = __Pyx_PyDict_GetItemStr(dict, name);
37031         if (attr != NULL) {
37032             Py_INCREF(attr);
37033             Py_DECREF(dict);
37034             Py_XDECREF(descr);
37035             goto try_unpack;
37036         }
37037         Py_DECREF(dict);
37038     }
37039     if (meth_found) {
37040         *method = descr;
37041         return 1;
37042     }
37043     if (f != NULL) {
37044         attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
37045         Py_DECREF(descr);
37046         goto try_unpack;
37047     }
37048     if (descr != NULL) {
37049         *method = descr;
37050         return 0;
37051     }
37052     PyErr_Format(PyExc_AttributeError,
37053 #if PY_MAJOR_VERSION >= 3
37054                  "'%.50s' object has no attribute '%U'",
37055                  tp->tp_name, name);
37056 #else
37057                  "'%.50s' object has no attribute '%.400s'",
37058                  tp->tp_name, PyString_AS_STRING(name));
37059 #endif
37060     return 0;
37061 #else
37062     attr = __Pyx_PyObject_GetAttrStr(obj, name);
37063     goto try_unpack;
37064 #endif
37065 try_unpack:
37066 #if CYTHON_UNPACK_METHODS
37067     if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
37068         PyObject *function = PyMethod_GET_FUNCTION(attr);
37069         Py_INCREF(function);
37070         Py_DECREF(attr);
37071         *method = function;
37072         return 1;
37073     }
37074 #endif
37075     *method = attr;
37076     return 0;
37077 }
37078 
37079 /* PyObjectCallMethod1 */
__Pyx__PyObject_CallMethod1(PyObject * method,PyObject * arg)37080   static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
37081     PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
37082     Py_DECREF(method);
37083     return result;
37084 }
__Pyx_PyObject_CallMethod1(PyObject * obj,PyObject * method_name,PyObject * arg)37085 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
37086     PyObject *method = NULL, *result;
37087     int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
37088     if (likely(is_method)) {
37089         result = __Pyx_PyObject_Call2Args(method, obj, arg);
37090         Py_DECREF(method);
37091         return result;
37092     }
37093     if (unlikely(!method)) return NULL;
37094     return __Pyx__PyObject_CallMethod1(method, arg);
37095 }
37096 
37097 /* append */
__Pyx_PyObject_Append(PyObject * L,PyObject * x)37098   static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
37099     if (likely(PyList_CheckExact(L))) {
37100         if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
37101     } else {
37102         PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
37103         if (unlikely(!retval))
37104             return -1;
37105         Py_DECREF(retval);
37106     }
37107     return 0;
37108 }
37109 
37110 /* DictGetItem */
37111   #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
__Pyx_PyDict_GetItem(PyObject * d,PyObject * key)37112 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
37113     PyObject *value;
37114     value = PyDict_GetItemWithError(d, key);
37115     if (unlikely(!value)) {
37116         if (!PyErr_Occurred()) {
37117             if (unlikely(PyTuple_Check(key))) {
37118                 PyObject* args = PyTuple_Pack(1, key);
37119                 if (likely(args)) {
37120                     PyErr_SetObject(PyExc_KeyError, args);
37121                     Py_DECREF(args);
37122                 }
37123             } else {
37124                 PyErr_SetObject(PyExc_KeyError, key);
37125             }
37126         }
37127         return NULL;
37128     }
37129     Py_INCREF(value);
37130     return value;
37131 }
37132 #endif
37133 
37134 /* RaiseTooManyValuesToUnpack */
__Pyx_RaiseTooManyValuesError(Py_ssize_t expected)37135   static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
37136     PyErr_Format(PyExc_ValueError,
37137                  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
37138 }
37139 
37140 /* RaiseNeedMoreValuesToUnpack */
__Pyx_RaiseNeedMoreValuesError(Py_ssize_t index)37141   static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
37142     PyErr_Format(PyExc_ValueError,
37143                  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
37144                  index, (index == 1) ? "" : "s");
37145 }
37146 
37147 /* RaiseNoneIterError */
__Pyx_RaiseNoneNotIterableError(void)37148   static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
37149     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
37150 }
37151 
37152 /* GetTopmostException */
37153   #if CYTHON_USE_EXC_INFO_STACK
37154 static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState * tstate)37155 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
37156 {
37157     _PyErr_StackItem *exc_info = tstate->exc_info;
37158     while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
37159            exc_info->previous_item != NULL)
37160     {
37161         exc_info = exc_info->previous_item;
37162     }
37163     return exc_info;
37164 }
37165 #endif
37166 
37167 /* SaveResetException */
37168   #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSave(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)37169 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
37170     #if CYTHON_USE_EXC_INFO_STACK
37171     _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
37172     *type = exc_info->exc_type;
37173     *value = exc_info->exc_value;
37174     *tb = exc_info->exc_traceback;
37175     #else
37176     *type = tstate->exc_type;
37177     *value = tstate->exc_value;
37178     *tb = tstate->exc_traceback;
37179     #endif
37180     Py_XINCREF(*type);
37181     Py_XINCREF(*value);
37182     Py_XINCREF(*tb);
37183 }
__Pyx__ExceptionReset(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)37184 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
37185     PyObject *tmp_type, *tmp_value, *tmp_tb;
37186     #if CYTHON_USE_EXC_INFO_STACK
37187     _PyErr_StackItem *exc_info = tstate->exc_info;
37188     tmp_type = exc_info->exc_type;
37189     tmp_value = exc_info->exc_value;
37190     tmp_tb = exc_info->exc_traceback;
37191     exc_info->exc_type = type;
37192     exc_info->exc_value = value;
37193     exc_info->exc_traceback = tb;
37194     #else
37195     tmp_type = tstate->exc_type;
37196     tmp_value = tstate->exc_value;
37197     tmp_tb = tstate->exc_traceback;
37198     tstate->exc_type = type;
37199     tstate->exc_value = value;
37200     tstate->exc_traceback = tb;
37201     #endif
37202     Py_XDECREF(tmp_type);
37203     Py_XDECREF(tmp_value);
37204     Py_XDECREF(tmp_tb);
37205 }
37206 #endif
37207 
37208 /* PyErrExceptionMatches */
37209   #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)37210 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
37211     Py_ssize_t i, n;
37212     n = PyTuple_GET_SIZE(tuple);
37213 #if PY_MAJOR_VERSION >= 3
37214     for (i=0; i<n; i++) {
37215         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
37216     }
37217 #endif
37218     for (i=0; i<n; i++) {
37219         if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
37220     }
37221     return 0;
37222 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)37223 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
37224     PyObject *exc_type = tstate->curexc_type;
37225     if (exc_type == err) return 1;
37226     if (unlikely(!exc_type)) return 0;
37227     if (unlikely(PyTuple_Check(err)))
37228         return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
37229     return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
37230 }
37231 #endif
37232 
37233 /* GetException */
37234   #if CYTHON_FAST_THREAD_STATE
__Pyx__GetException(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)37235 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
37236 #else
37237 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
37238 #endif
37239 {
37240     PyObject *local_type, *local_value, *local_tb;
37241 #if CYTHON_FAST_THREAD_STATE
37242     PyObject *tmp_type, *tmp_value, *tmp_tb;
37243     local_type = tstate->curexc_type;
37244     local_value = tstate->curexc_value;
37245     local_tb = tstate->curexc_traceback;
37246     tstate->curexc_type = 0;
37247     tstate->curexc_value = 0;
37248     tstate->curexc_traceback = 0;
37249 #else
37250     PyErr_Fetch(&local_type, &local_value, &local_tb);
37251 #endif
37252     PyErr_NormalizeException(&local_type, &local_value, &local_tb);
37253 #if CYTHON_FAST_THREAD_STATE
37254     if (unlikely(tstate->curexc_type))
37255 #else
37256     if (unlikely(PyErr_Occurred()))
37257 #endif
37258         goto bad;
37259     #if PY_MAJOR_VERSION >= 3
37260     if (local_tb) {
37261         if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
37262             goto bad;
37263     }
37264     #endif
37265     Py_XINCREF(local_tb);
37266     Py_XINCREF(local_type);
37267     Py_XINCREF(local_value);
37268     *type = local_type;
37269     *value = local_value;
37270     *tb = local_tb;
37271 #if CYTHON_FAST_THREAD_STATE
37272     #if CYTHON_USE_EXC_INFO_STACK
37273     {
37274         _PyErr_StackItem *exc_info = tstate->exc_info;
37275         tmp_type = exc_info->exc_type;
37276         tmp_value = exc_info->exc_value;
37277         tmp_tb = exc_info->exc_traceback;
37278         exc_info->exc_type = local_type;
37279         exc_info->exc_value = local_value;
37280         exc_info->exc_traceback = local_tb;
37281     }
37282     #else
37283     tmp_type = tstate->exc_type;
37284     tmp_value = tstate->exc_value;
37285     tmp_tb = tstate->exc_traceback;
37286     tstate->exc_type = local_type;
37287     tstate->exc_value = local_value;
37288     tstate->exc_traceback = local_tb;
37289     #endif
37290     Py_XDECREF(tmp_type);
37291     Py_XDECREF(tmp_value);
37292     Py_XDECREF(tmp_tb);
37293 #else
37294     PyErr_SetExcInfo(local_type, local_value, local_tb);
37295 #endif
37296     return 0;
37297 bad:
37298     *type = 0;
37299     *value = 0;
37300     *tb = 0;
37301     Py_XDECREF(local_type);
37302     Py_XDECREF(local_value);
37303     Py_XDECREF(local_tb);
37304     return -1;
37305 }
37306 
37307 /* GetAttr */
__Pyx_GetAttr(PyObject * o,PyObject * n)37308   static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
37309 #if CYTHON_USE_TYPE_SLOTS
37310 #if PY_MAJOR_VERSION >= 3
37311     if (likely(PyUnicode_Check(n)))
37312 #else
37313     if (likely(PyString_Check(n)))
37314 #endif
37315         return __Pyx_PyObject_GetAttrStr(o, n);
37316 #endif
37317     return PyObject_GetAttr(o, n);
37318 }
37319 
37320 /* HasAttr */
__Pyx_HasAttr(PyObject * o,PyObject * n)37321   static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
37322     PyObject *r;
37323     if (unlikely(!__Pyx_PyBaseString_Check(n))) {
37324         PyErr_SetString(PyExc_TypeError,
37325                         "hasattr(): attribute name must be string");
37326         return -1;
37327     }
37328     r = __Pyx_GetAttr(o, n);
37329     if (unlikely(!r)) {
37330         PyErr_Clear();
37331         return 0;
37332     } else {
37333         Py_DECREF(r);
37334         return 1;
37335     }
37336 }
37337 
37338 /* BufferIndexError */
__Pyx_RaiseBufferIndexError(int axis)37339   static void __Pyx_RaiseBufferIndexError(int axis) {
37340   PyErr_Format(PyExc_IndexError,
37341      "Out of bounds on buffer access (axis %d)", axis);
37342 }
37343 
37344 /* None */
__Pyx_div_Py_ssize_t(Py_ssize_t a,Py_ssize_t b)37345   static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
37346     Py_ssize_t q = a / b;
37347     Py_ssize_t r = a - q*b;
37348     q -= ((r != 0) & ((r ^ b) < 0));
37349     return q;
37350 }
37351 
37352 /* 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))37353   static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
37354          const char* cstring, Py_ssize_t start, Py_ssize_t stop,
37355          const char* encoding, const char* errors,
37356          PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
37357     Py_ssize_t length;
37358     if (unlikely((start < 0) | (stop < 0))) {
37359         size_t slen = strlen(cstring);
37360         if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
37361             PyErr_SetString(PyExc_OverflowError,
37362                             "c-string too long to convert to Python");
37363             return NULL;
37364         }
37365         length = (Py_ssize_t) slen;
37366         if (start < 0) {
37367             start += length;
37368             if (start < 0)
37369                 start = 0;
37370         }
37371         if (stop < 0)
37372             stop += length;
37373     }
37374     length = stop - start;
37375     if (unlikely(length <= 0))
37376         return PyUnicode_FromUnicode(NULL, 0);
37377     cstring += start;
37378     if (decode_func) {
37379         return decode_func(cstring, length, errors);
37380     } else {
37381         return PyUnicode_Decode(cstring, length, encoding, errors);
37382     }
37383 }
37384 
37385 /* GetAttr3 */
__Pyx_GetAttr3Default(PyObject * d)37386   static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
37387     __Pyx_PyThreadState_declare
37388     __Pyx_PyThreadState_assign
37389     if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
37390         return NULL;
37391     __Pyx_PyErr_Clear();
37392     Py_INCREF(d);
37393     return d;
37394 }
__Pyx_GetAttr3(PyObject * o,PyObject * n,PyObject * d)37395 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
37396     PyObject *r = __Pyx_GetAttr(o, n);
37397     return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
37398 }
37399 
37400 /* SwapException */
37401   #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSwap(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)37402 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
37403     PyObject *tmp_type, *tmp_value, *tmp_tb;
37404     #if CYTHON_USE_EXC_INFO_STACK
37405     _PyErr_StackItem *exc_info = tstate->exc_info;
37406     tmp_type = exc_info->exc_type;
37407     tmp_value = exc_info->exc_value;
37408     tmp_tb = exc_info->exc_traceback;
37409     exc_info->exc_type = *type;
37410     exc_info->exc_value = *value;
37411     exc_info->exc_traceback = *tb;
37412     #else
37413     tmp_type = tstate->exc_type;
37414     tmp_value = tstate->exc_value;
37415     tmp_tb = tstate->exc_traceback;
37416     tstate->exc_type = *type;
37417     tstate->exc_value = *value;
37418     tstate->exc_traceback = *tb;
37419     #endif
37420     *type = tmp_type;
37421     *value = tmp_value;
37422     *tb = tmp_tb;
37423 }
37424 #else
__Pyx_ExceptionSwap(PyObject ** type,PyObject ** value,PyObject ** tb)37425 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
37426     PyObject *tmp_type, *tmp_value, *tmp_tb;
37427     PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
37428     PyErr_SetExcInfo(*type, *value, *tb);
37429     *type = tmp_type;
37430     *value = tmp_value;
37431     *tb = tmp_tb;
37432 }
37433 #endif
37434 
37435 /* Import */
__Pyx_Import(PyObject * name,PyObject * from_list,int level)37436   static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
37437     PyObject *empty_list = 0;
37438     PyObject *module = 0;
37439     PyObject *global_dict = 0;
37440     PyObject *empty_dict = 0;
37441     PyObject *list;
37442     #if PY_MAJOR_VERSION < 3
37443     PyObject *py_import;
37444     py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
37445     if (!py_import)
37446         goto bad;
37447     #endif
37448     if (from_list)
37449         list = from_list;
37450     else {
37451         empty_list = PyList_New(0);
37452         if (!empty_list)
37453             goto bad;
37454         list = empty_list;
37455     }
37456     global_dict = PyModule_GetDict(__pyx_m);
37457     if (!global_dict)
37458         goto bad;
37459     empty_dict = PyDict_New();
37460     if (!empty_dict)
37461         goto bad;
37462     {
37463         #if PY_MAJOR_VERSION >= 3
37464         if (level == -1) {
37465             if (strchr(__Pyx_MODULE_NAME, '.')) {
37466                 module = PyImport_ImportModuleLevelObject(
37467                     name, global_dict, empty_dict, list, 1);
37468                 if (!module) {
37469                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
37470                         goto bad;
37471                     PyErr_Clear();
37472                 }
37473             }
37474             level = 0;
37475         }
37476         #endif
37477         if (!module) {
37478             #if PY_MAJOR_VERSION < 3
37479             PyObject *py_level = PyInt_FromLong(level);
37480             if (!py_level)
37481                 goto bad;
37482             module = PyObject_CallFunctionObjArgs(py_import,
37483                 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
37484             Py_DECREF(py_level);
37485             #else
37486             module = PyImport_ImportModuleLevelObject(
37487                 name, global_dict, empty_dict, list, level);
37488             #endif
37489         }
37490     }
37491 bad:
37492     #if PY_MAJOR_VERSION < 3
37493     Py_XDECREF(py_import);
37494     #endif
37495     Py_XDECREF(empty_list);
37496     Py_XDECREF(empty_dict);
37497     return module;
37498 }
37499 
37500 /* FastTypeChecks */
37501   #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)37502 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
37503     while (a) {
37504         a = a->tp_base;
37505         if (a == b)
37506             return 1;
37507     }
37508     return b == &PyBaseObject_Type;
37509 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)37510 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
37511     PyObject *mro;
37512     if (a == b) return 1;
37513     mro = a->tp_mro;
37514     if (likely(mro)) {
37515         Py_ssize_t i, n;
37516         n = PyTuple_GET_SIZE(mro);
37517         for (i = 0; i < n; i++) {
37518             if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
37519                 return 1;
37520         }
37521         return 0;
37522     }
37523     return __Pyx_InBases(a, b);
37524 }
37525 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)37526 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
37527     PyObject *exception, *value, *tb;
37528     int res;
37529     __Pyx_PyThreadState_declare
37530     __Pyx_PyThreadState_assign
37531     __Pyx_ErrFetch(&exception, &value, &tb);
37532     res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
37533     if (unlikely(res == -1)) {
37534         PyErr_WriteUnraisable(err);
37535         res = 0;
37536     }
37537     if (!res) {
37538         res = PyObject_IsSubclass(err, exc_type2);
37539         if (unlikely(res == -1)) {
37540             PyErr_WriteUnraisable(err);
37541             res = 0;
37542         }
37543     }
37544     __Pyx_ErrRestore(exception, value, tb);
37545     return res;
37546 }
37547 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)37548 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
37549     int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
37550     if (!res) {
37551         res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
37552     }
37553     return res;
37554 }
37555 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)37556 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
37557     Py_ssize_t i, n;
37558     assert(PyExceptionClass_Check(exc_type));
37559     n = PyTuple_GET_SIZE(tuple);
37560 #if PY_MAJOR_VERSION >= 3
37561     for (i=0; i<n; i++) {
37562         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
37563     }
37564 #endif
37565     for (i=0; i<n; i++) {
37566         PyObject *t = PyTuple_GET_ITEM(tuple, i);
37567         #if PY_MAJOR_VERSION < 3
37568         if (likely(exc_type == t)) return 1;
37569         #endif
37570         if (likely(PyExceptionClass_Check(t))) {
37571             if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
37572         } else {
37573         }
37574     }
37575     return 0;
37576 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)37577 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
37578     if (likely(err == exc_type)) return 1;
37579     if (likely(PyExceptionClass_Check(err))) {
37580         if (likely(PyExceptionClass_Check(exc_type))) {
37581             return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
37582         } else if (likely(PyTuple_Check(exc_type))) {
37583             return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
37584         } else {
37585         }
37586     }
37587     return PyErr_GivenExceptionMatches(err, exc_type);
37588 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)37589 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
37590     assert(PyExceptionClass_Check(exc_type1));
37591     assert(PyExceptionClass_Check(exc_type2));
37592     if (likely(err == exc_type1 || err == exc_type2)) return 1;
37593     if (likely(PyExceptionClass_Check(err))) {
37594         return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
37595     }
37596     return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
37597 }
37598 #endif
37599 
37600 /* PyIntBinop */
37601   #if !CYTHON_COMPILING_IN_PYPY
__Pyx_PyInt_AddObjC(PyObject * op1,PyObject * op2,CYTHON_UNUSED long intval,int inplace,int zerodivision_check)37602 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
37603     (void)inplace;
37604     (void)zerodivision_check;
37605     #if PY_MAJOR_VERSION < 3
37606     if (likely(PyInt_CheckExact(op1))) {
37607         const long b = intval;
37608         long x;
37609         long a = PyInt_AS_LONG(op1);
37610             x = (long)((unsigned long)a + b);
37611             if (likely((x^a) >= 0 || (x^b) >= 0))
37612                 return PyInt_FromLong(x);
37613             return PyLong_Type.tp_as_number->nb_add(op1, op2);
37614     }
37615     #endif
37616     #if CYTHON_USE_PYLONG_INTERNALS
37617     if (likely(PyLong_CheckExact(op1))) {
37618         const long b = intval;
37619         long a, x;
37620 #ifdef HAVE_LONG_LONG
37621         const PY_LONG_LONG llb = intval;
37622         PY_LONG_LONG lla, llx;
37623 #endif
37624         const digit* digits = ((PyLongObject*)op1)->ob_digit;
37625         const Py_ssize_t size = Py_SIZE(op1);
37626         if (likely(__Pyx_sst_abs(size) <= 1)) {
37627             a = likely(size) ? digits[0] : 0;
37628             if (size == -1) a = -a;
37629         } else {
37630             switch (size) {
37631                 case -2:
37632                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
37633                         a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
37634                         break;
37635 #ifdef HAVE_LONG_LONG
37636                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
37637                         lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
37638                         goto long_long;
37639 #endif
37640                     }
37641                     CYTHON_FALLTHROUGH;
37642                 case 2:
37643                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
37644                         a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
37645                         break;
37646 #ifdef HAVE_LONG_LONG
37647                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
37648                         lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
37649                         goto long_long;
37650 #endif
37651                     }
37652                     CYTHON_FALLTHROUGH;
37653                 case -3:
37654                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
37655                         a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
37656                         break;
37657 #ifdef HAVE_LONG_LONG
37658                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
37659                         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]));
37660                         goto long_long;
37661 #endif
37662                     }
37663                     CYTHON_FALLTHROUGH;
37664                 case 3:
37665                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
37666                         a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
37667                         break;
37668 #ifdef HAVE_LONG_LONG
37669                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
37670                         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]));
37671                         goto long_long;
37672 #endif
37673                     }
37674                     CYTHON_FALLTHROUGH;
37675                 case -4:
37676                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
37677                         a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
37678                         break;
37679 #ifdef HAVE_LONG_LONG
37680                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
37681                         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]));
37682                         goto long_long;
37683 #endif
37684                     }
37685                     CYTHON_FALLTHROUGH;
37686                 case 4:
37687                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
37688                         a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
37689                         break;
37690 #ifdef HAVE_LONG_LONG
37691                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
37692                         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]));
37693                         goto long_long;
37694 #endif
37695                     }
37696                     CYTHON_FALLTHROUGH;
37697                 default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
37698             }
37699         }
37700                 x = a + b;
37701             return PyLong_FromLong(x);
37702 #ifdef HAVE_LONG_LONG
37703         long_long:
37704                 llx = lla + llb;
37705             return PyLong_FromLongLong(llx);
37706 #endif
37707 
37708 
37709     }
37710     #endif
37711     if (PyFloat_CheckExact(op1)) {
37712         const long b = intval;
37713         double a = PyFloat_AS_DOUBLE(op1);
37714             double result;
37715             PyFPE_START_PROTECT("add", return NULL)
37716             result = ((double)a) + (double)b;
37717             PyFPE_END_PROTECT(result)
37718             return PyFloat_FromDouble(result);
37719     }
37720     return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
37721 }
37722 #endif
37723 
37724 /* None */
__Pyx_RaiseUnboundLocalError(const char * varname)37725   static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
37726     PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
37727 }
37728 
37729 /* None */
__Pyx_div_long(long a,long b)37730   static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
37731     long q = a / b;
37732     long r = a - q*b;
37733     q -= ((r != 0) & ((r ^ b) < 0));
37734     return q;
37735 }
37736 
37737 /* ImportFrom */
__Pyx_ImportFrom(PyObject * module,PyObject * name)37738   static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
37739     PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
37740     if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
37741         PyErr_Format(PyExc_ImportError,
37742         #if PY_MAJOR_VERSION < 3
37743             "cannot import name %.230s", PyString_AS_STRING(name));
37744         #else
37745             "cannot import name %S", name);
37746         #endif
37747     }
37748     return value;
37749 }
37750 
37751 /* PyObject_GenericGetAttrNoDict */
37752   #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_RaiseGenericGetAttributeError(PyTypeObject * tp,PyObject * attr_name)37753 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
37754     PyErr_Format(PyExc_AttributeError,
37755 #if PY_MAJOR_VERSION >= 3
37756                  "'%.50s' object has no attribute '%U'",
37757                  tp->tp_name, attr_name);
37758 #else
37759                  "'%.50s' object has no attribute '%.400s'",
37760                  tp->tp_name, PyString_AS_STRING(attr_name));
37761 #endif
37762     return NULL;
37763 }
__Pyx_PyObject_GenericGetAttrNoDict(PyObject * obj,PyObject * attr_name)37764 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
37765     PyObject *descr;
37766     PyTypeObject *tp = Py_TYPE(obj);
37767     if (unlikely(!PyString_Check(attr_name))) {
37768         return PyObject_GenericGetAttr(obj, attr_name);
37769     }
37770     assert(!tp->tp_dictoffset);
37771     descr = _PyType_Lookup(tp, attr_name);
37772     if (unlikely(!descr)) {
37773         return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
37774     }
37775     Py_INCREF(descr);
37776     #if PY_MAJOR_VERSION < 3
37777     if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
37778     #endif
37779     {
37780         descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
37781         if (unlikely(f)) {
37782             PyObject *res = f(descr, obj, (PyObject *)tp);
37783             Py_DECREF(descr);
37784             return res;
37785         }
37786     }
37787     return descr;
37788 }
37789 #endif
37790 
37791 /* PyObject_GenericGetAttr */
37792   #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_PyObject_GenericGetAttr(PyObject * obj,PyObject * attr_name)37793 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
37794     if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
37795         return PyObject_GenericGetAttr(obj, attr_name);
37796     }
37797     return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
37798 }
37799 #endif
37800 
37801 /* SetVTable */
__Pyx_SetVtable(PyObject * dict,void * vtable)37802   static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
37803 #if PY_VERSION_HEX >= 0x02070000
37804     PyObject *ob = PyCapsule_New(vtable, 0, 0);
37805 #else
37806     PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
37807 #endif
37808     if (!ob)
37809         goto bad;
37810     if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
37811         goto bad;
37812     Py_DECREF(ob);
37813     return 0;
37814 bad:
37815     Py_XDECREF(ob);
37816     return -1;
37817 }
37818 
37819 /* SetupReduce */
__Pyx_setup_reduce_is_named(PyObject * meth,PyObject * name)37820   static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
37821   int ret;
37822   PyObject *name_attr;
37823   name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
37824   if (likely(name_attr)) {
37825       ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
37826   } else {
37827       ret = -1;
37828   }
37829   if (unlikely(ret < 0)) {
37830       PyErr_Clear();
37831       ret = 0;
37832   }
37833   Py_XDECREF(name_attr);
37834   return ret;
37835 }
__Pyx_setup_reduce(PyObject * type_obj)37836 static int __Pyx_setup_reduce(PyObject* type_obj) {
37837     int ret = 0;
37838     PyObject *object_reduce = NULL;
37839     PyObject *object_reduce_ex = NULL;
37840     PyObject *reduce = NULL;
37841     PyObject *reduce_ex = NULL;
37842     PyObject *reduce_cython = NULL;
37843     PyObject *setstate = NULL;
37844     PyObject *setstate_cython = NULL;
37845 #if CYTHON_USE_PYTYPE_LOOKUP
37846     if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
37847 #else
37848     if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
37849 #endif
37850 #if CYTHON_USE_PYTYPE_LOOKUP
37851     object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
37852 #else
37853     object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
37854 #endif
37855     reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
37856     if (reduce_ex == object_reduce_ex) {
37857 #if CYTHON_USE_PYTYPE_LOOKUP
37858         object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
37859 #else
37860         object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
37861 #endif
37862         reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
37863         if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
37864             reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
37865             ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
37866             ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
37867             setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
37868             if (!setstate) PyErr_Clear();
37869             if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
37870                 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
37871                 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
37872                 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
37873             }
37874             PyType_Modified((PyTypeObject*)type_obj);
37875         }
37876     }
37877     goto GOOD;
37878 BAD:
37879     if (!PyErr_Occurred())
37880         PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
37881     ret = -1;
37882 GOOD:
37883 #if !CYTHON_USE_PYTYPE_LOOKUP
37884     Py_XDECREF(object_reduce);
37885     Py_XDECREF(object_reduce_ex);
37886 #endif
37887     Py_XDECREF(reduce);
37888     Py_XDECREF(reduce_ex);
37889     Py_XDECREF(reduce_cython);
37890     Py_XDECREF(setstate);
37891     Py_XDECREF(setstate_cython);
37892     return ret;
37893 }
37894 
37895 /* TypeImport */
37896   #ifndef __PYX_HAVE_RT_ImportType
37897 #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)37898 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
37899     size_t size, enum __Pyx_ImportType_CheckSize check_size)
37900 {
37901     PyObject *result = 0;
37902     char warning[200];
37903     Py_ssize_t basicsize;
37904 #ifdef Py_LIMITED_API
37905     PyObject *py_basicsize;
37906 #endif
37907     result = PyObject_GetAttrString(module, class_name);
37908     if (!result)
37909         goto bad;
37910     if (!PyType_Check(result)) {
37911         PyErr_Format(PyExc_TypeError,
37912             "%.200s.%.200s is not a type object",
37913             module_name, class_name);
37914         goto bad;
37915     }
37916 #ifndef Py_LIMITED_API
37917     basicsize = ((PyTypeObject *)result)->tp_basicsize;
37918 #else
37919     py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
37920     if (!py_basicsize)
37921         goto bad;
37922     basicsize = PyLong_AsSsize_t(py_basicsize);
37923     Py_DECREF(py_basicsize);
37924     py_basicsize = 0;
37925     if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
37926         goto bad;
37927 #endif
37928     if ((size_t)basicsize < size) {
37929         PyErr_Format(PyExc_ValueError,
37930             "%.200s.%.200s size changed, may indicate binary incompatibility. "
37931             "Expected %zd from C header, got %zd from PyObject",
37932             module_name, class_name, size, basicsize);
37933         goto bad;
37934     }
37935     if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
37936         PyErr_Format(PyExc_ValueError,
37937             "%.200s.%.200s size changed, may indicate binary incompatibility. "
37938             "Expected %zd from C header, got %zd from PyObject",
37939             module_name, class_name, size, basicsize);
37940         goto bad;
37941     }
37942     else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
37943         PyOS_snprintf(warning, sizeof(warning),
37944             "%s.%s size changed, may indicate binary incompatibility. "
37945             "Expected %zd from C header, got %zd from PyObject",
37946             module_name, class_name, size, basicsize);
37947         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
37948     }
37949     return (PyTypeObject *)result;
37950 bad:
37951     Py_XDECREF(result);
37952     return NULL;
37953 }
37954 #endif
37955 
37956 /* GetVTable */
__Pyx_GetVtable(PyObject * dict)37957   static void* __Pyx_GetVtable(PyObject *dict) {
37958     void* ptr;
37959     PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
37960     if (!ob)
37961         goto bad;
37962 #if PY_VERSION_HEX >= 0x02070000
37963     ptr = PyCapsule_GetPointer(ob, 0);
37964 #else
37965     ptr = PyCObject_AsVoidPtr(ob);
37966 #endif
37967     if (!ptr && !PyErr_Occurred())
37968         PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
37969     Py_DECREF(ob);
37970     return ptr;
37971 bad:
37972     Py_XDECREF(ob);
37973     return NULL;
37974 }
37975 
37976 /* CLineInTraceback */
37977   #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(PyThreadState * tstate,int c_line)37978 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
37979     PyObject *use_cline;
37980     PyObject *ptype, *pvalue, *ptraceback;
37981 #if CYTHON_COMPILING_IN_CPYTHON
37982     PyObject **cython_runtime_dict;
37983 #endif
37984     if (unlikely(!__pyx_cython_runtime)) {
37985         return c_line;
37986     }
37987     __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
37988 #if CYTHON_COMPILING_IN_CPYTHON
37989     cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
37990     if (likely(cython_runtime_dict)) {
37991         __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
37992             use_cline, *cython_runtime_dict,
37993             __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
37994     } else
37995 #endif
37996     {
37997       PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
37998       if (use_cline_obj) {
37999         use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
38000         Py_DECREF(use_cline_obj);
38001       } else {
38002         PyErr_Clear();
38003         use_cline = NULL;
38004       }
38005     }
38006     if (!use_cline) {
38007         c_line = 0;
38008         PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
38009     }
38010     else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
38011         c_line = 0;
38012     }
38013     __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
38014     return c_line;
38015 }
38016 #endif
38017 
38018 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)38019   static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
38020     int start = 0, mid = 0, end = count - 1;
38021     if (end >= 0 && code_line > entries[end].code_line) {
38022         return count;
38023     }
38024     while (start < end) {
38025         mid = start + (end - start) / 2;
38026         if (code_line < entries[mid].code_line) {
38027             end = mid;
38028         } else if (code_line > entries[mid].code_line) {
38029              start = mid + 1;
38030         } else {
38031             return mid;
38032         }
38033     }
38034     if (code_line <= entries[mid].code_line) {
38035         return mid;
38036     } else {
38037         return mid + 1;
38038     }
38039 }
__pyx_find_code_object(int code_line)38040 static PyCodeObject *__pyx_find_code_object(int code_line) {
38041     PyCodeObject* code_object;
38042     int pos;
38043     if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
38044         return NULL;
38045     }
38046     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
38047     if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
38048         return NULL;
38049     }
38050     code_object = __pyx_code_cache.entries[pos].code_object;
38051     Py_INCREF(code_object);
38052     return code_object;
38053 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)38054 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
38055     int pos, i;
38056     __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
38057     if (unlikely(!code_line)) {
38058         return;
38059     }
38060     if (unlikely(!entries)) {
38061         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
38062         if (likely(entries)) {
38063             __pyx_code_cache.entries = entries;
38064             __pyx_code_cache.max_count = 64;
38065             __pyx_code_cache.count = 1;
38066             entries[0].code_line = code_line;
38067             entries[0].code_object = code_object;
38068             Py_INCREF(code_object);
38069         }
38070         return;
38071     }
38072     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
38073     if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
38074         PyCodeObject* tmp = entries[pos].code_object;
38075         entries[pos].code_object = code_object;
38076         Py_DECREF(tmp);
38077         return;
38078     }
38079     if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
38080         int new_max = __pyx_code_cache.max_count + 64;
38081         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
38082             __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
38083         if (unlikely(!entries)) {
38084             return;
38085         }
38086         __pyx_code_cache.entries = entries;
38087         __pyx_code_cache.max_count = new_max;
38088     }
38089     for (i=__pyx_code_cache.count; i>pos; i--) {
38090         entries[i] = entries[i-1];
38091     }
38092     entries[pos].code_line = code_line;
38093     entries[pos].code_object = code_object;
38094     __pyx_code_cache.count++;
38095     Py_INCREF(code_object);
38096 }
38097 
38098 /* AddTraceback */
38099   #include "compile.h"
38100 #include "frameobject.h"
38101 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)38102 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
38103             const char *funcname, int c_line,
38104             int py_line, const char *filename) {
38105     PyCodeObject *py_code = 0;
38106     PyObject *py_srcfile = 0;
38107     PyObject *py_funcname = 0;
38108     #if PY_MAJOR_VERSION < 3
38109     py_srcfile = PyString_FromString(filename);
38110     #else
38111     py_srcfile = PyUnicode_FromString(filename);
38112     #endif
38113     if (!py_srcfile) goto bad;
38114     if (c_line) {
38115         #if PY_MAJOR_VERSION < 3
38116         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
38117         #else
38118         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
38119         #endif
38120     }
38121     else {
38122         #if PY_MAJOR_VERSION < 3
38123         py_funcname = PyString_FromString(funcname);
38124         #else
38125         py_funcname = PyUnicode_FromString(funcname);
38126         #endif
38127     }
38128     if (!py_funcname) goto bad;
38129     py_code = __Pyx_PyCode_New(
38130         0,
38131         0,
38132         0,
38133         0,
38134         0,
38135         __pyx_empty_bytes, /*PyObject *code,*/
38136         __pyx_empty_tuple, /*PyObject *consts,*/
38137         __pyx_empty_tuple, /*PyObject *names,*/
38138         __pyx_empty_tuple, /*PyObject *varnames,*/
38139         __pyx_empty_tuple, /*PyObject *freevars,*/
38140         __pyx_empty_tuple, /*PyObject *cellvars,*/
38141         py_srcfile,   /*PyObject *filename,*/
38142         py_funcname,  /*PyObject *name,*/
38143         py_line,
38144         __pyx_empty_bytes  /*PyObject *lnotab*/
38145     );
38146     Py_DECREF(py_srcfile);
38147     Py_DECREF(py_funcname);
38148     return py_code;
38149 bad:
38150     Py_XDECREF(py_srcfile);
38151     Py_XDECREF(py_funcname);
38152     return NULL;
38153 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)38154 static void __Pyx_AddTraceback(const char *funcname, int c_line,
38155                                int py_line, const char *filename) {
38156     PyCodeObject *py_code = 0;
38157     PyFrameObject *py_frame = 0;
38158     PyThreadState *tstate = __Pyx_PyThreadState_Current;
38159     if (c_line) {
38160         c_line = __Pyx_CLineForTraceback(tstate, c_line);
38161     }
38162     py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
38163     if (!py_code) {
38164         py_code = __Pyx_CreateCodeObjectForTraceback(
38165             funcname, c_line, py_line, filename);
38166         if (!py_code) goto bad;
38167         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
38168     }
38169     py_frame = PyFrame_New(
38170         tstate,            /*PyThreadState *tstate,*/
38171         py_code,           /*PyCodeObject *code,*/
38172         __pyx_d,    /*PyObject *globals,*/
38173         0                  /*PyObject *locals*/
38174     );
38175     if (!py_frame) goto bad;
38176     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
38177     PyTraceBack_Here(py_frame);
38178 bad:
38179     Py_XDECREF(py_code);
38180     Py_XDECREF(py_frame);
38181 }
38182 
38183 #if PY_MAJOR_VERSION < 3
__Pyx_GetBuffer(PyObject * obj,Py_buffer * view,int flags)38184 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
38185     if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
38186         if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
38187         if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
38188         if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
38189     PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
38190     return -1;
38191 }
__Pyx_ReleaseBuffer(Py_buffer * view)38192 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
38193     PyObject *obj = view->obj;
38194     if (!obj) return;
38195     if (PyObject_CheckBuffer(obj)) {
38196         PyBuffer_Release(view);
38197         return;
38198     }
38199     if ((0)) {}
38200         else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
38201     view->obj = NULL;
38202     Py_DECREF(obj);
38203 }
38204 #endif
38205 
38206 
38207   /* MemviewSliceIsContig */
38208   static int
__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs,char order,int ndim)38209 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
38210 {
38211     int i, index, step, start;
38212     Py_ssize_t itemsize = mvs.memview->view.itemsize;
38213     if (order == 'F') {
38214         step = 1;
38215         start = 0;
38216     } else {
38217         step = -1;
38218         start = ndim - 1;
38219     }
38220     for (i = 0; i < ndim; i++) {
38221         index = start + step * i;
38222         if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
38223             return 0;
38224         itemsize *= mvs.shape[index];
38225     }
38226     return 1;
38227 }
38228 
38229 /* OverlappingSlices */
38230   static void
__pyx_get_array_memory_extents(__Pyx_memviewslice * slice,void ** out_start,void ** out_end,int ndim,size_t itemsize)38231 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
38232                                void **out_start, void **out_end,
38233                                int ndim, size_t itemsize)
38234 {
38235     char *start, *end;
38236     int i;
38237     start = end = slice->data;
38238     for (i = 0; i < ndim; i++) {
38239         Py_ssize_t stride = slice->strides[i];
38240         Py_ssize_t extent = slice->shape[i];
38241         if (extent == 0) {
38242             *out_start = *out_end = start;
38243             return;
38244         } else {
38245             if (stride > 0)
38246                 end += stride * (extent - 1);
38247             else
38248                 start += stride * (extent - 1);
38249         }
38250     }
38251     *out_start = start;
38252     *out_end = end + itemsize;
38253 }
38254 static int
__pyx_slices_overlap(__Pyx_memviewslice * slice1,__Pyx_memviewslice * slice2,int ndim,size_t itemsize)38255 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
38256                      __Pyx_memviewslice *slice2,
38257                      int ndim, size_t itemsize)
38258 {
38259     void *start1, *end1, *start2, *end2;
38260     __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
38261     __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
38262     return (start1 < end2) && (start2 < end1);
38263 }
38264 
38265 /* Capsule */
38266   static CYTHON_INLINE PyObject *
__pyx_capsule_create(void * p,CYTHON_UNUSED const char * sig)38267 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
38268 {
38269     PyObject *cobj;
38270 #if PY_VERSION_HEX >= 0x02070000
38271     cobj = PyCapsule_New(p, sig, NULL);
38272 #else
38273     cobj = PyCObject_FromVoidPtr(p, NULL);
38274 #endif
38275     return cobj;
38276 }
38277 
38278 /* TypeInfoCompare */
38279   static int
__pyx_typeinfo_cmp(__Pyx_TypeInfo * a,__Pyx_TypeInfo * b)38280 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
38281 {
38282     int i;
38283     if (!a || !b)
38284         return 0;
38285     if (a == b)
38286         return 1;
38287     if (a->size != b->size || a->typegroup != b->typegroup ||
38288             a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
38289         if (a->typegroup == 'H' || b->typegroup == 'H') {
38290             return a->size == b->size;
38291         } else {
38292             return 0;
38293         }
38294     }
38295     if (a->ndim) {
38296         for (i = 0; i < a->ndim; i++)
38297             if (a->arraysize[i] != b->arraysize[i])
38298                 return 0;
38299     }
38300     if (a->typegroup == 'S') {
38301         if (a->flags != b->flags)
38302             return 0;
38303         if (a->fields || b->fields) {
38304             if (!(a->fields && b->fields))
38305                 return 0;
38306             for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
38307                 __Pyx_StructField *field_a = a->fields + i;
38308                 __Pyx_StructField *field_b = b->fields + i;
38309                 if (field_a->offset != field_b->offset ||
38310                     !__pyx_typeinfo_cmp(field_a->type, field_b->type))
38311                     return 0;
38312             }
38313             return !a->fields[i].type && !b->fields[i].type;
38314         }
38315     }
38316     return 1;
38317 }
38318 
38319 /* MemviewSliceValidateAndInit */
38320   static int
__pyx_check_strides(Py_buffer * buf,int dim,int ndim,int spec)38321 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
38322 {
38323     if (buf->shape[dim] <= 1)
38324         return 1;
38325     if (buf->strides) {
38326         if (spec & __Pyx_MEMVIEW_CONTIG) {
38327             if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
38328                 if (buf->strides[dim] != sizeof(void *)) {
38329                     PyErr_Format(PyExc_ValueError,
38330                                  "Buffer is not indirectly contiguous "
38331                                  "in dimension %d.", dim);
38332                     goto fail;
38333                 }
38334             } else if (buf->strides[dim] != buf->itemsize) {
38335                 PyErr_SetString(PyExc_ValueError,
38336                                 "Buffer and memoryview are not contiguous "
38337                                 "in the same dimension.");
38338                 goto fail;
38339             }
38340         }
38341         if (spec & __Pyx_MEMVIEW_FOLLOW) {
38342             Py_ssize_t stride = buf->strides[dim];
38343             if (stride < 0)
38344                 stride = -stride;
38345             if (stride < buf->itemsize) {
38346                 PyErr_SetString(PyExc_ValueError,
38347                                 "Buffer and memoryview are not contiguous "
38348                                 "in the same dimension.");
38349                 goto fail;
38350             }
38351         }
38352     } else {
38353         if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
38354             PyErr_Format(PyExc_ValueError,
38355                          "C-contiguous buffer is not contiguous in "
38356                          "dimension %d", dim);
38357             goto fail;
38358         } else if (spec & (__Pyx_MEMVIEW_PTR)) {
38359             PyErr_Format(PyExc_ValueError,
38360                          "C-contiguous buffer is not indirect in "
38361                          "dimension %d", dim);
38362             goto fail;
38363         } else if (buf->suboffsets) {
38364             PyErr_SetString(PyExc_ValueError,
38365                             "Buffer exposes suboffsets but no strides");
38366             goto fail;
38367         }
38368     }
38369     return 1;
38370 fail:
38371     return 0;
38372 }
38373 static int
__pyx_check_suboffsets(Py_buffer * buf,int dim,CYTHON_UNUSED int ndim,int spec)38374 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
38375 {
38376     if (spec & __Pyx_MEMVIEW_DIRECT) {
38377         if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
38378             PyErr_Format(PyExc_ValueError,
38379                          "Buffer not compatible with direct access "
38380                          "in dimension %d.", dim);
38381             goto fail;
38382         }
38383     }
38384     if (spec & __Pyx_MEMVIEW_PTR) {
38385         if (!buf->suboffsets || (buf->suboffsets[dim] < 0)) {
38386             PyErr_Format(PyExc_ValueError,
38387                          "Buffer is not indirectly accessible "
38388                          "in dimension %d.", dim);
38389             goto fail;
38390         }
38391     }
38392     return 1;
38393 fail:
38394     return 0;
38395 }
38396 static int
__pyx_verify_contig(Py_buffer * buf,int ndim,int c_or_f_flag)38397 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
38398 {
38399     int i;
38400     if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
38401         Py_ssize_t stride = 1;
38402         for (i = 0; i < ndim; i++) {
38403             if (stride * buf->itemsize != buf->strides[i] &&
38404                     buf->shape[i] > 1)
38405             {
38406                 PyErr_SetString(PyExc_ValueError,
38407                     "Buffer not fortran contiguous.");
38408                 goto fail;
38409             }
38410             stride = stride * buf->shape[i];
38411         }
38412     } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
38413         Py_ssize_t stride = 1;
38414         for (i = ndim - 1; i >- 1; i--) {
38415             if (stride * buf->itemsize != buf->strides[i] &&
38416                     buf->shape[i] > 1) {
38417                 PyErr_SetString(PyExc_ValueError,
38418                     "Buffer not C contiguous.");
38419                 goto fail;
38420             }
38421             stride = stride * buf->shape[i];
38422         }
38423     }
38424     return 1;
38425 fail:
38426     return 0;
38427 }
__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)38428 static int __Pyx_ValidateAndInit_memviewslice(
38429                 int *axes_specs,
38430                 int c_or_f_flag,
38431                 int buf_flags,
38432                 int ndim,
38433                 __Pyx_TypeInfo *dtype,
38434                 __Pyx_BufFmt_StackElem stack[],
38435                 __Pyx_memviewslice *memviewslice,
38436                 PyObject *original_obj)
38437 {
38438     struct __pyx_memoryview_obj *memview, *new_memview;
38439     __Pyx_RefNannyDeclarations
38440     Py_buffer *buf;
38441     int i, spec = 0, retval = -1;
38442     __Pyx_BufFmt_Context ctx;
38443     int from_memoryview = __pyx_memoryview_check(original_obj);
38444     __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
38445     if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
38446                                                             original_obj)->typeinfo)) {
38447         memview = (struct __pyx_memoryview_obj *) original_obj;
38448         new_memview = NULL;
38449     } else {
38450         memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
38451                                             original_obj, buf_flags, 0, dtype);
38452         new_memview = memview;
38453         if (unlikely(!memview))
38454             goto fail;
38455     }
38456     buf = &memview->view;
38457     if (buf->ndim != ndim) {
38458         PyErr_Format(PyExc_ValueError,
38459                 "Buffer has wrong number of dimensions (expected %d, got %d)",
38460                 ndim, buf->ndim);
38461         goto fail;
38462     }
38463     if (new_memview) {
38464         __Pyx_BufFmt_Init(&ctx, stack, dtype);
38465         if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
38466     }
38467     if ((unsigned) buf->itemsize != dtype->size) {
38468         PyErr_Format(PyExc_ValueError,
38469                      "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
38470                      "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
38471                      buf->itemsize,
38472                      (buf->itemsize > 1) ? "s" : "",
38473                      dtype->name,
38474                      dtype->size,
38475                      (dtype->size > 1) ? "s" : "");
38476         goto fail;
38477     }
38478     for (i = 0; i < ndim; i++) {
38479         spec = axes_specs[i];
38480         if (!__pyx_check_strides(buf, i, ndim, spec))
38481             goto fail;
38482         if (!__pyx_check_suboffsets(buf, i, ndim, spec))
38483             goto fail;
38484     }
38485     if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
38486         goto fail;
38487     if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
38488                                          new_memview != NULL) == -1)) {
38489         goto fail;
38490     }
38491     retval = 0;
38492     goto no_fail;
38493 fail:
38494     Py_XDECREF(new_memview);
38495     retval = -1;
38496 no_fail:
38497     __Pyx_RefNannyFinishContext();
38498     return retval;
38499 }
38500 
38501 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject * obj,int writable_flag)38502   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *obj, int writable_flag) {
38503     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
38504     __Pyx_BufFmt_StackElem stack[1];
38505     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
38506     int retcode;
38507     if (obj == Py_None) {
38508         result.memview = (struct __pyx_memoryview_obj *) Py_None;
38509         return result;
38510     }
38511     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
38512                                                  PyBUF_RECORDS_RO | writable_flag, 1,
38513                                                  &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack,
38514                                                  &result, obj);
38515     if (unlikely(retcode == -1))
38516         goto __pyx_fail;
38517     return result;
38518 __pyx_fail:
38519     result.memview = NULL;
38520     result.data = NULL;
38521     return result;
38522 }
38523 
38524 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject * obj,int writable_flag)38525   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *obj, int writable_flag) {
38526     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
38527     __Pyx_BufFmt_StackElem stack[1];
38528     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
38529     int retcode;
38530     if (obj == Py_None) {
38531         result.memview = (struct __pyx_memoryview_obj *) Py_None;
38532         return result;
38533     }
38534     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
38535                                                  PyBUF_RECORDS_RO | writable_flag, 2,
38536                                                  &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack,
38537                                                  &result, obj);
38538     if (unlikely(retcode == -1))
38539         goto __pyx_fail;
38540     return result;
38541 __pyx_fail:
38542     result.memview = NULL;
38543     result.data = NULL;
38544     return result;
38545 }
38546 
38547 /* CIntFromPyVerify */
38548   #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
38549     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
38550 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
38551     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
38552 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
38553     {\
38554         func_type value = func_value;\
38555         if (sizeof(target_type) < sizeof(func_type)) {\
38556             if (unlikely(value != (func_type) (target_type) value)) {\
38557                 func_type zero = 0;\
38558                 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
38559                     return (target_type) -1;\
38560                 if (is_unsigned && unlikely(value < zero))\
38561                     goto raise_neg_overflow;\
38562                 else\
38563                     goto raise_overflow;\
38564             }\
38565         }\
38566         return (target_type) value;\
38567     }
38568 
38569 /* MemviewDtypeToObject */
__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char * itemp)38570   static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp) {
38571     return (PyObject *) PyFloat_FromDouble(*(__pyx_t_5numpy_float64_t *) itemp);
38572 }
__pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char * itemp,PyObject * obj)38573 static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj) {
38574     __pyx_t_5numpy_float64_t value = __pyx_PyFloat_AsDouble(obj);
38575     if ((value == ((npy_float64)-1)) && PyErr_Occurred())
38576         return 0;
38577     *(__pyx_t_5numpy_float64_t *) itemp = value;
38578     return 1;
38579 }
38580 
38581 /* CIntToPy */
__Pyx_PyInt_From_npy_int64(npy_int64 value)38582   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) {
38583     const npy_int64 neg_one = (npy_int64) ((npy_int64) 0 - (npy_int64) 1), const_zero = (npy_int64) 0;
38584     const int is_unsigned = neg_one > const_zero;
38585     if (is_unsigned) {
38586         if (sizeof(npy_int64) < sizeof(long)) {
38587             return PyInt_FromLong((long) value);
38588         } else if (sizeof(npy_int64) <= sizeof(unsigned long)) {
38589             return PyLong_FromUnsignedLong((unsigned long) value);
38590 #ifdef HAVE_LONG_LONG
38591         } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) {
38592             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
38593 #endif
38594         }
38595     } else {
38596         if (sizeof(npy_int64) <= sizeof(long)) {
38597             return PyInt_FromLong((long) value);
38598 #ifdef HAVE_LONG_LONG
38599         } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) {
38600             return PyLong_FromLongLong((PY_LONG_LONG) value);
38601 #endif
38602         }
38603     }
38604     {
38605         int one = 1; int little = (int)*(unsigned char *)&one;
38606         unsigned char *bytes = (unsigned char *)&value;
38607         return _PyLong_FromByteArray(bytes, sizeof(npy_int64),
38608                                      little, !is_unsigned);
38609     }
38610 }
38611 
38612 /* MemviewDtypeToObject */
__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char * itemp)38613   static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char *itemp) {
38614     return (PyObject *) __Pyx_PyInt_From_npy_int64(*(__pyx_t_5numpy_int64_t *) itemp);
38615 }
__pyx_memview_set_nn___pyx_t_5numpy_int64_t(const char * itemp,PyObject * obj)38616 static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_int64_t(const char *itemp, PyObject *obj) {
38617     __pyx_t_5numpy_int64_t value = __Pyx_PyInt_As_npy_int64(obj);
38618     if ((value == ((npy_int64)-1)) && PyErr_Occurred())
38619         return 0;
38620     *(__pyx_t_5numpy_int64_t *) itemp = value;
38621     return 1;
38622 }
38623 
38624 /* CIntToPy */
__Pyx_PyInt_From_int(int value)38625   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
38626     const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
38627     const int is_unsigned = neg_one > const_zero;
38628     if (is_unsigned) {
38629         if (sizeof(int) < sizeof(long)) {
38630             return PyInt_FromLong((long) value);
38631         } else if (sizeof(int) <= sizeof(unsigned long)) {
38632             return PyLong_FromUnsignedLong((unsigned long) value);
38633 #ifdef HAVE_LONG_LONG
38634         } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
38635             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
38636 #endif
38637         }
38638     } else {
38639         if (sizeof(int) <= sizeof(long)) {
38640             return PyInt_FromLong((long) value);
38641 #ifdef HAVE_LONG_LONG
38642         } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
38643             return PyLong_FromLongLong((PY_LONG_LONG) value);
38644 #endif
38645         }
38646     }
38647     {
38648         int one = 1; int little = (int)*(unsigned char *)&one;
38649         unsigned char *bytes = (unsigned char *)&value;
38650         return _PyLong_FromByteArray(bytes, sizeof(int),
38651                                      little, !is_unsigned);
38652     }
38653 }
38654 
38655 /* CIntToPy */
__Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value)38656   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
38657     const Py_intptr_t neg_one = (Py_intptr_t) ((Py_intptr_t) 0 - (Py_intptr_t) 1), const_zero = (Py_intptr_t) 0;
38658     const int is_unsigned = neg_one > const_zero;
38659     if (is_unsigned) {
38660         if (sizeof(Py_intptr_t) < sizeof(long)) {
38661             return PyInt_FromLong((long) value);
38662         } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
38663             return PyLong_FromUnsignedLong((unsigned long) value);
38664 #ifdef HAVE_LONG_LONG
38665         } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) {
38666             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
38667 #endif
38668         }
38669     } else {
38670         if (sizeof(Py_intptr_t) <= sizeof(long)) {
38671             return PyInt_FromLong((long) value);
38672 #ifdef HAVE_LONG_LONG
38673         } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) {
38674             return PyLong_FromLongLong((PY_LONG_LONG) value);
38675 #endif
38676         }
38677     }
38678     {
38679         int one = 1; int little = (int)*(unsigned char *)&one;
38680         unsigned char *bytes = (unsigned char *)&value;
38681         return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t),
38682                                      little, !is_unsigned);
38683     }
38684 }
38685 
38686 /* Print */
38687   #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
__Pyx_GetStdout(void)38688 static PyObject *__Pyx_GetStdout(void) {
38689     PyObject *f = PySys_GetObject((char *)"stdout");
38690     if (!f) {
38691         PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
38692     }
38693     return f;
38694 }
__Pyx_Print(PyObject * f,PyObject * arg_tuple,int newline)38695 static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
38696     int i;
38697     if (!f) {
38698         if (!(f = __Pyx_GetStdout()))
38699             return -1;
38700     }
38701     Py_INCREF(f);
38702     for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
38703         PyObject* v;
38704         if (PyFile_SoftSpace(f, 1)) {
38705             if (PyFile_WriteString(" ", f) < 0)
38706                 goto error;
38707         }
38708         v = PyTuple_GET_ITEM(arg_tuple, i);
38709         if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
38710             goto error;
38711         if (PyString_Check(v)) {
38712             char *s = PyString_AsString(v);
38713             Py_ssize_t len = PyString_Size(v);
38714             if (len > 0) {
38715                 switch (s[len-1]) {
38716                     case ' ': break;
38717                     case '\f': case '\r': case '\n': case '\t': case '\v':
38718                         PyFile_SoftSpace(f, 0);
38719                         break;
38720                     default:  break;
38721                 }
38722             }
38723         }
38724     }
38725     if (newline) {
38726         if (PyFile_WriteString("\n", f) < 0)
38727             goto error;
38728         PyFile_SoftSpace(f, 0);
38729     }
38730     Py_DECREF(f);
38731     return 0;
38732 error:
38733     Py_DECREF(f);
38734     return -1;
38735 }
38736 #else
__Pyx_Print(PyObject * stream,PyObject * arg_tuple,int newline)38737 static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
38738     PyObject* kwargs = 0;
38739     PyObject* result = 0;
38740     PyObject* end_string;
38741     if (unlikely(!__pyx_print)) {
38742         __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print);
38743         if (!__pyx_print)
38744             return -1;
38745     }
38746     if (stream) {
38747         kwargs = PyDict_New();
38748         if (unlikely(!kwargs))
38749             return -1;
38750         if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0))
38751             goto bad;
38752         if (!newline) {
38753             end_string = PyUnicode_FromStringAndSize(" ", 1);
38754             if (unlikely(!end_string))
38755                 goto bad;
38756             if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) {
38757                 Py_DECREF(end_string);
38758                 goto bad;
38759             }
38760             Py_DECREF(end_string);
38761         }
38762     } else if (!newline) {
38763         if (unlikely(!__pyx_print_kwargs)) {
38764             __pyx_print_kwargs = PyDict_New();
38765             if (unlikely(!__pyx_print_kwargs))
38766                 return -1;
38767             end_string = PyUnicode_FromStringAndSize(" ", 1);
38768             if (unlikely(!end_string))
38769                 return -1;
38770             if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) {
38771                 Py_DECREF(end_string);
38772                 return -1;
38773             }
38774             Py_DECREF(end_string);
38775         }
38776         kwargs = __pyx_print_kwargs;
38777     }
38778     result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
38779     if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
38780         Py_DECREF(kwargs);
38781     if (!result)
38782         return -1;
38783     Py_DECREF(result);
38784     return 0;
38785 bad:
38786     if (kwargs != __pyx_print_kwargs)
38787         Py_XDECREF(kwargs);
38788     return -1;
38789 }
38790 #endif
38791 
38792 /* CIntToPy */
__Pyx_PyInt_From_long(long value)38793   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
38794     const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
38795     const int is_unsigned = neg_one > const_zero;
38796     if (is_unsigned) {
38797         if (sizeof(long) < sizeof(long)) {
38798             return PyInt_FromLong((long) value);
38799         } else if (sizeof(long) <= sizeof(unsigned long)) {
38800             return PyLong_FromUnsignedLong((unsigned long) value);
38801 #ifdef HAVE_LONG_LONG
38802         } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
38803             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
38804 #endif
38805         }
38806     } else {
38807         if (sizeof(long) <= sizeof(long)) {
38808             return PyInt_FromLong((long) value);
38809 #ifdef HAVE_LONG_LONG
38810         } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
38811             return PyLong_FromLongLong((PY_LONG_LONG) value);
38812 #endif
38813         }
38814     }
38815     {
38816         int one = 1; int little = (int)*(unsigned char *)&one;
38817         unsigned char *bytes = (unsigned char *)&value;
38818         return _PyLong_FromByteArray(bytes, sizeof(long),
38819                                      little, !is_unsigned);
38820     }
38821 }
38822 
38823 /* Declarations */
38824   #if CYTHON_CCOMPLEX
38825   #ifdef __cplusplus
__pyx_t_float_complex_from_parts(float x,float y)38826     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
38827       return ::std::complex< float >(x, y);
38828     }
38829   #else
__pyx_t_float_complex_from_parts(float x,float y)38830     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
38831       return x + y*(__pyx_t_float_complex)_Complex_I;
38832     }
38833   #endif
38834 #else
__pyx_t_float_complex_from_parts(float x,float y)38835     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
38836       __pyx_t_float_complex z;
38837       z.real = x;
38838       z.imag = y;
38839       return z;
38840     }
38841 #endif
38842 
38843 /* Arithmetic */
38844   #if CYTHON_CCOMPLEX
38845 #else
__Pyx_c_eq_float(__pyx_t_float_complex a,__pyx_t_float_complex b)38846     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
38847        return (a.real == b.real) && (a.imag == b.imag);
38848     }
__Pyx_c_sum_float(__pyx_t_float_complex a,__pyx_t_float_complex b)38849     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
38850         __pyx_t_float_complex z;
38851         z.real = a.real + b.real;
38852         z.imag = a.imag + b.imag;
38853         return z;
38854     }
__Pyx_c_diff_float(__pyx_t_float_complex a,__pyx_t_float_complex b)38855     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
38856         __pyx_t_float_complex z;
38857         z.real = a.real - b.real;
38858         z.imag = a.imag - b.imag;
38859         return z;
38860     }
__Pyx_c_prod_float(__pyx_t_float_complex a,__pyx_t_float_complex b)38861     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
38862         __pyx_t_float_complex z;
38863         z.real = a.real * b.real - a.imag * b.imag;
38864         z.imag = a.real * b.imag + a.imag * b.real;
38865         return z;
38866     }
38867     #if 1
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)38868     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
38869         if (b.imag == 0) {
38870             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
38871         } else if (fabsf(b.real) >= fabsf(b.imag)) {
38872             if (b.real == 0 && b.imag == 0) {
38873                 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
38874             } else {
38875                 float r = b.imag / b.real;
38876                 float s = (float)(1.0) / (b.real + b.imag * r);
38877                 return __pyx_t_float_complex_from_parts(
38878                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
38879             }
38880         } else {
38881             float r = b.real / b.imag;
38882             float s = (float)(1.0) / (b.imag + b.real * r);
38883             return __pyx_t_float_complex_from_parts(
38884                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
38885         }
38886     }
38887     #else
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)38888     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
38889         if (b.imag == 0) {
38890             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
38891         } else {
38892             float denom = b.real * b.real + b.imag * b.imag;
38893             return __pyx_t_float_complex_from_parts(
38894                 (a.real * b.real + a.imag * b.imag) / denom,
38895                 (a.imag * b.real - a.real * b.imag) / denom);
38896         }
38897     }
38898     #endif
__Pyx_c_neg_float(__pyx_t_float_complex a)38899     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
38900         __pyx_t_float_complex z;
38901         z.real = -a.real;
38902         z.imag = -a.imag;
38903         return z;
38904     }
__Pyx_c_is_zero_float(__pyx_t_float_complex a)38905     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
38906        return (a.real == 0) && (a.imag == 0);
38907     }
__Pyx_c_conj_float(__pyx_t_float_complex a)38908     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
38909         __pyx_t_float_complex z;
38910         z.real =  a.real;
38911         z.imag = -a.imag;
38912         return z;
38913     }
38914     #if 1
__Pyx_c_abs_float(__pyx_t_float_complex z)38915         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
38916           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
38917             return sqrtf(z.real*z.real + z.imag*z.imag);
38918           #else
38919             return hypotf(z.real, z.imag);
38920           #endif
38921         }
__Pyx_c_pow_float(__pyx_t_float_complex a,__pyx_t_float_complex b)38922         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
38923             __pyx_t_float_complex z;
38924             float r, lnr, theta, z_r, z_theta;
38925             if (b.imag == 0 && b.real == (int)b.real) {
38926                 if (b.real < 0) {
38927                     float denom = a.real * a.real + a.imag * a.imag;
38928                     a.real = a.real / denom;
38929                     a.imag = -a.imag / denom;
38930                     b.real = -b.real;
38931                 }
38932                 switch ((int)b.real) {
38933                     case 0:
38934                         z.real = 1;
38935                         z.imag = 0;
38936                         return z;
38937                     case 1:
38938                         return a;
38939                     case 2:
38940                         z = __Pyx_c_prod_float(a, a);
38941                         return __Pyx_c_prod_float(a, a);
38942                     case 3:
38943                         z = __Pyx_c_prod_float(a, a);
38944                         return __Pyx_c_prod_float(z, a);
38945                     case 4:
38946                         z = __Pyx_c_prod_float(a, a);
38947                         return __Pyx_c_prod_float(z, z);
38948                 }
38949             }
38950             if (a.imag == 0) {
38951                 if (a.real == 0) {
38952                     return a;
38953                 } else if (b.imag == 0) {
38954                     z.real = powf(a.real, b.real);
38955                     z.imag = 0;
38956                     return z;
38957                 } else if (a.real > 0) {
38958                     r = a.real;
38959                     theta = 0;
38960                 } else {
38961                     r = -a.real;
38962                     theta = atan2f(0.0, -1.0);
38963                 }
38964             } else {
38965                 r = __Pyx_c_abs_float(a);
38966                 theta = atan2f(a.imag, a.real);
38967             }
38968             lnr = logf(r);
38969             z_r = expf(lnr * b.real - theta * b.imag);
38970             z_theta = theta * b.real + lnr * b.imag;
38971             z.real = z_r * cosf(z_theta);
38972             z.imag = z_r * sinf(z_theta);
38973             return z;
38974         }
38975     #endif
38976 #endif
38977 
38978 /* Declarations */
38979   #if CYTHON_CCOMPLEX
38980   #ifdef __cplusplus
__pyx_t_double_complex_from_parts(double x,double y)38981     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
38982       return ::std::complex< double >(x, y);
38983     }
38984   #else
__pyx_t_double_complex_from_parts(double x,double y)38985     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
38986       return x + y*(__pyx_t_double_complex)_Complex_I;
38987     }
38988   #endif
38989 #else
__pyx_t_double_complex_from_parts(double x,double y)38990     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
38991       __pyx_t_double_complex z;
38992       z.real = x;
38993       z.imag = y;
38994       return z;
38995     }
38996 #endif
38997 
38998 /* Arithmetic */
38999   #if CYTHON_CCOMPLEX
39000 #else
__Pyx_c_eq_double(__pyx_t_double_complex a,__pyx_t_double_complex b)39001     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
39002        return (a.real == b.real) && (a.imag == b.imag);
39003     }
__Pyx_c_sum_double(__pyx_t_double_complex a,__pyx_t_double_complex b)39004     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
39005         __pyx_t_double_complex z;
39006         z.real = a.real + b.real;
39007         z.imag = a.imag + b.imag;
39008         return z;
39009     }
__Pyx_c_diff_double(__pyx_t_double_complex a,__pyx_t_double_complex b)39010     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
39011         __pyx_t_double_complex z;
39012         z.real = a.real - b.real;
39013         z.imag = a.imag - b.imag;
39014         return z;
39015     }
__Pyx_c_prod_double(__pyx_t_double_complex a,__pyx_t_double_complex b)39016     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
39017         __pyx_t_double_complex z;
39018         z.real = a.real * b.real - a.imag * b.imag;
39019         z.imag = a.real * b.imag + a.imag * b.real;
39020         return z;
39021     }
39022     #if 1
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)39023     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
39024         if (b.imag == 0) {
39025             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
39026         } else if (fabs(b.real) >= fabs(b.imag)) {
39027             if (b.real == 0 && b.imag == 0) {
39028                 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
39029             } else {
39030                 double r = b.imag / b.real;
39031                 double s = (double)(1.0) / (b.real + b.imag * r);
39032                 return __pyx_t_double_complex_from_parts(
39033                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
39034             }
39035         } else {
39036             double r = b.real / b.imag;
39037             double s = (double)(1.0) / (b.imag + b.real * r);
39038             return __pyx_t_double_complex_from_parts(
39039                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
39040         }
39041     }
39042     #else
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)39043     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
39044         if (b.imag == 0) {
39045             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
39046         } else {
39047             double denom = b.real * b.real + b.imag * b.imag;
39048             return __pyx_t_double_complex_from_parts(
39049                 (a.real * b.real + a.imag * b.imag) / denom,
39050                 (a.imag * b.real - a.real * b.imag) / denom);
39051         }
39052     }
39053     #endif
__Pyx_c_neg_double(__pyx_t_double_complex a)39054     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
39055         __pyx_t_double_complex z;
39056         z.real = -a.real;
39057         z.imag = -a.imag;
39058         return z;
39059     }
__Pyx_c_is_zero_double(__pyx_t_double_complex a)39060     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
39061        return (a.real == 0) && (a.imag == 0);
39062     }
__Pyx_c_conj_double(__pyx_t_double_complex a)39063     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
39064         __pyx_t_double_complex z;
39065         z.real =  a.real;
39066         z.imag = -a.imag;
39067         return z;
39068     }
39069     #if 1
__Pyx_c_abs_double(__pyx_t_double_complex z)39070         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
39071           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
39072             return sqrt(z.real*z.real + z.imag*z.imag);
39073           #else
39074             return hypot(z.real, z.imag);
39075           #endif
39076         }
__Pyx_c_pow_double(__pyx_t_double_complex a,__pyx_t_double_complex b)39077         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
39078             __pyx_t_double_complex z;
39079             double r, lnr, theta, z_r, z_theta;
39080             if (b.imag == 0 && b.real == (int)b.real) {
39081                 if (b.real < 0) {
39082                     double denom = a.real * a.real + a.imag * a.imag;
39083                     a.real = a.real / denom;
39084                     a.imag = -a.imag / denom;
39085                     b.real = -b.real;
39086                 }
39087                 switch ((int)b.real) {
39088                     case 0:
39089                         z.real = 1;
39090                         z.imag = 0;
39091                         return z;
39092                     case 1:
39093                         return a;
39094                     case 2:
39095                         z = __Pyx_c_prod_double(a, a);
39096                         return __Pyx_c_prod_double(a, a);
39097                     case 3:
39098                         z = __Pyx_c_prod_double(a, a);
39099                         return __Pyx_c_prod_double(z, a);
39100                     case 4:
39101                         z = __Pyx_c_prod_double(a, a);
39102                         return __Pyx_c_prod_double(z, z);
39103                 }
39104             }
39105             if (a.imag == 0) {
39106                 if (a.real == 0) {
39107                     return a;
39108                 } else if (b.imag == 0) {
39109                     z.real = pow(a.real, b.real);
39110                     z.imag = 0;
39111                     return z;
39112                 } else if (a.real > 0) {
39113                     r = a.real;
39114                     theta = 0;
39115                 } else {
39116                     r = -a.real;
39117                     theta = atan2(0.0, -1.0);
39118                 }
39119             } else {
39120                 r = __Pyx_c_abs_double(a);
39121                 theta = atan2(a.imag, a.real);
39122             }
39123             lnr = log(r);
39124             z_r = exp(lnr * b.real - theta * b.imag);
39125             z_theta = theta * b.real + lnr * b.imag;
39126             z.real = z_r * cos(z_theta);
39127             z.imag = z_r * sin(z_theta);
39128             return z;
39129         }
39130     #endif
39131 #endif
39132 
39133 /* CIntToPy */
__Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value)39134   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
39135     const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
39136     const int is_unsigned = neg_one > const_zero;
39137     if (is_unsigned) {
39138         if (sizeof(enum NPY_TYPES) < sizeof(long)) {
39139             return PyInt_FromLong((long) value);
39140         } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
39141             return PyLong_FromUnsignedLong((unsigned long) value);
39142 #ifdef HAVE_LONG_LONG
39143         } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
39144             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
39145 #endif
39146         }
39147     } else {
39148         if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
39149             return PyInt_FromLong((long) value);
39150 #ifdef HAVE_LONG_LONG
39151         } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
39152             return PyLong_FromLongLong((PY_LONG_LONG) value);
39153 #endif
39154         }
39155     }
39156     {
39157         int one = 1; int little = (int)*(unsigned char *)&one;
39158         unsigned char *bytes = (unsigned char *)&value;
39159         return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
39160                                      little, !is_unsigned);
39161     }
39162 }
39163 
39164 /* MemviewSliceCopyTemplate */
39165   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)39166 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
39167                                  const char *mode, int ndim,
39168                                  size_t sizeof_dtype, int contig_flag,
39169                                  int dtype_is_object)
39170 {
39171     __Pyx_RefNannyDeclarations
39172     int i;
39173     __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
39174     struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
39175     Py_buffer *buf = &from_memview->view;
39176     PyObject *shape_tuple = NULL;
39177     PyObject *temp_int = NULL;
39178     struct __pyx_array_obj *array_obj = NULL;
39179     struct __pyx_memoryview_obj *memview_obj = NULL;
39180     __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
39181     for (i = 0; i < ndim; i++) {
39182         if (from_mvs->suboffsets[i] >= 0) {
39183             PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
39184                                            "indirect dimensions (axis %d)", i);
39185             goto fail;
39186         }
39187     }
39188     shape_tuple = PyTuple_New(ndim);
39189     if (unlikely(!shape_tuple)) {
39190         goto fail;
39191     }
39192     __Pyx_GOTREF(shape_tuple);
39193     for(i = 0; i < ndim; i++) {
39194         temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
39195         if(unlikely(!temp_int)) {
39196             goto fail;
39197         } else {
39198             PyTuple_SET_ITEM(shape_tuple, i, temp_int);
39199             temp_int = NULL;
39200         }
39201     }
39202     array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
39203     if (unlikely(!array_obj)) {
39204         goto fail;
39205     }
39206     __Pyx_GOTREF(array_obj);
39207     memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
39208                                     (PyObject *) array_obj, contig_flag,
39209                                     dtype_is_object,
39210                                     from_mvs->memview->typeinfo);
39211     if (unlikely(!memview_obj))
39212         goto fail;
39213     if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
39214         goto fail;
39215     if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
39216                                                 dtype_is_object) < 0))
39217         goto fail;
39218     goto no_fail;
39219 fail:
39220     __Pyx_XDECREF(new_mvs.memview);
39221     new_mvs.memview = NULL;
39222     new_mvs.data = NULL;
39223 no_fail:
39224     __Pyx_XDECREF(shape_tuple);
39225     __Pyx_XDECREF(temp_int);
39226     __Pyx_XDECREF(array_obj);
39227     __Pyx_RefNannyFinishContext();
39228     return new_mvs;
39229 }
39230 
39231 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)39232   static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
39233     const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
39234     const int is_unsigned = neg_one > const_zero;
39235 #if PY_MAJOR_VERSION < 3
39236     if (likely(PyInt_Check(x))) {
39237         if (sizeof(int) < sizeof(long)) {
39238             __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
39239         } else {
39240             long val = PyInt_AS_LONG(x);
39241             if (is_unsigned && unlikely(val < 0)) {
39242                 goto raise_neg_overflow;
39243             }
39244             return (int) val;
39245         }
39246     } else
39247 #endif
39248     if (likely(PyLong_Check(x))) {
39249         if (is_unsigned) {
39250 #if CYTHON_USE_PYLONG_INTERNALS
39251             const digit* digits = ((PyLongObject*)x)->ob_digit;
39252             switch (Py_SIZE(x)) {
39253                 case  0: return (int) 0;
39254                 case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
39255                 case 2:
39256                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
39257                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
39258                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39259                         } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
39260                             return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
39261                         }
39262                     }
39263                     break;
39264                 case 3:
39265                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
39266                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
39267                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39268                         } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
39269                             return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
39270                         }
39271                     }
39272                     break;
39273                 case 4:
39274                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
39275                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
39276                             __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])))
39277                         } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
39278                             return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
39279                         }
39280                     }
39281                     break;
39282             }
39283 #endif
39284 #if CYTHON_COMPILING_IN_CPYTHON
39285             if (unlikely(Py_SIZE(x) < 0)) {
39286                 goto raise_neg_overflow;
39287             }
39288 #else
39289             {
39290                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
39291                 if (unlikely(result < 0))
39292                     return (int) -1;
39293                 if (unlikely(result == 1))
39294                     goto raise_neg_overflow;
39295             }
39296 #endif
39297             if (sizeof(int) <= sizeof(unsigned long)) {
39298                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
39299 #ifdef HAVE_LONG_LONG
39300             } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
39301                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
39302 #endif
39303             }
39304         } else {
39305 #if CYTHON_USE_PYLONG_INTERNALS
39306             const digit* digits = ((PyLongObject*)x)->ob_digit;
39307             switch (Py_SIZE(x)) {
39308                 case  0: return (int) 0;
39309                 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
39310                 case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
39311                 case -2:
39312                     if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
39313                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
39314                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39315                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
39316                             return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
39317                         }
39318                     }
39319                     break;
39320                 case 2:
39321                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
39322                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
39323                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39324                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
39325                             return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
39326                         }
39327                     }
39328                     break;
39329                 case -3:
39330                     if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
39331                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
39332                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39333                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
39334                             return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
39335                         }
39336                     }
39337                     break;
39338                 case 3:
39339                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
39340                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
39341                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39342                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
39343                             return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
39344                         }
39345                     }
39346                     break;
39347                 case -4:
39348                     if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
39349                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
39350                             __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])))
39351                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
39352                             return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
39353                         }
39354                     }
39355                     break;
39356                 case 4:
39357                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
39358                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
39359                             __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])))
39360                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
39361                             return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
39362                         }
39363                     }
39364                     break;
39365             }
39366 #endif
39367             if (sizeof(int) <= sizeof(long)) {
39368                 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
39369 #ifdef HAVE_LONG_LONG
39370             } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
39371                 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
39372 #endif
39373             }
39374         }
39375         {
39376 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
39377             PyErr_SetString(PyExc_RuntimeError,
39378                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
39379 #else
39380             int val;
39381             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
39382  #if PY_MAJOR_VERSION < 3
39383             if (likely(v) && !PyLong_Check(v)) {
39384                 PyObject *tmp = v;
39385                 v = PyNumber_Long(tmp);
39386                 Py_DECREF(tmp);
39387             }
39388  #endif
39389             if (likely(v)) {
39390                 int one = 1; int is_little = (int)*(unsigned char *)&one;
39391                 unsigned char *bytes = (unsigned char *)&val;
39392                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
39393                                               bytes, sizeof(val),
39394                                               is_little, !is_unsigned);
39395                 Py_DECREF(v);
39396                 if (likely(!ret))
39397                     return val;
39398             }
39399 #endif
39400             return (int) -1;
39401         }
39402     } else {
39403         int val;
39404         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
39405         if (!tmp) return (int) -1;
39406         val = __Pyx_PyInt_As_int(tmp);
39407         Py_DECREF(tmp);
39408         return val;
39409     }
39410 raise_overflow:
39411     PyErr_SetString(PyExc_OverflowError,
39412         "value too large to convert to int");
39413     return (int) -1;
39414 raise_neg_overflow:
39415     PyErr_SetString(PyExc_OverflowError,
39416         "can't convert negative value to int");
39417     return (int) -1;
39418 }
39419 
39420 /* CIntFromPy */
__Pyx_PyInt_As_npy_int64(PyObject * x)39421   static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) {
39422     const npy_int64 neg_one = (npy_int64) ((npy_int64) 0 - (npy_int64) 1), const_zero = (npy_int64) 0;
39423     const int is_unsigned = neg_one > const_zero;
39424 #if PY_MAJOR_VERSION < 3
39425     if (likely(PyInt_Check(x))) {
39426         if (sizeof(npy_int64) < sizeof(long)) {
39427             __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG(x))
39428         } else {
39429             long val = PyInt_AS_LONG(x);
39430             if (is_unsigned && unlikely(val < 0)) {
39431                 goto raise_neg_overflow;
39432             }
39433             return (npy_int64) val;
39434         }
39435     } else
39436 #endif
39437     if (likely(PyLong_Check(x))) {
39438         if (is_unsigned) {
39439 #if CYTHON_USE_PYLONG_INTERNALS
39440             const digit* digits = ((PyLongObject*)x)->ob_digit;
39441             switch (Py_SIZE(x)) {
39442                 case  0: return (npy_int64) 0;
39443                 case  1: __PYX_VERIFY_RETURN_INT(npy_int64, digit, digits[0])
39444                 case 2:
39445                     if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) {
39446                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
39447                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39448                         } else if (8 * sizeof(npy_int64) >= 2 * PyLong_SHIFT) {
39449                             return (npy_int64) (((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
39450                         }
39451                     }
39452                     break;
39453                 case 3:
39454                     if (8 * sizeof(npy_int64) > 2 * PyLong_SHIFT) {
39455                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
39456                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39457                         } else if (8 * sizeof(npy_int64) >= 3 * PyLong_SHIFT) {
39458                             return (npy_int64) (((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
39459                         }
39460                     }
39461                     break;
39462                 case 4:
39463                     if (8 * sizeof(npy_int64) > 3 * PyLong_SHIFT) {
39464                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
39465                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39466                         } else if (8 * sizeof(npy_int64) >= 4 * PyLong_SHIFT) {
39467                             return (npy_int64) (((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
39468                         }
39469                     }
39470                     break;
39471             }
39472 #endif
39473 #if CYTHON_COMPILING_IN_CPYTHON
39474             if (unlikely(Py_SIZE(x) < 0)) {
39475                 goto raise_neg_overflow;
39476             }
39477 #else
39478             {
39479                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
39480                 if (unlikely(result < 0))
39481                     return (npy_int64) -1;
39482                 if (unlikely(result == 1))
39483                     goto raise_neg_overflow;
39484             }
39485 #endif
39486             if (sizeof(npy_int64) <= sizeof(unsigned long)) {
39487                 __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned long, PyLong_AsUnsignedLong(x))
39488 #ifdef HAVE_LONG_LONG
39489             } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) {
39490                 __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
39491 #endif
39492             }
39493         } else {
39494 #if CYTHON_USE_PYLONG_INTERNALS
39495             const digit* digits = ((PyLongObject*)x)->ob_digit;
39496             switch (Py_SIZE(x)) {
39497                 case  0: return (npy_int64) 0;
39498                 case -1: __PYX_VERIFY_RETURN_INT(npy_int64, sdigit, (sdigit) (-(sdigit)digits[0]))
39499                 case  1: __PYX_VERIFY_RETURN_INT(npy_int64,  digit, +digits[0])
39500                 case -2:
39501                     if (8 * sizeof(npy_int64) - 1 > 1 * PyLong_SHIFT) {
39502                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
39503                             __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39504                         } else if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) {
39505                             return (npy_int64) (((npy_int64)-1)*(((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
39506                         }
39507                     }
39508                     break;
39509                 case 2:
39510                     if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) {
39511                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
39512                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39513                         } else if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) {
39514                             return (npy_int64) ((((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
39515                         }
39516                     }
39517                     break;
39518                 case -3:
39519                     if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) {
39520                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
39521                             __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39522                         } else if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) {
39523                             return (npy_int64) (((npy_int64)-1)*(((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
39524                         }
39525                     }
39526                     break;
39527                 case 3:
39528                     if (8 * sizeof(npy_int64) > 2 * PyLong_SHIFT) {
39529                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
39530                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39531                         } else if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) {
39532                             return (npy_int64) ((((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
39533                         }
39534                     }
39535                     break;
39536                 case -4:
39537                     if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) {
39538                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
39539                             __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39540                         } else if (8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT) {
39541                             return (npy_int64) (((npy_int64)-1)*(((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
39542                         }
39543                     }
39544                     break;
39545                 case 4:
39546                     if (8 * sizeof(npy_int64) > 3 * PyLong_SHIFT) {
39547                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
39548                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39549                         } else if (8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT) {
39550                             return (npy_int64) ((((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
39551                         }
39552                     }
39553                     break;
39554             }
39555 #endif
39556             if (sizeof(npy_int64) <= sizeof(long)) {
39557                 __PYX_VERIFY_RETURN_INT_EXC(npy_int64, long, PyLong_AsLong(x))
39558 #ifdef HAVE_LONG_LONG
39559             } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) {
39560                 __PYX_VERIFY_RETURN_INT_EXC(npy_int64, PY_LONG_LONG, PyLong_AsLongLong(x))
39561 #endif
39562             }
39563         }
39564         {
39565 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
39566             PyErr_SetString(PyExc_RuntimeError,
39567                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
39568 #else
39569             npy_int64 val;
39570             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
39571  #if PY_MAJOR_VERSION < 3
39572             if (likely(v) && !PyLong_Check(v)) {
39573                 PyObject *tmp = v;
39574                 v = PyNumber_Long(tmp);
39575                 Py_DECREF(tmp);
39576             }
39577  #endif
39578             if (likely(v)) {
39579                 int one = 1; int is_little = (int)*(unsigned char *)&one;
39580                 unsigned char *bytes = (unsigned char *)&val;
39581                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
39582                                               bytes, sizeof(val),
39583                                               is_little, !is_unsigned);
39584                 Py_DECREF(v);
39585                 if (likely(!ret))
39586                     return val;
39587             }
39588 #endif
39589             return (npy_int64) -1;
39590         }
39591     } else {
39592         npy_int64 val;
39593         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
39594         if (!tmp) return (npy_int64) -1;
39595         val = __Pyx_PyInt_As_npy_int64(tmp);
39596         Py_DECREF(tmp);
39597         return val;
39598     }
39599 raise_overflow:
39600     PyErr_SetString(PyExc_OverflowError,
39601         "value too large to convert to npy_int64");
39602     return (npy_int64) -1;
39603 raise_neg_overflow:
39604     PyErr_SetString(PyExc_OverflowError,
39605         "can't convert negative value to npy_int64");
39606     return (npy_int64) -1;
39607 }
39608 
39609 /* PrintOne */
39610   #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
__Pyx_PrintOne(PyObject * f,PyObject * o)39611 static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
39612     if (!f) {
39613         if (!(f = __Pyx_GetStdout()))
39614             return -1;
39615     }
39616     Py_INCREF(f);
39617     if (PyFile_SoftSpace(f, 0)) {
39618         if (PyFile_WriteString(" ", f) < 0)
39619             goto error;
39620     }
39621     if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
39622         goto error;
39623     if (PyFile_WriteString("\n", f) < 0)
39624         goto error;
39625     Py_DECREF(f);
39626     return 0;
39627 error:
39628     Py_DECREF(f);
39629     return -1;
39630     /* the line below is just to avoid C compiler
39631      * warnings about unused functions */
39632     return __Pyx_Print(f, NULL, 0);
39633 }
39634 #else
__Pyx_PrintOne(PyObject * stream,PyObject * o)39635 static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
39636     int res;
39637     PyObject* arg_tuple = PyTuple_Pack(1, o);
39638     if (unlikely(!arg_tuple))
39639         return -1;
39640     res = __Pyx_Print(stream, arg_tuple, 1);
39641     Py_DECREF(arg_tuple);
39642     return res;
39643 }
39644 #endif
39645 
39646 /* CIntFromPy */
__Pyx_PyInt_As_npy_uint64(PyObject * x)39647   static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *x) {
39648     const npy_uint64 neg_one = (npy_uint64) ((npy_uint64) 0 - (npy_uint64) 1), const_zero = (npy_uint64) 0;
39649     const int is_unsigned = neg_one > const_zero;
39650 #if PY_MAJOR_VERSION < 3
39651     if (likely(PyInt_Check(x))) {
39652         if (sizeof(npy_uint64) < sizeof(long)) {
39653             __PYX_VERIFY_RETURN_INT(npy_uint64, long, PyInt_AS_LONG(x))
39654         } else {
39655             long val = PyInt_AS_LONG(x);
39656             if (is_unsigned && unlikely(val < 0)) {
39657                 goto raise_neg_overflow;
39658             }
39659             return (npy_uint64) val;
39660         }
39661     } else
39662 #endif
39663     if (likely(PyLong_Check(x))) {
39664         if (is_unsigned) {
39665 #if CYTHON_USE_PYLONG_INTERNALS
39666             const digit* digits = ((PyLongObject*)x)->ob_digit;
39667             switch (Py_SIZE(x)) {
39668                 case  0: return (npy_uint64) 0;
39669                 case  1: __PYX_VERIFY_RETURN_INT(npy_uint64, digit, digits[0])
39670                 case 2:
39671                     if (8 * sizeof(npy_uint64) > 1 * PyLong_SHIFT) {
39672                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
39673                             __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39674                         } else if (8 * sizeof(npy_uint64) >= 2 * PyLong_SHIFT) {
39675                             return (npy_uint64) (((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]));
39676                         }
39677                     }
39678                     break;
39679                 case 3:
39680                     if (8 * sizeof(npy_uint64) > 2 * PyLong_SHIFT) {
39681                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
39682                             __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39683                         } else if (8 * sizeof(npy_uint64) >= 3 * PyLong_SHIFT) {
39684                             return (npy_uint64) (((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]));
39685                         }
39686                     }
39687                     break;
39688                 case 4:
39689                     if (8 * sizeof(npy_uint64) > 3 * PyLong_SHIFT) {
39690                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
39691                             __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39692                         } else if (8 * sizeof(npy_uint64) >= 4 * PyLong_SHIFT) {
39693                             return (npy_uint64) (((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]));
39694                         }
39695                     }
39696                     break;
39697             }
39698 #endif
39699 #if CYTHON_COMPILING_IN_CPYTHON
39700             if (unlikely(Py_SIZE(x) < 0)) {
39701                 goto raise_neg_overflow;
39702             }
39703 #else
39704             {
39705                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
39706                 if (unlikely(result < 0))
39707                     return (npy_uint64) -1;
39708                 if (unlikely(result == 1))
39709                     goto raise_neg_overflow;
39710             }
39711 #endif
39712             if (sizeof(npy_uint64) <= sizeof(unsigned long)) {
39713                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, unsigned long, PyLong_AsUnsignedLong(x))
39714 #ifdef HAVE_LONG_LONG
39715             } else if (sizeof(npy_uint64) <= sizeof(unsigned PY_LONG_LONG)) {
39716                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
39717 #endif
39718             }
39719         } else {
39720 #if CYTHON_USE_PYLONG_INTERNALS
39721             const digit* digits = ((PyLongObject*)x)->ob_digit;
39722             switch (Py_SIZE(x)) {
39723                 case  0: return (npy_uint64) 0;
39724                 case -1: __PYX_VERIFY_RETURN_INT(npy_uint64, sdigit, (sdigit) (-(sdigit)digits[0]))
39725                 case  1: __PYX_VERIFY_RETURN_INT(npy_uint64,  digit, +digits[0])
39726                 case -2:
39727                     if (8 * sizeof(npy_uint64) - 1 > 1 * PyLong_SHIFT) {
39728                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
39729                             __PYX_VERIFY_RETURN_INT(npy_uint64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39730                         } else if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) {
39731                             return (npy_uint64) (((npy_uint64)-1)*(((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])));
39732                         }
39733                     }
39734                     break;
39735                 case 2:
39736                     if (8 * sizeof(npy_uint64) > 1 * PyLong_SHIFT) {
39737                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
39738                             __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39739                         } else if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) {
39740                             return (npy_uint64) ((((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])));
39741                         }
39742                     }
39743                     break;
39744                 case -3:
39745                     if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) {
39746                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
39747                             __PYX_VERIFY_RETURN_INT(npy_uint64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39748                         } else if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) {
39749                             return (npy_uint64) (((npy_uint64)-1)*(((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])));
39750                         }
39751                     }
39752                     break;
39753                 case 3:
39754                     if (8 * sizeof(npy_uint64) > 2 * PyLong_SHIFT) {
39755                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
39756                             __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39757                         } else if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) {
39758                             return (npy_uint64) ((((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])));
39759                         }
39760                     }
39761                     break;
39762                 case -4:
39763                     if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) {
39764                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
39765                             __PYX_VERIFY_RETURN_INT(npy_uint64, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39766                         } else if (8 * sizeof(npy_uint64) - 1 > 4 * PyLong_SHIFT) {
39767                             return (npy_uint64) (((npy_uint64)-1)*(((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])));
39768                         }
39769                     }
39770                     break;
39771                 case 4:
39772                     if (8 * sizeof(npy_uint64) > 3 * PyLong_SHIFT) {
39773                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
39774                             __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39775                         } else if (8 * sizeof(npy_uint64) - 1 > 4 * PyLong_SHIFT) {
39776                             return (npy_uint64) ((((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])));
39777                         }
39778                     }
39779                     break;
39780             }
39781 #endif
39782             if (sizeof(npy_uint64) <= sizeof(long)) {
39783                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, long, PyLong_AsLong(x))
39784 #ifdef HAVE_LONG_LONG
39785             } else if (sizeof(npy_uint64) <= sizeof(PY_LONG_LONG)) {
39786                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, PY_LONG_LONG, PyLong_AsLongLong(x))
39787 #endif
39788             }
39789         }
39790         {
39791 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
39792             PyErr_SetString(PyExc_RuntimeError,
39793                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
39794 #else
39795             npy_uint64 val;
39796             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
39797  #if PY_MAJOR_VERSION < 3
39798             if (likely(v) && !PyLong_Check(v)) {
39799                 PyObject *tmp = v;
39800                 v = PyNumber_Long(tmp);
39801                 Py_DECREF(tmp);
39802             }
39803  #endif
39804             if (likely(v)) {
39805                 int one = 1; int is_little = (int)*(unsigned char *)&one;
39806                 unsigned char *bytes = (unsigned char *)&val;
39807                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
39808                                               bytes, sizeof(val),
39809                                               is_little, !is_unsigned);
39810                 Py_DECREF(v);
39811                 if (likely(!ret))
39812                     return val;
39813             }
39814 #endif
39815             return (npy_uint64) -1;
39816         }
39817     } else {
39818         npy_uint64 val;
39819         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
39820         if (!tmp) return (npy_uint64) -1;
39821         val = __Pyx_PyInt_As_npy_uint64(tmp);
39822         Py_DECREF(tmp);
39823         return val;
39824     }
39825 raise_overflow:
39826     PyErr_SetString(PyExc_OverflowError,
39827         "value too large to convert to npy_uint64");
39828     return (npy_uint64) -1;
39829 raise_neg_overflow:
39830     PyErr_SetString(PyExc_OverflowError,
39831         "can't convert negative value to npy_uint64");
39832     return (npy_uint64) -1;
39833 }
39834 
39835 /* CIntFromPy */
__Pyx_PyInt_As_npy_uint32(PyObject * x)39836   static CYTHON_INLINE npy_uint32 __Pyx_PyInt_As_npy_uint32(PyObject *x) {
39837     const npy_uint32 neg_one = (npy_uint32) ((npy_uint32) 0 - (npy_uint32) 1), const_zero = (npy_uint32) 0;
39838     const int is_unsigned = neg_one > const_zero;
39839 #if PY_MAJOR_VERSION < 3
39840     if (likely(PyInt_Check(x))) {
39841         if (sizeof(npy_uint32) < sizeof(long)) {
39842             __PYX_VERIFY_RETURN_INT(npy_uint32, long, PyInt_AS_LONG(x))
39843         } else {
39844             long val = PyInt_AS_LONG(x);
39845             if (is_unsigned && unlikely(val < 0)) {
39846                 goto raise_neg_overflow;
39847             }
39848             return (npy_uint32) val;
39849         }
39850     } else
39851 #endif
39852     if (likely(PyLong_Check(x))) {
39853         if (is_unsigned) {
39854 #if CYTHON_USE_PYLONG_INTERNALS
39855             const digit* digits = ((PyLongObject*)x)->ob_digit;
39856             switch (Py_SIZE(x)) {
39857                 case  0: return (npy_uint32) 0;
39858                 case  1: __PYX_VERIFY_RETURN_INT(npy_uint32, digit, digits[0])
39859                 case 2:
39860                     if (8 * sizeof(npy_uint32) > 1 * PyLong_SHIFT) {
39861                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
39862                             __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39863                         } else if (8 * sizeof(npy_uint32) >= 2 * PyLong_SHIFT) {
39864                             return (npy_uint32) (((((npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0]));
39865                         }
39866                     }
39867                     break;
39868                 case 3:
39869                     if (8 * sizeof(npy_uint32) > 2 * PyLong_SHIFT) {
39870                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
39871                             __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39872                         } else if (8 * sizeof(npy_uint32) >= 3 * PyLong_SHIFT) {
39873                             return (npy_uint32) (((((((npy_uint32)digits[2]) << PyLong_SHIFT) | (npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0]));
39874                         }
39875                     }
39876                     break;
39877                 case 4:
39878                     if (8 * sizeof(npy_uint32) > 3 * PyLong_SHIFT) {
39879                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
39880                             __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39881                         } else if (8 * sizeof(npy_uint32) >= 4 * PyLong_SHIFT) {
39882                             return (npy_uint32) (((((((((npy_uint32)digits[3]) << PyLong_SHIFT) | (npy_uint32)digits[2]) << PyLong_SHIFT) | (npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0]));
39883                         }
39884                     }
39885                     break;
39886             }
39887 #endif
39888 #if CYTHON_COMPILING_IN_CPYTHON
39889             if (unlikely(Py_SIZE(x) < 0)) {
39890                 goto raise_neg_overflow;
39891             }
39892 #else
39893             {
39894                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
39895                 if (unlikely(result < 0))
39896                     return (npy_uint32) -1;
39897                 if (unlikely(result == 1))
39898                     goto raise_neg_overflow;
39899             }
39900 #endif
39901             if (sizeof(npy_uint32) <= sizeof(unsigned long)) {
39902                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint32, unsigned long, PyLong_AsUnsignedLong(x))
39903 #ifdef HAVE_LONG_LONG
39904             } else if (sizeof(npy_uint32) <= sizeof(unsigned PY_LONG_LONG)) {
39905                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
39906 #endif
39907             }
39908         } else {
39909 #if CYTHON_USE_PYLONG_INTERNALS
39910             const digit* digits = ((PyLongObject*)x)->ob_digit;
39911             switch (Py_SIZE(x)) {
39912                 case  0: return (npy_uint32) 0;
39913                 case -1: __PYX_VERIFY_RETURN_INT(npy_uint32, sdigit, (sdigit) (-(sdigit)digits[0]))
39914                 case  1: __PYX_VERIFY_RETURN_INT(npy_uint32,  digit, +digits[0])
39915                 case -2:
39916                     if (8 * sizeof(npy_uint32) - 1 > 1 * PyLong_SHIFT) {
39917                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
39918                             __PYX_VERIFY_RETURN_INT(npy_uint32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39919                         } else if (8 * sizeof(npy_uint32) - 1 > 2 * PyLong_SHIFT) {
39920                             return (npy_uint32) (((npy_uint32)-1)*(((((npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0])));
39921                         }
39922                     }
39923                     break;
39924                 case 2:
39925                     if (8 * sizeof(npy_uint32) > 1 * PyLong_SHIFT) {
39926                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
39927                             __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39928                         } else if (8 * sizeof(npy_uint32) - 1 > 2 * PyLong_SHIFT) {
39929                             return (npy_uint32) ((((((npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0])));
39930                         }
39931                     }
39932                     break;
39933                 case -3:
39934                     if (8 * sizeof(npy_uint32) - 1 > 2 * PyLong_SHIFT) {
39935                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
39936                             __PYX_VERIFY_RETURN_INT(npy_uint32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39937                         } else if (8 * sizeof(npy_uint32) - 1 > 3 * PyLong_SHIFT) {
39938                             return (npy_uint32) (((npy_uint32)-1)*(((((((npy_uint32)digits[2]) << PyLong_SHIFT) | (npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0])));
39939                         }
39940                     }
39941                     break;
39942                 case 3:
39943                     if (8 * sizeof(npy_uint32) > 2 * PyLong_SHIFT) {
39944                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
39945                             __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39946                         } else if (8 * sizeof(npy_uint32) - 1 > 3 * PyLong_SHIFT) {
39947                             return (npy_uint32) ((((((((npy_uint32)digits[2]) << PyLong_SHIFT) | (npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0])));
39948                         }
39949                     }
39950                     break;
39951                 case -4:
39952                     if (8 * sizeof(npy_uint32) - 1 > 3 * PyLong_SHIFT) {
39953                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
39954                             __PYX_VERIFY_RETURN_INT(npy_uint32, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39955                         } else if (8 * sizeof(npy_uint32) - 1 > 4 * PyLong_SHIFT) {
39956                             return (npy_uint32) (((npy_uint32)-1)*(((((((((npy_uint32)digits[3]) << PyLong_SHIFT) | (npy_uint32)digits[2]) << PyLong_SHIFT) | (npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0])));
39957                         }
39958                     }
39959                     break;
39960                 case 4:
39961                     if (8 * sizeof(npy_uint32) > 3 * PyLong_SHIFT) {
39962                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
39963                             __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39964                         } else if (8 * sizeof(npy_uint32) - 1 > 4 * PyLong_SHIFT) {
39965                             return (npy_uint32) ((((((((((npy_uint32)digits[3]) << PyLong_SHIFT) | (npy_uint32)digits[2]) << PyLong_SHIFT) | (npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0])));
39966                         }
39967                     }
39968                     break;
39969             }
39970 #endif
39971             if (sizeof(npy_uint32) <= sizeof(long)) {
39972                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint32, long, PyLong_AsLong(x))
39973 #ifdef HAVE_LONG_LONG
39974             } else if (sizeof(npy_uint32) <= sizeof(PY_LONG_LONG)) {
39975                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint32, PY_LONG_LONG, PyLong_AsLongLong(x))
39976 #endif
39977             }
39978         }
39979         {
39980 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
39981             PyErr_SetString(PyExc_RuntimeError,
39982                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
39983 #else
39984             npy_uint32 val;
39985             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
39986  #if PY_MAJOR_VERSION < 3
39987             if (likely(v) && !PyLong_Check(v)) {
39988                 PyObject *tmp = v;
39989                 v = PyNumber_Long(tmp);
39990                 Py_DECREF(tmp);
39991             }
39992  #endif
39993             if (likely(v)) {
39994                 int one = 1; int is_little = (int)*(unsigned char *)&one;
39995                 unsigned char *bytes = (unsigned char *)&val;
39996                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
39997                                               bytes, sizeof(val),
39998                                               is_little, !is_unsigned);
39999                 Py_DECREF(v);
40000                 if (likely(!ret))
40001                     return val;
40002             }
40003 #endif
40004             return (npy_uint32) -1;
40005         }
40006     } else {
40007         npy_uint32 val;
40008         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
40009         if (!tmp) return (npy_uint32) -1;
40010         val = __Pyx_PyInt_As_npy_uint32(tmp);
40011         Py_DECREF(tmp);
40012         return val;
40013     }
40014 raise_overflow:
40015     PyErr_SetString(PyExc_OverflowError,
40016         "value too large to convert to npy_uint32");
40017     return (npy_uint32) -1;
40018 raise_neg_overflow:
40019     PyErr_SetString(PyExc_OverflowError,
40020         "can't convert negative value to npy_uint32");
40021     return (npy_uint32) -1;
40022 }
40023 
40024 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)40025   static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
40026     const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
40027     const int is_unsigned = neg_one > const_zero;
40028 #if PY_MAJOR_VERSION < 3
40029     if (likely(PyInt_Check(x))) {
40030         if (sizeof(long) < sizeof(long)) {
40031             __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
40032         } else {
40033             long val = PyInt_AS_LONG(x);
40034             if (is_unsigned && unlikely(val < 0)) {
40035                 goto raise_neg_overflow;
40036             }
40037             return (long) val;
40038         }
40039     } else
40040 #endif
40041     if (likely(PyLong_Check(x))) {
40042         if (is_unsigned) {
40043 #if CYTHON_USE_PYLONG_INTERNALS
40044             const digit* digits = ((PyLongObject*)x)->ob_digit;
40045             switch (Py_SIZE(x)) {
40046                 case  0: return (long) 0;
40047                 case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
40048                 case 2:
40049                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
40050                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
40051                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40052                         } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
40053                             return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
40054                         }
40055                     }
40056                     break;
40057                 case 3:
40058                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
40059                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
40060                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40061                         } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
40062                             return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
40063                         }
40064                     }
40065                     break;
40066                 case 4:
40067                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
40068                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
40069                             __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])))
40070                         } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
40071                             return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
40072                         }
40073                     }
40074                     break;
40075             }
40076 #endif
40077 #if CYTHON_COMPILING_IN_CPYTHON
40078             if (unlikely(Py_SIZE(x) < 0)) {
40079                 goto raise_neg_overflow;
40080             }
40081 #else
40082             {
40083                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
40084                 if (unlikely(result < 0))
40085                     return (long) -1;
40086                 if (unlikely(result == 1))
40087                     goto raise_neg_overflow;
40088             }
40089 #endif
40090             if (sizeof(long) <= sizeof(unsigned long)) {
40091                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
40092 #ifdef HAVE_LONG_LONG
40093             } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
40094                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
40095 #endif
40096             }
40097         } else {
40098 #if CYTHON_USE_PYLONG_INTERNALS
40099             const digit* digits = ((PyLongObject*)x)->ob_digit;
40100             switch (Py_SIZE(x)) {
40101                 case  0: return (long) 0;
40102                 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
40103                 case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
40104                 case -2:
40105                     if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
40106                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
40107                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40108                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
40109                             return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
40110                         }
40111                     }
40112                     break;
40113                 case 2:
40114                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
40115                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
40116                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40117                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
40118                             return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
40119                         }
40120                     }
40121                     break;
40122                 case -3:
40123                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
40124                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
40125                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40126                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
40127                             return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
40128                         }
40129                     }
40130                     break;
40131                 case 3:
40132                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
40133                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
40134                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40135                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
40136                             return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
40137                         }
40138                     }
40139                     break;
40140                 case -4:
40141                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
40142                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
40143                             __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])))
40144                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
40145                             return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
40146                         }
40147                     }
40148                     break;
40149                 case 4:
40150                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
40151                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
40152                             __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])))
40153                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
40154                             return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
40155                         }
40156                     }
40157                     break;
40158             }
40159 #endif
40160             if (sizeof(long) <= sizeof(long)) {
40161                 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
40162 #ifdef HAVE_LONG_LONG
40163             } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
40164                 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
40165 #endif
40166             }
40167         }
40168         {
40169 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
40170             PyErr_SetString(PyExc_RuntimeError,
40171                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
40172 #else
40173             long val;
40174             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
40175  #if PY_MAJOR_VERSION < 3
40176             if (likely(v) && !PyLong_Check(v)) {
40177                 PyObject *tmp = v;
40178                 v = PyNumber_Long(tmp);
40179                 Py_DECREF(tmp);
40180             }
40181  #endif
40182             if (likely(v)) {
40183                 int one = 1; int is_little = (int)*(unsigned char *)&one;
40184                 unsigned char *bytes = (unsigned char *)&val;
40185                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
40186                                               bytes, sizeof(val),
40187                                               is_little, !is_unsigned);
40188                 Py_DECREF(v);
40189                 if (likely(!ret))
40190                     return val;
40191             }
40192 #endif
40193             return (long) -1;
40194         }
40195     } else {
40196         long val;
40197         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
40198         if (!tmp) return (long) -1;
40199         val = __Pyx_PyInt_As_long(tmp);
40200         Py_DECREF(tmp);
40201         return val;
40202     }
40203 raise_overflow:
40204     PyErr_SetString(PyExc_OverflowError,
40205         "value too large to convert to long");
40206     return (long) -1;
40207 raise_neg_overflow:
40208     PyErr_SetString(PyExc_OverflowError,
40209         "can't convert negative value to long");
40210     return (long) -1;
40211 }
40212 
40213 /* CIntFromPy */
__Pyx_PyInt_As_char(PyObject * x)40214   static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
40215     const char neg_one = (char) ((char) 0 - (char) 1), const_zero = (char) 0;
40216     const int is_unsigned = neg_one > const_zero;
40217 #if PY_MAJOR_VERSION < 3
40218     if (likely(PyInt_Check(x))) {
40219         if (sizeof(char) < sizeof(long)) {
40220             __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
40221         } else {
40222             long val = PyInt_AS_LONG(x);
40223             if (is_unsigned && unlikely(val < 0)) {
40224                 goto raise_neg_overflow;
40225             }
40226             return (char) val;
40227         }
40228     } else
40229 #endif
40230     if (likely(PyLong_Check(x))) {
40231         if (is_unsigned) {
40232 #if CYTHON_USE_PYLONG_INTERNALS
40233             const digit* digits = ((PyLongObject*)x)->ob_digit;
40234             switch (Py_SIZE(x)) {
40235                 case  0: return (char) 0;
40236                 case  1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
40237                 case 2:
40238                     if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
40239                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
40240                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40241                         } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
40242                             return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
40243                         }
40244                     }
40245                     break;
40246                 case 3:
40247                     if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
40248                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
40249                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40250                         } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
40251                             return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
40252                         }
40253                     }
40254                     break;
40255                 case 4:
40256                     if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
40257                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
40258                             __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])))
40259                         } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
40260                             return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
40261                         }
40262                     }
40263                     break;
40264             }
40265 #endif
40266 #if CYTHON_COMPILING_IN_CPYTHON
40267             if (unlikely(Py_SIZE(x) < 0)) {
40268                 goto raise_neg_overflow;
40269             }
40270 #else
40271             {
40272                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
40273                 if (unlikely(result < 0))
40274                     return (char) -1;
40275                 if (unlikely(result == 1))
40276                     goto raise_neg_overflow;
40277             }
40278 #endif
40279             if (sizeof(char) <= sizeof(unsigned long)) {
40280                 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
40281 #ifdef HAVE_LONG_LONG
40282             } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
40283                 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
40284 #endif
40285             }
40286         } else {
40287 #if CYTHON_USE_PYLONG_INTERNALS
40288             const digit* digits = ((PyLongObject*)x)->ob_digit;
40289             switch (Py_SIZE(x)) {
40290                 case  0: return (char) 0;
40291                 case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
40292                 case  1: __PYX_VERIFY_RETURN_INT(char,  digit, +digits[0])
40293                 case -2:
40294                     if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
40295                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
40296                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40297                         } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
40298                             return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
40299                         }
40300                     }
40301                     break;
40302                 case 2:
40303                     if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
40304                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
40305                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40306                         } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
40307                             return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
40308                         }
40309                     }
40310                     break;
40311                 case -3:
40312                     if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
40313                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
40314                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40315                         } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
40316                             return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
40317                         }
40318                     }
40319                     break;
40320                 case 3:
40321                     if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
40322                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
40323                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40324                         } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
40325                             return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
40326                         }
40327                     }
40328                     break;
40329                 case -4:
40330                     if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
40331                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
40332                             __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])))
40333                         } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
40334                             return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
40335                         }
40336                     }
40337                     break;
40338                 case 4:
40339                     if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
40340                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
40341                             __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])))
40342                         } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
40343                             return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
40344                         }
40345                     }
40346                     break;
40347             }
40348 #endif
40349             if (sizeof(char) <= sizeof(long)) {
40350                 __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
40351 #ifdef HAVE_LONG_LONG
40352             } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
40353                 __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
40354 #endif
40355             }
40356         }
40357         {
40358 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
40359             PyErr_SetString(PyExc_RuntimeError,
40360                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
40361 #else
40362             char val;
40363             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
40364  #if PY_MAJOR_VERSION < 3
40365             if (likely(v) && !PyLong_Check(v)) {
40366                 PyObject *tmp = v;
40367                 v = PyNumber_Long(tmp);
40368                 Py_DECREF(tmp);
40369             }
40370  #endif
40371             if (likely(v)) {
40372                 int one = 1; int is_little = (int)*(unsigned char *)&one;
40373                 unsigned char *bytes = (unsigned char *)&val;
40374                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
40375                                               bytes, sizeof(val),
40376                                               is_little, !is_unsigned);
40377                 Py_DECREF(v);
40378                 if (likely(!ret))
40379                     return val;
40380             }
40381 #endif
40382             return (char) -1;
40383         }
40384     } else {
40385         char val;
40386         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
40387         if (!tmp) return (char) -1;
40388         val = __Pyx_PyInt_As_char(tmp);
40389         Py_DECREF(tmp);
40390         return val;
40391     }
40392 raise_overflow:
40393     PyErr_SetString(PyExc_OverflowError,
40394         "value too large to convert to char");
40395     return (char) -1;
40396 raise_neg_overflow:
40397     PyErr_SetString(PyExc_OverflowError,
40398         "can't convert negative value to char");
40399     return (char) -1;
40400 }
40401 
40402 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(PyObject * obj,int writable_flag)40403   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(PyObject *obj, int writable_flag) {
40404     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
40405     __Pyx_BufFmt_StackElem stack[1];
40406     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
40407     int retcode;
40408     if (obj == Py_None) {
40409         result.memview = (struct __pyx_memoryview_obj *) Py_None;
40410         return result;
40411     }
40412     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
40413                                                  PyBUF_RECORDS_RO | writable_flag, 2,
40414                                                  &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack,
40415                                                  &result, obj);
40416     if (unlikely(retcode == -1))
40417         goto __pyx_fail;
40418     return result;
40419 __pyx_fail:
40420     result.memview = NULL;
40421     result.data = NULL;
40422     return result;
40423 }
40424 
40425 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)40426   static int __Pyx_check_binary_version(void) {
40427     char ctversion[4], rtversion[4];
40428     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
40429     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
40430     if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
40431         char message[200];
40432         PyOS_snprintf(message, sizeof(message),
40433                       "compiletime version %s of module '%.100s' "
40434                       "does not match runtime version %s",
40435                       ctversion, __Pyx_MODULE_NAME, rtversion);
40436         return PyErr_WarnEx(NULL, message, 1);
40437     }
40438     return 0;
40439 }
40440 
40441 /* VoidPtrImport */
40442   #ifndef __PYX_HAVE_RT_ImportVoidPtr
40443 #define __PYX_HAVE_RT_ImportVoidPtr
__Pyx_ImportVoidPtr(PyObject * module,const char * name,void ** p,const char * sig)40444 static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) {
40445     PyObject *d = 0;
40446     PyObject *cobj = 0;
40447     d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
40448     if (!d)
40449         goto bad;
40450     cobj = PyDict_GetItemString(d, name);
40451     if (!cobj) {
40452         PyErr_Format(PyExc_ImportError,
40453             "%.200s does not export expected C variable %.200s",
40454                 PyModule_GetName(module), name);
40455         goto bad;
40456     }
40457 #if PY_VERSION_HEX >= 0x02070000
40458     if (!PyCapsule_IsValid(cobj, sig)) {
40459         PyErr_Format(PyExc_TypeError,
40460             "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
40461              PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj));
40462         goto bad;
40463     }
40464     *p = PyCapsule_GetPointer(cobj, sig);
40465 #else
40466     {const char *desc, *s1, *s2;
40467     desc = (const char *)PyCObject_GetDesc(cobj);
40468     if (!desc)
40469         goto bad;
40470     s1 = desc; s2 = sig;
40471     while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
40472     if (*s1 != *s2) {
40473         PyErr_Format(PyExc_TypeError,
40474             "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
40475              PyModule_GetName(module), name, sig, desc);
40476         goto bad;
40477     }
40478     *p = PyCObject_AsVoidPtr(cobj);}
40479 #endif
40480     if (!(*p))
40481         goto bad;
40482     Py_DECREF(d);
40483     return 0;
40484 bad:
40485     Py_XDECREF(d);
40486     return -1;
40487 }
40488 #endif
40489 
40490 /* FunctionImport */
40491   #ifndef __PYX_HAVE_RT_ImportFunction
40492 #define __PYX_HAVE_RT_ImportFunction
__Pyx_ImportFunction(PyObject * module,const char * funcname,void (** f)(void),const char * sig)40493 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
40494     PyObject *d = 0;
40495     PyObject *cobj = 0;
40496     union {
40497         void (*fp)(void);
40498         void *p;
40499     } tmp;
40500     d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
40501     if (!d)
40502         goto bad;
40503     cobj = PyDict_GetItemString(d, funcname);
40504     if (!cobj) {
40505         PyErr_Format(PyExc_ImportError,
40506             "%.200s does not export expected C function %.200s",
40507                 PyModule_GetName(module), funcname);
40508         goto bad;
40509     }
40510 #if PY_VERSION_HEX >= 0x02070000
40511     if (!PyCapsule_IsValid(cobj, sig)) {
40512         PyErr_Format(PyExc_TypeError,
40513             "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
40514              PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
40515         goto bad;
40516     }
40517     tmp.p = PyCapsule_GetPointer(cobj, sig);
40518 #else
40519     {const char *desc, *s1, *s2;
40520     desc = (const char *)PyCObject_GetDesc(cobj);
40521     if (!desc)
40522         goto bad;
40523     s1 = desc; s2 = sig;
40524     while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
40525     if (*s1 != *s2) {
40526         PyErr_Format(PyExc_TypeError,
40527             "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
40528              PyModule_GetName(module), funcname, sig, desc);
40529         goto bad;
40530     }
40531     tmp.p = PyCObject_AsVoidPtr(cobj);}
40532 #endif
40533     *f = tmp.fp;
40534     if (!(*f))
40535         goto bad;
40536     Py_DECREF(d);
40537     return 0;
40538 bad:
40539     Py_XDECREF(d);
40540     return -1;
40541 }
40542 #endif
40543 
40544 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)40545   static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
40546     while (t->p) {
40547         #if PY_MAJOR_VERSION < 3
40548         if (t->is_unicode) {
40549             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
40550         } else if (t->intern) {
40551             *t->p = PyString_InternFromString(t->s);
40552         } else {
40553             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
40554         }
40555         #else
40556         if (t->is_unicode | t->is_str) {
40557             if (t->intern) {
40558                 *t->p = PyUnicode_InternFromString(t->s);
40559             } else if (t->encoding) {
40560                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
40561             } else {
40562                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
40563             }
40564         } else {
40565             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
40566         }
40567         #endif
40568         if (!*t->p)
40569             return -1;
40570         if (PyObject_Hash(*t->p) == -1)
40571             return -1;
40572         ++t;
40573     }
40574     return 0;
40575 }
40576 
__Pyx_PyUnicode_FromString(const char * c_str)40577 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
40578     return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
40579 }
__Pyx_PyObject_AsString(PyObject * o)40580 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
40581     Py_ssize_t ignore;
40582     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
40583 }
40584 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
40585 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)40586 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
40587     char* defenc_c;
40588     PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
40589     if (!defenc) return NULL;
40590     defenc_c = PyBytes_AS_STRING(defenc);
40591 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
40592     {
40593         char* end = defenc_c + PyBytes_GET_SIZE(defenc);
40594         char* c;
40595         for (c = defenc_c; c < end; c++) {
40596             if ((unsigned char) (*c) >= 128) {
40597                 PyUnicode_AsASCIIString(o);
40598                 return NULL;
40599             }
40600         }
40601     }
40602 #endif
40603     *length = PyBytes_GET_SIZE(defenc);
40604     return defenc_c;
40605 }
40606 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)40607 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
40608     if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
40609 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
40610     if (likely(PyUnicode_IS_ASCII(o))) {
40611         *length = PyUnicode_GET_LENGTH(o);
40612         return PyUnicode_AsUTF8(o);
40613     } else {
40614         PyUnicode_AsASCIIString(o);
40615         return NULL;
40616     }
40617 #else
40618     return PyUnicode_AsUTF8AndSize(o, length);
40619 #endif
40620 }
40621 #endif
40622 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)40623 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
40624 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
40625     if (
40626 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
40627             __Pyx_sys_getdefaultencoding_not_ascii &&
40628 #endif
40629             PyUnicode_Check(o)) {
40630         return __Pyx_PyUnicode_AsStringAndSize(o, length);
40631     } else
40632 #endif
40633 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
40634     if (PyByteArray_Check(o)) {
40635         *length = PyByteArray_GET_SIZE(o);
40636         return PyByteArray_AS_STRING(o);
40637     } else
40638 #endif
40639     {
40640         char* result;
40641         int r = PyBytes_AsStringAndSize(o, &result, length);
40642         if (unlikely(r < 0)) {
40643             return NULL;
40644         } else {
40645             return result;
40646         }
40647     }
40648 }
__Pyx_PyObject_IsTrue(PyObject * x)40649 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
40650    int is_true = x == Py_True;
40651    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
40652    else return PyObject_IsTrue(x);
40653 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)40654 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
40655     int retval;
40656     if (unlikely(!x)) return -1;
40657     retval = __Pyx_PyObject_IsTrue(x);
40658     Py_DECREF(x);
40659     return retval;
40660 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)40661 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
40662 #if PY_MAJOR_VERSION >= 3
40663     if (PyLong_Check(result)) {
40664         if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
40665                 "__int__ returned non-int (type %.200s).  "
40666                 "The ability to return an instance of a strict subclass of int "
40667                 "is deprecated, and may be removed in a future version of Python.",
40668                 Py_TYPE(result)->tp_name)) {
40669             Py_DECREF(result);
40670             return NULL;
40671         }
40672         return result;
40673     }
40674 #endif
40675     PyErr_Format(PyExc_TypeError,
40676                  "__%.4s__ returned non-%.4s (type %.200s)",
40677                  type_name, type_name, Py_TYPE(result)->tp_name);
40678     Py_DECREF(result);
40679     return NULL;
40680 }
__Pyx_PyNumber_IntOrLong(PyObject * x)40681 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
40682 #if CYTHON_USE_TYPE_SLOTS
40683   PyNumberMethods *m;
40684 #endif
40685   const char *name = NULL;
40686   PyObject *res = NULL;
40687 #if PY_MAJOR_VERSION < 3
40688   if (likely(PyInt_Check(x) || PyLong_Check(x)))
40689 #else
40690   if (likely(PyLong_Check(x)))
40691 #endif
40692     return __Pyx_NewRef(x);
40693 #if CYTHON_USE_TYPE_SLOTS
40694   m = Py_TYPE(x)->tp_as_number;
40695   #if PY_MAJOR_VERSION < 3
40696   if (m && m->nb_int) {
40697     name = "int";
40698     res = m->nb_int(x);
40699   }
40700   else if (m && m->nb_long) {
40701     name = "long";
40702     res = m->nb_long(x);
40703   }
40704   #else
40705   if (likely(m && m->nb_int)) {
40706     name = "int";
40707     res = m->nb_int(x);
40708   }
40709   #endif
40710 #else
40711   if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
40712     res = PyNumber_Int(x);
40713   }
40714 #endif
40715   if (likely(res)) {
40716 #if PY_MAJOR_VERSION < 3
40717     if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
40718 #else
40719     if (unlikely(!PyLong_CheckExact(res))) {
40720 #endif
40721         return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
40722     }
40723   }
40724   else if (!PyErr_Occurred()) {
40725     PyErr_SetString(PyExc_TypeError,
40726                     "an integer is required");
40727   }
40728   return res;
40729 }
40730 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
40731   Py_ssize_t ival;
40732   PyObject *x;
40733 #if PY_MAJOR_VERSION < 3
40734   if (likely(PyInt_CheckExact(b))) {
40735     if (sizeof(Py_ssize_t) >= sizeof(long))
40736         return PyInt_AS_LONG(b);
40737     else
40738         return PyInt_AsSsize_t(b);
40739   }
40740 #endif
40741   if (likely(PyLong_CheckExact(b))) {
40742     #if CYTHON_USE_PYLONG_INTERNALS
40743     const digit* digits = ((PyLongObject*)b)->ob_digit;
40744     const Py_ssize_t size = Py_SIZE(b);
40745     if (likely(__Pyx_sst_abs(size) <= 1)) {
40746         ival = likely(size) ? digits[0] : 0;
40747         if (size == -1) ival = -ival;
40748         return ival;
40749     } else {
40750       switch (size) {
40751          case 2:
40752            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
40753              return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
40754            }
40755            break;
40756          case -2:
40757            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
40758              return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
40759            }
40760            break;
40761          case 3:
40762            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
40763              return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
40764            }
40765            break;
40766          case -3:
40767            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
40768              return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
40769            }
40770            break;
40771          case 4:
40772            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
40773              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]));
40774            }
40775            break;
40776          case -4:
40777            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
40778              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]));
40779            }
40780            break;
40781       }
40782     }
40783     #endif
40784     return PyLong_AsSsize_t(b);
40785   }
40786   x = PyNumber_Index(b);
40787   if (!x) return -1;
40788   ival = PyInt_AsSsize_t(x);
40789   Py_DECREF(x);
40790   return ival;
40791 }
40792 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
40793   return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
40794 }
40795 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
40796     return PyInt_FromSize_t(ival);
40797 }
40798 
40799 
40800 #endif /* Py_PYTHON_H */
40801